From: Greg Kroah-Hartman Date: Mon, 15 May 2017 09:02:05 +0000 (+0200) Subject: 4.10-stable patches X-Git-Tag: v3.18.54~45 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=7e92d8f659ac72e94a4933cab70bcfe9fdf1035a;p=thirdparty%2Fkernel%2Fstable-queue.git 4.10-stable patches added patches: xen-adjust-early-dom0-p2m-handling-to-xen-hypervisor-behavior.patch --- diff --git a/queue-3.18/series b/queue-3.18/series new file mode 100644 index 00000000000..e69de29bb2d diff --git a/queue-4.10/series b/queue-4.10/series new file mode 100644 index 00000000000..ca0ac415f0b --- /dev/null +++ b/queue-4.10/series @@ -0,0 +1 @@ +xen-adjust-early-dom0-p2m-handling-to-xen-hypervisor-behavior.patch diff --git a/queue-4.10/xen-adjust-early-dom0-p2m-handling-to-xen-hypervisor-behavior.patch b/queue-4.10/xen-adjust-early-dom0-p2m-handling-to-xen-hypervisor-behavior.patch new file mode 100644 index 00000000000..97ae8dc38aa --- /dev/null +++ b/queue-4.10/xen-adjust-early-dom0-p2m-handling-to-xen-hypervisor-behavior.patch @@ -0,0 +1,58 @@ +From 69861e0a52f8733355ce246f0db15e1b240ad667 Mon Sep 17 00:00:00 2001 +From: Juergen Gross +Date: Wed, 10 May 2017 06:08:44 +0200 +Subject: xen: adjust early dom0 p2m handling to xen hypervisor behavior + +From: Juergen Gross + +commit 69861e0a52f8733355ce246f0db15e1b240ad667 upstream. + +When booted as pv-guest the p2m list presented by the Xen is already +mapped to virtual addresses. In dom0 case the hypervisor might make use +of 2M- or 1G-pages for this mapping. Unfortunately while being properly +aligned in virtual and machine address space, those pages might not be +aligned properly in guest physical address space. + +So when trying to obtain the guest physical address of such a page +pud_pfn() and pmd_pfn() must be avoided as those will mask away guest +physical address bits not being zero in this special case. + +Signed-off-by: Juergen Gross +Reviewed-by: Jan Beulich +Signed-off-by: Juergen Gross +Signed-off-by: Greg Kroah-Hartman + +--- + arch/x86/xen/mmu.c | 7 ++++--- + 1 file changed, 4 insertions(+), 3 deletions(-) + +--- a/arch/x86/xen/mmu.c ++++ b/arch/x86/xen/mmu.c +@@ -2028,7 +2028,8 @@ static unsigned long __init xen_read_phy + + /* + * Translate a virtual address to a physical one without relying on mapped +- * page tables. ++ * page tables. Don't rely on big pages being aligned in (guest) physical ++ * space! + */ + static phys_addr_t __init xen_early_virt_to_phys(unsigned long vaddr) + { +@@ -2049,7 +2050,7 @@ static phys_addr_t __init xen_early_virt + sizeof(pud))); + if (!pud_present(pud)) + return 0; +- pa = pud_pfn(pud) << PAGE_SHIFT; ++ pa = pud_val(pud) & PTE_PFN_MASK; + if (pud_large(pud)) + return pa + (vaddr & ~PUD_MASK); + +@@ -2057,7 +2058,7 @@ static phys_addr_t __init xen_early_virt + sizeof(pmd))); + if (!pmd_present(pmd)) + return 0; +- pa = pmd_pfn(pmd) << PAGE_SHIFT; ++ pa = pmd_val(pmd) & PTE_PFN_MASK; + if (pmd_large(pmd)) + return pa + (vaddr & ~PMD_MASK); + diff --git a/queue-4.11/series b/queue-4.11/series new file mode 100644 index 00000000000..ca0ac415f0b --- /dev/null +++ b/queue-4.11/series @@ -0,0 +1 @@ +xen-adjust-early-dom0-p2m-handling-to-xen-hypervisor-behavior.patch diff --git a/queue-4.4/series b/queue-4.4/series new file mode 100644 index 00000000000..ca0ac415f0b --- /dev/null +++ b/queue-4.4/series @@ -0,0 +1 @@ +xen-adjust-early-dom0-p2m-handling-to-xen-hypervisor-behavior.patch diff --git a/queue-4.9/series b/queue-4.9/series new file mode 100644 index 00000000000..ca0ac415f0b --- /dev/null +++ b/queue-4.9/series @@ -0,0 +1 @@ +xen-adjust-early-dom0-p2m-handling-to-xen-hypervisor-behavior.patch