[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAAhR5DGEUqHGvYztLZJKfY+Re-aq5ACC4++m_7+yeMsL+1E11g@mail.gmail.com>
Date: Thu, 21 Aug 2025 17:30:42 -0500
From: Sagi Shahar <sagis@...gle.com>
To: Ira Weiny <ira.weiny@...el.com>
Cc: linux-kselftest@...r.kernel.org, Paolo Bonzini <pbonzini@...hat.com>,
Shuah Khan <shuah@...nel.org>, Sean Christopherson <seanjc@...gle.com>,
Ackerley Tng <ackerleytng@...gle.com>, Ryan Afranji <afranji@...gle.com>,
Andrew Jones <ajones@...tanamicro.com>, Isaku Yamahata <isaku.yamahata@...el.com>,
Erdem Aktas <erdemaktas@...gle.com>, Rick Edgecombe <rick.p.edgecombe@...el.com>,
Roger Wang <runanwang@...gle.com>, Binbin Wu <binbin.wu@...ux.intel.com>,
Oliver Upton <oliver.upton@...ux.dev>, "Pratik R. Sampat" <pratikrajesh.sampat@....com>,
Reinette Chatre <reinette.chatre@...el.com>, Chao Gao <chao.gao@...el.com>,
Chenyi Qiang <chenyi.qiang@...el.com>, linux-kernel@...r.kernel.org, kvm@...r.kernel.org,
Adrian Hunter <adrian.hunter@...el.com>
Subject: Re: [PATCH v9 05/19] KVM: selftests: Update kvm_init_vm_address_properties()
for TDX
On Thu, Aug 21, 2025 at 5:03 PM Ira Weiny <ira.weiny@...el.com> wrote:
>
> Sagi Shahar wrote:
> > From: Isaku Yamahata <isaku.yamahata@...el.com>
> >
> > Let kvm_init_vm_address_properties() initialize vm->arch.{s_bit, tag_mask}
> > similar to SEV.
> >
> > TDX sets the shared bit based on the guest physical address width and
> > currently supports 48 and 52 widths.
> >
> > Co-developed-by: Adrian Hunter <adrian.hunter@...el.com>
> > Signed-off-by: Adrian Hunter <adrian.hunter@...el.com>
> > Signed-off-by: Isaku Yamahata <isaku.yamahata@...el.com>
> > Co-developed-by: Sagi Shahar <sagis@...gle.com>
> > Signed-off-by: Sagi Shahar <sagis@...gle.com>
> > ---
> > .../selftests/kvm/include/x86/tdx/tdx_util.h | 14 ++++++++++++++
> > tools/testing/selftests/kvm/lib/x86/processor.c | 12 ++++++++++--
> > 2 files changed, 24 insertions(+), 2 deletions(-)
> > create mode 100644 tools/testing/selftests/kvm/include/x86/tdx/tdx_util.h
> >
> > diff --git a/tools/testing/selftests/kvm/include/x86/tdx/tdx_util.h b/tools/testing/selftests/kvm/include/x86/tdx/tdx_util.h
> > new file mode 100644
> > index 000000000000..286d5e3c24b1
> > --- /dev/null
> > +++ b/tools/testing/selftests/kvm/include/x86/tdx/tdx_util.h
> > @@ -0,0 +1,14 @@
> > +/* SPDX-License-Identifier: GPL-2.0-only */
> > +#ifndef SELFTESTS_TDX_TDX_UTIL_H
> > +#define SELFTESTS_TDX_TDX_UTIL_H
> > +
> > +#include <stdbool.h>
> > +
> > +#include "kvm_util.h"
> > +
> > +static inline bool is_tdx_vm(struct kvm_vm *vm)
> > +{
> > + return vm->type == KVM_X86_TDX_VM;
> > +}
>
> NIT: Might have been better to define this in 4/19 and use it there. But
> looks like that logic is changed later on somewhere. So... meh.
We can skip the check for KVM_X86_TDX_VM entirely in 4/19 since like
you said, it's replaced with something different later on.
>
> Ira
>
> [snip]
Powered by blists - more mailing lists