public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Sean Christopherson <seanjc@google.com>
To: Jason Chen CJ <jason.cj.chen@intel.com>
Cc: kvm@vger.kernel.org
Subject: Re: [RFC PATCH part-5 00/22] VMX emulation
Date: Mon, 13 Mar 2023 09:58:27 -0700	[thread overview]
Message-ID: <ZA9WM3xA6Qu5Q43K@google.com> (raw)
In-Reply-To: <20230312180303.1778492-1-jason.cj.chen@intel.com>

On Mon, Mar 13, 2023, Jason Chen CJ wrote:
> This patch set is part-5 of this RFC patches. It introduces VMX
> emulation for pKVM on Intel platform.
> 
> Host VM wants the capability to run its guest, it needs VMX support.

No, the host VM only needs a way to request pKVM to run a VM.  If we go down the
rabbit hole of pKVM on x86, I think we should take the red pill[*] and go all the
way down said rabbit hole by heavily paravirtualizing the KVM=>pKVM interface.

Except for VMCALL vs. VMMCALL, it should be possible to eliminate all traces of
VMX and SVM from the interface.  That means no VMCS emulation, no EPT shadowing,
etc.  As a bonus, any paravirt stuff we do for pKVM x86 would also be usable for
KVM-on-KVM nested virtualization.

E.g. an idea floating around my head is to add a paravirt paging interface for
KVM-on-KVM so that L1's (KVM-high in this RFC) doesn't need to maintain its own
TDP page tables.  I haven't pursued that idea in any real capacity since most
nested virtualization use cases for KVM involve running an older L1 kernel and/or
a non-KVM L1 hypervisor, i.e. there's no concrete use case to justify the development
and maintenance cost.  But if the PV code is "needed" by pKVM anyways...

[*] You take the blue pill, the story ends, you wake up in your bed and believe
    whatever you want to believe. You take the red pill, you stay in wonderland,
    and I show you how deep the rabbit hole goes.

    -Morpheus

  parent reply	other threads:[~2023-03-13 16:59 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-12 18:02 [RFC PATCH part-5 00/22] VMX emulation Jason Chen CJ
2023-03-12 18:02 ` [RFC PATCH part-5 01/22] pkvm: x86: Add memcpy lib Jason Chen CJ
2023-03-12 18:02 ` [RFC PATCH part-5 02/22] pkvm: x86: Add memory operation APIs for for host VM Jason Chen CJ
2023-03-12 18:02 ` [RFC PATCH part-5 03/22] pkvm: x86: Do guest address translation per page granularity Jason Chen CJ
2023-03-12 18:02 ` [RFC PATCH part-5 04/22] pkvm: x86: Add check for guest address translation Jason Chen CJ
2023-03-12 18:02 ` [RFC PATCH part-5 05/22] pkvm: x86: Add hypercalls for shadow_vm/vcpu init & teardown Jason Chen CJ
2023-03-12 18:02 ` [RFC PATCH part-5 06/22] KVM: VMX: Add new kvm_x86_ops vm_free Jason Chen CJ
2023-03-12 18:02 ` [RFC PATCH part-5 07/22] KVM: VMX: Add initialization/teardown for shadow vm/vcpu Jason Chen CJ
2023-03-12 18:02 ` [RFC PATCH part-5 08/22] pkvm: x86: Add hash table mapping for shadow vcpu based on vmcs12_pa Jason Chen CJ
2023-03-12 18:02 ` [RFC PATCH part-5 09/22] pkvm: x86: Add VMXON/VMXOFF emulation Jason Chen CJ
2023-03-12 18:02 ` [RFC PATCH part-5 10/22] pkvm: x86: Add has_vmcs_field() API for physical vmx capability check Jason Chen CJ
2023-03-12 18:02 ` [RFC PATCH part-5 11/22] KVM: VMX: Add more vmcs and vmcs12 fields definition Jason Chen CJ
2023-03-12 18:02 ` [RFC PATCH part-5 12/22] pkvm: x86: Init vmcs read/write bitmap for vmcs emulation Jason Chen CJ
2023-03-12 18:02 ` [RFC PATCH part-5 13/22] pkvm: x86: Initialize emulated fields " Jason Chen CJ
2023-03-12 18:02 ` [RFC PATCH part-5 14/22] pkvm: x86: Add msr ops for pKVM hypervisor Jason Chen CJ
2023-03-12 18:02 ` [RFC PATCH part-5 15/22] pkvm: x86: Move _init_host_state_area to " Jason Chen CJ
2023-03-12 18:02 ` [RFC PATCH part-5 16/22] pkvm: x86: Add vmcs_load/clear_track APIs Jason Chen CJ
2023-03-12 18:02 ` [RFC PATCH part-5 17/22] pkvm: x86: Add VMPTRLD/VMCLEAR emulation Jason Chen CJ
2023-03-12 18:02 ` [RFC PATCH part-5 18/22] pkvm: x86: Add VMREAD/VMWRITE emulation Jason Chen CJ
2023-03-12 18:03 ` [RFC PATCH part-5 19/22] pkvm: x86: Add VMLAUNCH/VMRESUME emulation Jason Chen CJ
2023-03-12 18:03 ` [RFC PATCH part-5 20/22] pkvm: x86: Add INVEPT/INVVPID emulation Jason Chen CJ
2023-03-12 18:03 ` [RFC PATCH part-5 21/22] pkvm: x86: Initialize msr_bitmap for vmsr Jason Chen CJ
2023-03-12 18:03 ` [RFC PATCH part-5 22/22] pkvm: x86: Add vmx msr emulation Jason Chen CJ
2023-03-13 16:58 ` Sean Christopherson [this message]
2023-03-14 16:29   ` [RFC PATCH part-5 00/22] VMX emulation Jason Chen CJ
2023-06-08 21:38     ` Dmytro Maluka
2023-06-09  2:07       ` Chen, Jason CJ
2023-06-09  8:34         ` Dmytro Maluka
2023-06-13 19:50           ` Sean Christopherson
2023-06-15 18:07             ` Dmytro Maluka
2023-06-20 15:46             ` Jason Chen CJ
2023-09-05  9:47             ` Jason Chen CJ
2023-06-15  3:59           ` Chen, Jason CJ
2023-06-15 21:13       ` Nadav Amit

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=ZA9WM3xA6Qu5Q43K@google.com \
    --to=seanjc@google.com \
    --cc=jason.cj.chen@intel.com \
    --cc=kvm@vger.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