[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <116179545fafbf39ed01e1f0f5ac76e0467fc09a.camel@intel.com>
Date: Mon, 15 Apr 2024 19:12:07 +0000
From: "Edgecombe, Rick P" <rick.p.edgecombe@...el.com>
To: "kvm@...r.kernel.org" <kvm@...r.kernel.org>, "Yamahata, Isaku"
<isaku.yamahata@...el.com>
CC: "seanjc@...gle.com" <seanjc@...gle.com>, "Huang, Kai"
<kai.huang@...el.com>, "federico.parola@...ito.it"
<federico.parola@...ito.it>, "linux-kernel@...r.kernel.org"
<linux-kernel@...r.kernel.org>, "isaku.yamahata@...il.com"
<isaku.yamahata@...il.com>, "dmatlack@...gle.com" <dmatlack@...gle.com>,
"michael.roth@....com" <michael.roth@....com>, "pbonzini@...hat.com"
<pbonzini@...hat.com>
Subject: Re: [PATCH v2 07/10] KVM: x86: Always populate L1 GPA for
KVM_MAP_MEMORY
I wouldn't call myself much of an expert on nested, but...
On Wed, 2024-04-10 at 15:07 -0700, isaku.yamahata@...el.com wrote:
> There are several options to populate L1 GPA irrelevant to vCPU mode.
> - Switch vCPU MMU only: This patch.
> Pros: Concise implementation.
> Cons: Heavily dependent on the KVM MMU implementation.
Is switching just the MMU enough here? Won't the MTRRs and other vcpu bits be
wrong?
> - Use kvm_x86_nested_ops.get/set_state() to switch to/from guest mode.
> Use __get/set_sregs2() to switch to/from SMM mode.
> Pros: straightforward.
> Cons: This may cause unintended side effects.
Cons make sense.
> - Refactor KVM page fault handler not to pass vCPU. Pass around necessary
> parameters and struct kvm.
> Pros: The end result will have clearly no side effects.
> Cons: This will require big refactoring.
But doesn't the fault handler need the vCPU state?
> - Return error on guest mode or SMM mode: Without this patch.
> Pros: No additional patch.
> Cons: Difficult to use.
Hmm... For the non-TDX use cases this is just an optimization, right? For TDX
there shouldn't be an issue. If so, maybe this last one is not so horrible.
Powered by blists - more mailing lists