[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aa43556ea7b98000dc7bc4495e6fe2b61cf59c21.camel@intel.com>
Date: Thu, 13 Jun 2024 20:01:07 +0000
From: "Edgecombe, Rick P" <rick.p.edgecombe@...el.com>
To: "pbonzini@...hat.com" <pbonzini@...hat.com>, "seanjc@...gle.com"
<seanjc@...gle.com>, "Zhao, Yan Y" <yan.y.zhao@...el.com>
CC: "kvm@...r.kernel.org" <kvm@...r.kernel.org>, "sagis@...gle.com"
<sagis@...gle.com>, "linux-kernel@...r.kernel.org"
<linux-kernel@...r.kernel.org>, "dmatlack@...gle.com" <dmatlack@...gle.com>,
"Huang, Kai" <kai.huang@...el.com>, "Yamahata, Isaku"
<isaku.yamahata@...el.com>, "Aktas, Erdem" <erdemaktas@...gle.com>
Subject: Re: [PATCH 0/5] Introduce a quirk to control memslot zap behavior
On Thu, 2024-06-13 at 14:06 +0800, Yan Zhao wrote:
> a) Add a condition for TDX VM type in kvm_arch_flush_shadow_memslot()
> besides the testing of kvm_check_has_quirk(). It is similar to
> "all new VM types have the quirk disabled". e.g.
>
> static inline bool kvm_memslot_flush_zap_all(struct kvm
> *kvm)
>
> {
>
> return kvm->arch.vm_type != KVM_X86_TDX_VM
> &&
> kvm_check_has_quirk(kvm,
> KVM_X86_QUIRK_SLOT_ZAP_ALL);
> }
>
> b) Init the disabled_quirks based on VM type in kernel, extend
> disabled_quirk querying/setting interface to enforce the quirk to
> be disabled for TDX.
I'd prefer to go with option (a) here. Because we don't have any behavior
defined yet for KVM_X86_TDX_VM, we don't really need to "disable a quirk" of it.
Instead we could just define KVM_X86_QUIRK_SLOT_ZAP_ALL to be about the behavior
of the existing vm_types. It would be a few lines of documentation to save
implementing and maintaining a whole interface with special logic for TDX. So to
me it doesn't seem worth it, unless there is some other user for a new more
complex quirk interface.
Powered by blists - more mailing lists