a4d1d9fe03
bnc#828623 - bnc#839596 - VUL-0: CVE-2013-1442: XSA-62: xen: Information leak on AVX and/or LWP capable CPUs 5242a1b5-x86-xsave-initialize-extended-register-state-when-guests-enable-it.patch - bnc#840592 - VUL-0: CVE-2013-4355: XSA-63: xen: Information leaks through I/O instruction emulation CVE-2013-4355-xsa63.patch - bnc#840593 - VUL-0: CVE-2013-4356: XSA-64: xen: Memory accessible by 64-bit PV guests under live migration CVE-2013-4356-xsa64.patch - bnc#841766 - VUL-1: CVE-2013-4361: XSA-66: xen: Information leak through fbld instruction emulation CVE-2013-4361-xsa66.patch - bnc#833796 - L3: Xen: migration broken from xsave-capable to xsave-incapable host 52205e27-x86-xsave-initialization-improvements.patch 522dc0e6-x86-xsave-fix-migration-from-xsave-capable-to-xsave-incapable-host.patch - bnc#839600 - [HP BCS SLES11 Bug]: In HP’s UEFI x86_64 platform and sles11sp3 with xen environment, xen hypervisor will panic on multiple blades nPar. 523172d5-x86-fix-memory-cut-off-when-using-PFN-compression.patch - bnc#833251 - [HP BCS SLES11 Bug]: In HP’s UEFI x86_64 platform and with xen environment, in booting stage ,xen hypervisor will panic. 522d896b-x86-EFI-properly-handle-run-time-memory-regions-outside-the-1-1-map.patch - bnc#834751 - [HP BCS SLES11 Bug]: In xen, “shutdown –y 0 –h” cannot power off system 522d896b-x86-EFI-properly-handle-run-time-memory-regions-outside-the-1-1-map.patch OBS-URL: https://build.opensuse.org/package/show/Virtualization/xen?expand=0&rev=274
117 lines
4.5 KiB
Diff
117 lines
4.5 KiB
Diff
References: bnc#839600
|
|
|
|
# Commit 8efce9d69998a3d3c720ac7dbdb9b7e240369957
|
|
# Date 2013-09-12 09:52:53 +0200
|
|
# Author Jan Beulich <jbeulich@suse.com>
|
|
# Committer Jan Beulich <jbeulich@suse.com>
|
|
x86: fix memory cut-off when using PFN compression
|
|
|
|
For one setup_max_pdx(), when invoked a second time (after SRAT got
|
|
parsed), needs to start from the original max_page value again (using
|
|
the already adjusted one from the first invocation would not allow the
|
|
cut-off boundary to be moved up).
|
|
|
|
Second, _if_ we need to cut off some part of memory, we must not allow
|
|
this to also propagate into the NUMA accounting. Otherwise
|
|
cutoff_node() results in nodes_cover_memory() to find some parts of
|
|
memory apparently not having a PXM association, causing all SRAT info
|
|
to be ignored.
|
|
|
|
The only possibly problematic consumer of node_spanned_pages (the
|
|
meaning of which gets altered here in that it now also includes memory
|
|
Xen can't actively make use of) is XEN_SYSCTL_numainfo: At a first
|
|
glance the potentially larger reported memory size shouldn't confuse
|
|
tool stacks.
|
|
|
|
And finally we must not put our boot time modules at addresses which
|
|
(at that time) can't be guaranteed to be accessible later. This applies
|
|
to both the EFI boot loader and the module relocation code.
|
|
|
|
Signed-off-by: Jan Beulich <jbeulich@suse.com>
|
|
Acked-by: Keir Fraser <keir@xen.org>
|
|
Acked-by: Dario Faggioli <dario.faggioli@citrix.com>
|
|
|
|
--- a/xen/arch/x86/efi/boot.c
|
|
+++ b/xen/arch/x86/efi/boot.c
|
|
@@ -459,7 +459,8 @@ static bool_t __init read_file(EFI_FILE_
|
|
what = what ?: L"Seek";
|
|
else
|
|
{
|
|
- file->addr = (EFI_PHYSICAL_ADDRESS)1 << (32 + PAGE_SHIFT);
|
|
+ file->addr = min(1UL << (32 + PAGE_SHIFT),
|
|
+ HYPERVISOR_VIRT_END - DIRECTMAP_VIRT_START);
|
|
ret = efi_bs->AllocatePages(AllocateMaxAddress, EfiLoaderData,
|
|
PFN_UP(size), &file->addr);
|
|
}
|
|
--- a/xen/arch/x86/setup.c
|
|
+++ b/xen/arch/x86/setup.c
|
|
@@ -377,9 +377,9 @@ static uint64_t __init consider_modules(
|
|
return e;
|
|
}
|
|
|
|
-static void __init setup_max_pdx(void)
|
|
+static void __init setup_max_pdx(unsigned long top_page)
|
|
{
|
|
- max_pdx = pfn_to_pdx(max_page - 1) + 1;
|
|
+ max_pdx = pfn_to_pdx(top_page - 1) + 1;
|
|
|
|
if ( max_pdx > (DIRECTMAP_SIZE >> PAGE_SHIFT) )
|
|
max_pdx = DIRECTMAP_SIZE >> PAGE_SHIFT;
|
|
@@ -547,7 +547,7 @@ void __init __start_xen(unsigned long mb
|
|
unsigned int initrdidx;
|
|
multiboot_info_t *mbi = __va(mbi_p);
|
|
module_t *mod = (module_t *)__va(mbi->mods_addr);
|
|
- unsigned long nr_pages, modules_headroom, *module_map;
|
|
+ unsigned long nr_pages, raw_max_page, modules_headroom, *module_map;
|
|
int i, j, e820_warn = 0, bytes = 0;
|
|
bool_t acpi_boot_table_init_done = 0;
|
|
struct ns16550_defaults ns16550 = {
|
|
@@ -751,7 +751,7 @@ void __init __start_xen(unsigned long mb
|
|
}
|
|
|
|
/* Sanitise the raw E820 map to produce a final clean version. */
|
|
- max_page = init_e820(memmap_type, e820_raw, &e820_raw_nr);
|
|
+ max_page = raw_max_page = init_e820(memmap_type, e820_raw, &e820_raw_nr);
|
|
|
|
/* Create a temporary copy of the E820 map. */
|
|
memcpy(&boot_e820, &e820, sizeof(e820));
|
|
@@ -820,7 +820,10 @@ void __init __start_xen(unsigned long mb
|
|
(end - s) >> PAGE_SHIFT, PAGE_HYPERVISOR);
|
|
}
|
|
|
|
- e = min_t(uint64_t, e, 1ULL << (PAGE_SHIFT + 32));
|
|
+ if ( e > min(HYPERVISOR_VIRT_END - DIRECTMAP_VIRT_START,
|
|
+ 1UL << (PAGE_SHIFT + 32)) )
|
|
+ e = min(HYPERVISOR_VIRT_END - DIRECTMAP_VIRT_START,
|
|
+ 1UL << (PAGE_SHIFT + 32));
|
|
#define reloc_size ((__pa(&_end) + mask) & ~mask)
|
|
/* Is the region suitable for relocating Xen? */
|
|
if ( !xen_phys_start && e <= limit )
|
|
@@ -969,7 +972,7 @@ void __init __start_xen(unsigned long mb
|
|
/* Late kexec reservation (dynamic start address). */
|
|
kexec_reserve_area(&boot_e820);
|
|
|
|
- setup_max_pdx();
|
|
+ setup_max_pdx(raw_max_page);
|
|
if ( highmem_start )
|
|
xenheap_max_mfn(PFN_DOWN(highmem_start));
|
|
|
|
@@ -995,7 +998,7 @@ void __init __start_xen(unsigned long mb
|
|
{
|
|
acpi_boot_table_init_done = 1;
|
|
srat_parse_regions(s);
|
|
- setup_max_pdx();
|
|
+ setup_max_pdx(raw_max_page);
|
|
}
|
|
|
|
if ( pfn_to_pdx((e - 1) >> PAGE_SHIFT) >= max_pdx )
|
|
@@ -1133,7 +1136,7 @@ void __init __start_xen(unsigned long mb
|
|
|
|
acpi_numa_init();
|
|
|
|
- numa_initmem_init(0, max_page);
|
|
+ numa_initmem_init(0, raw_max_page);
|
|
|
|
end_boot_allocator();
|
|
system_state = SYS_STATE_boot;
|