arm64: hyp-stub: Define a return value for failed stub calls
authorMarc Zyngier <marc.zyngier@arm.com>
Mon, 3 Apr 2017 18:37:37 +0000 (19:37 +0100)
committerChristoffer Dall <cdall@linaro.org>
Sun, 9 Apr 2017 14:49:19 +0000 (07:49 -0700)
Define a standard return value to be returned when a hyp stub
call fails, and make KVM use it for ARM_EXCEPTION_HYP_GONE
(instead of using a KVM-specific value).

Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: Christoffer Dall <cdall@linaro.org>
arch/arm64/include/asm/kvm_asm.h
arch/arm64/include/asm/virt.h
arch/arm64/kernel/hyp-stub.S

index 49f99cd02613cf59b6aee87a178f1ea4649d0479..b7e4ef5fcc410f239cbf4081330e092b95d315f5 100644 (file)
@@ -28,7 +28,7 @@
 #define ARM_EXCEPTION_EL1_SERROR  1
 #define ARM_EXCEPTION_TRAP       2
 /* The hyp-stub will return this for any kvm_call_hyp() call */
-#define ARM_EXCEPTION_HYP_GONE   3
+#define ARM_EXCEPTION_HYP_GONE   HVC_STUB_ERR
 
 #define KVM_ARM64_DEBUG_DIRTY_SHIFT    0
 #define KVM_ARM64_DEBUG_DIRTY          (1 << KVM_ARM64_DEBUG_DIRTY_SHIFT)
index 439f6b5d31f67576e57e67cdf1e8284bf57c08a7..1466d14c664d9fbf95d95be1f01bdca856de694d 100644 (file)
@@ -39,6 +39,9 @@
  */
 #define HVC_SOFT_RESTART 2
 
+/* Error returned when an invalid stub number is passed into x0 */
+#define HVC_STUB_ERR   0xbadca11
+
 #define BOOT_CPU_MODE_EL1      (0xe11)
 #define BOOT_CPU_MODE_EL2      (0xe12)
 
index 193dfb25ce2f8b41c4fe4ef2302ea2cab6b22057..f53e8b84cd3a6255ca3c6d869595a584c307f2a2 100644 (file)
@@ -74,7 +74,7 @@ el1_sync:
        br      x4                              // no return
 
        /* Someone called kvm_call_hyp() against the hyp-stub... */
-3:     mov     x0, #ARM_EXCEPTION_HYP_GONE
+3:     ldr     x0, =HVC_STUB_ERR
 
 9:     eret
 ENDPROC(el1_sync)