lkml.org 
[lkml]   [2024]   [Feb]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v18 057/121] KVM: TDX: Add load_mmu_pgd method for TDX
On Mon, Feb 05, 2024 at 10:23:34AM +0800,
Binbin Wu <binbin.wu@linux.intel.com> wrote:

> > diff --git a/arch/x86/kvm/vmx/tdx.c b/arch/x86/kvm/vmx/tdx.c
> > index 59d170709f82..25510b6740a3 100644
> > --- a/arch/x86/kvm/vmx/tdx.c
> > +++ b/arch/x86/kvm/vmx/tdx.c
> > @@ -501,6 +501,11 @@ void tdx_vcpu_reset(struct kvm_vcpu *vcpu, bool init_event)
> > */
> > }
> > +void tdx_load_mmu_pgd(struct kvm_vcpu *vcpu, hpa_t root_hpa, int pgd_level)
> > +{
> > + td_vmcs_write64(to_tdx(vcpu), SHARED_EPT_POINTER, root_hpa & PAGE_MASK);
>
> If we have concern about the alignment of root_hpa, shouldn't we do some
> check instead of masking the address quietly?

Makes sense. I'll add WARN_ON_ONCE(root_hpa & ~PAGE_MASK)
--
Isaku Yamahata <isaku.yamahata@linux.intel.com>

\
 
 \ /
  Last update: 2024-05-27 15:22    [W:0.107 / U:0.196 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site