ARM: KVM: Convert KVM to use HVC_GET_VECTORS
authorMarc Zyngier <marc.zyngier@arm.com>
Mon, 3 Apr 2017 18:37:47 +0000 (19:37 +0100)
committerChristoffer Dall <cdall@linaro.org>
Sun, 9 Apr 2017 14:49:24 +0000 (07:49 -0700)
The conversion of the HYP stub ABI to something similar to arm64
left the KVM code broken, as it doesn't know about the new
stub numbering. Let's move the various #defines to virt.h, and
let KVM use HVC_GET_VECTORS.

Tested-by: Keerthy <j-keerthy@ti.com>
Acked-by: Russell King <rmk+kernel@armlinux.org.uk>
Acked-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: Christoffer Dall <cdall@linaro.org>
arch/arm/include/asm/virt.h
arch/arm/kernel/hyp-stub.S
arch/arm/kvm/hyp/hyp-entry.S

index 6dae1956c74d761beb8f1cb5f12dc1a8e912c4b5..4ea16fcaf2edc149f4910325a1c2a7b522c1d36b 100644 (file)
@@ -94,6 +94,14 @@ extern char __hyp_text_start[];
 extern char __hyp_text_end[];
 #endif
 
+#else
+
+/* Only assembly code should need those */
+
+#define HVC_GET_VECTORS 0
+#define HVC_SET_VECTORS 1
+#define HVC_SOFT_RESTART 2
+
 #endif /* __ASSEMBLY__ */
 
 #endif /* ! VIRT_H */
index 82915231c6f850b6f1c04de9b3f39f9b6d28f50a..8301db963d8336fe3337bbaa1058f5fc6ead52fc 100644 (file)
 #include <asm/assembler.h>
 #include <asm/virt.h>
 
-#define HVC_GET_VECTORS 0
-#define HVC_SET_VECTORS 1
-#define HVC_SOFT_RESTART 2
-
 #ifndef ZIMAGE
 /*
  * For the kernel proper, we need to find out the CPU boot mode long after
index 96beb53934c9769d13f7c58f5e574a065638c42c..1f8db7d21fc55be8621c70708d9ba72a49373953 100644 (file)
@@ -127,7 +127,7 @@ hyp_hvc:
        pop     {r0, r1, r2}
 
        /* Check for __hyp_get_vectors */
-       cmp     r0, #-1
+       cmp     r0, #HVC_GET_VECTORS
        mrceq   p15, 4, r0, c12, c0, 0  @ get HVBAR
        beq     1f