From 38eafc18fdbe6c6345f6bdeb864e735fb4b2d584 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Tue, 3 Oct 2017 11:06:01 +0200 Subject: [PATCH] 4.4-stable patches added patches: arm-pxa-add-the-number-of-dma-requestor-lines.patch arm-pxa-fix-the-number-of-dma-requestor-lines.patch cxl-fix-driver-use-count.patch dmaengine-mmp-pdma-add-number-of-requestors.patch gfs2-fix-debugfs-glocks-dump.patch kvm-vmx-do-not-change-sn-bit-in-vmx_update_pi_irte.patch kvm-vmx-remove-warn_on_once-in-kvm_vcpu_trigger_posted_interrupt.patch timer-sysclt-restrict-timer-migration-sysctl-values-to-0-and-1.patch --- ...dd-the-number-of-dma-requestor-lines.patch | 111 +++++++++++++++++ ...ix-the-number-of-dma-requestor-lines.patch | 29 +++++ queue-4.4/cxl-fix-driver-use-count.patch | 80 ++++++++++++ ...ne-mmp-pdma-add-number-of-requestors.patch | 32 +++++ queue-4.4/gfs2-fix-debugfs-glocks-dump.patch | 117 ++++++++++++++++++ ...-change-sn-bit-in-vmx_update_pi_irte.patch | 50 ++++++++ ...in-kvm_vcpu_trigger_posted_interrupt.patch | 81 ++++++++++++ queue-4.4/series | 8 ++ ...r-migration-sysctl-values-to-0-and-1.patch | 49 ++++++++ 9 files changed, 557 insertions(+) create mode 100644 queue-4.4/arm-pxa-add-the-number-of-dma-requestor-lines.patch create mode 100644 queue-4.4/arm-pxa-fix-the-number-of-dma-requestor-lines.patch create mode 100644 queue-4.4/cxl-fix-driver-use-count.patch create mode 100644 queue-4.4/dmaengine-mmp-pdma-add-number-of-requestors.patch create mode 100644 queue-4.4/gfs2-fix-debugfs-glocks-dump.patch create mode 100644 queue-4.4/kvm-vmx-do-not-change-sn-bit-in-vmx_update_pi_irte.patch create mode 100644 queue-4.4/kvm-vmx-remove-warn_on_once-in-kvm_vcpu_trigger_posted_interrupt.patch create mode 100644 queue-4.4/timer-sysclt-restrict-timer-migration-sysctl-values-to-0-and-1.patch diff --git a/queue-4.4/arm-pxa-add-the-number-of-dma-requestor-lines.patch b/queue-4.4/arm-pxa-add-the-number-of-dma-requestor-lines.patch new file mode 100644 index 00000000000..ce44c1fb137 --- /dev/null +++ b/queue-4.4/arm-pxa-add-the-number-of-dma-requestor-lines.patch @@ -0,0 +1,111 @@ +From 72b195cb716284217e8b270af420bc7e5cf04b3c Mon Sep 17 00:00:00 2001 +From: Robert Jarzmik +Date: Mon, 15 Feb 2016 21:57:47 +0100 +Subject: ARM: pxa: add the number of DMA requestor lines + +From: Robert Jarzmik + +commit 72b195cb716284217e8b270af420bc7e5cf04b3c upstream. + +Declare the number of DMA requestor lines per platform : + - for pxa25x: 40 requestor lines + - for pxa27x: 75 requestor lines + - for pxa3xx: 100 requestor lines + +This information will be used to activate the DMA flow control or not. + +Signed-off-by: Robert Jarzmik +Signed-off-by: Greg Kroah-Hartman + +--- + arch/arm/boot/dts/pxa27x.dtsi | 1 + + arch/arm/boot/dts/pxa3xx.dtsi | 1 + + arch/arm/mach-pxa/devices.c | 3 ++- + arch/arm/mach-pxa/pxa25x.c | 2 +- + arch/arm/mach-pxa/pxa27x.c | 2 +- + arch/arm/mach-pxa/pxa3xx.c | 2 +- + arch/arm/plat-pxa/include/plat/dma.h | 2 +- + 7 files changed, 8 insertions(+), 5 deletions(-) + +--- a/arch/arm/boot/dts/pxa27x.dtsi ++++ b/arch/arm/boot/dts/pxa27x.dtsi +@@ -13,6 +13,7 @@ + interrupts = <25>; + #dma-channels = <32>; + #dma-cells = <2>; ++ #dma-requests = <75>; + status = "okay"; + }; + +--- a/arch/arm/boot/dts/pxa3xx.dtsi ++++ b/arch/arm/boot/dts/pxa3xx.dtsi +@@ -12,6 +12,7 @@ + interrupts = <25>; + #dma-channels = <32>; + #dma-cells = <2>; ++ #dma-requests = <100>; + status = "okay"; + }; + +--- a/arch/arm/mach-pxa/devices.c ++++ b/arch/arm/mach-pxa/devices.c +@@ -1203,6 +1203,7 @@ void __init pxa2xx_set_spi_info(unsigned + + static struct mmp_dma_platdata pxa_dma_pdata = { + .dma_channels = 0, ++ .nb_requestors = 0, + }; + + static struct resource pxa_dma_resource[] = { +@@ -1231,7 +1232,7 @@ static struct platform_device pxa2xx_pxa + .resource = pxa_dma_resource, + }; + +-void __init pxa2xx_set_dmac_info(int nb_channels) ++void __init pxa2xx_set_dmac_info(int nb_channels, int nb_requestors) + { + pxa_dma_pdata.dma_channels = nb_channels; + pxa_register_device(&pxa2xx_pxa_dma, &pxa_dma_pdata); +--- a/arch/arm/mach-pxa/pxa25x.c ++++ b/arch/arm/mach-pxa/pxa25x.c +@@ -206,7 +206,7 @@ static int __init pxa25x_init(void) + register_syscore_ops(&pxa_irq_syscore_ops); + register_syscore_ops(&pxa2xx_mfp_syscore_ops); + +- pxa2xx_set_dmac_info(16); ++ pxa2xx_set_dmac_info(16, 40); + pxa_register_device(&pxa25x_device_gpio, &pxa25x_gpio_info); + ret = platform_add_devices(pxa25x_devices, + ARRAY_SIZE(pxa25x_devices)); +--- a/arch/arm/mach-pxa/pxa27x.c ++++ b/arch/arm/mach-pxa/pxa27x.c +@@ -309,7 +309,7 @@ static int __init pxa27x_init(void) + if (!of_have_populated_dt()) { + pxa_register_device(&pxa27x_device_gpio, + &pxa27x_gpio_info); +- pxa2xx_set_dmac_info(32); ++ pxa2xx_set_dmac_info(32, 75); + ret = platform_add_devices(devices, + ARRAY_SIZE(devices)); + } +--- a/arch/arm/mach-pxa/pxa3xx.c ++++ b/arch/arm/mach-pxa/pxa3xx.c +@@ -450,7 +450,7 @@ static int __init pxa3xx_init(void) + if (of_have_populated_dt()) + return 0; + +- pxa2xx_set_dmac_info(32); ++ pxa2xx_set_dmac_info(32, 100); + ret = platform_add_devices(devices, ARRAY_SIZE(devices)); + if (ret) + return ret; +--- a/arch/arm/plat-pxa/include/plat/dma.h ++++ b/arch/arm/plat-pxa/include/plat/dma.h +@@ -95,6 +95,6 @@ static inline int pxad_toggle_reserved_c + } + #endif + +-extern void __init pxa2xx_set_dmac_info(int nb_channels); ++extern void __init pxa2xx_set_dmac_info(int nb_channels, int nb_requestors); + + #endif /* __PLAT_DMA_H */ diff --git a/queue-4.4/arm-pxa-fix-the-number-of-dma-requestor-lines.patch b/queue-4.4/arm-pxa-fix-the-number-of-dma-requestor-lines.patch new file mode 100644 index 00000000000..ed66ee044a8 --- /dev/null +++ b/queue-4.4/arm-pxa-fix-the-number-of-dma-requestor-lines.patch @@ -0,0 +1,29 @@ +From 4c35430ad18f5a034302cb90e559ede5a27f93b9 Mon Sep 17 00:00:00 2001 +From: Robert Jarzmik +Date: Wed, 9 Mar 2016 00:46:11 +0100 +Subject: ARM: pxa: fix the number of DMA requestor lines + +From: Robert Jarzmik + +commit 4c35430ad18f5a034302cb90e559ede5a27f93b9 upstream. + +The number of requestor lines was clamped to 0 for all pxa architectures +in the requestor declaration. Fix this by using the value. + +Fixes: 72b195cb7162 ("ARM: pxa: add the number of DMA requestor lines") +Signed-off-by: Robert Jarzmik +Signed-off-by: Greg Kroah-Hartman + +--- + arch/arm/mach-pxa/devices.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/arch/arm/mach-pxa/devices.c ++++ b/arch/arm/mach-pxa/devices.c +@@ -1235,5 +1235,6 @@ static struct platform_device pxa2xx_pxa + void __init pxa2xx_set_dmac_info(int nb_channels, int nb_requestors) + { + pxa_dma_pdata.dma_channels = nb_channels; ++ pxa_dma_pdata.nb_requestors = nb_requestors; + pxa_register_device(&pxa2xx_pxa_dma, &pxa_dma_pdata); + } diff --git a/queue-4.4/cxl-fix-driver-use-count.patch b/queue-4.4/cxl-fix-driver-use-count.patch new file mode 100644 index 00000000000..90544ae873c --- /dev/null +++ b/queue-4.4/cxl-fix-driver-use-count.patch @@ -0,0 +1,80 @@ +From 197267d0356004a31c4d6b6336598f5dff3301e1 Mon Sep 17 00:00:00 2001 +From: Frederic Barrat +Date: Wed, 30 Aug 2017 12:15:49 +0200 +Subject: cxl: Fix driver use count + +From: Frederic Barrat + +commit 197267d0356004a31c4d6b6336598f5dff3301e1 upstream. + +cxl keeps a driver use count, which is used with the hash memory model +on p8 to know when to upgrade local TLBIs to global and to trigger +callbacks to manage the MMU for PSL8. + +If a process opens a context and closes without attaching or fails the +attachment, the driver use count is never decremented. As a +consequence, TLB invalidations remain global, even if there are no +active cxl contexts. + +We should increment the driver use count when the process is attaching +to the cxl adapter, and not on open. It's not needed before the +adapter starts using the context and the use count is decremented on +the detach path, so it makes more sense. + +It affects only the user api. The kernel api is already doing The +Right Thing. + +Signed-off-by: Frederic Barrat +Fixes: 7bb5d91a4dda ("cxl: Rework context lifetimes") +Acked-by: Andrew Donnellan +Signed-off-by: Michael Ellerman +[ajd: backport to stable v4.4 tree] +Signed-off-by: Andrew Donnellan +Signed-off-by: Greg Kroah-Hartman +--- + drivers/misc/cxl/api.c | 4 ++++ + drivers/misc/cxl/file.c | 8 +++++++- + 2 files changed, 11 insertions(+), 1 deletion(-) + +--- a/drivers/misc/cxl/api.c ++++ b/drivers/misc/cxl/api.c +@@ -176,6 +176,10 @@ int cxl_start_context(struct cxl_context + kernel = false; + } + ++ /* ++ * Increment driver use count. Enables global TLBIs for hash ++ * and callbacks to handle the segment table ++ */ + cxl_ctx_get(); + + if ((rc = cxl_attach_process(ctx, kernel, wed , 0))) { +--- a/drivers/misc/cxl/file.c ++++ b/drivers/misc/cxl/file.c +@@ -94,7 +94,6 @@ static int __afu_open(struct inode *inod + + pr_devel("afu_open pe: %i\n", ctx->pe); + file->private_data = ctx; +- cxl_ctx_get(); + + /* indicate success */ + rc = 0; +@@ -205,11 +204,18 @@ static long afu_ioctl_start_work(struct + ctx->pid = get_task_pid(current, PIDTYPE_PID); + ctx->glpid = get_task_pid(current->group_leader, PIDTYPE_PID); + ++ /* ++ * Increment driver use count. Enables global TLBIs for hash ++ * and callbacks to handle the segment table ++ */ ++ cxl_ctx_get(); ++ + trace_cxl_attach(ctx, work.work_element_descriptor, work.num_interrupts, amr); + + if ((rc = cxl_attach_process(ctx, false, work.work_element_descriptor, + amr))) { + afu_release_irqs(ctx, ctx); ++ cxl_ctx_put(); + goto out; + } + diff --git a/queue-4.4/dmaengine-mmp-pdma-add-number-of-requestors.patch b/queue-4.4/dmaengine-mmp-pdma-add-number-of-requestors.patch new file mode 100644 index 00000000000..05ced3437b9 --- /dev/null +++ b/queue-4.4/dmaengine-mmp-pdma-add-number-of-requestors.patch @@ -0,0 +1,32 @@ +From c283e41ef32442f41e7180f9bb1c5aedf9255bfe Mon Sep 17 00:00:00 2001 +From: Robert Jarzmik +Date: Mon, 15 Feb 2016 21:57:46 +0100 +Subject: dmaengine: mmp-pdma: add number of requestors + +From: Robert Jarzmik + +commit c283e41ef32442f41e7180f9bb1c5aedf9255bfe upstream. + +The DMA chip has a fixed number of requestor lines used for flow +control. This number is platform dependent. The pxa_dma dma driver will +use this value to activate or not the flow control. + +There won't be any impact on mmp_pdma driver. + +Signed-off-by: Robert Jarzmik +Signed-off-by: Greg Kroah-Hartman + +--- + include/linux/platform_data/mmp_dma.h | 1 + + 1 file changed, 1 insertion(+) + +--- a/include/linux/platform_data/mmp_dma.h ++++ b/include/linux/platform_data/mmp_dma.h +@@ -14,6 +14,7 @@ + + struct mmp_dma_platdata { + int dma_channels; ++ int nb_requestors; + }; + + #endif /* MMP_DMA_H */ diff --git a/queue-4.4/gfs2-fix-debugfs-glocks-dump.patch b/queue-4.4/gfs2-fix-debugfs-glocks-dump.patch new file mode 100644 index 00000000000..8343b9d030c --- /dev/null +++ b/queue-4.4/gfs2-fix-debugfs-glocks-dump.patch @@ -0,0 +1,117 @@ +From 10201655b085df8e000822e496e5d4016a167a36 Mon Sep 17 00:00:00 2001 +From: Andreas Gruenbacher +Date: Tue, 19 Sep 2017 07:15:35 -0500 +Subject: gfs2: Fix debugfs glocks dump + +From: Andreas Gruenbacher + +commit 10201655b085df8e000822e496e5d4016a167a36 upstream. + +The switch to rhashtables (commit 88ffbf3e03) broke the debugfs glock +dump (/sys/kernel/debug/gfs2//glocks) for dumps bigger than a +single buffer: the right function for restarting an rhashtable iteration +from the beginning of the hash table is rhashtable_walk_enter; +rhashtable_walk_stop + rhashtable_walk_start will just resume from the +current position. + +The upstream commit doesn't directly apply to 4.4.y because 4.4.y +doesn't have rhashtable_walk_enter and the following mainline commits: + + 92ecd73a887c4a2b94daf5fc35179d75d1c4ef95 + gfs2: Deduplicate gfs2_{glocks,glstats}_open + cc37a62785a584f4875788689f3fd1fa6e4eb291 + gfs2: Replace rhashtable_walk_init with rhashtable_walk_enter + +Other than rhashtable_walk_enter, rhashtable_walk_init can fail. To +handle the failure case in gfs2_glock_seq_stop, we check if +rhashtable_walk_init has initialized iter->walker; if it has not, we +must not call rhashtable_walk_stop or rhashtable_walk_exit. + +Signed-off-by: Andreas Gruenbacher +Signed-off-by: Bob Peterson +Signed-off-by: Greg Kroah-Hartman +--- + fs/gfs2/glock.c | 21 +++++++++------------ + 1 file changed, 9 insertions(+), 12 deletions(-) + +--- a/fs/gfs2/glock.c ++++ b/fs/gfs2/glock.c +@@ -1814,13 +1814,10 @@ static void *gfs2_glock_seq_start(struct + { + struct gfs2_glock_iter *gi = seq->private; + loff_t n = *pos; +- int ret; + +- if (gi->last_pos <= *pos) +- n = (*pos - gi->last_pos); +- +- ret = rhashtable_walk_start(&gi->hti); +- if (ret) ++ if (rhashtable_walk_init(&gl_hash_table, &gi->hti) != 0) ++ return NULL; ++ if (rhashtable_walk_start(&gi->hti) != 0) + return NULL; + + do { +@@ -1828,6 +1825,7 @@ static void *gfs2_glock_seq_start(struct + } while (gi->gl && n--); + + gi->last_pos = *pos; ++ + return gi->gl; + } + +@@ -1839,6 +1837,7 @@ static void *gfs2_glock_seq_next(struct + (*pos)++; + gi->last_pos = *pos; + gfs2_glock_iter_next(gi); ++ + return gi->gl; + } + +@@ -1847,7 +1846,10 @@ static void gfs2_glock_seq_stop(struct s + struct gfs2_glock_iter *gi = seq->private; + + gi->gl = NULL; +- rhashtable_walk_stop(&gi->hti); ++ if (gi->hti.walker) { ++ rhashtable_walk_stop(&gi->hti); ++ rhashtable_walk_exit(&gi->hti); ++ } + } + + static int gfs2_glock_seq_show(struct seq_file *seq, void *iter_ptr) +@@ -1910,12 +1912,10 @@ static int gfs2_glocks_open(struct inode + struct gfs2_glock_iter *gi = seq->private; + + gi->sdp = inode->i_private; +- gi->last_pos = 0; + seq->buf = kmalloc(GFS2_SEQ_GOODSIZE, GFP_KERNEL | __GFP_NOWARN); + if (seq->buf) + seq->size = GFS2_SEQ_GOODSIZE; + gi->gl = NULL; +- ret = rhashtable_walk_init(&gl_hash_table, &gi->hti); + } + return ret; + } +@@ -1926,7 +1926,6 @@ static int gfs2_glocks_release(struct in + struct gfs2_glock_iter *gi = seq->private; + + gi->gl = NULL; +- rhashtable_walk_exit(&gi->hti); + return seq_release_private(inode, file); + } + +@@ -1938,12 +1937,10 @@ static int gfs2_glstats_open(struct inod + struct seq_file *seq = file->private_data; + struct gfs2_glock_iter *gi = seq->private; + gi->sdp = inode->i_private; +- gi->last_pos = 0; + seq->buf = kmalloc(GFS2_SEQ_GOODSIZE, GFP_KERNEL | __GFP_NOWARN); + if (seq->buf) + seq->size = GFS2_SEQ_GOODSIZE; + gi->gl = NULL; +- ret = rhashtable_walk_init(&gl_hash_table, &gi->hti); + } + return ret; + } diff --git a/queue-4.4/kvm-vmx-do-not-change-sn-bit-in-vmx_update_pi_irte.patch b/queue-4.4/kvm-vmx-do-not-change-sn-bit-in-vmx_update_pi_irte.patch new file mode 100644 index 00000000000..767932a9c28 --- /dev/null +++ b/queue-4.4/kvm-vmx-do-not-change-sn-bit-in-vmx_update_pi_irte.patch @@ -0,0 +1,50 @@ +From dc91f2eb1a4021eb6705c15e474942f84ab9b211 Mon Sep 17 00:00:00 2001 +From: Haozhong Zhang +Date: Mon, 18 Sep 2017 09:56:49 +0800 +Subject: KVM: VMX: do not change SN bit in vmx_update_pi_irte() +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Haozhong Zhang + +commit dc91f2eb1a4021eb6705c15e474942f84ab9b211 upstream. + +In kvm_vcpu_trigger_posted_interrupt() and pi_pre_block(), KVM +assumes that PI notification events should not be suppressed when the +target vCPU is not blocked. + +vmx_update_pi_irte() sets the SN field before changing an interrupt +from posting to remapping, but it does not check the vCPU mode. +Therefore, the change of SN field may break above the assumption. +Besides, I don't see reasons to suppress notification events here, so +remove the changes of SN field to avoid race condition. + +Signed-off-by: Haozhong Zhang +Reported-by: "Ramamurthy, Venkatesh" +Reported-by: Dan Williams +Reviewed-by: Paolo Bonzini +Fixes: 28b835d60fcc ("KVM: Update Posted-Interrupts Descriptor when vCPU is preempted") +Signed-off-by: Radim Krčmář +Signed-off-by: Greg Kroah-Hartman + +--- + arch/x86/kvm/vmx.c | 6 +----- + 1 file changed, 1 insertion(+), 5 deletions(-) + +--- a/arch/x86/kvm/vmx.c ++++ b/arch/x86/kvm/vmx.c +@@ -10803,12 +10803,8 @@ static int vmx_update_pi_irte(struct kvm + + if (set) + ret = irq_set_vcpu_affinity(host_irq, &vcpu_info); +- else { +- /* suppress notification event before unposting */ +- pi_set_sn(vcpu_to_pi_desc(vcpu)); ++ else + ret = irq_set_vcpu_affinity(host_irq, NULL); +- pi_clear_sn(vcpu_to_pi_desc(vcpu)); +- } + + if (ret < 0) { + printk(KERN_INFO "%s: failed to update PI IRTE\n", diff --git a/queue-4.4/kvm-vmx-remove-warn_on_once-in-kvm_vcpu_trigger_posted_interrupt.patch b/queue-4.4/kvm-vmx-remove-warn_on_once-in-kvm_vcpu_trigger_posted_interrupt.patch new file mode 100644 index 00000000000..3e305b57c4f --- /dev/null +++ b/queue-4.4/kvm-vmx-remove-warn_on_once-in-kvm_vcpu_trigger_posted_interrupt.patch @@ -0,0 +1,81 @@ +From 5753743fa5108b8f98bd61e40dc63f641b26c768 Mon Sep 17 00:00:00 2001 +From: Haozhong Zhang +Date: Mon, 18 Sep 2017 09:56:50 +0800 +Subject: KVM: VMX: remove WARN_ON_ONCE in kvm_vcpu_trigger_posted_interrupt +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Haozhong Zhang + +commit 5753743fa5108b8f98bd61e40dc63f641b26c768 upstream. + +WARN_ON_ONCE(pi_test_sn(&vmx->pi_desc)) in kvm_vcpu_trigger_posted_interrupt() +intends to detect the violation of invariant that VT-d PI notification +event is not suppressed when vcpu is in the guest mode. Because the +two checks for the target vcpu mode and the target suppress field +cannot be performed atomically, the target vcpu mode may change in +between. If that does happen, WARN_ON_ONCE() here may raise false +alarms. + +As the previous patch fixed the real invariant breaker, remove this +WARN_ON_ONCE() to avoid false alarms, and document the allowed cases +instead. + +Signed-off-by: Haozhong Zhang +Reported-by: "Ramamurthy, Venkatesh" +Reported-by: Dan Williams +Reviewed-by: Paolo Bonzini +Fixes: 28b835d60fcc ("KVM: Update Posted-Interrupts Descriptor when vCPU is preempted") +Signed-off-by: Radim Krčmář +Signed-off-by: Greg Kroah-Hartman + +--- + arch/x86/kvm/vmx.c | 33 +++++++++++++++++++++------------ + 1 file changed, 21 insertions(+), 12 deletions(-) + +--- a/arch/x86/kvm/vmx.c ++++ b/arch/x86/kvm/vmx.c +@@ -4541,21 +4541,30 @@ static inline bool kvm_vcpu_trigger_post + { + #ifdef CONFIG_SMP + if (vcpu->mode == IN_GUEST_MODE) { +- struct vcpu_vmx *vmx = to_vmx(vcpu); +- + /* +- * Currently, we don't support urgent interrupt, +- * all interrupts are recognized as non-urgent +- * interrupt, so we cannot post interrupts when +- * 'SN' is set. ++ * The vector of interrupt to be delivered to vcpu had ++ * been set in PIR before this function. ++ * ++ * Following cases will be reached in this block, and ++ * we always send a notification event in all cases as ++ * explained below. ++ * ++ * Case 1: vcpu keeps in non-root mode. Sending a ++ * notification event posts the interrupt to vcpu. ++ * ++ * Case 2: vcpu exits to root mode and is still ++ * runnable. PIR will be synced to vIRR before the ++ * next vcpu entry. Sending a notification event in ++ * this case has no effect, as vcpu is not in root ++ * mode. + * +- * If the vcpu is in guest mode, it means it is +- * running instead of being scheduled out and +- * waiting in the run queue, and that's the only +- * case when 'SN' is set currently, warning if +- * 'SN' is set. ++ * Case 3: vcpu exits to root mode and is blocked. ++ * vcpu_block() has already synced PIR to vIRR and ++ * never blocks vcpu if vIRR is not cleared. Therefore, ++ * a blocked vcpu here does not wait for any requested ++ * interrupts in PIR, and sending a notification event ++ * which has no effect is safe here. + */ +- WARN_ON_ONCE(pi_test_sn(&vmx->pi_desc)); + + apic->send_IPI_mask(get_cpu_mask(vcpu->cpu), + POSTED_INTR_VECTOR); diff --git a/queue-4.4/series b/queue-4.4/series index 74161eb54ba..e66b66c0c0d 100644 --- a/queue-4.4/series +++ b/queue-4.4/series @@ -28,3 +28,11 @@ btrfs-fix-null-pointer-dereference-from-free_reloc_roots.patch btrfs-propagate-error-to-btrfs_cmp_data_prepare-caller.patch btrfs-prevent-to-set-invalid-default-subvolid.patch x86-fpu-don-t-let-userspace-set-bogus-xcomp_bv.patch +gfs2-fix-debugfs-glocks-dump.patch +timer-sysclt-restrict-timer-migration-sysctl-values-to-0-and-1.patch +kvm-vmx-do-not-change-sn-bit-in-vmx_update_pi_irte.patch +kvm-vmx-remove-warn_on_once-in-kvm_vcpu_trigger_posted_interrupt.patch +cxl-fix-driver-use-count.patch +dmaengine-mmp-pdma-add-number-of-requestors.patch +arm-pxa-add-the-number-of-dma-requestor-lines.patch +arm-pxa-fix-the-number-of-dma-requestor-lines.patch diff --git a/queue-4.4/timer-sysclt-restrict-timer-migration-sysctl-values-to-0-and-1.patch b/queue-4.4/timer-sysclt-restrict-timer-migration-sysctl-values-to-0-and-1.patch new file mode 100644 index 00000000000..4b838816609 --- /dev/null +++ b/queue-4.4/timer-sysclt-restrict-timer-migration-sysctl-values-to-0-and-1.patch @@ -0,0 +1,49 @@ +From b94bf594cf8ed67cdd0439e70fa939783471597a Mon Sep 17 00:00:00 2001 +From: Myungho Jung +Date: Wed, 19 Apr 2017 15:24:50 -0700 +Subject: timer/sysclt: Restrict timer migration sysctl values to 0 and 1 + +From: Myungho Jung + +commit b94bf594cf8ed67cdd0439e70fa939783471597a upstream. + +timer_migration sysctl acts as a boolean switch, so the allowed values +should be restricted to 0 and 1. + +Add the necessary extra fields to the sysctl table entry to enforce that. + +[ tglx: Rewrote changelog ] + +Signed-off-by: Myungho Jung +Link: http://lkml.kernel.org/r/1492640690-3550-1-git-send-email-mhjungk@gmail.com +Signed-off-by: Thomas Gleixner +Cc: Kazuhiro Hayashi +Signed-off-by: Greg Kroah-Hartman + +--- + kernel/sysctl.c | 2 ++ + kernel/time/timer.c | 2 +- + 2 files changed, 3 insertions(+), 1 deletion(-) + +--- a/kernel/sysctl.c ++++ b/kernel/sysctl.c +@@ -1159,6 +1159,8 @@ static struct ctl_table kern_table[] = { + .maxlen = sizeof(unsigned int), + .mode = 0644, + .proc_handler = timer_migration_handler, ++ .extra1 = &zero, ++ .extra2 = &one, + }, + #endif + #ifdef CONFIG_BPF_SYSCALL +--- a/kernel/time/timer.c ++++ b/kernel/time/timer.c +@@ -127,7 +127,7 @@ int timer_migration_handler(struct ctl_t + int ret; + + mutex_lock(&mutex); +- ret = proc_dointvec(table, write, buffer, lenp, ppos); ++ ret = proc_dointvec_minmax(table, write, buffer, lenp, ppos); + if (!ret && write) + timers_update_migration(false); + mutex_unlock(&mutex); -- 2.47.3