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: <alpine.LSU.2.20.1602101439540.20277@wotan.suse.de>
Date:	Wed, 10 Feb 2016 14:48:02 +0100 (CET)
From:	Michael Matz <matz@...e.de>
To:	Borislav Petkov <bp@...en8.de>
cc:	mingo@...nel.org, luto@...capital.net, tglx@...utronix.de,
	oleg@...hat.com, brgerst@...il.com, mcgrof@...e.com,
	dave.hansen@...ux.intel.com, akpm@...ux-foundation.org,
	dvlasenk@...hat.com, peterz@...radead.org,
	torvalds@...ux-foundation.org, linux-kernel@...r.kernel.org,
	toshi.kani@...com, luto@...nel.org, aryabinin@...tuozzo.com,
	hpa@...or.com, linux-tip-commits@...r.kernel.org
Subject: Re: [tip:x86/mm] x86/mm: Add INVPCID helpers

Hi,

On Wed, 10 Feb 2016, Borislav Petkov wrote:

> --- a/arch/x86/include/asm/tlbflush.h
> +++ b/arch/x86/include/asm/tlbflush.h
> @@ -23,7 +23,7 @@ static inline void __invpcid(unsigned long pcid, unsigned long addr,
>  	 * invpcid (%rcx), %rax in long mode.
>  	 */
>  	asm volatile (".byte 0x66, 0x0f, 0x38, 0x82, 0x01"
> -		      : : "m" (desc), "a" (type), "c" (desc) : "memory");
> +		      : : "m" (*desc), "a" (type), "c" (desc) : "memory");

That still doesn't do what you want.  Arrays in C are funny.  *desc is 
exactly equivalent to desc[0], _not_ to the whole array, indeed there's no 
C syntax to name an lvalue of array type in normal expressions.  You need 
to jump through hoops for this:

  "m" (*(struct {unsigned long x[2];} *)desc)

It'd probably be easier to simply declare the descriptor as a struct, 
rather than an array, then the original syntax would have been mostly 
correct:

  struct {u64 d[2];} desc = { pcid, addr };
  asm ... "m" (desc), "c" (&desc)


Ciao,
Michael.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ