x86/xen: correct bug in p2m list initialization
authorJuergen Gross <jgross@suse.com>
Fri, 27 Feb 2015 14:45:29 +0000 (15:45 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 26 Mar 2015 12:59:46 +0000 (13:59 +0100)
commit3d60a2bc53f2ba4c4bcf889d0c10841c4c702bac
tree562b644448266b48a43660831194064692424c04
parent952b4fea79c26dcec36676d83c8b908c7b150e68
x86/xen: correct bug in p2m list initialization

commit b8f05c8803fce899d79ca66f8d7f348cf15fb40e upstream.

Commit 054954eb051f35e74b75a566a96fe756015352c8 ("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.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/x86/xen/p2m.c