Re: [PATCH v14 12/23] x86/virt/tdx: Allocate and set up PAMTs for TDMRs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





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>



[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux