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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Thu, 1 Sep 2022 19:29:53 +0200
From:   Uros Bizjak <ubizjak@...il.com>
To:     Sean Christopherson <seanjc@...gle.com>
Cc:     kvm@...r.kernel.org, linux-kernel@...r.kernel.org,
        Paolo Bonzini <pbonzini@...hat.com>
Subject: Re: [PATCH] KVM/VMX: Do not declare vmread_error asmlinkage

On Thu, Sep 1, 2022 at 5:40 PM Sean Christopherson <seanjc@...gle.com> wrote:
>
> On Wed, Aug 17, 2022, Uros Bizjak wrote:
> > There is no need to declare vmread_error asmlinkage, its arguments
> > can be passed via registers for both, 32-bit and 64-bit targets.
> > Function argument registers are considered call-clobbered registers,
> > they are saved in the trampoline just before the function call and
> > restored afterwards.
> >
> > Note that asmlinkage and __attribute__((regparm(0))) have no effect
> > on 64-bit targets. The trampoline is called from the assembler glue
> > code that implements its own stack-passing function calling convention,
> > so the attribute on the trampoline declaration does not change anything
> > for 64-bit as well as 32-bit targets. We can declare it asmlinkage for
> > documentation purposes.
>
> ...
>
> > diff --git a/arch/x86/kvm/vmx/vmx_ops.h b/arch/x86/kvm/vmx/vmx_ops.h
> > index 5cfc49ddb1b4..550a89394d9f 100644
> > --- a/arch/x86/kvm/vmx/vmx_ops.h
> > +++ b/arch/x86/kvm/vmx/vmx_ops.h
> > @@ -10,9 +10,9 @@
> >  #include "vmcs.h"
> >  #include "../x86.h"
> >
> > -asmlinkage void vmread_error(unsigned long field, bool fault);
> > -__attribute__((regparm(0))) void vmread_error_trampoline(unsigned long field,
> > -                                                      bool fault);
> > +void vmread_error(unsigned long field, bool fault);
> > +asmlinkage void vmread_error_trampoline(unsigned long field,
> > +                                     bool fault);
> >  void vmwrite_error(unsigned long field, unsigned long value);
> >  void vmclear_error(struct vmcs *vmcs, u64 phys_addr);
> >  void vmptrld_error(struct vmcs *vmcs, u64 phys_addr);
>
> If it's ok with you, I'll split this into two patches.  One to drop asmlinkage
> from vmread_error(), and one to convert the open coded regparm to asmlinkage.

Sure, please go ahead.

Thanks,
Uros.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ