diff mbox series

[for-stable-4.4,08/50] arm/arm64: KVM: Advertise SMCCC v1.1

Message ID 20191108123554.29004-9-ardb@kernel.org
State New
Headers show
Series None | expand

Commit Message

Ard Biesheuvel Nov. 8, 2019, 12:35 p.m. UTC
From: Mark Rutland <mark.rutland@arm.com>


From: Marc Zyngier <marc.zyngier@arm.com>


commit 09e6be12effdb33bf7210c8867bbd213b66a499e upstream.

The new SMC Calling Convention (v1.1) allows for a reduced overhead
when calling into the firmware, and provides a new feature discovery
mechanism.

Make it visible to KVM guests.

Tested-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>

Reviewed-by: Christoffer Dall <christoffer.dall@linaro.org>

Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>

Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>

[v4.9: account for files moved to virt/ upstream]
Signed-off-by: Mark Rutland <mark.rutland@arm.com> [v4.9 backport]

Tested-by: Greg Hackmann <ghackmann@google.com>

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

[ardb: restrict to include/linux/arm-smccc.h, drop KVM bits]
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>

---
 include/linux/arm-smccc.h | 22 +++++++++++++++++---
 1 file changed, 19 insertions(+), 3 deletions(-)

-- 
2.20.1

Comments

Greg KH Nov. 8, 2019, 1:11 p.m. UTC | #1
On Fri, Nov 08, 2019 at 01:35:12PM +0100, Ard Biesheuvel wrote:
> From: Mark Rutland <mark.rutland@arm.com>

> 

> From: Marc Zyngier <marc.zyngier@arm.com>


Lots of Mar[c/k]'s :)

I'll fix this up...
Ard Biesheuvel Nov. 8, 2019, 1:29 p.m. UTC | #2
On Fri, 8 Nov 2019 at 14:11, Greg KH <greg@kroah.com> wrote:
>

> On Fri, Nov 08, 2019 at 01:35:12PM +0100, Ard Biesheuvel wrote:

> > From: Mark Rutland <mark.rutland@arm.com>

> >

> > From: Marc Zyngier <marc.zyngier@arm.com>

>

> Lots of Mar[c/k]'s :)

>

> I'll fix this up...

>


This is eactly how it appears in v4.9, so I just left it. Same for the
double 'upstream commit' that you responded to.
Greg KH Nov. 8, 2019, 1:39 p.m. UTC | #3
On Fri, Nov 08, 2019 at 02:29:21PM +0100, Ard Biesheuvel wrote:
> On Fri, 8 Nov 2019 at 14:11, Greg KH <greg@kroah.com> wrote:

> >

> > On Fri, Nov 08, 2019 at 01:35:12PM +0100, Ard Biesheuvel wrote:

> > > From: Mark Rutland <mark.rutland@arm.com>

> > >

> > > From: Marc Zyngier <marc.zyngier@arm.com>

> >

> > Lots of Mar[c/k]'s :)

> >

> > I'll fix this up...

> >

> 

> This is eactly how it appears in v4.9, so I just left it. Same for the

> double 'upstream commit' that you responded to.


Ick, I must have missed those there, sorry.

greg k-h
Russell King (Oracle) Nov. 8, 2019, 1:39 p.m. UTC | #4
On Fri, Nov 08, 2019 at 02:11:05PM +0100, Greg KH wrote:
> On Fri, Nov 08, 2019 at 01:35:12PM +0100, Ard Biesheuvel wrote:

> > From: Mark Rutland <mark.rutland@arm.com>

> > 

> > From: Marc Zyngier <marc.zyngier@arm.com>

> 

> Lots of Mar[c/k]'s :)

> 

> I'll fix this up...


Mark and Marc are both valid variants, there is nothing to be fixed up
(and if you do, you risk insulting one or other.)

-- 
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTC broadband for 0.8mile line in suburbia: sync at 12.1Mbps down 622kbps up
According to speedtest.net: 11.9Mbps down 500kbps up
Mark Rutland Nov. 8, 2019, 1:48 p.m. UTC | #5
On Fri, Nov 08, 2019 at 01:39:52PM +0000, Russell King - ARM Linux admin wrote:
> On Fri, Nov 08, 2019 at 02:11:05PM +0100, Greg KH wrote:

> > On Fri, Nov 08, 2019 at 01:35:12PM +0100, Ard Biesheuvel wrote:

> > > From: Mark Rutland <mark.rutland@arm.com>

> > > 

> > > From: Marc Zyngier <marc.zyngier@arm.com>

> > 

> > Lots of Mar[c/k]'s :)

> > 

> > I'll fix this up...

> 

> Mark and Marc are both valid variants, there is nothing to be fixed up

> (and if you do, you risk insulting one or other.)


Lost context here -- the issue was both were at the top of the patch,
but there should only be one for the author (Zyngier).

I don't think anyone was suggesting deed poll would be necessary! ;)

I probably messsed that up when doing the v4.9 backport, sorry if that
was the case!

Mark.
diff mbox series

Patch

diff --git a/include/linux/arm-smccc.h b/include/linux/arm-smccc.h
index b5abfda80465..8bf047eab116 100644
--- a/include/linux/arm-smccc.h
+++ b/include/linux/arm-smccc.h
@@ -14,9 +14,6 @@ 
 #ifndef __LINUX_ARM_SMCCC_H
 #define __LINUX_ARM_SMCCC_H
 
-#include <linux/linkage.h>
-#include <linux/types.h>
-
 /*
  * This file provides common defines for ARM SMC Calling Convention as
  * specified in
@@ -60,6 +57,24 @@ 
 #define ARM_SMCCC_OWNER_TRUSTED_OS	50
 #define ARM_SMCCC_OWNER_TRUSTED_OS_END	63
 
+#define ARM_SMCCC_VERSION_1_0		0x10000
+#define ARM_SMCCC_VERSION_1_1		0x10001
+
+#define ARM_SMCCC_VERSION_FUNC_ID					\
+	ARM_SMCCC_CALL_VAL(ARM_SMCCC_FAST_CALL,				\
+			   ARM_SMCCC_SMC_32,				\
+			   0, 0)
+
+#define ARM_SMCCC_ARCH_FEATURES_FUNC_ID					\
+	ARM_SMCCC_CALL_VAL(ARM_SMCCC_FAST_CALL,				\
+			   ARM_SMCCC_SMC_32,				\
+			   0, 1)
+
+#ifndef __ASSEMBLY__
+
+#include <linux/linkage.h>
+#include <linux/types.h>
+
 /**
  * struct arm_smccc_res - Result from SMC/HVC call
  * @a0-a3 result values from registers 0 to 3
@@ -101,4 +116,5 @@  asmlinkage void arm_smccc_hvc(unsigned long a0, unsigned long a1,
 			unsigned long a5, unsigned long a6, unsigned long a7,
 			struct arm_smccc_res *res);
 
+#endif /*__ASSEMBLY__*/
 #endif /*__LINUX_ARM_SMCCC_H*/