[lkml]   [2024]   [May]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH 04/16] KVM: x86/mmu: Add address conversion functions for TDX shared bit of GPA
On Thu, 2024-05-16 at 12:12 +1200, Huang, Kai wrote:
> I don't have strong objection if the use of kvm_gfn_shared_mask() is
> contained in smaller areas that truly need it.  Let's discuss in
> relevant patch(es).
> However I do think the helpers like below makes no sense (for SEV-SNP):
> +static inline bool kvm_is_private_gpa(const struct kvm *kvm, gpa_t gpa)
> +{
> +       gfn_t mask = kvm_gfn_shared_mask(kvm);
> +
> +       return mask && !(gpa_to_gfn(gpa) & mask);
> +}

You mean the name? SNP doesn't have a concept of "private GPA" IIUC. The C bit
is more like an permission bit. So SNP doesn't have private GPAs, and the
function would always return false for SNP. So I'm not sure it's too horrible.

If it's the name, can you suggest something?
 \ /
  Last update: 2024-05-16 02:19    [W:0.081 / U:1.000 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site