linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] firmware: arm-smccc: define identifier for Arm SMCCC v1.2
@ 2020-05-14  8:21 Etienne Carriere
  2020-05-14  8:21 ` [PATCH 2/2] firmware: psci: support SMCCC v1.2 for SMCCC conduit Etienne Carriere
  2020-05-14 12:38 ` [PATCH 1/2] firmware: arm-smccc: define identifier for Arm SMCCC v1.2 Steven Price
  0 siblings, 2 replies; 7+ messages in thread
From: Etienne Carriere @ 2020-05-14  8:21 UTC (permalink / raw)
  To: linux-kernel
  Cc: lorenzo.pieralisi, linux-arm-kernel, mark.rutland, tglx,
	alexios.zavras, will, maz, steven.price, etienne.carriere

Define identifier value reported by secure firmware when its
supports Arm SMCCC specification v1.2.

Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org>
---
 include/linux/arm-smccc.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/include/linux/arm-smccc.h b/include/linux/arm-smccc.h
index 59494df0f55b..1cf221f3f07a 100644
--- a/include/linux/arm-smccc.h
+++ b/include/linux/arm-smccc.h
@@ -56,6 +56,7 @@
 
 #define ARM_SMCCC_VERSION_1_0		0x10000
 #define ARM_SMCCC_VERSION_1_1		0x10001
+#define ARM_SMCCC_VERSION_1_2		0x10002
 
 #define ARM_SMCCC_VERSION_FUNC_ID					\
 	ARM_SMCCC_CALL_VAL(ARM_SMCCC_FAST_CALL,				\
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 2/2] firmware: psci: support SMCCC v1.2 for SMCCC conduit
  2020-05-14  8:21 [PATCH 1/2] firmware: arm-smccc: define identifier for Arm SMCCC v1.2 Etienne Carriere
@ 2020-05-14  8:21 ` Etienne Carriere
  2020-05-14 14:24   ` Sudeep Holla
  2020-05-14 12:38 ` [PATCH 1/2] firmware: arm-smccc: define identifier for Arm SMCCC v1.2 Steven Price
  1 sibling, 1 reply; 7+ messages in thread
From: Etienne Carriere @ 2020-05-14  8:21 UTC (permalink / raw)
  To: linux-kernel
  Cc: lorenzo.pieralisi, linux-arm-kernel, mark.rutland, tglx,
	alexios.zavras, will, maz, steven.price, etienne.carriere

Update PSCI driver to support SMCCC v1.2 reported by secure firmware
and indirectly make SMCCC conduit properly set when so. TF-A release
v2.3 implements and reports SMCCC v1.2 since commit [1].

Link: [1] https://git.trustedfirmware.org/TF-A/trusted-firmware-a.git/commit/?id=e34cc0cedca6e229847c232fe58d37fad2610ce9
Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org>
---
 drivers/firmware/psci/psci.c | 14 ++++++++++----
 include/linux/psci.h         |  1 +
 2 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/drivers/firmware/psci/psci.c b/drivers/firmware/psci/psci.c
index 2937d44b5df4..80cf73bea4b0 100644
--- a/drivers/firmware/psci/psci.c
+++ b/drivers/firmware/psci/psci.c
@@ -409,11 +409,17 @@ static void __init psci_init_smccc(void)
 	feature = psci_features(ARM_SMCCC_VERSION_FUNC_ID);
 
 	if (feature != PSCI_RET_NOT_SUPPORTED) {
-		u32 ret;
-		ret = invoke_psci_fn(ARM_SMCCC_VERSION_FUNC_ID, 0, 0, 0);
-		if (ret == ARM_SMCCC_VERSION_1_1) {
+		ver = invoke_psci_fn(ARM_SMCCC_VERSION_FUNC_ID, 0, 0, 0);
+
+		switch (ver) {
+		case ARM_SMCCC_VERSION_1_1:
 			psci_ops.smccc_version = SMCCC_VERSION_1_1;
-			ver = ret;
+			break;
+		case ARM_SMCCC_VERSION_1_2:
+			psci_ops.smccc_version = SMCCC_VERSION_1_2;
+			break;
+		default:
+			break;
 		}
 	}
 
diff --git a/include/linux/psci.h b/include/linux/psci.h
index a67712b73b6c..c7d99b7f34ed 100644
--- a/include/linux/psci.h
+++ b/include/linux/psci.h
@@ -24,6 +24,7 @@ bool psci_has_osi_support(void);
 enum smccc_version {
 	SMCCC_VERSION_1_0,
 	SMCCC_VERSION_1_1,
+	SMCCC_VERSION_1_2,
 };
 
 struct psci_operations {
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH 1/2] firmware: arm-smccc: define identifier for Arm SMCCC v1.2
  2020-05-14  8:21 [PATCH 1/2] firmware: arm-smccc: define identifier for Arm SMCCC v1.2 Etienne Carriere
  2020-05-14  8:21 ` [PATCH 2/2] firmware: psci: support SMCCC v1.2 for SMCCC conduit Etienne Carriere
@ 2020-05-14 12:38 ` Steven Price
  2020-05-14 12:52   ` Etienne Carriere
  1 sibling, 1 reply; 7+ messages in thread
From: Steven Price @ 2020-05-14 12:38 UTC (permalink / raw)
  To: Etienne Carriere, linux-kernel
  Cc: lorenzo.pieralisi, linux-arm-kernel, mark.rutland, tglx,
	alexios.zavras, will, maz, Sudeep Holla

On 14/05/2020 09:21, Etienne Carriere wrote:
> Define identifier value reported by secure firmware when its
> supports Arm SMCCC specification v1.2.
> 
> Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org>

FYI Sudeep has already posted a patch to do this[1].

Steve

[1] 
https://lore.kernel.org/linux-arm-kernel/20200430114814.14116-3-sudeep.holla@arm.com/

> ---
>   include/linux/arm-smccc.h | 1 +
>   1 file changed, 1 insertion(+)
> 
> diff --git a/include/linux/arm-smccc.h b/include/linux/arm-smccc.h
> index 59494df0f55b..1cf221f3f07a 100644
> --- a/include/linux/arm-smccc.h
> +++ b/include/linux/arm-smccc.h
> @@ -56,6 +56,7 @@
>   
>   #define ARM_SMCCC_VERSION_1_0		0x10000
>   #define ARM_SMCCC_VERSION_1_1		0x10001
> +#define ARM_SMCCC_VERSION_1_2		0x10002
>   
>   #define ARM_SMCCC_VERSION_FUNC_ID					\
>   	ARM_SMCCC_CALL_VAL(ARM_SMCCC_FAST_CALL,				\
> 


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 1/2] firmware: arm-smccc: define identifier for Arm SMCCC v1.2
  2020-05-14 12:38 ` [PATCH 1/2] firmware: arm-smccc: define identifier for Arm SMCCC v1.2 Steven Price
@ 2020-05-14 12:52   ` Etienne Carriere
  0 siblings, 0 replies; 7+ messages in thread
From: Etienne Carriere @ 2020-05-14 12:52 UTC (permalink / raw)
  To: Steven Price
  Cc: linux-kernel, lorenzo.pieralisi,
	moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE,
	Mark Rutland, Thomas Gleixner, alexios.zavras, will, maz,
	Sudeep Holla

On Thu, 14 May 2020 at 14:38, Steven Price <steven.price@arm.com> wrote:
>
> On 14/05/2020 09:21, Etienne Carriere wrote:
> > Define identifier value reported by secure firmware when its
> > supports Arm SMCCC specification v1.2.
> >
> > Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org>
>
> FYI Sudeep has already posted a patch to do this[1].
>
> Steve

Thanks. I'll follow the thread.

Regards
Etienne

>
> [1]
> https://lore.kernel.org/linux-arm-kernel/20200430114814.14116-3-sudeep.holla@arm.com/
>
> > ---
> >   include/linux/arm-smccc.h | 1 +
> >   1 file changed, 1 insertion(+)
> >
> > diff --git a/include/linux/arm-smccc.h b/include/linux/arm-smccc.h
> > index 59494df0f55b..1cf221f3f07a 100644
> > --- a/include/linux/arm-smccc.h
> > +++ b/include/linux/arm-smccc.h
> > @@ -56,6 +56,7 @@
> >
> >   #define ARM_SMCCC_VERSION_1_0               0x10000
> >   #define ARM_SMCCC_VERSION_1_1               0x10001
> > +#define ARM_SMCCC_VERSION_1_2                0x10002
> >
> >   #define ARM_SMCCC_VERSION_FUNC_ID                                   \
> >       ARM_SMCCC_CALL_VAL(ARM_SMCCC_FAST_CALL,                         \
> >
>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 2/2] firmware: psci: support SMCCC v1.2 for SMCCC conduit
  2020-05-14  8:21 ` [PATCH 2/2] firmware: psci: support SMCCC v1.2 for SMCCC conduit Etienne Carriere
@ 2020-05-14 14:24   ` Sudeep Holla
  2020-05-14 14:56     ` Etienne Carriere
  0 siblings, 1 reply; 7+ messages in thread
From: Sudeep Holla @ 2020-05-14 14:24 UTC (permalink / raw)
  To: Etienne Carriere
  Cc: linux-kernel, mark.rutland, lorenzo.pieralisi, maz, steven.price,
	alexios.zavras, tglx, will, Sudeep Holla, linux-arm-kernel

On Thu, May 14, 2020 at 10:21:09AM +0200, Etienne Carriere wrote:
> Update PSCI driver to support SMCCC v1.2 reported by secure firmware
> and indirectly make SMCCC conduit properly set when so. TF-A release
> v2.3 implements and reports SMCCC v1.2 since commit [1].
> 
> Link: [1] https://git.trustedfirmware.org/TF-A/trusted-firmware-a.git/commit/?id=e34cc0cedca6e229847c232fe58d37fad2610ce9
> Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org>
> ---
>  drivers/firmware/psci/psci.c | 14 ++++++++++----
>  include/linux/psci.h         |  1 +
>  2 files changed, 11 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/firmware/psci/psci.c b/drivers/firmware/psci/psci.c
> index 2937d44b5df4..80cf73bea4b0 100644
> --- a/drivers/firmware/psci/psci.c
> +++ b/drivers/firmware/psci/psci.c
> @@ -409,11 +409,17 @@ static void __init psci_init_smccc(void)
>  	feature = psci_features(ARM_SMCCC_VERSION_FUNC_ID);
>  
>  	if (feature != PSCI_RET_NOT_SUPPORTED) {
> -		u32 ret;
> -		ret = invoke_psci_fn(ARM_SMCCC_VERSION_FUNC_ID, 0, 0, 0);
> -		if (ret == ARM_SMCCC_VERSION_1_1) {
> +		ver = invoke_psci_fn(ARM_SMCCC_VERSION_FUNC_ID, 0, 0, 0);
> +
> +		switch (ver) {
> +		case ARM_SMCCC_VERSION_1_1:
>  			psci_ops.smccc_version = SMCCC_VERSION_1_1;
> -			ver = ret;
> +			break;
> +		case ARM_SMCCC_VERSION_1_2:
> +			psci_ops.smccc_version = SMCCC_VERSION_1_2;
> +			break;
> +		default:
> +			break;
>  		}
>  	}
>  
> diff --git a/include/linux/psci.h b/include/linux/psci.h
> index a67712b73b6c..c7d99b7f34ed 100644
> --- a/include/linux/psci.h
> +++ b/include/linux/psci.h
> @@ -24,6 +24,7 @@ bool psci_has_osi_support(void);
>  enum smccc_version {
>  	SMCCC_VERSION_1_0,
>  	SMCCC_VERSION_1_1,
> +	SMCCC_VERSION_1_2,

I took approach to kill this completely [1] instead of having to keep
expanding it for ever.

-- 
Regards,
Sudeep

[1] https://lore.kernel.org/linux-arm-kernel/20200506164411.3284-5-sudeep.holla@arm.com/

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 2/2] firmware: psci: support SMCCC v1.2 for SMCCC conduit
  2020-05-14 14:24   ` Sudeep Holla
@ 2020-05-14 14:56     ` Etienne Carriere
  2020-05-15  9:24       ` Sudeep Holla
  0 siblings, 1 reply; 7+ messages in thread
From: Etienne Carriere @ 2020-05-14 14:56 UTC (permalink / raw)
  To: Sudeep Holla
  Cc: linux-kernel, Mark Rutland, lorenzo.pieralisi, maz, Steven Price,
	alexios.zavras, Thomas Gleixner, will,
	moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE

On Thu, 14 May 2020 at 16:24, Sudeep Holla <sudeep.holla@arm.com> wrote:
>
> On Thu, May 14, 2020 at 10:21:09AM +0200, Etienne Carriere wrote:
> > Update PSCI driver to support SMCCC v1.2 reported by secure firmware
> > and indirectly make SMCCC conduit properly set when so. TF-A release
> > v2.3 implements and reports SMCCC v1.2 since commit [1].
> >
> > Link: [1] https://git.trustedfirmware.org/TF-A/trusted-firmware-a.git/commit/?id=e34cc0cedca6e229847c232fe58d37fad2610ce9
> > Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org>
> > ---
> >  drivers/firmware/psci/psci.c | 14 ++++++++++----
> >  include/linux/psci.h         |  1 +
> >  2 files changed, 11 insertions(+), 4 deletions(-)
> >
> > diff --git a/drivers/firmware/psci/psci.c b/drivers/firmware/psci/psci.c
> > index 2937d44b5df4..80cf73bea4b0 100644
> > --- a/drivers/firmware/psci/psci.c
> > +++ b/drivers/firmware/psci/psci.c
> > @@ -409,11 +409,17 @@ static void __init psci_init_smccc(void)
> >       feature = psci_features(ARM_SMCCC_VERSION_FUNC_ID);
> >
> >       if (feature != PSCI_RET_NOT_SUPPORTED) {
> > -             u32 ret;
> > -             ret = invoke_psci_fn(ARM_SMCCC_VERSION_FUNC_ID, 0, 0, 0);
> > -             if (ret == ARM_SMCCC_VERSION_1_1) {
> > +             ver = invoke_psci_fn(ARM_SMCCC_VERSION_FUNC_ID, 0, 0, 0);
> > +
> > +             switch (ver) {
> > +             case ARM_SMCCC_VERSION_1_1:
> >                       psci_ops.smccc_version = SMCCC_VERSION_1_1;
> > -                     ver = ret;
> > +                     break;
> > +             case ARM_SMCCC_VERSION_1_2:
> > +                     psci_ops.smccc_version = SMCCC_VERSION_1_2;
> > +                     break;
> > +             default:
> > +                     break;
> >               }
> >       }
> >
> > diff --git a/include/linux/psci.h b/include/linux/psci.h
> > index a67712b73b6c..c7d99b7f34ed 100644
> > --- a/include/linux/psci.h
> > +++ b/include/linux/psci.h
> > @@ -24,6 +24,7 @@ bool psci_has_osi_support(void);
> >  enum smccc_version {
> >       SMCCC_VERSION_1_0,
> >       SMCCC_VERSION_1_1,
> > +     SMCCC_VERSION_1_2,
>
> I took approach to kill this completely [1] instead of having to keep
> expanding it for ever.

Yes, I've been pointed to [1]. Discard this change. Sorry for the
(little) noise.

Etienne

> --
> Regards,
> Sudeep
>
> [1] https://lore.kernel.org/linux-arm-kernel/20200506164411.3284-5-sudeep.holla@arm.com/

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 2/2] firmware: psci: support SMCCC v1.2 for SMCCC conduit
  2020-05-14 14:56     ` Etienne Carriere
@ 2020-05-15  9:24       ` Sudeep Holla
  0 siblings, 0 replies; 7+ messages in thread
From: Sudeep Holla @ 2020-05-15  9:24 UTC (permalink / raw)
  To: Etienne Carriere
  Cc: linux-kernel, Mark Rutland, lorenzo.pieralisi, maz, Steven Price,
	alexios.zavras, Thomas Gleixner, will,
	moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE

On Thu, May 14, 2020 at 04:56:53PM +0200, Etienne Carriere wrote:
> On Thu, 14 May 2020 at 16:24, Sudeep Holla <sudeep.holla@arm.com> wrote:
> >
> > On Thu, May 14, 2020 at 10:21:09AM +0200, Etienne Carriere wrote:
> > > Update PSCI driver to support SMCCC v1.2 reported by secure firmware
> > > and indirectly make SMCCC conduit properly set when so. TF-A release
> > > v2.3 implements and reports SMCCC v1.2 since commit [1].
> > >
> > > Link: [1] https://git.trustedfirmware.org/TF-A/trusted-firmware-a.git/commit/?id=e34cc0cedca6e229847c232fe58d37fad2610ce9
> > > Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org>
> > > ---
> > >  drivers/firmware/psci/psci.c | 14 ++++++++++----
> > >  include/linux/psci.h         |  1 +
> > >  2 files changed, 11 insertions(+), 4 deletions(-)
> > >
> > > diff --git a/drivers/firmware/psci/psci.c b/drivers/firmware/psci/psci.c
> > > index 2937d44b5df4..80cf73bea4b0 100644
> > > --- a/drivers/firmware/psci/psci.c
> > > +++ b/drivers/firmware/psci/psci.c
> > > @@ -409,11 +409,17 @@ static void __init psci_init_smccc(void)
> > >       feature = psci_features(ARM_SMCCC_VERSION_FUNC_ID);
> > >
> > >       if (feature != PSCI_RET_NOT_SUPPORTED) {
> > > -             u32 ret;
> > > -             ret = invoke_psci_fn(ARM_SMCCC_VERSION_FUNC_ID, 0, 0, 0);
> > > -             if (ret == ARM_SMCCC_VERSION_1_1) {
> > > +             ver = invoke_psci_fn(ARM_SMCCC_VERSION_FUNC_ID, 0, 0, 0);
> > > +
> > > +             switch (ver) {
> > > +             case ARM_SMCCC_VERSION_1_1:
> > >                       psci_ops.smccc_version = SMCCC_VERSION_1_1;
> > > -                     ver = ret;
> > > +                     break;
> > > +             case ARM_SMCCC_VERSION_1_2:
> > > +                     psci_ops.smccc_version = SMCCC_VERSION_1_2;
> > > +                     break;
> > > +             default:
> > > +                     break;
> > >               }
> > >       }
> > >
> > > diff --git a/include/linux/psci.h b/include/linux/psci.h
> > > index a67712b73b6c..c7d99b7f34ed 100644
> > > --- a/include/linux/psci.h
> > > +++ b/include/linux/psci.h
> > > @@ -24,6 +24,7 @@ bool psci_has_osi_support(void);
> > >  enum smccc_version {
> > >       SMCCC_VERSION_1_0,
> > >       SMCCC_VERSION_1_1,
> > > +     SMCCC_VERSION_1_2,
> >
> > I took approach to kill this completely [1] instead of having to keep
> > expanding it for ever.
>
> Yes, I've been pointed to [1]. Discard this change. Sorry for the
> (little) noise.
>

No worries, it's not a noise, just different approach.

--
Regards,
Sudeep

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2020-05-15  9:25 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-14  8:21 [PATCH 1/2] firmware: arm-smccc: define identifier for Arm SMCCC v1.2 Etienne Carriere
2020-05-14  8:21 ` [PATCH 2/2] firmware: psci: support SMCCC v1.2 for SMCCC conduit Etienne Carriere
2020-05-14 14:24   ` Sudeep Holla
2020-05-14 14:56     ` Etienne Carriere
2020-05-15  9:24       ` Sudeep Holla
2020-05-14 12:38 ` [PATCH 1/2] firmware: arm-smccc: define identifier for Arm SMCCC v1.2 Steven Price
2020-05-14 12:52   ` Etienne Carriere

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).