Skip to content

Commit 19a519c

Browse files
committed
Merge tag 'for-linus-6.12-rc1-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip
Pull xen updates from Juergen Gross: - fix a boot problem as a Xen dom0 on some AMD systems - fix Xen PVH boot problems with KASAN enabled - fix for a build warning - fixes to swiotlb-xen * tag 'for-linus-6.12-rc1-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip: xen/swiotlb: fix allocated size xen/swiotlb: add alignment check for dma buffers xen/pci: Avoid -Wflex-array-member-not-at-end warning xen/xenbus: Convert to use ERR_CAST() xen, pvh: fix unbootable VMs by inlining memset() in xen_prepare_pvh() x86/cpu: fix unbootable VMs by inlining memcmp() in hypervisor_cpuid_base() xen, pvh: fix unbootable VMs (PVH + KASAN - AMD_MEM_ENCRYPT) xen: tolerate ACPI NVS memory overlapping with Xen allocated memory xen: allow mapping ACPI data using a different physical address xen: add capability to remap non-RAM pages to different PFNs xen: move max_pfn in xen_memory_setup() out of function scope xen: move checks for e820 conflicts further up xen: introduce generic helper checking for memory map conflicts xen: use correct end address of kernel for conflict checking
2 parents 1d7bb2b + c3dea3d commit 19a519c

File tree

16 files changed

+312
-66
lines changed

16 files changed

+312
-66
lines changed

arch/x86/include/asm/acpi.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,14 @@ void acpi_generic_reduced_hw_init(void);
174174
void x86_default_set_root_pointer(u64 addr);
175175
u64 x86_default_get_root_pointer(void);
176176

177+
#ifdef CONFIG_XEN_PV
178+
/* A Xen PV domain needs a special acpi_os_ioremap() handling. */
179+
extern void __iomem * (*acpi_os_ioremap)(acpi_physical_address phys,
180+
acpi_size size);
181+
void __iomem *x86_acpi_os_ioremap(acpi_physical_address phys, acpi_size size);
182+
#define acpi_os_ioremap acpi_os_ioremap
183+
#endif
184+
177185
#else /* !CONFIG_ACPI */
178186

179187
#define acpi_lapic 0

arch/x86/include/asm/cpuid.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,12 @@ static inline uint32_t hypervisor_cpuid_base(const char *sig, uint32_t leaves)
196196
for_each_possible_hypervisor_cpuid_base(base) {
197197
cpuid(base, &eax, &signature[0], &signature[1], &signature[2]);
198198

199-
if (!memcmp(sig, signature, 12) &&
199+
/*
200+
* This must not compile to "call memcmp" because it's called
201+
* from PVH early boot code before instrumentation is set up
202+
* and memcmp() itself may be instrumented.
203+
*/
204+
if (!__builtin_memcmp(sig, signature, 12) &&
200205
(leaves == 0 || ((eax - base) >= leaves)))
201206
return base;
202207
}

arch/x86/kernel/acpi/boot.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1778,3 +1778,14 @@ u64 x86_default_get_root_pointer(void)
17781778
{
17791779
return boot_params.acpi_rsdp_addr;
17801780
}
1781+
1782+
#ifdef CONFIG_XEN_PV
1783+
void __iomem *x86_acpi_os_ioremap(acpi_physical_address phys, acpi_size size)
1784+
{
1785+
return ioremap_cache(phys, size);
1786+
}
1787+
1788+
void __iomem * (*acpi_os_ioremap)(acpi_physical_address phys, acpi_size size) =
1789+
x86_acpi_os_ioremap;
1790+
EXPORT_SYMBOL_GPL(acpi_os_ioremap);
1791+
#endif

arch/x86/kernel/jailhouse.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
#include <linux/kernel.h>
1313
#include <linux/reboot.h>
1414
#include <linux/serial_8250.h>
15+
#include <linux/acpi.h>
1516
#include <asm/apic.h>
1617
#include <asm/io_apic.h>
1718
#include <asm/acpi.h>

arch/x86/kernel/mmconf-fam10h_64.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#include <linux/pci.h>
1010
#include <linux/dmi.h>
1111
#include <linux/range.h>
12+
#include <linux/acpi.h>
1213

1314
#include <asm/pci-direct.h>
1415
#include <linux/sort.h>

arch/x86/kernel/smpboot.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@
6060
#include <linux/stackprotector.h>
6161
#include <linux/cpuhotplug.h>
6262
#include <linux/mc146818rtc.h>
63+
#include <linux/acpi.h>
6364

6465
#include <asm/acpi.h>
6566
#include <asm/cacheinfo.h>

arch/x86/kernel/x86_init.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
#include <linux/ioport.h>
99
#include <linux/export.h>
1010
#include <linux/pci.h>
11+
#include <linux/acpi.h>
1112

1213
#include <asm/acpi.h>
1314
#include <asm/bios_ebda.h>

arch/x86/platform/pvh/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# SPDX-License-Identifier: GPL-2.0
22
OBJECT_FILES_NON_STANDARD_head.o := y
3+
KASAN_SANITIZE := n
34

45
obj-$(CONFIG_PVH) += enlighten.o
56
obj-$(CONFIG_PVH) += head.o

arch/x86/platform/pvh/enlighten.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,11 @@ void __init xen_prepare_pvh(void)
130130
BUG();
131131
}
132132

133-
memset(&pvh_bootparams, 0, sizeof(pvh_bootparams));
133+
/*
134+
* This must not compile to "call memset" because memset() may be
135+
* instrumented.
136+
*/
137+
__builtin_memset(&pvh_bootparams, 0, sizeof(pvh_bootparams));
134138

135139
hypervisor_specific_init(xen_guest);
136140

arch/x86/xen/mmu_pv.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2018,10 +2018,7 @@ void __init xen_reserve_special_pages(void)
20182018

20192019
void __init xen_pt_check_e820(void)
20202020
{
2021-
if (xen_is_e820_reserved(xen_pt_base, xen_pt_size)) {
2022-
xen_raw_console_write("Xen hypervisor allocated page table memory conflicts with E820 map\n");
2023-
BUG();
2024-
}
2021+
xen_chk_is_e820_usable(xen_pt_base, xen_pt_size, "page table");
20252022
}
20262023

20272024
static unsigned char dummy_mapping[PAGE_SIZE] __page_aligned_bss;

0 commit comments

Comments
 (0)