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: <20211105185256.GO174703@worktop.programming.kicks-ass.net>
Date:   Fri, 5 Nov 2021 19:52:56 +0100
From:   Peter Zijlstra <peterz@...radead.org>
To:     Sean Christopherson <seanjc@...gle.com>
Cc:     x86@...nel.org, linux-kernel@...r.kernel.org, jpoimboe@...hat.com,
        mark.rutland@....com, dvyukov@...gle.com, pbonzini@...hat.com,
        mbenes@...e.cz
Subject: Re: [RFC][PATCH 15/22] x86,vmx: Remove .fixup usage

On Fri, Nov 05, 2021 at 06:17:53PM +0000, Sean Christopherson wrote:
> On Thu, Nov 04, 2021, Peter Zijlstra wrote:
> > In the vmread exceptin path, use the, thus far, unused output register
> > to push the @fault argument onto the stack. This, in turn, enables the
> > exception handler to not do pushes and only modify that register when
> > an exception does occur.
> > 
> > Signed-off-by: Peter Zijlstra (Intel) <peterz@...radead.org>
> > ---
> >  arch/x86/kvm/vmx/vmx_ops.h |   14 ++++++--------
> >  1 file changed, 6 insertions(+), 8 deletions(-)
> > 
> > --- a/arch/x86/kvm/vmx/vmx_ops.h
> > +++ b/arch/x86/kvm/vmx/vmx_ops.h
> > @@ -80,9 +80,11 @@ static __always_inline unsigned long __v
> >  		      * @field, and bounce through the trampoline to preserve
> >  		      * volatile registers.
> >  		      */
> > -		     "push $0\n\t"
> > +		     "xorl %k1, %k1\n\t"
> > +		     "2:\n\t"
> > +		     "push %1\n\t"
> >  		     "push %2\n\t"
> 
> This trick doesn't work if the compiler selects the same GPR for %1 and %2, as
> the "field" will get lost.
> 
>    0x00000000000005a2 <+66>:	0f 78 c0	vmread %rax,%rax
>    0x00000000000005a5 <+69>:	3e 77 0b	ja,pt  0x5b3 <vmx_read_guest_seg_selector+83>
>    0x00000000000005a8 <+72>:	31 c0	xor    %eax,%eax
>    0x00000000000005aa <+74>:	50	push   %rax
>    0x00000000000005ab <+75>:	50	push   %rax

*argh* I misread that thing, %2 is an input reg :/ Thanks for your
patch.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ