Re: [PATCH] mark read_crX() asm code as volatile

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Arjan van de Ven <arjan@...>
Cc: Kirill Korotaev <dev@...>, Andrew Morton <akpm@...>, Andi Kleen <ak@...>, Linux Kernel Mailing List <linux-kernel@...>, <devel@...>
Date: Tuesday, October 2, 2007 - 2:27 pm

On 10/02/2007 11:28 AM, Arjan van de Ven wrote:

It means "don't eliminate this code if it's reachable" which should be
just enough for this case. But it could still be reordered in some cases
that could break, I think.

This should work because the result gets used before reading again:

read_cr3(a);
write_cr3(a | 1);
read_cr3(a);

But this might be reordered so that b gets read before the write:

read_cr3(a);
write_cr3(a | 1);
read_cr3(b);

?
-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH] mark read_crX() asm code as volatile, Kirill Korotaev, (Tue Oct 2, 10:08 am)
Re: [PATCH] mark read_crX() asm code as volatile, Arjan van de Ven, (Tue Oct 2, 11:28 am)
Re: [PATCH] mark read_crX() asm code as volatile, Kirill Korotaev, (Wed Oct 3, 4:25 am)
Re: [PATCH] mark read_crX() asm code as volatile, H. Peter Anvin, (Tue Oct 2, 3:21 pm)
Re: [PATCH] mark read_crX() asm code as volatile, Chuck Ebbert, (Tue Oct 2, 2:27 pm)
Re: [PATCH] mark read_crX() asm code as volatile, Nick Piggin, (Tue Oct 2, 8:14 am)
Re: [PATCH] mark read_crX() asm code as volatile, H. Peter Anvin, (Wed Oct 3, 2:18 am)
Re: [PATCH] mark read_crX() asm code as volatile, Nick Piggin, (Tue Oct 2, 11:49 am)
Re: [PATCH] mark read_crX() asm code as volatile, Andi Kleen, (Wed Oct 3, 4:45 am)
Re: [PATCH] mark read_crX() asm code as volatile, Andi Kleen, (Tue Oct 2, 10:17 am)