On Thu, 11 Jun 2020 at 23:42, Varun Wadekar via TF-A <
tf-a(a)lists.trustedfirmware.org> wrote:
> Hello Matteo,
>
> Apologies for still using an outdated term. I have trained myself to get
> used to "TF-A" - looks like I am still not there.
>
> >> The idea has also been just raised to the Trusted Firmware project
> Board for initial consideration and we will be all very keen to understand
> how much interest there is from the wider TF-A community of adopters and
> external (non-Arm) maintainers
>
> That is good to hear. For the exact scope, I think we can assume the usual
> expectations from any LTS software stack - stability, performance,
> security, bug fixes along with maintenance support. We are open to
> discussing the cadence and any other operational commitments.
>
> @Francois, from the description of Trusted Substrate looks like you also
> expect the sub-projects to provide LTS versions for the project as a whole
> to succeed (?)
>
> Yes. I assume relevant tf.org projects decide to branch LTSes so that we
can extend the scope to selected OP-TEE TAs for the Trusted Substrate LTS
and may be extend duration of support for the tf.org LTSes. (just to make
sure: this is just early open thinking to understand what it would mean to
build such a service on the Linaro side should there be tf.org LTSes).
-Varun
>
>
> -----Original Message-----
> From: TF-A <tf-a-bounces(a)lists.trustedfirmware.org> On Behalf Of Matteo
> Carlini via TF-A
> Sent: Thursday, June 11, 2020 4:25 AM
> To: tf-a(a)lists.trustedfirmware.org
> Subject: Re: [TF-A] ATF LTS version
>
> External email: Use caution opening links or attachments
>
>
> Hi Francois,
>
> > I'd be happy to know more about what you see as TFA LTS: exact scope,
> number of versions, duration, operational commitments (zero-day...).
> > Do you have other firmware LTS needs?
>
> Agree. That’s precisely what I was hinting to Varun, when mentioning
> concrete requirements for the LTS scheme.
>
> > Trusted Substrate is the aggregation of { TFA, OP-TEE, some TEE apps
> such as firmwareTPM, U-Boot }.
> > Trusted Substrate effort is led by Linaro members and is going to be set
> up as a more open project.
>
> First time I heard about it. Good to know, but I guess we'll need to
> discuss the intersection and collaboration with the Trusted Firmware
> project at some point.
> Having a LTS versioning scheme for the Trusted Firmware hosted projects
> should be theoretically either in the scope of the Project itself or, if
> the Board agrees, appointed to some other project/entity.
>
> > Our end goal is to enable unified, transactional, robust (anti-bricking,
> anti rollback) UEFI OTA on both U-Boot and EDK2.
>
> Fair, but IMHO this has little to do with Arm Secure world software LTS
> releases (TF-A/Hafnium/OP-TEE/TAs, TF-M)...probably best to discuss aside,
> this is not in scope of what Varun is raising.
>
> Thanks
> Matteo
>
> --
> TF-A mailing list
> TF-A(a)lists.trustedfirmware.org
> https://lists.trustedfirmware.org/mailman/listinfo/tf-a
> --
> TF-A mailing list
> TF-A(a)lists.trustedfirmware.org
> https://lists.trustedfirmware.org/mailman/listinfo/tf-a
>
--
François-Frédéric Ozog | *Director Linaro Edge & Fog Computing Group*
T: +33.67221.6485
francois.ozog(a)linaro.org | Skype: ffozog
Hello arm expects,
While reading the tf-a spec about the section "3.5.1 Register state".
It described that "The MMU must be disabled for a partition that does
not run in S-EL0".
Does this mean that the S-EL1 SP need to create their own page table
and enable the MMU itself. I wonder in this way, it is not very friendly
to a SP developer.
Since the SP can be a verify simple binary, maybe a single driver which
can benefited from the isolation from other partitions.
So in the pointer of developing a single driver. I think it do not need
to care about the MMU configuration. It will be more friendly to be as
easy as developing a user-land binary. The SPMC(SEL2) can do this
configure for the SEL1's page-tables and enable MMU for SEL1 before jump
into the SP.
So I want to discuss here to understand the meaning behind it.
Cheers,
Feng
Hi Dan,
On Thu, Aug 27, 2020 at 8:31 PM Dan Handley via TF-A
<tf-a(a)lists.trustedfirmware.org> wrote:
>
> Hi Sandeep
>
>
>
> Arm development platforms that have an SBSA secure watchdog like N1SDP do not register an interrupt handler for the WS0 signal. They simply wait for the WS1 signal, which is fed to a higher agent (in this case the System Control Processor), which resets the platform.
> There is no explicit watchdog interrupt handling functionality in TF-A.
>
what happens to non secure sbsa WS1 ?
That is the case for Secure sbsa WS1.
NS WS0 ----> EL1 X (optional) but linux already implements it .
NS WS1 ----> EL3 X TF-A Do not handle it. Hence the patch.
Not handling it altogether is not an option I guess.
S WS0 -------> EL3 X (optional) . Platform might want to log
this condition.
S WS1 ----------------------------------------> handled by a higher agent.
>
>
> If your platform does not have a higher agent that handles WS1 then I guess you could add a handler in TF-A as you suggest in your code snippet, though I'm not sure if the maintainers would want this in generic SBSA code. Also, I don't see why you need both callback(s) and the explicit call to psci_systrem_reset2(), when presumably the callback(s) would do the latter.
>
Platform callback can optionally do more things like some logging.
Ultimately 'system_reset2' seems to be the thing everyone would like
to do as part of action. Then to reduce duplicate code we can have at
one place.
>
>
> > Q1- What happens if core is stuck and interrupts are not taken.
>
> It's rare for EL3 interrupts not to be taken when the core is stuck, unless an EL3 exception handler itself is stuck, in which case I'm not sure there's much you can do. That's why it's good to have a higher agent.
>
The rare lockup of core where it's not able to respond (not the
software ones) requires some other agent to detect and reset/recover
the system. Linux watchdog (ns sbsa WS1) will go unnoticed in such
cases.
ie. even if the watchdog hardware detected the lockup and indicated by
WS0 then WS1 .. both were not acted upon. If it were the secure
watchdog then no issues.
>
>
> > Or it has to be registered as a RAS priority exception.
>
> I don't think that would help, unless the system was flooded with higher priority exceptions that prevented the watchdog handler from running.
>
>
>
> Regards
>
>
> Dan.
>
>
>
> From: TF-A <tf-a-bounces(a)lists.trustedfirmware.org> On Behalf Of Sandeep Tripathy via TF-A
> Sent: 27 August 2020 12:14
> To: tf-a(a)lists.trustedfirmware.org
> Subject: [TF-A] [query] sbsa level 3 spec: non secure watchdog WS1 handling at EL3
>
>
>
> Hi,
>
> Based on sbsa spec for level-3 firmware specification watchdog signals NS WS1 and S WS0 to be handled at EL3 firmware.
>
> I have some query on how TF-A plans to implement this.
>
>
>
> Ref: Excerpt DEN0029D_SBSA_6.0 https://developer.arm.com/documentation/den0029/d/?lang=en
>
> 3.2.3 Watchdogs The required behavior of watchdog signal 1 of the Non-secure watchdog is modified in level 3– firmware and is required to be routed as an SPI to the GIC. It is expected that this SPI be configured as an EL3 interrupt, directly targeting a single PE. A system compatible with level 3- firmware must implement a second watchdog, and is referred to as the Secure watchdog. It must have both its register frames mapped in the Secure memory address space and must not be aliased to the Non-secure address space. Watchdog Signal 0 of the Secure watchdog must be routed as an SPI to the GIC and it is expected this will be configured as an EL3 interrupt, directly targeting a single PE.
>
>
>
> Q1- What happens if core is stuck and interrupts are not taken. Non-secure watchdog will expire and ultimately results in a WS1 which is also not taken as the core is not responding.
>
> If WS1 were to another subsystem (eg: SCP) then it would take action.
>
> In current scheme is it the secure sbsa wdg expected to detect such hang ?
>
>
>
> Q2- How to handle sbsa watchdog interrupt at EL3. Please suggest if I should make a patch in following approach to start with. Or it has to be registered as a RAS priority exception.
>
>
>
> diff --git a/drivers/arm/sbsa/sbsa.c b/drivers/arm/sbsa/sbsa.c
>
> index 79c6f26..9683ef8 100644
>
> --- a/drivers/arm/sbsa/sbsa.c
>
> +++ b/drivers/arm/sbsa/sbsa.c
>
> @@ -40,3 +40,26 @@
>
> +
>
> +#define weak plat_sbsa_nt_wdog_ws1_handle
>
> +#define weak plat_sbsa_t_wdog_ws0_handle
>
> +void sbsa_wdog_handler(int id)
>
> +{
>
> + if (id == SBSA_NT_WDG_WS1_INT) {
>
> + /* PUBLISH_EVENT */
>
> + plat_sbsa_nt_wdog_ws1_handle();
>
> + } else if (id == SBSA_T_WDG_WS0_INT) {
>
> + /* PUBLISH_EVENT */
>
> + plat_sbsa_t_wdog_ws0_handle();
>
> + }
>
> + /* EOI and reset , log what else */
>
> + psci_systrem_reset2();
>
> +}
>
> +
>
> +void sbsa_wdog_hander_init(void)
>
> +{
>
> +#if EXCEPTION_HANDLING_FRAMEWORK
>
> + ehf_register_priority_handler(SBSA_WDG_PRI, sbsa_wdog_handler);
>
> +#endif
>
> +}
>
>
>
> Thanks
>
> Sandeep
>
> --
> TF-A mailing list
> TF-A(a)lists.trustedfirmware.org
> https://lists.trustedfirmware.org/mailman/listinfo/tf-a
Thanks
Sandeep
Hi Sandeep
Arm development platforms that have an SBSA secure watchdog like N1SDP do not register an interrupt handler for the WS0 signal. They simply wait for the WS1 signal, which is fed to a higher agent (in this case the System Control Processor), which resets the platform. There is no explicit watchdog interrupt handling functionality in TF-A.
If your platform does not have a higher agent that handles WS1 then I guess you could add a handler in TF-A as you suggest in your code snippet, though I'm not sure if the maintainers would want this in generic SBSA code. Also, I don't see why you need both callback(s) and the explicit call to psci_systrem_reset2(), when presumably the callback(s) would do the latter.
> Q1- What happens if core is stuck and interrupts are not taken.
It's rare for EL3 interrupts not to be taken when the core is stuck, unless an EL3 exception handler itself is stuck, in which case I'm not sure there's much you can do. That's why it's good to have a higher agent.
> Or it has to be registered as a RAS priority exception.
I don't think that would help, unless the system was flooded with higher priority exceptions that prevented the watchdog handler from running.
Regards
Dan.
From: TF-A <tf-a-bounces(a)lists.trustedfirmware.org> On Behalf Of Sandeep Tripathy via TF-A
Sent: 27 August 2020 12:14
To: tf-a(a)lists.trustedfirmware.org
Subject: [TF-A] [query] sbsa level 3 spec: non secure watchdog WS1 handling at EL3
Hi,
Based on sbsa spec for level-3 firmware specification watchdog signals NS WS1 and S WS0 to be handled at EL3 firmware.
I have some query on how TF-A plans to implement this.
Ref: Excerpt DEN0029D_SBSA_6.0 https://developer.arm.com/documentation/den0029/d/?lang=en
3.2.3 Watchdogs The required behavior of watchdog signal 1 of the Non-secure watchdog is modified in level 3– firmware and is required to be routed as an SPI to the GIC. It is expected that this SPI be configured as an EL3 interrupt, directly targeting a single PE. A system compatible with level 3- firmware must implement a second watchdog, and is referred to as the Secure watchdog. It must have both its register frames mapped in the Secure memory address space and must not be aliased to the Non-secure address space. Watchdog Signal 0 of the Secure watchdog must be routed as an SPI to the GIC and it is expected this will be configured as an EL3 interrupt, directly targeting a single PE.
Q1- What happens if core is stuck and interrupts are not taken. Non-secure watchdog will expire and ultimately results in a WS1 which is also not taken as the core is not responding.
If WS1 were to another subsystem (eg: SCP) then it would take action.
In current scheme is it the secure sbsa wdg expected to detect such hang ?
Q2- How to handle sbsa watchdog interrupt at EL3. Please suggest if I should make a patch in following approach to start with. Or it has to be registered as a RAS priority exception.
diff --git a/drivers/arm/sbsa/sbsa.c b/drivers/arm/sbsa/sbsa.c
index 79c6f26..9683ef8 100644
--- a/drivers/arm/sbsa/sbsa.c
+++ b/drivers/arm/sbsa/sbsa.c
@@ -40,3 +40,26 @@
+
+#define weak plat_sbsa_nt_wdog_ws1_handle
+#define weak plat_sbsa_t_wdog_ws0_handle
+void sbsa_wdog_handler(int id)
+{
+ if (id == SBSA_NT_WDG_WS1_INT) {
+ /* PUBLISH_EVENT */
+ plat_sbsa_nt_wdog_ws1_handle();
+ } else if (id == SBSA_T_WDG_WS0_INT) {
+ /* PUBLISH_EVENT */
+ plat_sbsa_t_wdog_ws0_handle();
+ }
+ /* EOI and reset , log what else */
+ psci_systrem_reset2();
+}
+
+void sbsa_wdog_hander_init(void)
+{
+#if EXCEPTION_HANDLING_FRAMEWORK
+ ehf_register_priority_handler(SBSA_WDG_PRI, sbsa_wdog_handler);
+#endif
+}
Thanks
Sandeep
Hi,
Based on sbsa spec for level-3 firmware specification watchdog signals
NS WS1 and S WS0 to be handled at EL3 firmware.
I have some query on how TF-A plans to implement this.
Ref: Excerpt DEN0029D_SBSA_6.0
https://developer.arm.com/documentation/den0029/d/?lang=en
3.2.3 Watchdogs The required behavior of watchdog signal 1 of the
Non-secure watchdog is modified in level 3– firmware and is required to be
routed as an SPI to the GIC. It is expected that this SPI be configured as
an EL3 interrupt, directly targeting a single PE. A system compatible with
level 3- firmware must implement a second watchdog, and is referred to as
the Secure watchdog. It must have both its register frames mapped in the
Secure memory address space and must not be aliased to the Non-secure
address space. Watchdog Signal 0 of the Secure watchdog must be routed as
an SPI to the GIC and it is expected this will be configured as an EL3
interrupt, directly targeting a single PE.
Q1- What happens if core is stuck and interrupts are not taken. Non-secure
watchdog will expire and ultimately results in a WS1 which is also not
taken as the core is not responding.
If WS1 were to another subsystem (eg: SCP) then it would take action.
In current scheme is it the secure sbsa wdg expected to detect such
hang ?
Q2- How to handle sbsa watchdog interrupt at EL3. Please suggest if I
should make a patch in following approach to start with. Or it has to be
registered as a RAS priority exception.
diff --git a/drivers/arm/sbsa/sbsa.c b/drivers/arm/sbsa/sbsa.c
index 79c6f26..9683ef8 100644
--- a/drivers/arm/sbsa/sbsa.c
+++ b/drivers/arm/sbsa/sbsa.c
@@ -40,3 +40,26 @@
+
+#define weak plat_sbsa_nt_wdog_ws1_handle
+#define weak plat_sbsa_t_wdog_ws0_handle
+void sbsa_wdog_handler(int id)
+{
+ if (id == SBSA_NT_WDG_WS1_INT) {
+ /* PUBLISH_EVENT */
+ plat_sbsa_nt_wdog_ws1_handle();
+ } else if (id == SBSA_T_WDG_WS0_INT) {
+ /* PUBLISH_EVENT */
+ plat_sbsa_t_wdog_ws0_handle();
+ }
+ /* EOI and reset , log what else */
+ psci_systrem_reset2();
+}
+
+void sbsa_wdog_hander_init(void)
+{
+#if EXCEPTION_HANDLING_FRAMEWORK
+ ehf_register_priority_handler(SBSA_WDG_PRI, sbsa_wdog_handler);
+#endif
+}
Thanks
Sandeep
Hi,
Please find the latest report on new defect(s) introduced to ARM-software/arm-trusted-firmware found with Coverity Scan.
2 new defect(s) introduced to ARM-software/arm-trusted-firmware found with Coverity Scan.
New defect(s) Reported-by: Coverity Scan
Showing 2 of 2 defect(s)
** CID 361485: Integer handling issues (SIGN_EXTENSION)
/plat/qti/common/src/spmi_arb.c: 54 in wait_for_done()
________________________________________________________________________________________________________
*** CID 361485: Integer handling issues (SIGN_EXTENSION)
/plat/qti/common/src/spmi_arb.c: 54 in wait_for_done()
48
49 static int wait_for_done(uint16_t apid)
50 {
51 unsigned int timeout = 100;
52
53 while (timeout-- != 0U) {
>>> CID 361485: Integer handling issues (SIGN_EXTENSION)
>>> Suspicious implicit sign extension: "apid" with type "uint16_t" (16 bits, unsigned) is promoted in "207618056 + 65536 * apid" to type "int" (32 bits, signed), then sign-extended to type "unsigned long" (64 bits, unsigned). If "207618056 + 65536 * apid" is greater than 0x7FFFFFFF, the upper bits of the result will all be 1.
54 uint32_t status = mmio_read_32(REG_ARB_STATUS(apid));
55 if ((status & ARB_STATUS_DONE) != 0U) {
56 if ((status & ARB_STATUS_FAILURE) != 0U ||
57 (status & ARB_STATUS_DENIED) != 0U ||
58 (status & ARB_STATUS_DROPPED) != 0U) {
59 return status & 0xff;
** CID 361484: Integer handling issues (SIGN_EXTENSION)
/plat/qti/common/src/spmi_arb.c: 72 in arb_command()
________________________________________________________________________________________________________
*** CID 361484: Integer handling issues (SIGN_EXTENSION)
/plat/qti/common/src/spmi_arb.c: 72 in arb_command()
66 return ARB_FAKE_STATUS_TIMEOUT;
67 }
68
69 static void arb_command(uint16_t apid, uint8_t opcode, uint32_t addr,
70 uint8_t bytes)
71 {
>>> CID 361484: Integer handling issues (SIGN_EXTENSION)
>>> Suspicious implicit sign extension: "apid" with type "uint16_t" (16 bits, unsigned) is promoted in "207618048 + 65536 * apid" to type "int" (32 bits, signed), then sign-extended to type "unsigned long" (64 bits, unsigned). If "207618048 + 65536 * apid" is greater than 0x7FFFFFFF, the upper bits of the result will all be 1.
72 mmio_write_32(REG_ARB_CMD(apid), (uint32_t)opcode << 27 |
73 (addr & 0xff) << 4 | (bytes - 1));
74 }
75
76 int spmi_arb_read8(uint32_t addr)
77 {
________________________________________________________________________________________________________
To view the defects in Coverity Scan visit, https://u15810271.ct.sendgrid.net/ls/click?upn=HRESupC-2F2Czv4BOaCWWCy7my0P…
Things should be back to normal.
Joanna
From: TF-A <tf-a-bounces(a)lists.trustedfirmware.org> on behalf of Joanna Farley via TF-A <tf-a(a)lists.trustedfirmware.org>
Reply to: Joanna Farley <Joanna.Farley(a)arm.com>
Date: Wednesday, 26 August 2020 at 12:51
To: "tf-a(a)lists.trustedfirmware.org" <tf-a(a)lists.trustedfirmware.org>
Subject: [TF-A] TF-A Gerrit access permissions currently broken.
Just to inform project contributors that people may find their gerrit access rights may be broken at this time.
I have raised a support request with the trustedfirmware.org support team.
Joanna
Just to inform project contributors that people may find their gerrit access rights may be broken at this time.
I have raised a support request with the trustedfirmware.org support team.
Joanna
Hi All,
The next TF-A Tech Forum is scheduled for Thu 27th August 2020 16:00 – 17:00 (BST). A reoccurring meeting invite has been sent out to the subscribers of this TF-A mailing list. If you don’t have this please let me know.
Agenda:
* TF-A Errata Process – Presented by Bipin Ravi
* Bug Review Committee (BRC) & Categorization of Errata
* Software Developers Errata Notice (SDEN) & Product Errata Notice (PEN)
* What TF-A Implements
* How TF-A Implements
* Testing
If TF-A contributors have anything they wish to present at any future TF-A tech forum please contact me to have that scheduled.
Previous sessions, both recording and presentation material can be found on the trustedfirmware.org TF-A Technical meeting webpage: https://www.trustedfirmware.org/meetings/tf-a-technical-forum/
A scheduling tracking page is also available to help track sessions suggested and being prepared: https://developer.trustedfirmware.org/w/tf_a/tf-a-tech-forum-scheduling/ Final decisions on what will be presented will be shared a few days before the next meeting and shared on the TF-A mailing list.
Thanks
Joanna
<Cc alias>
-----Original Message-----
From: Sandeep Tripathy <sandeep.tripathy(a)broadcom.com>
Sent: Tuesday, August 25, 2020 8:59 AM
To: Varun Wadekar <vwadekar(a)nvidia.com>; Soby Mathew <Soby.Mathew(a)arm.com>
Subject: RE: [TF-A] [RFC] Api to power down all cores
Thanks,
I will use callback as param to get rid of the 'plat*'. 'void psci_stop_other_cores(void (*stop_func)(uregister_t mpidr))'
Platform can call like .. psci_stop_other_cores(ipi_send_stop); I will
update the patch tomorrow.
This api is not invoked by psci generic functions. So I think that should suffice your concern. Anyways I will take care any other suggestions.
IPI implementation is under flag 'IPI_SUPPORT'.
https://review.trustedfirmware.org/c/TF-A/trusted-firmware-a/+/5323/
Thanks
Sandeep
> -----Original Message-----
> From: Varun Wadekar [mailto:vwadekar@nvidia.com]
> Sent: Tuesday, August 25, 2020 9:11 AM
> To: Soby Mathew; Sandeep Tripathy
> Subject: RE: [TF-A] [RFC] Api to power down all cores
>
> Hi,
>
> In addition to the suggestions already posted, we should provide a
> build flag or dynamic knob to allow platforms to disable this feature.
>
> -Varun
>
> -----Original Message-----
> From: TF-A <tf-a-bounces(a)lists.trustedfirmware.org> On Behalf Of Soby
> Mathew via TF-A
> Sent: Friday, August 21, 2020 3:57 AM
> To: Sandeep Tripathy <sandeep.tripathy(a)broadcom.com>
> Cc: tf-a(a)lists.trustedfirmware.org
> Subject: Re: [TF-A] [RFC] Api to power down all cores
>
> External email: Use caution opening links or attachments
>
>
> Hi Sandeep,
> Thanks for the clarification. I too think this has general utility and
> since you need access to internal PSCI data to perform the
> functionality , exporting a utility function from PSCI for platforms
> to invoke seems the right thing to do.
> The small concern I have is using the `plat_*` namespace as this is a
> utility function invoked by the platform and another porting layer
> beneath it seems out of place.
>
> I would suggest to add a parameter to stop_other_cores(), this could
> be either the IPI number or a callback function to trigger the IPI.
> This allows to provide the platform specific details without `plat_*`
> API.
>
> Best Regards
> Soby Mathew
>
> > -----Original Message-----
> > From: Sandeep Tripathy <sandeep.tripathy(a)broadcom.com>
> > Sent: 21 August 2020 07:17
> > To: Soby Mathew <Soby.Mathew(a)arm.com>
> > Cc: tf-a(a)lists.trustedfirmware.org
> > Subject: RE: [TF-A] [RFC] Api to power down all cores
> >
> > Hi Soby,
> > I realize using term 'PSCI API' in rfc tag is misleading like Achin
> > mentioned in gerrit.
> >
> > Here I wanted to have a generic API to 'stop_other_cores' in
> > secure world.
> > The usage is platform firmware specific.
> > Implementation of 'stop_other_cores' depends on a generic 'IPI'
> > support
> (1).
> > It leverages the existing EHF. So I feel it is not adding and
> > complexity or overhead in normal execution path.
> >
> > 'stop_other_cores' API implementation depends on some psci private
> > functions to traverse the pd nodes and extract MPIDRs for target pe
> > list. That was the reason to put the function within psci lib. So
> > there are
> two things.
> > 1- Does this idea of 'stop_other_core' api qualify to be generic
> > 2- Does a generic IPI layer make sense
> >
> > Thanks
> > Sandeep
> > > -----Original Message-----
> > > From: Soby Mathew [mailto:Soby.Mathew@arm.com]
> > > Sent: Thursday, August 20, 2020 8:54 PM
> > > To: Sandeep Tripathy
> > > Cc: tf-a(a)lists.trustedfirmware.org
> > > Subject: RE: [TF-A] [RFC] psci: api to power down all cores
> > >
> > > Hi Sandeep,
> > > Just to understand better, if there is a secure side
> > > panic/watchdog interrupt, then the secure side is already able to
> > > do such an intervention without the availability of a PSCI API to the NS side.
> > >
> > > In case the NS world has crashed, then PSCI_SYSTEM_RESET and
> > > PSCI_SYSTEM_OFF APIs can be invoked which then does the
> > > appropriate actions. From my reading, the PSCI specification
> > > doesn't prevent firmware implementation of the reset and off API's
> > > from doing the kind of implementation as per your proposal.
> >
> > I intend to do 'stop_other_cores' in platform extension of
> > 'plat_system_resetx()', secure side watchdog expiry/
> > plat_panic_handler().
> >
> > >
> > > Best Regards
> > > Soby Mathew
> > >
> > > > -----Original Message-----
> > > > From: TF-A <tf-a-bounces(a)lists.trustedfirmware.org> On Behalf Of
> > > Sandeep
> > > > Tripathy via TF-A
> > > > Sent: 19 August 2020 16:42
> > > > To: tf-a(a)lists.trustedfirmware.org
> > > > Subject: [TF-A] [RFC] psci: api to power down all cores
> > > >
> > > > Hi,
> > > > I am proposing to have a generic api in psci lib which can be
> > > > used to
> > > force
> > > > power down all other cores from any initiating core analogous to
> > > > 'smp_cpu_stop' in linux. It is immune to interrupt lock by
> > > > EL1/EL2 software.
> > > >
> > > > Platforms may use this api in case of secure side panic, secure
> > > > watchdog interrupt handling or if required in certain types of
> > > > warm resets. The usage
> > > is
> > > > platform dependent.
> > > >
> > > > This depends on a generic implementation of secure IPI (1) which
> > > > uses EHF
> > > to
> > > > handle IPI at platform defined priority. We probably require
> > > > more types of secure IPIs.
> > > >
> > > > Please review the series
> > > > Ref:
> > > > https://review.trustedfirmware.org/c/TF-A/trusted-firmware-a/+/5
> > > > 32
> > > > 4
> > > >
> > > > diff --git a/lib/psci/psci_system_off.c
> > > > b/lib/psci/psci_system_off.c index
> > > > 141d69e..011aaa6 100644
> > > > --- a/lib/psci/psci_system_off.c
> > > > +++ b/lib/psci/psci_system_off.c
> > > > @@ -10,10 +10,44 @@
> > > > #include <arch_helpers.h>
> > > > #include <common/debug.h>
> > > > #include <drivers/console.h>
> > > > +#include <drivers/delay_timer.h>
> > > > #include <plat/common/platform.h>
> > > >
> > > > #include "psci_private.h"
> > > >
> > > > +#ifndef PLAT_CORES_PWRDWN_WAIT_TIMEOUT_MS #define
> > > > +PLAT_CORES_PWRDWN_WAIT_TIMEOUT_MS 1000 #endif
> > > > +
> > > > +#if IMAGE_BL31
> > > > +void psci_stop_other_cores(void) { #define
> > > > +PLAT_CORES_PWRDWN_WAIT_TIMEOUT_MS 1000 #endif
> > > > +
> > > > +#if IMAGE_BL31
> > > > +void psci_stop_other_cores(void) {
> > > > + int idx, this_cpu_idx, cnt;
> > > > +
> > > > + this_cpu_idx = plat_my_core_pos();
> > > > +
> > > > + /* Raise G0 IPI cpustop to all cores but self */
> > > > + for (idx = 0; idx < psci_plat_core_count; idx++) {
> > > > + if ((idx != this_cpu_idx) &&
> > > > + (psci_get_aff_info_state_by_idx(idx) ==
> > > > AFF_STATE_ON)) {
> > > > +
> > > > plat_ipi_send_cpu_stop(psci_cpu_pd_nodes[idx].mpidr);
> > > > + }
> > > > + }
> > > > +
> > > > + /* Wait for others cores to shutdown */
> > > > + for (cnt = 0; cnt < PLAT_CORES_PWRDWN_WAIT_TIMEOUT_MS;
> > > > + cnt++)
> > > {
> > > > + if (psci_is_last_on_cpu())
> > > > + break;
> > > > + mdelay(1);
> > > > + }
> > > > +
> > > > + if (!psci_is_last_on_cpu()) {
> > > > + WARN("Failed to stop all cores!\n");
> > > > + psci_print_power_domain_map();
> > > > + }
> > > > +}
> > > > +#endif
> > > > +
> > > >
> > > > (1)
> > > > RFC: ipi: add ipi feature
> > > > Ref:
> > > > https://review.trustedfirmware.org/c/TF-A/trusted-firmware-
> > > a/+/5323/1
> > > >
> > > > Thanks
> > > > Sandeep
> > > > --
> > > > TF-A mailing list
> > > > TF-A(a)lists.trustedfirmware.org
> > > > https://lists.trustedfirmware.org/mailman/listinfo/tf-a
> --
> TF-A mailing list
> TF-A(a)lists.trustedfirmware.org
> https://lists.trustedfirmware.org/mailman/listinfo/tf-a