xref: /rk3399_ARM-atf/docs/about/lts.rst (revision 8145e2fdf2891a24fbf6e7ac01060f324b4cc0e5)
1LTS - Long-Term Support
2=======================
3
4.. table:: Table 1: Document History
5
6  +-------------+--------------------+-------------------------------------------------------+
7  | Date        | Author             | Description                                           |
8  +=============+====================+=======================================================+
9  | 2022-07-20  | Okash Khawaja,     | Initial draft.                                        |
10  |             | Varun Wadekar      |                                                       |
11  +-------------+--------------------+-------------------------------------------------------+
12  | 2022-07-21  | Varun Wadekar      | Refine the Maintainership guidelines and planning     |
13  |             |                    | sections. Introduce a new section documenting a day   |
14  |             |                    | in the life of a LTS branch maintainer                |
15  +-------------+--------------------+-------------------------------------------------------+
16  | 2022-08-05  | Okash Khawaja,     | Merge two drafts (draft 1 and 2), address comments    |
17  |             | Varun Wadekar      | made by both authors, cosmetic changes to the content |
18  |             |                    | all over the document                                 |
19  +-------------+--------------------+-------------------------------------------------------+
20  | 2022-08-05  | Okash Khawaja      | Add note about testing support available from TF.org  |
21  +-------------+--------------------+-------------------------------------------------------+
22  | 2022-08-05  | Varun Wadekar      | Changed the “Future plans” section to “FAQ” and       |
23  |             |                    | answered some of the questions with feedback from     |
24  |             |                    | the community.                                        |
25  +-------------+--------------------+-------------------------------------------------------+
26  | 2025-01-07  | Govindraj Raja     | Convert from pdf to rst.                              |
27  +-------------+--------------------+-------------------------------------------------------+
28  | 2025-01-07  | Govindraj Raja     | Updates based on learnings and suggestions.           |
29  +-------------+--------------------+-------------------------------------------------------+
30  | 2025-03-27  | Chris Palmer       | Playbook for making a new release.                    |
31  +-------------+--------------------+-------------------------------------------------------+
32
33This document proposes a plan for long-term support (LTS) of the |TF-A| project.
34
35Why is LTS required?
36--------------------
37LTS is needed for commercial reasons. More specifically, on the device side,
38when a product is released, the companies have to support that in-market product
39such that the amount of changes to the firmware are kept to a minimum to avoid
40the risk of regression. At the same time the companies don't want to exclude
41critical patches such as those for security advisories. Similarly on the server side,
42companies want to minimize the churn when deploying fixes during incident
43response, e.g. due to critical security bugs.
44
45Also, the European Cyber Resilience Act (CRA) is a new EU legislation that mandates
46cybersecurity standards for products containing digital elements, aiming to
47protect consumers and businesses by ensuring manufacturers build security into
48their hardware and software throughout their lifecycle, including automatic
49updates and incident reporting; essentially requiring all digital products
50sold in the EU to meet specific cybersecurity requirements.
51
52This means that companies have to maintain and backport critical updates to
53old branches internally. As this effort is duplicated across different companies
54using TF-A, it makes sense to factor out this effort into a community-wide LTS.
55
56What does LTS mean for TF-A?
57----------------------------
58In this section we will define exactly what constitutes LTS for TF-A.
59Specifically, we will define the following characteristics:
60
61- criteria for selecting patches which will be backported to LTS branches
62- lifetime and frequency of LTS branches
63
64**Criteria**
65
66We must have an objective criterion for selecting patches to be backported to
67LTS branches. This will make maintenance easy because:
68
69a. there will be less -- ideally no -- discussion when selecting patches to backport
70b. large parts of the process can be automated
71
72Below is the criteria
73
74#. No features will be backported.
75#. Security advisories: Any patch that makes it into :ref:`Security Advisories`
76   is automatically selected for back porting. This includes patches to external
77   components too, e.g. libfdt.
78#. Workarounds for CPU and other ARM IP errata
79#. Workarounds for non-ARM IP errata, e.g. TI UART
80#. Fixes for platform bugs. These patches must not modify any code outside of
81   the specific platform that the fix applies to.
82#. Patches can only be backported from the master branch. In other words, the
83   master branch will be a superset of all the changes in any LTS branch.
84
85**Lifetime and frequency**
86
87This section approaches three questions: for how long should an LTS release be
88supported, how frequently should LTS releases be made and at which time(s) of
89the year should the releases be made.
90
911. For how long should an LTS release be supported?
92
93The Linux kernel maintainers supports an LTS branch for 2 years. Since firmware
94tends to have less churn and longer lifetime than a HLOS, TF-A is trying to
95support at-least 7 years for its LTS. Initially it was intended to support
965 years but there has been no objections to extend LTS support to 7 years.
97There are many challenges that may influence the 7 year support from CI
98infrastructure to availability of maintainers.
99
1002. How frequently should LTS releases be made?
101
102Given that many products that have a release cycle, have a yearly release
103cycle, it would make sense to have yearly TF-A releases.
104
1053. Which time(s) of the year should the releases be made?
106
107TF-A releases are cut twice a year: May and November. Basing LTS release
108on the November TF-A release has a few benefits. First, it aligns with Linux
109LTS releases which happen towards the end of each year. Second, it aligns
110with Android releases which tend to fall in Q3 each year. Since product
111releases are timed with Android release, this gives enough time to harden
112the TF-A LTS release during development so that it's ready for launch in
113Q3 following year. On the other hand, if the May release of TF-A is chosen as
114the basis for LTS then developers will have little time -- about a month,
115taking into account the test-and-debug phase before LTS is cut (see below) --
116before Android release.
117
118To summarize, there will be one LTS release per year. It will be supported for
1195 years and we can discuss extending it to 7 years later on. The LTS release
120will be based on the November release of TF-A.
121
122**Testing Criteria**
123
124Every patch merged to the LTS branch will complete the following tests before
125getting approved.
126
127#. TFTF tests currently running in the testing farm
128#. CI/CD static analysis scans
129#. Coverity scans
130#. Platform tests
131
132Platforms that are not maintained upstream will undergo testing downstream in a
133pre-defined window. The platform maintainer will complete the testing and provide
134a verified score on the patch once testing is completed.
135
136** A note about test coverage from TF.org **
137
138Currently TF.org maintains a CI system to run TF-A automated tests on a
139selection of HW boards donated by TF.org members (a benefit reserved to project
140members, see the project charter for more details). This automated test coverage
141will be extended to cover testing for LTS as well for boards that are part of
142the CI system.
143
144**TFTF Branching**
145
146A note about testing here. After a patch is backported to an LTS branch, that
147branch will need to be regression tested. Since TFTF moves forward with latest
148TF-A changes, newer TFTF tests may not apply to old LTS branches. Therefore
149TFTF will also need to be branched, in-sync with TF-A LTS branches. In other
150words, there will be one TFTF LTS branch corresponding to each TF-A LTS branch.
151The TFTF LTS branch will be used to regression test the corresponding TF-A LTS
152branch.
153
154As we work with the LTS branch of TFTF, we might also need fixes for TFTF
155itself to be ported to LTS. However, decision-making about those patches need
156not be as stringent as for TF-A.
157
158**CI Scripts**
159
160CI Scripts moves forward with TF-A changes, since we need to checkout the
161corresponding release version of CI scripts for LTS.
162
163Though we are unlikely to update CI scripts, but time to time migrating a newer
164FVP version or deprecating certain tests due to unavailability of platforms may
165influence updates to CI Scripts.
166
167**Hafnium / OP-TEE**
168
169Both Hafnium and OP-TEE move forward with TF-A changes so we need to freeze their
170corresponding version from TF-A release for a LTS.
171
172**MbedTLS**
173
174Updates to the version of MbedTLS used with LTS will happen time to time based on
175maintainers call to update them or not.
176
177Release details
178---------------
179This section goes into details of what the LTS release process will look like.
180
181
182**Test-and-debug period**
183
184Since the LTS branch will be used in product releases, it is expected that more
185testing and debugging will be done on the November release of TF-A. Therefore
186it would make sense to leave at least a month after the November release and
187then cut the LTS branch. We recommend two months, given that one of the months
188is December which tends to be slower due to holidays. So, an end-of-November
189TF-A release would result in a beginning-of-February LTS release. Note that
190the LTS branch will be created at the same time as the TF-A November release,
191but it will be officially released at the end of January or early February.
192Going forward we should strive to make the period smaller and smaller until
193ideally it coincides with TF-A November release which means that our test
194and CI/CD infra is good enough to allow that to happen.
195
196**Example timeline**
197
198Below is an example timeline starting from the November 2022 release of TF-A.
199
200.. image:: ../resources/diagrams/lts-timeline-example.png
201
202- Nov 2022: TF-A 2.8 is released towards the end of Nov, 2022. Not shown in the
203  diagram, at the same time LTS release candidate branch is made which is based
204  on TF-A 2.8. This means new features going in 2.8 won’t go in the LTS branch.
205  We can call it `LTS 2.8-rc`.
206- Feb 2023: After testing and debugging LTS 2.8-rc for a couple of months,
207  LTS 2.8.0 is officially released in early Feb 2023.
208- May 2023: TF-A 2.9 is released but since this is not an LTS branch it doesn’t
209  affect LTS.
210- Somewhere between May and Nov of 2023: A security advisory comes up and the
211  related patches go into TF-A master branch. Since these patches fall under
212  LTS criteria, they are backported to LTS 2.8.0 which results in LTS 2.8.1
213  being released. Note that here we don’t allow the extra testing and debugging
214  time that we had between Nov 2022 and early Feb 2023. This is because there
215  isn’t as much to test and debug as an annual LTS release has. Also companies
216  might want to deploy critical patches soon.
217- Nov 2023: TF-A 2.10 is released. Not shown in the diagram, at the same time
218  LTS 2.10-rc is made. It’s tested by partners for a couple of months.
219- Feb 2024: LTS 2.10.1 is released in early Feb. Now there are two LTS
220  branches: 2.8.1 and 2.10.1.
221
222Note that TFTF will follow similar branching model as TF-A LTS, i.e. there will
223be TFTF LTS 2.8.0 in Feb 2023, 2.8.1 (if new TFTF tests need to be added for
224the security advisory) when there is TF-A LTS 2.8.1 and so on.
225
226Maintainership
227--------------
228
229**Guidelines & Responsibilities**
230
231#. Maintainers shall be impartial and strive to work for the benefit of
232   the community
233#. Objective and well-defined merge criteria to avoid confusion and discussions
234   at random points in time when there is a "candidate" patch
235#. The maintainers shall explain the lifecycle of a patch to the community,
236   with a detailed description of the maximum time spent in each step
237#. Automate, automate, automate
238#. Reviewers should not focus too much on "what" and instead focus on "how"
239#. Constantly refine the merge criteria to include more partner use cases
240#. Ensure that all candidate patches flow from the main branch to all LTS branches
241#. Maintainers collaborate in the following discord channel -
242   https://discord.com/channels/1106321706588577904/1162029539761852436
243#. Maintainers discuss and provide updates about upcoming LTS releases in the above
244   mentioned discord channel.
245
246**Options**
247
248These are some options in the order of preference.
249
250#. Current set of :ref:`lts maintainers` from tf.org(or hired contractor) take care of the LTS
251#. From the community, create a set of maintainers focused solely on the LTS branches
252
253A day in the life of a maintainer
254*********************************
255This section documents the daily tasks that a maintainer might perform to
256support the LTS program. It is expected that a maintainer follows clearly laid
257down steps and does not have to make policy level decisions for merge, testing,
258or candidate patch selection.
259
260#. Monitor the main branch to identify candidate patches for the LTS branches
261#. Monitor emails from LTS triage report to choose patches that should be
262   cherry-picked for LTS branches.
263#. Cherry-pick agreed patches to LTS branches co-ordinate review process and Monitor
264   CI results.
265#. Monitor the mailing list for any LTS related issues
266#. Propose or solicit patches to the main branch and tag them as candidates for LTS
267#. Monitor Github dependabot pull requests to identify patches that could be taken for a given LTS
268   branch: https://github.com/TrustedFirmware-A/trusted-firmware-a/pulls
269
270Playbook for new releases
271-------------------------
272To make a new minor release (e.g. 2.x.y2.x.y+1), follow these steps.
273
274#. Every Friday, LTS maintainers receive a triage report email (subject: “TF-A
275   LTS Triage report”) that contains attached CSV files, 1 per
276   currently-supported LTS major release branch (e.g. lts-2.8, lts-2.10,
277   lts-2.12, etc.). It contains a list of patches to be cherry-picked into a new
278   minor release of each supported LTS branch.
279#. Run ``git fetch origin``.
280#. Run ``git checkout -b lts-v2.x.y+1 --track origin/lts-v2.x``.
281#. Run ``git log`` and verify that the most recent commit is the changelog for
282   the v2.x.y release, and that it has the origin/lts-v2.x tag.
283#. For the version 2.x for which you want to create a new release, open its CSV
284   file. For each patch listed, **from the bottom to the top**, run ``git
285   cherry-pick -x sha1-hash``.
286#. Some of the patches of this list may not be taken, mainly due to false
287   positive. If in doubt, that can be discussed either in the “tf-a-lts” channel
288   on Discord or during the LTS weekly meeting.
289#. Some dependency patches, not listed in the CSV file, may have to be taken, to ease the
290   application of the LTS patches. This can also be discussed with the other LTS maintainers.
291#. Run ``git remote add dependabot https://github.com/TrustedFirmware-A/trusted-firmware-a.git``
292   (This has to be done only once).
293#. Run ``git fetch dependabot``.
294#. Cherry-pick the dependabot patches dedicated to the given LTS. Those patches should be amended
295   to add a gerrit Change ID.
296#. Push the stack of changes: ``git push origin
297   HEAD:refs/for/lts-v2.x%topic=for-lts-v2.x.y+1``. You might need the
298   ``--no-verify`` option: ``git push origin --no-verify
299   HEAD:refs/for/lts-v2.x%topic=for-lts-v2.x.y+1``.
300#. The AllowCI+2 job runs automatically on each LTS branch once a new
301   cherry-picked patch/patch-stack is pushed to the corresponding branch. If
302   this CI run passes, it automatically applies the Verified+1 (V+1) label to
303   the patch/all patches in the stack. The other LTS maintainers will provide
304   MR+1 and COR+1 votes. If the CI is OK and votes V+1, and if the
305   Maintainer-Review+1 (MR+1), Code-Owner-Review+1 (COR+1), and V+1 votes are
306   present, Gerrit will automatically merge the patch. LTS maintainers will then
307   trigger a Jenkins job that will take care of the release (tag, mail, and
308   readthedocs update).
309#. Some features may also require updates in other repositories (tf-a-ci-scripts,
310   tf-a-job-configs or tf-a-tests...). For tf-a-job-configs, there are no LTS branches, but
311   dedicated scripts for each LTS version which have to be updated manually. This is the case
312   for e.g. MbedTLS updates. For tf-a-ci-scripts and tf-a-tests, there are LTS branches and patches
313   will be cherry-picked from master branch to the LTS branch the same way it is done for TF-A.
314   There is no automation for those repositories. So the patches will have to be merged manually,
315   and for tf-a-ci-scripts and tf-a-tests, tags will also have to be set manually.
316
317Execution Plan
318**************
319This section lists the steps needed to put the LTS system in place. However,
320to kick start LTS in Nov ‘22, only a few steps are needed. The rest can follow
321in the background.
322
323Initial release steps
324*********************
325
326The following steps are necessary to kickstart the project and potentially
327create the first LTS from the Nov’22 release.
328
329#. Create a TF-A LTS release-candidate branch and a TFTF LTS branch immediately
330   after the Nov’22 release
331#. Request all platform-owners to test and debug the RC branch
332#. Gather feedback from the test and debug cycle
333#. Mark the TF-A LTS branch ready by the end of January
334#. Announce the official LTS release availability on the mailing lists
335
336Long term release plan
337**********************
338Above will buy us time to then work on the rest of the execution plan which
339is given below.
340
341#. The review criteria for LTS patches must be the same as TF-A patches
342#. The maintainers shall publish the well-defined merge criteria to allow
343   the community to choose candidate patches
344#. The maintainers shall publish a well-defined test specification for any
345   patch entering the LTS branch
346
347   a. Tests required to pass in the CI/CD flow
348   b. Static analysis scans
349   c. Coverity scans
350
351#. The maintainers shall publish a mechanism to choose candidate patches for
352   the LTS branch
353#. The maintainers shall publish a mechanism to report bugs `[1]`_ seen with
354   an LTS branch
355#. The maintainers shall publish a versioning mechanism for the LTS branch
356
357   a. Bump minor version for any “logical” `[2]`_ fix(es) that gets merged
358
359#. The CI/CD infrastructure shall provide test support for all “live” LTS
360   branches at any given point in time
361#. The CI/CD infrastructure shall provide means to
362
363   a. notify all maintainers that a patch is ready for review
364   b. automatically cherry-pick a patch to a given LTS branch
365   c. get it through the CI/CD testing flow
366   d. gentle ping in LTS discord channel asking for reviews to ensure
367      cherry-picks are merged.
368
369FAQ
370***
371
372In our discussions, in addition to the above points we also considered some
373questions. They have been discussed on the mailing list too.
374
375| Q. What happens when a bug fix applies just to a LTS branch and not to the
376     master branch?
377| A. This will be treated as a special case and the bug, and the fix will be
378     discussed
379
380| Q. When testing a backported patch, what if one of the partners needs more
381     time while the patch fix is time-critical and, hence slowing other
382     partners?
383| A. The maintainers will add more detail to the review and merge process to
384     handle this scenario.
385
386| Q. How do we handle the increasing version numbers for errata fixes?
387| A. Too many CPU errata workarounds resulting in too many LTS releases.
388     We propose bumping the version number for each logical fix as
389     described in the section “Long term release plan” above because
390     that will help accurately track what changes have been deployed in-field.
391
392| Q. What if LTS support duration needs to be extended to longer than 5 years?
393| A. Still under discussion.
394
395These are uncharted waters, and we will face some unseen problems. When they
396become real problems, then we will have concrete data and be better able to
397address them. This means that our LTS definition as presented in this document
398is not the final one. We will constantly be discussing it and deciding how to
399adapt it as we see practical problems.
400
401.. _[1]:
402
403[1] The plan is to create a system where reviewers can tag a patch on mainline which
404gets automatically rebased on LTS and pushed to Gerrit. On seeing this patch,
405the CI/CD starts tests and provides a score. In parallel, the system also sends
406an email to the maintainers announcing the arrival of a candidate patch for the
407LTS branch.
408
409.. _[2]:
410
411[2] Logical will be a patch or patches implementing a certain fix. For example, if a
412security mitigation is fixed with the help of three patches, then all of them are
413considered as one "logical" fix. The version is incremented only after all these
414patches are merged. with the maintainers. If agreed unanimously, the bug fix
415will be merged to the affected LTS branches after completing the review process.
416