From b1abf1299c2f635db21370f989ac9dc2ecbe4189 Mon Sep 17 00:00:00 2001 From: Martin Borg Date: Wed, 9 May 2018 15:29:03 +0200 Subject: boot_time_opt_guest: update guest boot time optimization patches for 4.14 The new patches are based on: https://github.com/clearlinux-pkgs/linux-kvm commit 5a0a30430116735fecb22b269e4ca10a08147d8d Signed-off-by: Martin Borg Signed-off-by: Adrian Dudau --- ...0152-x86-kvm-Notify-host-to-release-pages.patch | 57 +++++++++++----------- 1 file changed, 29 insertions(+), 28 deletions(-) (limited to 'patches/boot_time_opt_guest/0152-x86-kvm-Notify-host-to-release-pages.patch') diff --git a/patches/boot_time_opt_guest/0152-x86-kvm-Notify-host-to-release-pages.patch b/patches/boot_time_opt_guest/0152-x86-kvm-Notify-host-to-release-pages.patch index 5f44930..7197ce7 100644 --- a/patches/boot_time_opt_guest/0152-x86-kvm-Notify-host-to-release-pages.patch +++ b/patches/boot_time_opt_guest/0152-x86-kvm-Notify-host-to-release-pages.patch @@ -1,4 +1,4 @@ -From d28921b5f797829e4e676f7968ae688ef96b7992 Mon Sep 17 00:00:00 2001 +From c08f0e4d768db796098c8bdc64c3358baee076e7 Mon Sep 17 00:00:00 2001 From: Sebastien Boeuf Date: Mon, 23 Jan 2017 15:08:55 -0800 Subject: [PATCH 152/154] x86: kvm: Notify host to release pages @@ -37,15 +37,15 @@ Signed-off-by: Sebastien Boeuf include/uapi/linux/kvm_para.h | 3 +++ kernel/sysctl.c | 7 +++++++ mm/Makefile | 2 +- - mm/kvm.c | 25 +++++++++++++++++++++++++ - 6 files changed, 58 insertions(+), 1 deletion(-) + mm/kvm.c | 26 ++++++++++++++++++++++++++ + 6 files changed, 59 insertions(+), 1 deletion(-) create mode 100644 mm/kvm.c diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c -index 582c75311f95..683a94dd5f03 100644 +index 0e846f0cb83b..7bd380ff8dfa 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c -@@ -46,6 +46,7 @@ +@@ -45,6 +45,7 @@ #include #include #include @@ -53,7 +53,7 @@ index 582c75311f95..683a94dd5f03 100644 #include #include #include -@@ -6019,6 +6020,19 @@ static void kvm_pv_kick_cpu_op(struct kvm *kvm, unsigned long flags, int apicid) +@@ -6206,6 +6207,19 @@ static void kvm_pv_kick_cpu_op(struct kvm *kvm, unsigned long flags, int apicid) kvm_irq_delivery_to_apic(kvm, NULL, &lapic_irq, NULL); } @@ -73,10 +73,10 @@ index 582c75311f95..683a94dd5f03 100644 void kvm_vcpu_deactivate_apicv(struct kvm_vcpu *vcpu) { vcpu->arch.apicv_active = false; -@@ -6065,6 +6079,9 @@ int kvm_emulate_hypercall(struct kvm_vcpu *vcpu) - kvm_pv_kick_cpu_op(vcpu->kvm, a0, a1); - ret = 0; +@@ -6257,6 +6271,9 @@ int kvm_emulate_hypercall(struct kvm_vcpu *vcpu) + ret = kvm_pv_clock_pairing(vcpu, a0, a1); break; + #endif + case KVM_HC_RETURN_MEM: + ret = kvm_pv_return_mem_op(vcpu->kvm, a0, a1); + break; @@ -84,10 +84,10 @@ index 582c75311f95..683a94dd5f03 100644 ret = -KVM_ENOSYS; break; diff --git a/include/linux/mm.h b/include/linux/mm.h -index 925ec25f99a8..833f23d98baa 100644 +index bf52e0498247..d8bcf5c4b996 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h -@@ -2303,6 +2303,11 @@ extern bool process_shares_mm(struct task_struct *p, struct mm_struct *mm); +@@ -2406,6 +2406,11 @@ extern bool process_shares_mm(struct task_struct *p, struct mm_struct *mm); extern int sysctl_drop_caches; int drop_caches_sysctl_handler(struct ctl_table *, int, void __user *, size_t *, loff_t *); @@ -100,13 +100,13 @@ index 925ec25f99a8..833f23d98baa 100644 void drop_slab(void); diff --git a/include/uapi/linux/kvm_para.h b/include/uapi/linux/kvm_para.h -index bf6cd7d5cac2..7d90f77d87d0 100644 +index fed506aeff62..ebc482ce7d38 100644 --- a/include/uapi/linux/kvm_para.h +++ b/include/uapi/linux/kvm_para.h -@@ -23,6 +23,9 @@ - #define KVM_HC_MIPS_GET_CLOCK_FREQ 6 +@@ -25,6 +25,9 @@ #define KVM_HC_MIPS_EXIT_VM 7 #define KVM_HC_MIPS_CONSOLE_OUTPUT 8 + #define KVM_HC_CLOCK_PAIRING 9 +#define KVM_HC_RETURN_MEM 10 + +#define KVM_MAX_RET_MEM_SIZE (1 << 22) // 4MiB @@ -114,10 +114,10 @@ index bf6cd7d5cac2..7d90f77d87d0 100644 /* * hypercalls use architecture specific diff --git a/kernel/sysctl.c b/kernel/sysctl.c -index c1095cdc0fe2..d8ae774fa042 100644 +index 4dfba1a76cc3..771a930cadfa 100644 --- a/kernel/sysctl.c +++ b/kernel/sysctl.c -@@ -1398,6 +1398,13 @@ static struct ctl_table vm_table[] = { +@@ -1387,6 +1387,13 @@ static struct ctl_table vm_table[] = { .extra1 = &one, .extra2 = &four, }, @@ -132,25 +132,26 @@ index c1095cdc0fe2..d8ae774fa042 100644 { .procname = "compact_memory", diff --git a/mm/Makefile b/mm/Makefile -index 295bd7a..6455723 100644 +index 026f6a828a50..28d95bed7e1d 100644 --- a/mm/Makefile +++ b/mm/Makefile -@@ -47,6 +47,8 @@ else - obj-y += bootmem.o - endif +@@ -39,7 +39,7 @@ obj-y := filemap.o mempool.o oom_kill.o \ + mm_init.o mmu_context.o percpu.o slab_common.o \ + compaction.o vmacache.o swap_slots.o \ + interval_tree.o list_lru.o workingset.o \ +- debug.o $(mmu-y) ++ debug.o kvm.o $(mmu-y) + + obj-y += init-mm.o -+obj-y += kvm.o -+ - obj-$(CONFIG_ADVISE_SYSCALLS) += fadvise.o - ifdef CONFIG_MMU - obj-$(CONFIG_ADVISE_SYSCALLS) += madvise.o diff --git a/mm/kvm.c b/mm/kvm.c new file mode 100644 -index 000000000000..8945f6a311b9 +index 000000000000..1c5600788221 --- /dev/null +++ b/mm/kvm.c -@@ -0,0 +1,25 @@ +@@ -0,0 +1,26 @@ +#include ++#include + +int sysctl_kvm_madv_instant_free; + @@ -176,5 +177,5 @@ index 000000000000..8945f6a311b9 + return 0; +} -- -2.12.1 +2.13.2 -- cgit v1.2.3-54-g00ecf