Message ID | 20220421180443.1465634-3-pbonzini@redhat.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | KVM: fix KVM_EXIT_SYSTEM_EVENT mess | expand |
diff --git a/arch/arm64/kvm/psci.c b/arch/arm64/kvm/psci.c index baac2b405f23..708d80e8e60d 100644 --- a/arch/arm64/kvm/psci.c +++ b/arch/arm64/kvm/psci.c @@ -181,7 +181,8 @@ static void kvm_prepare_system_event(struct kvm_vcpu *vcpu, u32 type, u64 flags) memset(&vcpu->run->system_event, 0, sizeof(vcpu->run->system_event)); vcpu->run->system_event.type = type; - vcpu->run->system_event.flags = flags; + vcpu->run->system_event.ndata = 1; + vcpu->run->system_event.data[0] = flags; vcpu->run->exit_reason = KVM_EXIT_SYSTEM_EVENT; }
The flags datum for KVM_EXIT_SYSTEM_EVENT exits has been removed because it was defined incorrectly; no padding was introduced between the 32-bit type and the 64-bit flags, resulting in different definitions for 32-bit and 64-bit userspace. The replacement is a pair of fields, ndata and data[], with ndata saying how many items are valid in the data array. In the case of ARM that's one, as flags can be simply moved to data[0]. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> --- arch/arm64/kvm/psci.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)