[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-changelog] [xen-unstable] x86/mm: don't treat entirely empty p2m entries as RAM.
# HG changeset patch # User Tim Deegan <Tim.Deegan@xxxxxxxxxx> # Date 1304613634 -3600 # Node ID 4b0692880dfa557d4e1537c7a58c412c1286a416 # Parent 39f2942fe56bda90d3285b9f2d4e214f0712375f x86/mm: don't treat entirely empty p2m entries as RAM. The AMD IOMMU pagetable-sharing code switched p2m type 0 to be r/w RAM rather than invalid. Be more careful when translating from PTEs to p2m types that we don't treat all-zeros as a RAM mapping of frame zero. Signed-off-by: Tim Deegan <Tim.Deegan@xxxxxxxxxx> --- diff -r 39f2942fe56b -r 4b0692880dfa xen/arch/x86/mm/hap/p2m-ept.c --- a/xen/arch/x86/mm/hap/p2m-ept.c Wed May 04 14:46:32 2011 +0100 +++ b/xen/arch/x86/mm/hap/p2m-ept.c Thu May 05 17:40:34 2011 +0100 @@ -579,8 +579,9 @@ goto out; } - - if ( ept_entry->sa_p2mt != p2m_invalid ) + /* Need to check for all-zeroes because typecode 0 is p2m_ram and an + * entirely empty entry shouldn't have RAM type. */ + if ( ept_entry->epte != 0 && ept_entry->sa_p2mt != p2m_invalid ) { *t = ept_entry->sa_p2mt; *a = ept_entry->access; diff -r 39f2942fe56b -r 4b0692880dfa xen/arch/x86/mm/p2m.c --- a/xen/arch/x86/mm/p2m.c Wed May 04 14:46:32 2011 +0100 +++ b/xen/arch/x86/mm/p2m.c Thu May 05 17:40:34 2011 +0100 @@ -1883,9 +1883,6 @@ p2mt = p2m_flags_to_type(l1e_get_flags(l1e)); ASSERT(l1e_get_pfn(l1e) != INVALID_MFN || !p2m_is_ram(p2mt)); - if ( l1e.l1 == 0 ) - p2mt = p2m_invalid; - if ( p2m_flags_to_type(l1e_get_flags(l1e)) == p2m_populate_on_demand ) { diff -r 39f2942fe56b -r 4b0692880dfa xen/include/asm-x86/p2m.h --- a/xen/include/asm-x86/p2m.h Wed May 04 14:46:32 2011 +0100 +++ b/xen/include/asm-x86/p2m.h Thu May 05 17:40:34 2011 +0100 @@ -381,12 +381,12 @@ { /* Type is stored in the "available" bits */ #ifdef __x86_64__ - /* - * AMD IOMMU: When we share p2m table with iommu, bit 9 - bit 11 will be - * used for iommu hardware to encode next io page level. Bit 59 - bit 62 - * are used for iommu flags, We could not use these bits to store p2m types. - */ - + /* For AMD IOMMUs we need to use type 0 for plain RAM, but we need + * to make sure that an entirely empty PTE doesn't have RAM type */ + if ( flags == 0 ) + return p2m_invalid; + /* AMD IOMMUs use bits 9-11 to encode next io page level and bits + * 59-62 for iommu flags so we can't use them to store p2m type info. */ return (flags >> 12) & 0x7f; #else return (flags >> 9) & 0x7; _______________________________________________ Xen-changelog mailing list Xen-changelog@xxxxxxxxxxxxxxxxxxx http://lists.xensource.com/xen-changelog
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |