From 0aa684b508ebe97a486de9ec2892120e9697163d Mon Sep 17 00:00:00 2001 From: Jan Beulich Date: Tue, 24 Nov 2015 17:40:18 +0100 Subject: [PATCH 1/2] x86: drop MAX_APICID It's unused and wrong (we already have MAX_LOCAL_APIC and MAX_APICS). Signed-off-by: Jan Beulich Reviewed-by: Andrew Cooper --- xen/include/asm-x86/smp.h | 1 - 1 file changed, 1 deletion(-) diff --git a/xen/include/asm-x86/smp.h b/xen/include/asm-x86/smp.h index 64f510b6ba..33c2c32f42 100644 --- a/xen/include/asm-x86/smp.h +++ b/xen/include/asm-x86/smp.h @@ -37,7 +37,6 @@ extern void (*mtrr_hook) (void); extern void zap_low_mappings(void); -#define MAX_APICID 256 extern u32 x86_cpu_to_apicid[]; #define cpu_physical_id(cpu) x86_cpu_to_apicid[cpu] From 9cf5f0affcab74a93e0beb9e64ade446d7d23e1b Mon Sep 17 00:00:00 2001 From: Andrew Cooper Date: Tue, 24 Nov 2015 17:41:04 +0100 Subject: [PATCH 2/2] x86/kexec: hide more kexec infrastructure behind CONFIG_KEXEC Experimenting with the kconfig series showed that various bits of kexec infrastructure were still being unconditionally included. Make them conditional on CONFIG_KEXEC. Signed-off-by: Andrew Cooper Reviewed-by: David Vrabel --- xen/arch/x86/x86_64/Makefile | 4 ++-- xen/arch/x86/xen.lds.S | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/xen/arch/x86/x86_64/Makefile b/xen/arch/x86/x86_64/Makefile index d5af722421..5b54c16d09 100644 --- a/xen/arch/x86/x86_64/Makefile +++ b/xen/arch/x86/x86_64/Makefile @@ -3,7 +3,7 @@ subdir-y += compat obj-bin-y += entry.o obj-bin-y += gpr_switch.o obj-y += traps.o -obj-y += machine_kexec.o +obj-$(CONFIG_KEXEC) += machine_kexec.o obj-y += pci.o obj-y += acpi_mmcfg.o obj-y += mmconf-fam10h.o @@ -12,6 +12,6 @@ obj-y += mmconfig-shared.o obj-y += domain.o obj-y += cpu_idle.o obj-y += cpufreq.o -obj-bin-y += kexec_reloc.o +obj-bin-$(CONFIG_KEXEC) += kexec_reloc.o obj-$(crash_debug) += gdbstub.o diff --git a/xen/arch/x86/xen.lds.S b/xen/arch/x86/xen.lds.S index 6553cff56f..e18e08fc5a 100644 --- a/xen/arch/x86/xen.lds.S +++ b/xen/arch/x86/xen.lds.S @@ -220,5 +220,9 @@ SECTIONS ASSERT(__image_base__ > XEN_VIRT_START || _end <= XEN_VIRT_END - NR_CPUS * PAGE_SIZE, "Xen image overlaps stubs area") + +#ifdef CONFIG_KEXEC ASSERT(kexec_reloc_size - kexec_reloc <= PAGE_SIZE, "kexec_reloc is too large") +#endif + ASSERT((cpu0_stack & (STACK_SIZE - 1)) == 0, "cpu0_stack misaligned")