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: <46A0EF4D.6030308@zytor.com>
Date:	Fri, 20 Jul 2007 10:22:21 -0700
From:	"H. Peter Anvin" <hpa@...or.com>
To:	Andi Kleen <ak@...e.de>
CC:	Glauber de Oliveira Costa <gcosta@...hat.com>,
	akpm@...ux-foundation.org, linux-kernel@...r.kernel.org,
	Muli Ben-Yehuda <muli@...ibm.com>
Subject: Re: [PATCH] Use wbinvd() macro instead of raw inline assembly in
 .c files

Andi Kleen wrote:
> On Friday 20 July 2007 00:55:40 Glauber de Oliveira Costa wrote:
>> This patch uses the already-existant wbinvd() macro to replace
>> raw assembly to perform this very same task in some .c files
>>     
>> Signed-off-by: Glauber de Oliveira Costa <gcosta@...hat.com>
>>
>> diff --git a/arch/x86_64/kernel/tce.c b/arch/x86_64/kernel/tce.c
>> index f61fb8e..afbb951 100644
>> --- a/arch/x86_64/kernel/tce.c
>> +++ b/arch/x86_64/kernel/tce.c
>> @@ -42,7 +42,7 @@ static inline void flush_tce(void* tceaddr)
>>  	if (cpu_has_clflush)
>>  		asm volatile("clflush (%0)" :: "r" (tceaddr));
>>  	else
>> -		asm volatile("wbinvd":::"memory");
>> +		wbinvd();
> 
> I guess it can be just removed there. I don' think there are any calgary 
> machines without clflush
> 

That seems like an unsafe thing to do (unless we err out somewhere);
lest there is, say, a microcode update disabling clflush due to an erratum.

It also seems to me we should have a macro for clflush(), especially
since it is "clflush (%0)" :: "r" in a number of places, which really
isn't correct; it should be "clflush %0" : "+m", both to allow
addressing modes to be used and to give gcc a modicum of a hint that
something is going on with a specific memory location.

	-hpa
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ