mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: linux-kernel@vger.kernel.org, kvm@vger.kernel.org
Cc: roy.hopkins@suse.com, seanjc@google.com, michael.roth@amd.com,
	ashish.kalra@amd.com, jroedel@suse.de, thomas.lendacky@amd.com,
	nsaenz@amazon.com, anelkz@amazon.de, oliver.upton@linux.dev,
	isaku.yamahata@intel.com, maz@kernel.org, steven.price@arm.com,
	kai.huang@intel.com, rick.p.edgecombe@intel.com,
	James.Bottomley@HansenPartnership.com
Subject: [RFC PATCH 0/5] Documentation: kvm: cleanup and introduce "VM planes"
Date: Wed, 23 Oct 2024 14:45:02 +0200	[thread overview]
Message-ID: <20241023124507.280382-1-pbonzini@redhat.com> (raw)

As discussed at KVM Forum, this series introduces documentation for the
"VM planes" concept that can be used to implement at least AMD VMPLs
and Microsoft VTLs.

I didn't include Intel TDX and Arm CCA, because people expressed doubts
on whether KVM could deal with {firm,hard}ware that magically enters the
vCPU in one privilege level and leave at another.  This however may not
be a blocker, especially considering that we decided to have only one
mutex for all planes.

Compared to the notes from the KVM Forum BoF, the main change is in the
kvm_run fields.  The design at the BoF had fields masked_planes and
runnable_planes, and a userspace exit would happen if the value of
runnable_planes & ~masked_planes became nonzero.

Here instead I have:

- req_exit_planes which is similar to ~masked_planes.  The difference comes
  from the Hyper-V VINA feature ("Virtual Interrupt Notification Assist"),
  which requires userspace to know about _all_ interrupts, even those for
  lower VTLs

- suspended_planes, which is not used yet but needs to be there for future
  in-kernel accelerations, because interrupts can "skip" VTLs/VMPLs and need
  to return to the last suspended level.

  I am not sure that this needs to be in kvm_run though.  It definitely has
  to be migrated once KVM supports in-kernel switch, but I am not sure that
  userspace needs it "enough" to put it in kvm_run.  It could be accessed
  with KVM_GET_ONE_REG/KVM_SET_ONE_REG or similar, perhaps.

- pending_event_planes (same as runnable_planes) is in the KVM_EXIT_PLANE_EVENT
  data, kvm_run->exit.plane.  It seems that it is not used in any other case
  by userspace (KVM probably needs to keep it up to date at all time; but
  it cannot trust anyway what is in kvm_run and needs to have its own copy).


Another difference is in whether FPU is shared.  We had it as shared,
but for SEV-ES the contents of the x87 and AVX registers are stored in
the VMSA and therefore each VMPL has its own copy.  The solution I have
(KVM_CAP_PLANE_FPU) is a bit of a cop out though.

In order to add the relevant text, there are a few cleanups that can be applied
separately.


Paolo Bonzini (5):
  KVM: powerpc: remove remaining traces of KVM_CAP_PPC_RMA
  Documentation: kvm: fix a few mistakes
  Documentation: kvm: replace section numbers with links
  Documentation: kvm: reorganize introduction
  Documentation: kvm: introduce "VM plane" concept

 Documentation/virt/kvm/api.rst           | 357 ++++++++++++++++-------
 Documentation/virt/kvm/vcpu-requests.rst |   7 +
 arch/powerpc/kvm/powerpc.c               |   3 -
 3 files changed, 266 insertions(+), 101 deletions(-)

-- 
2.46.2


             reply	other threads:[~2024-10-23 12:45 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-23 12:45 Paolo Bonzini [this message]
2024-10-23 12:45 ` [RFC PATCH 1/5] KVM: powerpc: remove remaining traces of KVM_CAP_PPC_RMA Paolo Bonzini
2024-10-23 12:45 ` [RFC PATCH 2/5] Documentation: kvm: fix a few mistakes Paolo Bonzini
2024-10-23 12:45 ` [RFC PATCH 3/5] Documentation: kvm: replace section numbers with links Paolo Bonzini
2024-10-23 12:45 ` [RFC PATCH 4/5] Documentation: kvm: reorganize introduction Paolo Bonzini
2024-10-23 12:45 ` [PATCH 5/5] Documentation: kvm: introduce "VM plane" concept Paolo Bonzini
2025-01-17 21:48   ` Sean Christopherson
2025-01-21 10:50     ` Nicolas Saenz Julienne
2025-01-21 17:20       ` Sean Christopherson
2025-01-21 18:34         ` Nicolas Saenz Julienne
2024-11-08  9:07 ` [RFC PATCH 0/5] Documentation: kvm: cleanup and introduce "VM planes" 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=20241023124507.280382-1-pbonzini@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=James.Bottomley@HansenPartnership.com \
    --cc=anelkz@amazon.de \
    --cc=ashish.kalra@amd.com \
    --cc=isaku.yamahata@intel.com \
    --cc=jroedel@suse.de \
    --cc=kai.huang@intel.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maz@kernel.org \
    --cc=michael.roth@amd.com \
    --cc=nsaenz@amazon.com \
    --cc=oliver.upton@linux.dev \
    --cc=rick.p.edgecombe@intel.com \
    --cc=roy.hopkins@suse.com \
    --cc=seanjc@google.com \
    --cc=steven.price@arm.com \
    --cc=thomas.lendacky@amd.com \
    /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®