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]
Message-ID: <6345272506c5bc707f11b6f54c4bd5015cedcd95.camel@intel.com>
Date: Wed, 15 Jan 2025 00:49:15 +0000
From: "Edgecombe, Rick P" <rick.p.edgecombe@...el.com>
To: "pbonzini@...hat.com" <pbonzini@...hat.com>, "Zhao, Yan Y"
	<yan.y.zhao@...el.com>
CC: "kvm@...r.kernel.org" <kvm@...r.kernel.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>, "Huang, Kai"
	<kai.huang@...el.com>, "dave.hansen@...ux.intel.com"
	<dave.hansen@...ux.intel.com>, "Yamahata, Isaku" <isaku.yamahata@...el.com>
Subject: Re: [PATCH 08/13] x86/virt/tdx: Add SEAMCALL wrappers to add TD
 private pages

On Wed, 2025-01-15 at 00:32 +0100, Paolo Bonzini wrote:
> I've pushed to kvm-coco-queue; if you have some time to double check 
> what I did that's great, otherwise if I don't hear from you I'll post 
> around noon European time the v3 of this series.

Level handling and gpa encoding looks fine to me.

I get a build error:

In file included from /home/rpedgeco/repos/linux/include/asm-
generic/memory_model.h:5,
                 from arch/x86/include/asm/page.h:89,
                 from linux/arch/x86/include/asm/processor.h:20,
                 from linux/arch/x86/include/asm/timex.h:5,
                 from linux/include/linux/timex.h:67,
                 from linux/include/linux/clocksource.h:13,
                 from linux/include/linux/clockchips.h:14,
                 from linux/arch/x86/kernel/i8253.c:6:
linux/arch/x86/include/asm/tdx.h: In function ‘mk_keyed_paddr’:
linux/include/asm-generic/memory_model.h:38:58: error: ‘vmemmap’ undeclared
(first use in this function); did you mean ‘mem_map’?
   38 | #define __page_to_pfn(page)     (unsigned long)((page) - vmemmap)
      |                                                          ^~~~~~~

...and needed this:

diff --git a/arch/x86/include/asm/tdx.h b/arch/x86/include/asm/tdx.h
index 201f2e910411..a8a6fbd7bf71 100644
--- a/arch/x86/include/asm/tdx.h
+++ b/arch/x86/include/asm/tdx.h
@@ -35,6 +35,7 @@
 
 #include <uapi/asm/mce.h>
 #include <asm/tdx_global_metadata.h>
+#include <linux/pgtable.h>
 
 /*
  * Used by the #VE exception handler to gather the #VE exception


Nit, whitespace errors:

+static inline u64 mk_keyed_paddr(u16 hkid, struct page *page)
+{
+       u64 ret;
+
+       ret = page_to_phys(page);
+       /* KeyID bits are just above the physical address bits: */
+       ret |= hkid << boot_cpu_data.x86_phys_bits;
+       
  ^ extra tab here
+       return ret;
+}
+

+static inline int pg_level_to_tdx_sept_level(enum pg_level level)
+{
+        WARN_ON_ONCE(level == PG_LEVEL_NONE);
+        return level - 1;
+ ^ spaces instead of tabs
+
+}

Lastly, TD's are not booting for me, with a QEMU error. Still debugging this.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ