lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 24 Oct 2023 10:49:23 +0000
From:   "Huang, Kai" <kai.huang@...el.com>
To:     "kvm@...r.kernel.org" <kvm@...r.kernel.org>,
        "nik.borisov@...e.com" <nik.borisov@...e.com>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
CC:     "sathyanarayanan.kuppuswamy@...ux.intel.com" 
        <sathyanarayanan.kuppuswamy@...ux.intel.com>,
        "Hansen, Dave" <dave.hansen@...el.com>,
        "david@...hat.com" <david@...hat.com>,
        "bagasdotme@...il.com" <bagasdotme@...il.com>,
        "ak@...ux.intel.com" <ak@...ux.intel.com>,
        "kirill.shutemov@...ux.intel.com" <kirill.shutemov@...ux.intel.com>,
        "Christopherson,, Sean" <seanjc@...gle.com>,
        "mingo@...hat.com" <mingo@...hat.com>,
        "pbonzini@...hat.com" <pbonzini@...hat.com>,
        "tglx@...utronix.de" <tglx@...utronix.de>,
        "Yamahata, Isaku" <isaku.yamahata@...el.com>,
        "Luck, Tony" <tony.luck@...el.com>,
        "hpa@...or.com" <hpa@...or.com>,
        "peterz@...radead.org" <peterz@...radead.org>,
        "Shahar, Sagi" <sagis@...gle.com>,
        "imammedo@...hat.com" <imammedo@...hat.com>,
        "bp@...en8.de" <bp@...en8.de>, "Gao, Chao" <chao.gao@...el.com>,
        "rafael@...nel.org" <rafael@...nel.org>,
        "Brown, Len" <len.brown@...el.com>,
        "Huang, Ying" <ying.huang@...el.com>,
        "Williams, Dan J" <dan.j.williams@...el.com>,
        "x86@...nel.org" <x86@...nel.org>
Subject: Re: [PATCH v14 12/23] x86/virt/tdx: Allocate and set up PAMTs for
 TDMRs

On Tue, 2023-10-24 at 08:53 +0300, Nikolay Borisov wrote:
> 
> On 17.10.23 г. 13:14 ч., Kai Huang wrote:
> 
> <snip>
> 
> >   arch/x86/Kconfig                  |   1 +
> >   arch/x86/include/asm/shared/tdx.h |   1 +
> >   arch/x86/virt/vmx/tdx/tdx.c       | 215 +++++++++++++++++++++++++++++-
> >   arch/x86/virt/vmx/tdx/tdx.h       |   1 +
> >   4 files changed, 213 insertions(+), 5 deletions(-)
> > 
> > diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
> > index 864e43b008b1..ee4ac117aa3c 100644
> > --- a/arch/x86/Kconfig
> > +++ b/arch/x86/Kconfig
> > @@ -1946,6 +1946,7 @@ config INTEL_TDX_HOST
> >   	depends on KVM_INTEL
> >   	depends on X86_X2APIC
> >   	select ARCH_KEEP_MEMBLOCK
> > +	depends on CONTIG_ALLOC
> >   	help
> >   	  Intel Trust Domain Extensions (TDX) protects guest VMs from malicious
> >   	  host and certain physical attacks.  This option enables necessary TDX
> > diff --git a/arch/x86/include/asm/shared/tdx.h b/arch/x86/include/asm/shared/tdx.h
> > index abcca86b5af3..cb59fe329b00 100644
> > --- a/arch/x86/include/asm/shared/tdx.h
> > +++ b/arch/x86/include/asm/shared/tdx.h
> > @@ -58,6 +58,7 @@
> >   #define TDX_PS_4K	0
> >   #define TDX_PS_2M	1
> >   #define TDX_PS_1G	2
> > +#define TDX_PS_NR	(TDX_PS_1G + 1)
> 
> nit: I'd prefer if you those defines are turned into an enum and 
> subsequently this enum type can be used in the definition of 
> tdmr_get_pamt_sz(). However, at this point I consider this a 
> bikeshedding and you can do that iff you are going to respin the series 
> due to other feedback as well.
> 
> <snip>

Thanks for comments.  But to be honest I don't get why enum is better, and I
would like to leave this to future work if really needed.  Please note these
TDX_PS_xx are also used by TDX guest code (see patch 2).

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ