xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] xen: arm: zero EL2 pagetable pages before use
@ 2016-03-10 22:00 Shanker Donthineni
  2016-03-11 11:29 ` Jan Beulich
  2016-03-14  7:37 ` Julien Grall
  0 siblings, 2 replies; 10+ messages in thread
From: Shanker Donthineni @ 2016-03-10 22:00 UTC (permalink / raw)
  To: Stefano Stabellini, xen-devel
  Cc: Jan Beulich, Philip Elcan, Shanker Donthineni, Ian Campbell,
	Vikram Sethi

From: Vikram Sethi <vikrams@codeaurora.org>

arch/arm/mm.c has 2 uses of alloc_boot_pages which are used for
pagetables, but the allocated pages are not zeroed. This can cause
crashes on CPUs with aggressive prefetching when they find 'valid'
entries in the page tables but which are really uninitialized.
Memset the allocated pages before use.

Change-Id: I517ca45ca240766dfbf1d6884c044c377babab7d
Signed-off-by: Vikram Sethi <vikrams@codeaurora.org>
Signed-off-by: Shanker Donthineni <shankerd@codeaurora.org>
---
 xen/arch/arm/mm.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/xen/arch/arm/mm.c b/xen/arch/arm/mm.c
index 81f9e2e..215ec93 100644
--- a/xen/arch/arm/mm.c
+++ b/xen/arch/arm/mm.c
@@ -730,6 +730,7 @@ void __init setup_xenheap_mappings(unsigned long base_mfn,
         else
         {
             unsigned long first_mfn = alloc_boot_pages(1, 1);
+            memset(mfn_to_virt(first_mfn), 0, PAGE_SIZE);
             pte = mfn_to_xen_entry(first_mfn, WRITEALLOC);
             pte.pt.table = 1;
             write_pte(p, pte);
@@ -771,6 +772,7 @@ void __init setup_frametable_mappings(paddr_t ps, paddr_t pe)
     nr_second = frametable_size >> SECOND_SHIFT;
     second_base = alloc_boot_pages(nr_second, 1);
     second = mfn_to_virt(second_base);
+    memset(second, 0, nr_second * PAGE_SIZE);
     for ( i = 0; i < nr_second; i++ )
     {
         pte = mfn_to_xen_entry(second_base + i, WRITEALLOC);
-- 
Qualcomm Technologies, Inc. on behalf of Qualcomm Innovation Center, Inc. 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, 
a Linux Foundation Collaborative Project


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2016-03-15 17:37 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-03-10 22:00 [PATCH] xen: arm: zero EL2 pagetable pages before use Shanker Donthineni
2016-03-11 11:29 ` Jan Beulich
2016-03-11 12:56   ` Andrew Cooper
2016-03-11 13:13     ` Jan Beulich
2016-03-11 13:24       ` Andrew Cooper
2016-03-12 16:03         ` Julien Grall
2016-03-14 17:18           ` Shanker Donthineni
2016-03-15 17:37             ` Julien Grall
2016-03-12 14:32   ` Julien Grall
2016-03-14  7:37 ` Julien Grall

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).