diff options
Diffstat (limited to 'arch/arm/kvm')
-rw-r--r-- | arch/arm/kvm/arm.c | 3 | ||||
-rw-r--r-- | arch/arm/kvm/interrupts.S | 11 |
2 files changed, 12 insertions, 2 deletions
diff --git a/arch/arm/kvm/arm.c b/arch/arm/kvm/arm.c index 1d8248ea5669..bd18bb8b2770 100644 --- a/arch/arm/kvm/arm.c +++ b/arch/arm/kvm/arm.c | |||
@@ -878,7 +878,8 @@ static int hyp_init_cpu_pm_notifier(struct notifier_block *self, | |||
878 | unsigned long cmd, | 878 | unsigned long cmd, |
879 | void *v) | 879 | void *v) |
880 | { | 880 | { |
881 | if (cmd == CPU_PM_EXIT) { | 881 | if (cmd == CPU_PM_EXIT && |
882 | __hyp_get_vectors() == hyp_default_vectors) { | ||
882 | cpu_init_hyp_mode(NULL); | 883 | cpu_init_hyp_mode(NULL); |
883 | return NOTIFY_OK; | 884 | return NOTIFY_OK; |
884 | } | 885 | } |
diff --git a/arch/arm/kvm/interrupts.S b/arch/arm/kvm/interrupts.S index ddc15539bad2..0d68d4073068 100644 --- a/arch/arm/kvm/interrupts.S +++ b/arch/arm/kvm/interrupts.S | |||
@@ -220,6 +220,10 @@ after_vfp_restore: | |||
220 | * in Hyp mode (see init_hyp_mode in arch/arm/kvm/arm.c). Return values are | 220 | * in Hyp mode (see init_hyp_mode in arch/arm/kvm/arm.c). Return values are |
221 | * passed in r0 and r1. | 221 | * passed in r0 and r1. |
222 | * | 222 | * |
223 | * A function pointer with a value of 0xffffffff has a special meaning, | ||
224 | * and is used to implement __hyp_get_vectors in the same way as in | ||
225 | * arch/arm/kernel/hyp_stub.S. | ||
226 | * | ||
223 | * The calling convention follows the standard AAPCS: | 227 | * The calling convention follows the standard AAPCS: |
224 | * r0 - r3: caller save | 228 | * r0 - r3: caller save |
225 | * r12: caller save | 229 | * r12: caller save |
@@ -363,6 +367,11 @@ hyp_hvc: | |||
363 | host_switch_to_hyp: | 367 | host_switch_to_hyp: |
364 | pop {r0, r1, r2} | 368 | pop {r0, r1, r2} |
365 | 369 | ||
370 | /* Check for __hyp_get_vectors */ | ||
371 | cmp r0, #-1 | ||
372 | mrceq p15, 4, r0, c12, c0, 0 @ get HVBAR | ||
373 | beq 1f | ||
374 | |||
366 | push {lr} | 375 | push {lr} |
367 | mrs lr, SPSR | 376 | mrs lr, SPSR |
368 | push {lr} | 377 | push {lr} |
@@ -378,7 +387,7 @@ THUMB( orr lr, #1) | |||
378 | pop {lr} | 387 | pop {lr} |
379 | msr SPSR_csxf, lr | 388 | msr SPSR_csxf, lr |
380 | pop {lr} | 389 | pop {lr} |
381 | eret | 390 | 1: eret |
382 | 391 | ||
383 | guest_trap: | 392 | guest_trap: |
384 | load_vcpu @ Load VCPU pointer to r0 | 393 | load_vcpu @ Load VCPU pointer to r0 |