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] [day] [month] [year] [list]
Date:   Mon, 8 Aug 2022 11:59:54 -0700
From:   "H. Peter Anvin" <hpa@...or.com>
To:     Dave Hansen <dave.hansen@...el.com>,
        Uros Bizjak <ubizjak@...il.com>
Cc:     x86@...nel.org, linux-kernel@...r.kernel.org,
        Thomas Gleixner <tglx@...utronix.de>,
        Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>,
        Dave Hansen <dave.hansen@...ux.intel.com>
Subject: Re: [PATCH] x86/acrn: Improve ACRN hypercalls

On August 4, 2022 12:03:56 PM PDT, Dave Hansen <dave.hansen@...el.com> 
wrote:
>On 8/4/22 11:56, Uros Bizjak wrote:
>> The %r8 is not preserved across function calls, so your statement
>> above is correct. But as long as there is no function call *between*
>> the variable definition and the assembly, the approach with the local
>> register variable works without any problems. It is even something GCC
>> itself has used in its library for years.
>
>I'm glad it's workout out for GCC.  But, the kernel is not GCC.  I
>specifically asked for the ACRN code to be the way that it is today and
>your argument is not making me reconsider it in the slightest.
>
>So, thanks for the patch, but I don't think we should apply it.

Well, this is universally used, so it isn't going to break. x86 is kind 
of unique in that it often doesn't need it, because it has predicates 
for so many of the specific registers, but even x86 needs it for 
inlining system calls in glibc, for example.

There is a way to do it right, which is to wrap the assignments (which 
don't have to be the declarations, but customarily are) and asm() 
statements in a block (e.g. an inline function, but can also just be a 
plain old statement block.)


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ