# HG changeset patch
# User kfraser@xxxxxxxxxxxxxxxxxxxxx
# Date 1176670598 -3600
# Node ID 6a4c6d8a00f53ac22a2687e30d4ec6bfdd588cfe
# Parent 249de074617f259f456de3a9d60c108182044efa
Fix map_pages_to_xen() to atomically switch between valid mappings.
This is needed to successfully boot a debug=y build of xen on kvm.
Reported by Jeremy Fitzhardinge <jeremy@xxxxxxxx>
Signed-off-by: Avi Kivity <avi@xxxxxxxxxxxx>
Signed-off-by: Keir Fraser <keir@xxxxxxxxxxxxx>
---
xen/arch/x86/mm.c | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
diff -r 249de074617f -r 6a4c6d8a00f5 xen/arch/x86/mm.c
--- a/xen/arch/x86/mm.c Fri Apr 13 18:14:06 2007 +0100
+++ b/xen/arch/x86/mm.c Sun Apr 15 21:56:38 2007 +0100
@@ -3424,7 +3424,7 @@ int map_pages_to_xen(
{
/* Super-page mapping. */
ol2e = *pl2e;
- l2e_write(pl2e, l2e_from_pfn(mfn, flags|_PAGE_PSE));
+ l2e_write_atomic(pl2e, l2e_from_pfn(mfn, flags|_PAGE_PSE));
if ( (l2e_get_flags(ol2e) & _PAGE_PRESENT) )
{
@@ -3454,14 +3454,14 @@ int map_pages_to_xen(
l1e_write(&pl1e[i],
l1e_from_pfn(l2e_get_pfn(*pl2e) + i,
l2e_get_flags(*pl2e) & ~_PAGE_PSE));
- l2e_write(pl2e, l2e_from_pfn(virt_to_mfn(pl1e),
- __PAGE_HYPERVISOR));
+ l2e_write_atomic(pl2e, l2e_from_pfn(virt_to_mfn(pl1e),
+ __PAGE_HYPERVISOR));
local_flush_tlb_pge();
}
pl1e = l2e_to_l1e(*pl2e) + l1_table_offset(virt);
ol1e = *pl1e;
- l1e_write(pl1e, l1e_from_pfn(mfn, flags));
+ l1e_write_atomic(pl1e, l1e_from_pfn(mfn, flags));
if ( (l1e_get_flags(ol1e) & _PAGE_PRESENT) )
local_flush_tlb_one(virt);
_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog
|