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: <20230721080618.GC3630545@hirez.programming.kicks-ass.net>
Date:   Fri, 21 Jul 2023 10:06:18 +0200
From:   Peter Zijlstra <peterz@...radead.org>
To:     "Huang, Kai" <kai.huang@...el.com>
Cc:     "Hansen, Dave" <dave.hansen@...el.com>,
        "Christopherson,, Sean" <seanjc@...gle.com>,
        "bp@...en8.de" <bp@...en8.de>, "x86@...nel.org" <x86@...nel.org>,
        "hpa@...or.com" <hpa@...or.com>,
        "mingo@...hat.com" <mingo@...hat.com>,
        "kirill.shutemov@...ux.intel.com" <kirill.shutemov@...ux.intel.com>,
        "tglx@...utronix.de" <tglx@...utronix.de>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "pbonzini@...hat.com" <pbonzini@...hat.com>,
        "Yamahata, Isaku" <isaku.yamahata@...el.com>,
        "sathyanarayanan.kuppuswamy@...ux.intel.com" 
        <sathyanarayanan.kuppuswamy@...ux.intel.com>,
        "n.borisov.lkml@...il.com" <n.borisov.lkml@...il.com>
Subject: Re: [PATCH v2 00/11] Unify TDCALL/SEAMCALL and TDVMCALL assembly

On Fri, Jul 21, 2023 at 12:18:23AM +0000, Huang, Kai wrote:

> Unfortunately I don't think it's feasible.  Sean pointed out that
> kvm_vcpu_arch::regs[] do follow the "register index" hardware layout in x86 (for
> which I missed sorry), so we cannot re-order KVM part.  
> 
> And unfortunately RBP (5) is in middle of those registers:
> 
> 	0 = RAX
> 	1 = RCX
> 	2 = RDX
> 	3 = RBX
> 	4 = RSP
> 	5 = RBP
> 	6 = RSI
> 	7 = RDI
> 	8–15 represent R8–R15, respectively...
> 
> Thus unless we add RBP to 'struct tdx_module_args', it's impossible to re-order
> the structure to match KVM's layout.

Adding RBP to the struct shouldn't be a problem, we'll just not use it.
Same as RSP, nobody sane would expect that to be used. If you worry
about it you can give them funny names like:

struct tdx_module_args {
	unsigned long ax;
	unsigned long cx;
	unsigned long dx;
	unsigned long bx;
	unsigned long __sp_unused;
	unsigned long __bp_unused;
	unsigned long si;
	unsigned long di;
	...
};

I mean, at this point the whole thing is just 128 bytes of data anyway.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ