From: Paolo Bonzini <pbonzini@redhat.com>
To: linux-kernel@vger.kernel.org, kvm@vger.kernel.org
Cc: will@kernel.org, maz@kernel.org, apatel@ventanamicro.com,
atishp@rivosinc.com, seanjc@google.com, pgonda@google.com
Subject: [PATCH 2/4] KVM: ARM: replace system_event.flags with ndata and data[0]
Date: Thu, 21 Apr 2022 14:04:41 -0400 [thread overview]
Message-ID: <20220421180443.1465634-3-pbonzini@redhat.com> (raw)
In-Reply-To: <20220421180443.1465634-1-pbonzini@redhat.com>
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(-)
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;
}
--
2.31.1
next prev parent reply other threads:[~2022-04-21 18:05 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-21 18:04 [PATCH 0/4] KVM: fix KVM_EXIT_SYSTEM_EVENT mess Paolo Bonzini
2022-04-21 18:04 ` [PATCH 1/4] KVM: x86: always initialize system_event.ndata Paolo Bonzini
2022-04-22 9:48 ` Marc Zyngier
2022-04-22 10:11 ` Paolo Bonzini
2022-04-21 18:04 ` Paolo Bonzini [this message]
2022-04-21 18:04 ` [PATCH 3/4] KVM: RISC-V: replace system_event.flags with ndata and data[0] Paolo Bonzini
2022-04-21 18:04 ` [PATCH 4/4] KVM: tell userspace that system_event.ndata is valid Paolo Bonzini
2022-04-22 7:58 ` [PATCH 0/4] KVM: fix KVM_EXIT_SYSTEM_EVENT mess Oliver Upton
2022-04-22 9:41 ` Paolo Bonzini
2022-04-22 10:01 ` Marc Zyngier
2022-04-22 10:19 ` Paolo Bonzini
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220421180443.1465634-3-pbonzini@redhat.com \
--to=pbonzini@redhat.com \
--cc=apatel@ventanamicro.com \
--cc=atishp@rivosinc.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=maz@kernel.org \
--cc=pgonda@google.com \
--cc=seanjc@google.com \
--cc=will@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®