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

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Chuck Ebbert
Date: Tuesday, October 2, 2007 - 11:27 am

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:
Re: [PATCH] mark read_crX() asm code as volatile, Nick Piggin, (Tue Oct 2, 5:14 am)
[PATCH] mark read_crX() asm code as volatile, Kirill Korotaev, (Tue Oct 2, 7:08 am)
Re: [PATCH] mark read_crX() asm code as volatile, Andi Kleen, (Tue Oct 2, 7:17 am)
Re: [PATCH] mark read_crX() asm code as volatile, Arjan van de Ven, (Tue Oct 2, 8:28 am)
Re: [PATCH] mark read_crX() asm code as volatile, Nick Piggin, (Tue Oct 2, 8:49 am)
Re: [PATCH] mark read_crX() asm code as volatile, Chuck Ebbert, (Tue Oct 2, 11:27 am)
Re: [PATCH] mark read_crX() asm code as volatile, H. Peter Anvin, (Tue Oct 2, 12:21 pm)
Re: [PATCH] mark read_crX() asm code as volatile, H. Peter Anvin, (Tue Oct 2, 11:18 pm)
Re: [PATCH] mark read_crX() asm code as volatile, Kirill Korotaev, (Wed Oct 3, 1:25 am)
Re: [PATCH] mark read_crX() asm code as volatile, Andi Kleen, (Wed Oct 3, 1:45 am)