arm/arm64: smccc: Make function identifiers an unsigned quantity
authorMarc Zyngier <marc.zyngier@arm.com>
Tue, 6 Feb 2018 17:56:18 +0000 (17:56 +0000)
committerCatalin Marinas <catalin.marinas@arm.com>
Tue, 6 Feb 2018 22:54:13 +0000 (22:54 +0000)
Function identifiers are a 32bit, unsigned quantity. But we never
tell so to the compiler, resulting in the following:

 4ac:   b26187e0        mov     x0, #0xffffffff80000001

We thus rely on the firmware narrowing it for us, which is not
always a reasonable expectation.

Cc: stable@vger.kernel.org
Reported-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Acked-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Robin Murphy <robin.murphy@arm.com>
Tested-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
include/linux/arm-smccc.h

index e1ef944ef1da9b5de7b48b2cabf2bd962719af23..dd44d8458c04e4e898e7c9f316d172ade69e0e11 100644 (file)
 #ifndef __LINUX_ARM_SMCCC_H
 #define __LINUX_ARM_SMCCC_H
 
+#include <uapi/linux/const.h>
+
 /*
  * This file provides common defines for ARM SMC Calling Convention as
  * specified in
  * http://infocenter.arm.com/help/topic/com.arm.doc.den0028a/index.html
  */
 
-#define ARM_SMCCC_STD_CALL             0
-#define ARM_SMCCC_FAST_CALL            1
+#define ARM_SMCCC_STD_CALL             _AC(0,U)
+#define ARM_SMCCC_FAST_CALL            _AC(1,U)
 #define ARM_SMCCC_TYPE_SHIFT           31
 
 #define ARM_SMCCC_SMC_32               0