* [PATCH] i386/PAE: avoid temporarily inconsistent pte-s
@ 2007-09-19 14:39 Jan Beulich
2007-09-19 16:09 ` Andi Kleen
0 siblings, 1 reply; 4+ messages in thread
From: Jan Beulich @ 2007-09-19 14:39 UTC (permalink / raw)
To: Andi Kleen; +Cc: linux-kernel
One more of these issues (which were considered fixed a few releases
back): Other than on x86-64, i386 allows set_fixmap() to replace
already present mappings. Consequently, on PAE, care must be taken to
not update the high half of a pte while the low half is still holding
the old value.
Signed-off-by: Jan Beulich <jbeulich@novell.com>
arch/i386/mm/pgtable.c | 3 +--
1 files changed, 1 insertion(+), 2 deletions(-)
--- linux-2.6.23-rc6/arch/i386/mm/pgtable.c 2007-09-14 17:38:47.000000000 +0200
+++ 2.6.23-rc6-i386-set-fixmap/arch/i386/mm/pgtable.c 2007-09-19 10:49:53.000000000 +0200
@@ -97,8 +97,7 @@ static void set_pte_pfn(unsigned long va
}
pte = pte_offset_kernel(pmd, vaddr);
if (pgprot_val(flags))
- /* <pfn,flags> stored as-is, to permit clearing entries */
- set_pte(pte, pfn_pte(pfn, flags));
+ set_pte_present(&init_mm, vaddr, pte, pfn_pte(pfn, flags));
else
pte_clear(&init_mm, vaddr, pte);
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] i386/PAE: avoid temporarily inconsistent pte-s
2007-09-19 14:39 [PATCH] i386/PAE: avoid temporarily inconsistent pte-s Jan Beulich
@ 2007-09-19 16:09 ` Andi Kleen
2007-09-19 16:16 ` Jan Beulich
0 siblings, 1 reply; 4+ messages in thread
From: Andi Kleen @ 2007-09-19 16:09 UTC (permalink / raw)
To: Jan Beulich; +Cc: linux-kernel
On Wednesday 19 September 2007 16:39:39 Jan Beulich wrote:
> One more of these issues (which were considered fixed a few releases
> back): Other than on x86-64, i386 allows set_fixmap() to replace
> already present mappings. Consequently, on PAE, care must be taken to
> not update the high half of a pte while the low half is still holding
> the old value.
Hmm perhaps it would be better to just forbid it on i386 too.
Do you know who uses it?
-Andi
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] i386/PAE: avoid temporarily inconsistent pte-s
2007-09-19 16:09 ` Andi Kleen
@ 2007-09-19 16:16 ` Jan Beulich
2007-09-19 16:17 ` Andi Kleen
0 siblings, 1 reply; 4+ messages in thread
From: Jan Beulich @ 2007-09-19 16:16 UTC (permalink / raw)
To: Andi Kleen; +Cc: linux-kernel
>>> Andi Kleen <ak@suse.de> 19.09.07 18:09 >>>
>On Wednesday 19 September 2007 16:39:39 Jan Beulich wrote:
>> One more of these issues (which were considered fixed a few releases
>> back): Other than on x86-64, i386 allows set_fixmap() to replace
>> already present mappings. Consequently, on PAE, care must be taken to
>> not update the high half of a pte while the low half is still holding
>> the old value.
>
>Hmm perhaps it would be better to just forbid it on i386 too.
>Do you know who uses it?
PCI's mmconfig accessor. One could of course make it call clear_fixmap() prior
to establishing a new mapping, but I thought that was not intended and is the
reason for allowing this.
Jan
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] i386/PAE: avoid temporarily inconsistent pte-s
2007-09-19 16:16 ` Jan Beulich
@ 2007-09-19 16:17 ` Andi Kleen
0 siblings, 0 replies; 4+ messages in thread
From: Andi Kleen @ 2007-09-19 16:17 UTC (permalink / raw)
To: Jan Beulich; +Cc: linux-kernel
On Wednesday 19 September 2007 18:16:25 Jan Beulich wrote:
> >>> Andi Kleen <ak@suse.de> 19.09.07 18:09 >>>
> >On Wednesday 19 September 2007 16:39:39 Jan Beulich wrote:
> >> One more of these issues (which were considered fixed a few releases
> >> back): Other than on x86-64, i386 allows set_fixmap() to replace
> >> already present mappings. Consequently, on PAE, care must be taken to
> >> not update the high half of a pte while the low half is still holding
> >> the old value.
> >
> >Hmm perhaps it would be better to just forbid it on i386 too.
> >Do you know who uses it?
>
> PCI's mmconfig accessor. One could of course make it call clear_fixmap() prior
> to establishing a new mapping, but I thought that was not intended and is the
> reason for allowing this.
Makes sense. Applied thanks.
-Andi
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2007-09-19 16:17 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-09-19 14:39 [PATCH] i386/PAE: avoid temporarily inconsistent pte-s Jan Beulich
2007-09-19 16:09 ` Andi Kleen
2007-09-19 16:16 ` Jan Beulich
2007-09-19 16:17 ` Andi Kleen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox