diff options
Diffstat (limited to 'arch/arm/kvm/handle_exit.c')
-rw-r--r-- | arch/arm/kvm/handle_exit.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/arch/arm/kvm/handle_exit.c b/arch/arm/kvm/handle_exit.c index f36b5b1acd1f..05b2f8294968 100644 --- a/arch/arm/kvm/handle_exit.c +++ b/arch/arm/kvm/handle_exit.c | |||
@@ -45,7 +45,7 @@ static int handle_hvc(struct kvm_vcpu *vcpu, struct kvm_run *run) | |||
45 | 45 | ||
46 | ret = kvm_psci_call(vcpu); | 46 | ret = kvm_psci_call(vcpu); |
47 | if (ret < 0) { | 47 | if (ret < 0) { |
48 | kvm_inject_undefined(vcpu); | 48 | vcpu_set_reg(vcpu, 0, ~0UL); |
49 | return 1; | 49 | return 1; |
50 | } | 50 | } |
51 | 51 | ||
@@ -54,7 +54,16 @@ static int handle_hvc(struct kvm_vcpu *vcpu, struct kvm_run *run) | |||
54 | 54 | ||
55 | static int handle_smc(struct kvm_vcpu *vcpu, struct kvm_run *run) | 55 | static int handle_smc(struct kvm_vcpu *vcpu, struct kvm_run *run) |
56 | { | 56 | { |
57 | kvm_inject_undefined(vcpu); | 57 | /* |
58 | * "If an SMC instruction executed at Non-secure EL1 is | ||
59 | * trapped to EL2 because HCR_EL2.TSC is 1, the exception is a | ||
60 | * Trap exception, not a Secure Monitor Call exception [...]" | ||
61 | * | ||
62 | * We need to advance the PC after the trap, as it would | ||
63 | * otherwise return to the same address... | ||
64 | */ | ||
65 | vcpu_set_reg(vcpu, 0, ~0UL); | ||
66 | kvm_skip_instr(vcpu, kvm_vcpu_trap_il_is32bit(vcpu)); | ||
58 | return 1; | 67 | return 1; |
59 | } | 68 | } |
60 | 69 | ||