aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcelo Henrique Cerri <marcelo.cerri@canonical.com>2017-10-05 09:34:29 -0400
committerIngo Molnar <mingo@kernel.org>2017-10-10 06:54:56 -0400
commitab7ff471aa5db670197070760f022622793da7e5 (patch)
tree4673a3d6619798ee9d9d303dc06936d4e7a375d7
parent60d73a7c96601434dfdb56d5b9167ff3b850d8d7 (diff)
x86/hyperv: Fix hypercalls with extended CPU ranges for TLB flushing
Do not consider the fixed size of hv_vp_set when passing the variable header size to hv_do_rep_hypercall(). The Hyper-V hypervisor specification states that for a hypercall with a variable header only the size of the variable portion should be supplied via the input control. For HVCALL_FLUSH_VIRTUAL_ADDRESS_SPACE_EX/LIST_EX calls that means the fixed portion of hv_vp_set should not be considered. That fixes random failures of some applications that are unexpectedly killed with SIGBUS or SIGSEGV. Signed-off-by: Marcelo Henrique Cerri <marcelo.cerri@canonical.com> Cc: Dexuan Cui <decui@microsoft.com> Cc: Haiyang Zhang <haiyangz@microsoft.com> Cc: Jork Loeser <Jork.Loeser@microsoft.com> Cc: Josh Poulson <jopoulso@microsoft.com> Cc: K. Y. Srinivasan <kys@microsoft.com> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Simon Xiao <sixiao@microsoft.com> Cc: Stephen Hemminger <sthemmin@microsoft.com> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Vitaly Kuznetsov <vkuznets@redhat.com> Cc: devel@linuxdriverproject.org Fixes: 628f54cc6451 ("x86/hyper-v: Support extended CPU ranges for TLB flush hypercalls") Link: http://lkml.kernel.org/r/1507210469-29065-1-git-send-email-marcelo.cerri@canonical.com Signed-off-by: Ingo Molnar <mingo@kernel.org>
-rw-r--r--arch/x86/hyperv/mmu.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/arch/x86/hyperv/mmu.c b/arch/x86/hyperv/mmu.c
index f21cebbb5f6c..9cc9e1c1e2db 100644
--- a/arch/x86/hyperv/mmu.c
+++ b/arch/x86/hyperv/mmu.c
@@ -251,18 +251,18 @@ static void hyperv_flush_tlb_others_ex(const struct cpumask *cpus,
251 flush->flags |= HV_FLUSH_NON_GLOBAL_MAPPINGS_ONLY; 251 flush->flags |= HV_FLUSH_NON_GLOBAL_MAPPINGS_ONLY;
252 status = hv_do_rep_hypercall( 252 status = hv_do_rep_hypercall(
253 HVCALL_FLUSH_VIRTUAL_ADDRESS_SPACE_EX, 253 HVCALL_FLUSH_VIRTUAL_ADDRESS_SPACE_EX,
254 0, nr_bank + 2, flush, NULL); 254 0, nr_bank, flush, NULL);
255 } else if (info->end && 255 } else if (info->end &&
256 ((info->end - info->start)/HV_TLB_FLUSH_UNIT) > max_gvas) { 256 ((info->end - info->start)/HV_TLB_FLUSH_UNIT) > max_gvas) {
257 status = hv_do_rep_hypercall( 257 status = hv_do_rep_hypercall(
258 HVCALL_FLUSH_VIRTUAL_ADDRESS_SPACE_EX, 258 HVCALL_FLUSH_VIRTUAL_ADDRESS_SPACE_EX,
259 0, nr_bank + 2, flush, NULL); 259 0, nr_bank, flush, NULL);
260 } else { 260 } else {
261 gva_n = fill_gva_list(flush->gva_list, nr_bank, 261 gva_n = fill_gva_list(flush->gva_list, nr_bank,
262 info->start, info->end); 262 info->start, info->end);
263 status = hv_do_rep_hypercall( 263 status = hv_do_rep_hypercall(
264 HVCALL_FLUSH_VIRTUAL_ADDRESS_LIST_EX, 264 HVCALL_FLUSH_VIRTUAL_ADDRESS_LIST_EX,
265 gva_n, nr_bank + 2, flush, NULL); 265 gva_n, nr_bank, flush, NULL);
266 } 266 }
267 267
268 local_irq_restore(flags); 268 local_irq_restore(flags);