[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4703342E.3020101@zytor.com>
Date: Tue, 02 Oct 2007 23:18:22 -0700
From: "H. Peter Anvin" <hpa@...or.com>
To: Nick Piggin <nickpiggin@...oo.com.au>
CC: Chuck Ebbert <cebbert@...hat.com>,
Arjan van de Ven <arjan@...radead.org>,
Kirill Korotaev <dev@...nvz.org>,
Andrew Morton <akpm@...l.org>, Andi Kleen <ak@...e.de>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
devel@...nvz.org
Subject: Re: [PATCH] mark read_crX() asm code as volatile
Nick Piggin wrote:
>>
>> 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);
>>
>> ?
>
> I don't see how, as write_cr3 clobbers memory.
Because read_cr3() doesn't depend on memory, and b could be stored in a
register.
-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