Skip to content

Commit

Permalink
x86/xen: correct bug in p2m list initialization
Browse files Browse the repository at this point in the history
Commit 054954e ("xen: switch to
linear virtual mapped sparse p2m list") introduced an error.

During initialization of the p2m list a p2m identity area mapped by
a complete identity pmd entry has to be split up into smaller chunks
sometimes, if a non-identity pfn is introduced in this area.

If this non-identity pfn is not at index 0 of a p2m page the new
p2m page needed is initialized with wrong identity entries, as the
identity pfns don't start with the value corresponding to index 0,
but with the initial non-identity pfn. This results in weird wrong
mappings.

Correct the wrong initialization by starting with the correct pfn.

Cc: stable@vger.kernel.org # 3.19
Reported-by: Stefan Bader <stefan.bader@canonical.com>
Signed-off-by: Juergen Gross <jgross@suse.com>
Tested-by: Stefan Bader <stefan.bader@canonical.com>
Signed-off-by: David Vrabel <david.vrabel@citrix.com>
  • Loading branch information
Juergen Gross authored and David Vrabel committed Feb 27, 2015
1 parent 5054daa commit b8f05c8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion arch/x86/xen/p2m.c
Original file line number Diff line number Diff line change
@@ -563,7 +563,7 @@ static bool alloc_p2m(unsigned long pfn)
if (p2m_pfn == PFN_DOWN(__pa(p2m_missing)))
p2m_init(p2m);
else
p2m_init_identity(p2m, pfn);
p2m_init_identity(p2m, pfn & ~(P2M_PER_PAGE - 1));

spin_lock_irqsave(&p2m_update_lock, flags);

0 comments on commit b8f05c8

Please sign in to comment.