* [PATCH] xen: correct bug in p2m list initialization
@ 2015-02-27 14:45 Juergen Gross
2015-02-27 14:54 ` David Vrabel
0 siblings, 1 reply; 3+ messages in thread
From: Juergen Gross @ 2015-02-27 14:45 UTC (permalink / raw)
To: linux-kernel, xen-devel, konrad.wilk, david.vrabel,
boris.ostrovsky, stefan.bader
Cc: Juergen Gross, stable
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.
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>
---
arch/x86/xen/p2m.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/x86/xen/p2m.c b/arch/x86/xen/p2m.c
index 740ae30..9f93af5 100644
--- a/arch/x86/xen/p2m.c
+++ b/arch/x86/xen/p2m.c
@@ -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);
--
2.1.4
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH] xen: correct bug in p2m list initialization
2015-02-27 14:45 [PATCH] xen: correct bug in p2m list initialization Juergen Gross
@ 2015-02-27 14:54 ` David Vrabel
0 siblings, 0 replies; 3+ messages in thread
From: David Vrabel @ 2015-02-27 14:54 UTC (permalink / raw)
To: Juergen Gross, linux-kernel, xen-devel, konrad.wilk,
boris.ostrovsky, stefan.bader
On 27/02/15 14:45, Juergen Gross wrote:
> 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.
Applied to stable/for-linus-4.0, thanks.
David
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH] xen: correct bug in p2m list initialization
@ 2015-02-27 14:54 ` David Vrabel
0 siblings, 0 replies; 3+ messages in thread
From: David Vrabel @ 2015-02-27 14:54 UTC (permalink / raw)
To: Juergen Gross, linux-kernel, xen-devel, konrad.wilk,
boris.ostrovsky, stefan.bader
On 27/02/15 14:45, Juergen Gross wrote:
> 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.
Applied to stable/for-linus-4.0, thanks.
David
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2015-02-27 14:57 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-02-27 14:45 [PATCH] xen: correct bug in p2m list initialization Juergen Gross
2015-02-27 14:54 ` David Vrabel
2015-02-27 14:54 ` David Vrabel
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.