From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932338AbdJJPBw (ORCPT ); Tue, 10 Oct 2017 11:01:52 -0400 Received: from terminus.zytor.com ([65.50.211.136]:43951 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932107AbdJJPBt (ORCPT ); Tue, 10 Oct 2017 11:01:49 -0400 Date: Tue, 10 Oct 2017 07:58:10 -0700 From: tip-bot for Marcelo Henrique Cerri Message-ID: Cc: kys@microsoft.com, vkuznets@redhat.com, torvalds@linux-foundation.org, Jork.Loeser@microsoft.com, jopoulso@microsoft.com, sixiao@microsoft.com, hpa@zytor.com, linux-kernel@vger.kernel.org, decui@microsoft.com, peterz@infradead.org, haiyangz@microsoft.com, sthemmin@microsoft.com, marcelo.cerri@canonical.com, mingo@kernel.org, tglx@linutronix.de Reply-To: tglx@linutronix.de, mingo@kernel.org, marcelo.cerri@canonical.com, sthemmin@microsoft.com, haiyangz@microsoft.com, peterz@infradead.org, linux-kernel@vger.kernel.org, decui@microsoft.com, jopoulso@microsoft.com, hpa@zytor.com, sixiao@microsoft.com, Jork.Loeser@microsoft.com, torvalds@linux-foundation.org, vkuznets@redhat.com, kys@microsoft.com In-Reply-To: <1507210469-29065-1-git-send-email-marcelo.cerri@canonical.com> References: <1507210469-29065-1-git-send-email-marcelo.cerri@canonical.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:x86/urgent] x86/hyperv: Fix hypercalls with extended CPU ranges for TLB flushing Git-Commit-ID: ab7ff471aa5db670197070760f022622793da7e5 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: ab7ff471aa5db670197070760f022622793da7e5 Gitweb: https://git.kernel.org/tip/ab7ff471aa5db670197070760f022622793da7e5 Author: Marcelo Henrique Cerri AuthorDate: Thu, 5 Oct 2017 10:34:29 -0300 Committer: Ingo Molnar CommitDate: Tue, 10 Oct 2017 12:54:56 +0200 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 Cc: Dexuan Cui Cc: Haiyang Zhang Cc: Jork Loeser Cc: Josh Poulson Cc: K. Y. Srinivasan Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Simon Xiao Cc: Stephen Hemminger Cc: Thomas Gleixner Cc: Vitaly Kuznetsov 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 --- arch/x86/hyperv/mmu.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/x86/hyperv/mmu.c b/arch/x86/hyperv/mmu.c index f21cebb..9cc9e1c 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, flush->flags |= HV_FLUSH_NON_GLOBAL_MAPPINGS_ONLY; status = hv_do_rep_hypercall( HVCALL_FLUSH_VIRTUAL_ADDRESS_SPACE_EX, - 0, nr_bank + 2, flush, NULL); + 0, nr_bank, flush, NULL); } else if (info->end && ((info->end - info->start)/HV_TLB_FLUSH_UNIT) > max_gvas) { status = hv_do_rep_hypercall( HVCALL_FLUSH_VIRTUAL_ADDRESS_SPACE_EX, - 0, nr_bank + 2, flush, NULL); + 0, nr_bank, flush, NULL); } else { gva_n = fill_gva_list(flush->gva_list, nr_bank, info->start, info->end); status = hv_do_rep_hypercall( HVCALL_FLUSH_VIRTUAL_ADDRESS_LIST_EX, - gva_n, nr_bank + 2, flush, NULL); + gva_n, nr_bank, flush, NULL); } local_irq_restore(flags);