97a0425e04
xen-4.5.1-testing-src.tar.bz2 - Dropped patches now contained in tarball 556c2cf2-x86-don-t-crash-mapping-a-page-using-EFI-rt-page-tables.patch 556d9718-efi-fix-allocation-problems-if-ExitBootServices-fails.patch 556eabf7-x86-apic-Disable-the-LAPIC-later-in-smp_send_stop.patch 556eac15-x86-crash-don-t-use-set_fixmap-in-the-crash-path.patch 55780aaa-efi-avoid-calling-boot-services-after-ExitBootServices.patch 55780aff-x86-EFI-fix-EFI_MEMORY_WP-handling.patch 55780b43-EFI-early-add-mapbs-to-map-EfiBootServices-Code-Data.patch 55780b97-EFI-support-default-attributes-to-map-Runtime-service-areas.patch - Replace 5124efbe-add-qxl-support.patch with the variant that finally made it upstream, 554cc211-libxl-add-qxl.patch - bsc#931627 - VUL-0: CVE-2015-4105: XSA-130: xen: Guest triggerable qemu MSI-X pass-through error messages qemu-MSI-X-latch-writes.patch - bsc#907514 - Bus fatal error & sles12 sudden reboot has been observed - bsc#910258 - SLES12 Xen host crashes with FATAL NMI after shutdown of guest with VT-d NIC - bsc#918984 - Bus fatal error & sles11-SP4 sudden reboot has been observed - bsc#923967 - Partner-L3: Bus fatal error & sles11-SP3 sudden reboot has been observed x86-MSI-X-teardown.patch x86-MSI-X-enable.patch x86-MSI-X-guest-mask.patch x86-MSI-X-maskall.patch qemu-MSI-X-enable-maskall.patch OBS-URL: https://build.opensuse.org/package/show/Virtualization/xen?expand=0&rev=364
87 lines
3.6 KiB
Diff
87 lines
3.6 KiB
Diff
# Commit 860313f0411d2dcc6b2fd78bfb834b39d05373a6
|
|
# Date 2015-06-10 12:05:21 +0200
|
|
# Author Jan Beulich <jbeulich@suse.com>
|
|
# Committer Jan Beulich <jbeulich@suse.com>
|
|
x86/EFI: adjust EFI_MEMORY_WP handling for spec version 2.5
|
|
|
|
That flag now means cachability rather than protection, and a new flag
|
|
EFI_MEMORY_RO got added in its place.
|
|
|
|
Along with EFI_MEMORY_RO also add the two other new EFI_MEMORY_*
|
|
definitions, even if we don't need them right away.
|
|
|
|
Signed-off-by: Jan Beulich <jbeulich@suse.com>
|
|
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
|
|
Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
|
|
|
|
Index: xen-4.5.1-testing/xen/common/efi/boot.c
|
|
===================================================================
|
|
--- xen-4.5.1-testing.orig/xen/common/efi/boot.c
|
|
+++ xen-4.5.1-testing/xen/common/efi/boot.c
|
|
@@ -32,6 +32,8 @@
|
|
/* Using SetVirtualAddressMap() is incompatible with kexec: */
|
|
#undef USE_SET_VIRTUAL_ADDRESS_MAP
|
|
|
|
+#define EFI_REVISION(major, minor) (((major) << 16) | (minor))
|
|
+
|
|
#define SHIM_LOCK_PROTOCOL_GUID \
|
|
{ 0x605dab50, 0xe046, 0x4300, {0xab, 0xb6, 0x3d, 0xd8, 0x10, 0xdd, 0x8b, 0x23} }
|
|
|
|
@@ -76,6 +78,7 @@ static int set_color(u32 mask, int bpp,
|
|
static bool_t match_guid(const EFI_GUID *guid1, const EFI_GUID *guid2);
|
|
|
|
static const EFI_BOOT_SERVICES *__initdata efi_bs;
|
|
+static UINT32 __initdata efi_bs_revision;
|
|
static EFI_HANDLE __initdata efi_ih;
|
|
|
|
static SIMPLE_TEXT_OUTPUT_INTERFACE *__initdata StdOut;
|
|
@@ -714,6 +717,7 @@ efi_start(EFI_HANDLE ImageHandle, EFI_SY
|
|
|
|
efi_ih = ImageHandle;
|
|
efi_bs = SystemTable->BootServices;
|
|
+ efi_bs_revision = efi_bs->Hdr.Revision;
|
|
efi_rs = SystemTable->RuntimeServices;
|
|
efi_ct = SystemTable->ConfigurationTable;
|
|
efi_num_ct = SystemTable->NumberOfTableEntries;
|
|
@@ -1221,6 +1225,9 @@ void __init efi_init_memory(void)
|
|
prot |= _PAGE_PAT | MAP_SMALL_PAGES;
|
|
else if ( desc->Attribute & (EFI_MEMORY_UC | EFI_MEMORY_UCE) )
|
|
prot |= _PAGE_PWT | _PAGE_PCD | MAP_SMALL_PAGES;
|
|
+ else if ( efi_bs_revision >= EFI_REVISION(2, 5) &&
|
|
+ (desc->Attribute & EFI_MEMORY_WP) )
|
|
+ prot |= _PAGE_PAT | _PAGE_PWT | MAP_SMALL_PAGES;
|
|
else
|
|
{
|
|
printk(XENLOG_ERR "Unknown cachability for MFNs %#lx-%#lx%s\n",
|
|
@@ -1230,7 +1237,8 @@ void __init efi_init_memory(void)
|
|
prot |= _PAGE_PWT | _PAGE_PCD | MAP_SMALL_PAGES;
|
|
}
|
|
|
|
- if ( desc->Attribute & EFI_MEMORY_WP )
|
|
+ if ( desc->Attribute & (efi_bs_revision < EFI_REVISION(2, 5)
|
|
+ ? EFI_MEMORY_WP : EFI_MEMORY_RO) )
|
|
prot &= ~_PAGE_RW;
|
|
if ( (desc->Attribute & EFI_MEMORY_XP) && cpu_has_nx )
|
|
prot |= _PAGE_NX_BIT;
|
|
Index: xen-4.5.1-testing/xen/include/efi/efidef.h
|
|
===================================================================
|
|
--- xen-4.5.1-testing.orig/xen/include/efi/efidef.h
|
|
+++ xen-4.5.1-testing/xen/include/efi/efidef.h
|
|
@@ -156,11 +156,15 @@ typedef enum {
|
|
#define EFI_MEMORY_WT 0x0000000000000004
|
|
#define EFI_MEMORY_WB 0x0000000000000008
|
|
#define EFI_MEMORY_UCE 0x0000000000000010
|
|
+#define EFI_MEMORY_WP 0x0000000000001000
|
|
|
|
// physical memory protection on range
|
|
-#define EFI_MEMORY_WP 0x0000000000001000
|
|
#define EFI_MEMORY_RP 0x0000000000002000
|
|
#define EFI_MEMORY_XP 0x0000000000004000
|
|
+#define EFI_MEMORY_RO 0x0000000000020000
|
|
+
|
|
+#define EFI_MEMORY_NV 0x0000000000008000
|
|
+#define EFI_MEMORY_MORE_RELIABLE 0x0000000000010000
|
|
|
|
// range requires a runtime mapping
|
|
#define EFI_MEMORY_RUNTIME 0x8000000000000000
|