lkml.org 
[lkml]   [2022]   [Apr]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [RFC PATCH v5 033/104] KVM: x86: Add infrastructure for stolen GPA bits
From
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

\
 
 \ /
  Last update: 2022-04-06 06:52    [W:0.132 / U:1.624 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site