aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Marc Zyngier <maz@kernel.org> 2022-03-09 18:19:10 +0000
committerGravatar Marc Zyngier <maz@kernel.org> 2022-03-09 18:19:10 +0000
commit9872e6bc08d6ef6de79717ff6bbff0f297c134ef (patch)
tree4b968b750e00d247a9d2cc2301533e29acd27104
parentMerge branch kvm-arm64/misc-5.18 into kvmarm-master/next (diff)
parentKVM: arm64: Really propagate PSCI SYSTEM_RESET2 arguments to userspace (diff)
downloadlinux-9872e6bc08d6ef6de79717ff6bbff0f297c134ef.tar.gz
linux-9872e6bc08d6ef6de79717ff6bbff0f297c134ef.tar.bz2
linux-9872e6bc08d6ef6de79717ff6bbff0f297c134ef.zip
Merge branch kvm-arm64/psci-1.1 into kvmarm-master/next
* kvm-arm64/psci-1.1: : . : Limited PSCI-1.1 support from Will Deacon: : : This small series exposes the PSCI SYSTEM_RESET2 call to guests, which : allows the propagation of a "reset_type" and a "cookie" back to the VMM. : Although Linux guests only ever pass 0 for the type ("SYSTEM_WARM_RESET"), : the vendor-defined range can be used by a bootloader to provide additional : information about the reset, such as an error code. : . KVM: arm64: Really propagate PSCI SYSTEM_RESET2 arguments to userspace Signed-off-by: Marc Zyngier <maz@kernel.org>
-rw-r--r--arch/arm64/kvm/psci.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/arch/arm64/kvm/psci.c b/arch/arm64/kvm/psci.c
index 505e148ed1b9..a433c3eac9b7 100644
--- a/arch/arm64/kvm/psci.c
+++ b/arch/arm64/kvm/psci.c
@@ -367,14 +367,14 @@ static int kvm_psci_1_x_call(struct kvm_vcpu *vcpu, u32 minor)
if (minor >= 1) {
arg = smccc_get_arg1(vcpu);
- if (arg > PSCI_1_1_RESET_TYPE_SYSTEM_WARM_RESET &&
- arg < PSCI_1_1_RESET_TYPE_VENDOR_START) {
- val = PSCI_RET_INVALID_PARAMS;
- } else {
+ if (arg <= PSCI_1_1_RESET_TYPE_SYSTEM_WARM_RESET ||
+ arg >= PSCI_1_1_RESET_TYPE_VENDOR_START) {
kvm_psci_system_reset2(vcpu);
- val = PSCI_RET_INTERNAL_FAILURE;
- ret = 0;
+ vcpu_set_reg(vcpu, 0, PSCI_RET_INTERNAL_FAILURE);
+ return 0;
}
+
+ val = PSCI_RET_INVALID_PARAMS;
break;
}
fallthrough;