public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/4] KVM: fix KVM_EXIT_SYSTEM_EVENT mess
@ 2022-04-21 18:04 Paolo Bonzini
  2022-04-21 18:04 ` [PATCH 1/4] KVM: x86: always initialize system_event.ndata Paolo Bonzini
                   ` (4 more replies)
  0 siblings, 5 replies; 11+ messages in thread
From: Paolo Bonzini @ 2022-04-21 18:04 UTC (permalink / raw)
  To: linux-kernel, kvm; +Cc: will, maz, apatel, atishp, seanjc, pgonda

The KVM_SYSTEM_EVENT_NDATA_VALID mechanism that was introduced
contextually with KVM_SYSTEM_EVENT_SEV_TERM is not a good match
for ARM and RISC-V, which want to communicate information even
for existing KVM_SYSTEM_EVENT_* constants.  Userspace is not ready
to filter out bit 31 of type, and fails to process the
KVM_EXIT_SYSTEM_EVENT exit.

Therefore, tie the availability of ndata to a system capability;
if the capability is present, ndata is always valid, so patch 1
makes x86 always initialize it.  Then patches 2 and 3 fix
ARM and RISC-V compilation and patch 4 enables the capability.

Only compiled on x86, waiting for acks.

Paolo

Paolo Bonzini (4):
  KVM: x86: always initialize system_event.ndata
  KVM: ARM: replace system_event.flags with ndata and data[0]
  KVM: RISC-V: replace system_event.flags with ndata and data[0]
  KVM: tell userspace that system_event.ndata is valid

 Documentation/virt/kvm/api.rst        | 29 +++++++++++++++------------
 arch/arm64/kvm/psci.c                 |  3 ++-
 arch/riscv/include/asm/kvm_vcpu_sbi.h |  2 +-
 arch/riscv/kvm/vcpu_sbi.c             |  5 +++--
 arch/riscv/kvm/vcpu_sbi_replace.c     |  4 ++--
 arch/riscv/kvm/vcpu_sbi_v01.c         |  2 +-
 arch/x86/kvm/svm/sev.c                |  3 +--
 arch/x86/kvm/x86.c                    |  2 ++
 include/uapi/linux/kvm.h              |  2 +-
 virt/kvm/kvm_main.c                   |  1 +
 10 files changed, 30 insertions(+), 23 deletions(-)

-- 
2.31.1


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2022-04-22 10:20 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 ` [PATCH 2/4] KVM: ARM: replace system_event.flags with ndata and data[0] Paolo Bonzini
2022-04-21 18:04 ` [PATCH 3/4] KVM: RISC-V: " 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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox