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]
Message-ID: <8de5e0f4-e3c4-cd91-c34c-f214e9db52c7@infradead.org>
Date:   Thu, 7 Jan 2021 08:49:45 -0800
From:   Randy Dunlap <rdunlap@...radead.org>
To:     Peter Zijlstra <peterz@...radead.org>
Cc:     x86@...nel.org, linux-kernel@...r.kernel.org, jpoimboe@...hat.com,
        sfr@...b.auug.org.au, tony.luck@...el.com
Subject: Re: [PATCH 7/6] x86: __always_inline __{rd,wr}msr()

On 1/7/21 2:18 AM, Peter Zijlstra wrote:
> On Thu, Jan 07, 2021 at 10:36:43AM +0100, Peter Zijlstra wrote:
>> On Wed, Jan 06, 2021 at 09:59:17AM -0800, Randy Dunlap wrote:
>>> On 1/6/21 6:36 AM, Peter Zijlstra wrote:
>>>> When the compiler fails to inline; we violate nonisntr:
>>>>
>>>>   vmlinux.o: warning: objtool: __sev_es_nmi_complete()+0xc7: call to sev_es_wr_ghcb_msr() leaves .noinstr.text section
>>>
>>> I am still seeing (a variant of) this one:
>>>
>>> vmlinux.o: warning: objtool: __sev_es_nmi_complete()+0xce: call to __wrmsr.constprop.14() leaves .noinstr.text section
>>
>> Gah, sorry, I managed to mess up my .config :/ /me goes try again.
> 
> OK, restored your original .config and that did indeed reproduce, the
> below cures it.
> 
> ---
> 
> Subject: x86: __always_inline __{rd,wr}msr()
> From: Peter Zijlstra <peterz@...radead.org>
> Date: Thu Jan  7 11:14:25 CET 2021
> 
> When the compiler choses to not inline the trivial MSR helpers:
> 
>   vmlinux.o: warning: objtool: __sev_es_nmi_complete()+0xce: call to __wrmsr.constprop.14() leaves .noinstr.text section
> 
> Reported-by: Randy Dunlap <rdunlap@...radead.org>
> Signed-off-by: Peter Zijlstra (Intel) <peterz@...radead.org>

Acked-by: Randy Dunlap <rdunlap@...radead.org> # build-tested

Thanks.

> ---
>  arch/x86/include/asm/msr.h |    4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> --- a/arch/x86/include/asm/msr.h
> +++ b/arch/x86/include/asm/msr.h
> @@ -86,7 +86,7 @@ static inline void do_trace_rdpmc(unsign
>   * think of extending them - you will be slapped with a stinking trout or a frozen
>   * shark will reach you, wherever you are! You've been warned.
>   */
> -static inline unsigned long long notrace __rdmsr(unsigned int msr)
> +static __always_inline unsigned long long __rdmsr(unsigned int msr)
>  {
>  	DECLARE_ARGS(val, low, high);
>  
> @@ -98,7 +98,7 @@ static inline unsigned long long notrace
>  	return EAX_EDX_VAL(val, low, high);
>  }
>  
> -static inline void notrace __wrmsr(unsigned int msr, u32 low, u32 high)
> +static __always_inline void __wrmsr(unsigned int msr, u32 low, u32 high)
>  {
>  	asm volatile("1: wrmsr\n"
>  		     "2:\n"
> 


-- 
~Randy

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ