From: David Matlack <dmatlack@google.com>
To: Isaku Yamahata <isaku.yamahata@gmail.com>
Cc: "Huang, Kai" <kai.huang@intel.com>,
"kvm@vger.kernel.org" <kvm@vger.kernel.org>,
"pbonzini@redhat.com" <pbonzini@redhat.com>,
"peterx@redhat.com" <peterx@redhat.com>, "Christopherson,,
Sean" <seanjc@google.com>
Subject: Re: [PATCH v3 01/10] KVM: x86/mmu: Change tdp_mmu to a read-only parameter
Date: Mon, 3 Oct 2022 13:02:42 -0700 [thread overview]
Message-ID: <Yzs/4rqWFroUNyFU@google.com> (raw)
In-Reply-To: <20221003185834.GA2414580@ls.amr.corp.intel.com>
On Mon, Oct 03, 2022 at 11:58:34AM -0700, Isaku Yamahata wrote:
> On Tue, Sep 27, 2022 at 09:10:43PM +0000, "Huang, Kai" <kai.huang@intel.com> wrote:
> > On Tue, 2022-09-27 at 09:14 -0700, David Matlack wrote:
> > > On Tue, Sep 27, 2022 at 2:19 AM Huang, Kai <kai.huang@intel.com> wrote:
> > > >
> > > > Sorry last time I didn't review deeply, but I am wondering why do we need
> > > > 'tdp_mmu_allowed' at all? The purpose of having 'allow_mmio_caching' is because
> > > > kvm_mmu_set_mmio_spte_mask() is called twice, and 'enable_mmio_caching' can be
> > > > disabled in the first call, so it can be against user's desire in the second
> > > > call. However it appears for 'tdp_mmu_enabled' we don't need 'tdp_mmu_allowed',
> > > > as kvm_configure_mmu() is only called once by VMX or SVM, if I read correctly.
> > >
> > > tdp_mmu_allowed is needed because kvm_intel and kvm_amd are separate
> > > modules from kvm. So kvm_configure_mmu() can be called multiple times
> > > (each time kvm_intel or kvm_amd is loaded).
> > >
> > >
> >
> > Indeed. :)
> >
> > Reviewed-by: Kai Huang <kai.huang@intel.com>
>
> kvm_arch_init() which is called early during the module initialization before
> kvm_configure_mmu() via kvm_arch_hardware_setup() checks if the vendor module
> (kvm_intel or kvm_amd) was already loaded. If yes, it results in -EEXIST.
>
> So kvm_configure_mmu() won't be called twice.
kvm_configure_mmu() can be called multiple times if the vendor module is
unloaded without unloading the kvm module. For example:
$ modprobe kvm
$ modprobe kvm_intel ept=Y # kvm_configure_mmu(true, ...)
$ modprobe -r kvm_intel
$ modprobe kvm_intel ept=N # kvm_configure_mmu(false, ...)
next prev parent reply other threads:[~2022-10-03 20:02 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-21 17:35 [PATCH v3 00/10] KVM: x86/mmu: Make tdp_mmu read-only and clean up TPD MMU fault handler David Matlack
2022-09-21 17:35 ` [PATCH v3 01/10] KVM: x86/mmu: Change tdp_mmu to a read-only parameter David Matlack
2022-09-27 9:19 ` Huang, Kai
2022-09-27 16:14 ` David Matlack
2022-09-27 21:10 ` Huang, Kai
2022-09-29 1:56 ` Huang, Kai
2022-10-03 18:58 ` Isaku Yamahata
2022-10-03 20:02 ` David Matlack [this message]
2022-10-03 21:56 ` Isaku Yamahata
2022-10-03 20:11 ` Huang, Kai
2022-10-11 20:12 ` Sean Christopherson
2022-09-21 17:35 ` [PATCH v3 02/10] KVM: x86/mmu: Move TDP MMU VM init/uninit behind tdp_mmu_enabled David Matlack
2022-10-03 19:01 ` Isaku Yamahata
2022-09-21 17:35 ` [PATCH v3 03/10] KVM: x86/mmu: Grab mmu_invalidate_seq in kvm_faultin_pfn() David Matlack
2022-10-03 19:05 ` Isaku Yamahata
2022-09-21 17:35 ` [PATCH v3 04/10] KVM: x86/mmu: Handle error PFNs " David Matlack
2022-09-21 17:35 ` [PATCH v3 05/10] KVM: x86/mmu: Avoid memslot lookup during KVM_PFN_ERR_HWPOISON handling David Matlack
2022-10-03 19:23 ` Isaku Yamahata
2022-09-21 17:35 ` [PATCH v3 06/10] KVM: x86/mmu: Handle no-slot faults in kvm_faultin_pfn() David Matlack
2022-09-21 17:35 ` [PATCH v3 07/10] KVM: x86/mmu: Initialize fault.{gfn,slot} earlier for direct MMUs David Matlack
2022-10-03 19:27 ` Isaku Yamahata
2022-09-21 17:35 ` [PATCH v3 08/10] KVM: x86/mmu: Split out TDP MMU page fault handling David Matlack
2022-10-03 19:28 ` Isaku Yamahata
2022-10-11 21:56 ` Sean Christopherson
2022-09-21 17:35 ` [PATCH v3 09/10] KVM: x86/mmu: Stop needlessly making MMU pages available for TDP MMU faults David Matlack
2022-10-03 19:28 ` Isaku Yamahata
2022-09-21 17:35 ` [PATCH v3 10/10] KVM: x86/mmu: Rename __direct_map() to direct_map() David Matlack
2022-10-03 19:29 ` Isaku Yamahata
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=Yzs/4rqWFroUNyFU@google.com \
--to=dmatlack@google.com \
--cc=isaku.yamahata@gmail.com \
--cc=kai.huang@intel.com \
--cc=kvm@vger.kernel.org \
--cc=pbonzini@redhat.com \
--cc=peterx@redhat.com \
--cc=seanjc@google.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.