[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <240599a4-47f0-fe7e-1270-5ec7fbc0da0b@redhat.com>
Date: Tue, 5 Apr 2022 16:02:02 +0200
From: Paolo Bonzini <pbonzini@...hat.com>
To: Isaku Yamahata <isaku.yamahata@...il.com>,
Kai Huang <kai.huang@...el.com>
Cc: isaku.yamahata@...el.com, kvm@...r.kernel.org,
linux-kernel@...r.kernel.org, Jim Mattson <jmattson@...gle.com>,
erdemaktas@...gle.com, Connor Kuehl <ckuehl@...hat.com>,
Sean Christopherson <seanjc@...gle.com>,
Chao Peng <chao.p.peng@...ux.intel.com>
Subject: Re: [RFC PATCH v5 033/104] KVM: x86: Add infrastructure for stolen
GPA bits
On 4/1/22 04:34, Isaku Yamahata wrote:
> Sure, this patch heavily changed from the original patch Now. One suggestion
> is that private/shared is characteristic to kvm page fault, not gpa/gfn.
> It's TDX specific.
>
> - Add a helper function to check if KVM MMU is TD or VM. Right now
> kvm_gfn_stolen_mask() is used. Probably kvm_mmu_has_private_bit().
> (any better name?)
I think use of kvm_gfn_stolen_mask() should be minimized anyway. I
would rename it to to kvm_{gfn,gpa}_private_mask and not return bool.
> - Let's keep address conversion functions: address => unalias/shared/private
unalias is the same as private. It doesn't seem to have a lot of uses.
I would just inline "x & ~gfn_private_mask", or "x &
~kvm_gfn_private_mask(kvm)"; or the same with gpa of course.
The shared and private conversion functions should remain.
> - Add struct kvm_page_fault.is_private
> see how kvm_is_private_{gpa, gfn}() can be removed (or reduced).
Agreed.
Paolo
Powered by blists - more mailing lists