From a519f1a554cdeea7aaddce8cfa177e453a273955 Mon Sep 17 00:00:00 2001 From: "Gary S. Robertson" Date: Mon, 13 Apr 2015 11:31:30 -0500 Subject: KVM:EVENTFD: fix implicit declaration on x86/_64 During compilation for x86 and x86_64, received the following warning: virt/kvm/eventfd.c:493:2: error: implicit declaration of function 'kvm_vcpu_request_scan_ioapic' [-Werror=implicit-function-declaration] kvm_vcpu_request_scan_ioapic(kvm); In the kernel.org linux-stable tree, commit 29f1b65 KVM:EVENTFD: Remove inclusion of irq.h by Christoffer Dall addresses this issue. This backport incudes those portions of that patch which are relevant in the 3.14 tree. Acked-by: Christoffer Dall Signed-off-by: Gary S. Robertson Signed-off-by: Kevin Hilman --- virt/kvm/eventfd.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/virt/kvm/eventfd.c b/virt/kvm/eventfd.c index 0ab1411eb007..ce3ca4c54534 100644 --- a/virt/kvm/eventfd.c +++ b/virt/kvm/eventfd.c @@ -36,6 +36,9 @@ #include #include +#ifdef __KVM_HAVE_IOAPIC +#include "ioapic.h" +#endif #include "iodev.h" #ifdef CONFIG_HAVE_KVM_IRQFD -- cgit v1.2.3 From 69c11a1079700f80424805d8a40dabe436d37b46 Mon Sep 17 00:00:00 2001 From: "Gary S. Robertson" Date: Mon, 13 Apr 2015 11:31:31 -0500 Subject: KVM: VFIO: resolve redeclaration error on x86/_64 Compilation for x86 /x86_64 resulted in the following error: virt/kvm/vfio.c:238:30: error: static declaration of 'kvm_vfio_ops' follows non-static declaration static struct kvm_device_ops kvm_vfio_ops include/linux/kvm_host.h:1057:30: note: previous declaration of 'kvm_vfio_ops' was here extern struct kvm_device_ops kvm_vfio_ops; In the kernel.org linux-stable tree, commit 80ce163 KVM: VFIO: register kvm_device_ops dynamically by Will Deacon includes the removal of the declaration from include/linux/kvm_host.h, but that portion of the change does not seem to have made it into the 3.14 tree - while the rest of that commit does seem to have been backported. This patch resolves that omission to fix the x86 compilation problems. Acked-by: Christoffer Dall Signed-off-by: Gary S. Robertson Signed-off-by: Kevin Hilman --- include/linux/kvm_host.h | 1 - 1 file changed, 1 deletion(-) diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h index 55d75a7cba73..bf933ba17529 100644 --- a/include/linux/kvm_host.h +++ b/include/linux/kvm_host.h @@ -1054,7 +1054,6 @@ int kvm_register_device_ops(struct kvm_device_ops *ops, u32 type); extern struct kvm_device_ops kvm_mpic_ops; extern struct kvm_device_ops kvm_xics_ops; -extern struct kvm_device_ops kvm_vfio_ops; #ifdef CONFIG_HAVE_KVM_CPU_RELAX_INTERCEPT -- cgit v1.2.3 From 1dcd9896384ec3fe5c75829701d9babec7fe0d25 Mon Sep 17 00:00:00 2001 From: Mark Rutland Date: Thu, 15 Jan 2015 16:42:14 +0000 Subject: arm64: respect mem= for EFI When booting with EFI, we acquire the EFI memory map after parsing the early params. This unfortuantely renders the option useless as we call memblock_enforce_memory_limit (which uses memblock_remove_range behind the scenes) before we've added any memblocks. We end up removing nothing, then adding all of memory later when efi_init calls reserve_regions. Instead, we can log the limit and apply this later when we do the rest of the memblock work in memblock_init, which should work regardless of the presence of EFI. At the same time we may as well move the early parameter into arm64's mm/init.c, close to arm64_memblock_init. Any memory which must be mapped (e.g. for use by EFI runtime services) must be mapped explicitly reather than relying on the linear mapping, which may be truncated as a result of a mem= option passed on the kernel command line. Signed-off-by: Mark Rutland Acked-by: Catalin Marinas Acked-by: Ard Biesheuvel Tested-by: Ard Biesheuvel Cc: Leif Lindholm Cc: Will Deacon Signed-off-by: Catalin Marinas (cherry picked from commit 6083fe74b7bfffc2c7be8c711596608bda0cda6e) Signed-off-by: Alex Shi --- arch/arm64/kernel/setup.c | 19 ------------------- arch/arm64/mm/init.c | 19 +++++++++++++++++++ 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/arch/arm64/kernel/setup.c b/arch/arm64/kernel/setup.c index 90c4c129f71a..dff33006322b 100644 --- a/arch/arm64/kernel/setup.c +++ b/arch/arm64/kernel/setup.c @@ -310,25 +310,6 @@ static void __init setup_machine_fdt(phys_addr_t dt_phys) } } -/* - * Limit the memory size that was specified via FDT. - */ -static int __init early_mem(char *p) -{ - phys_addr_t limit; - - if (!p) - return 1; - - limit = memparse(p, &p) & PAGE_MASK; - pr_notice("Memory limited to %lldMB\n", limit >> 20); - - memblock_enforce_memory_limit(limit); - - return 0; -} -early_param("mem", early_mem); - static void __init request_standard_resources(void) { struct memblock_region *region; diff --git a/arch/arm64/mm/init.c b/arch/arm64/mm/init.c index cc3339d0a276..2d8f884d7f92 100644 --- a/arch/arm64/mm/init.c +++ b/arch/arm64/mm/init.c @@ -124,10 +124,29 @@ static void arm64_memory_present(void) } #endif +static phys_addr_t memory_limit = (phys_addr_t)ULLONG_MAX; + +/* + * Limit the memory size that was specified via FDT. + */ +static int __init early_mem(char *p) +{ + if (!p) + return 1; + + memory_limit = memparse(p, &p) & PAGE_MASK; + pr_notice("Memory limited to %lldMB\n", memory_limit >> 20); + + return 0; +} +early_param("mem", early_mem); + void __init arm64_memblock_init(void) { u64 *reserve_map, base, size; + memblock_enforce_memory_limit(memory_limit); + /* * Register the kernel text, kernel data, initrd, and initial * pagetables with memblock. -- cgit v1.2.3