Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp820823imm; Tue, 3 Jul 2018 00:05:57 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKEs9+YPyCVN6olNx4PDH9gIH2Z5aw57dYcXPgVSWSefMT+GL/BbomIa51Kkie5qH4W/KOk X-Received: by 2002:a65:4a4d:: with SMTP id a13-v6mr24410026pgu.161.1530601557005; Tue, 03 Jul 2018 00:05:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530601556; cv=none; d=google.com; s=arc-20160816; b=FG5uiLgtjHVfCIBOzdrf8j6xYOfAi5W/OQkhnPYi2/P4JWRgG/SjZHsIEor/uW7Du9 bCr/m014wuFZSrFcVoWwXFw/yMz9JYTJ1AvUvh7E03tM+Hp+wjQRzapWyVKyLgJ4GVBI MeTBv8jhtH+D5J86tfRbWdqul2SQQy+cfFrzL83o+uKeBBk0ZlHMk/OblVlJvdg0F4sc N+gIVhbIaxn2PBWij3UH/xbR+6OTVSRauTaSanNP+/IV0T8H+eXixA2BFSywSmZd7ocQ kwSPSIM2slPY0p2LZdylMt2OMGCN1sPCFSpu9hnv+jQiLt1cUYDQwROeKBlk4UFplXi0 1DSg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-disposition :content-transfer-encoding:mime-version:robot-unsubscribe:robot-id :git-commit-id:subject:to:references:in-reply-to:reply-to:cc :message-id:from:date:arc-authentication-results; bh=TlXRoNN7isidU9RMSt7GOibb0M5DGCHIfGXn4MWONUo=; b=pQF4tPj3QoqiZjvdFRDU+y0Ut1j1F+hSdRlOTtWj5lgZE4zuXM1EpqJjAEzgsJlT+g Xt3skDh5ccFlJqbuimtiDXrStFHb/iWTrz/bF+G62ep6bzlHIxB+jySTxYv5SbN5AIsy ijAswimyViO+s8baP8UuNmOYf1bT7E0vMU1w4ekK+MyoFZW3zOoBqaSCGyo5y9nrZkDM gggau3bTtXcPeUaECorEecOVIZC+C7mFi9mD4dGIK+hVPasQot1XRGIhEhiJVUhfEn9R k+A7R4rfVxcZAuvosvQyF3frW7rxiy7Vdz1miaRMiY4jqP5/p1gmS2lbFGpXEBkpdwec r8iw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q8-v6si448498pfh.353.2018.07.03.00.05.42; Tue, 03 Jul 2018 00:05:56 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754550AbeGCHEb (ORCPT + 99 others); Tue, 3 Jul 2018 03:04:31 -0400 Received: from terminus.zytor.com ([198.137.202.136]:54341 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753983AbeGCHE3 (ORCPT ); Tue, 3 Jul 2018 03:04:29 -0400 Received: from terminus.zytor.com (localhost [127.0.0.1]) by terminus.zytor.com (8.15.2/8.15.2) with ESMTPS id w6374K16189834 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 3 Jul 2018 00:04:20 -0700 Received: (from tipbot@localhost) by terminus.zytor.com (8.15.2/8.15.2/Submit) id w6374KEZ189831; Tue, 3 Jul 2018 00:04:20 -0700 Date: Tue, 3 Jul 2018 00:04:20 -0700 X-Authentication-Warning: terminus.zytor.com: tipbot set sender to tipbot@zytor.com using -f From: tip-bot for Vitaly Kuznetsov Message-ID: Cc: kys@microsoft.com, mikelley@microsoft.com, Michael.H.Kelley@microsoft.com, haiyangz@microsoft.com, hpa@zytor.com, tglx@linutronix.de, linux-kernel@vger.kernel.org, Tianyu.Lan@microsoft.com, mingo@kernel.org, vkuznets@redhat.com, sthemmin@microsoft.com Reply-To: haiyangz@microsoft.com, hpa@zytor.com, tglx@linutronix.de, kys@microsoft.com, mikelley@microsoft.com, Michael.H.Kelley@microsoft.com, Tianyu.Lan@microsoft.com, mingo@kernel.org, vkuznets@redhat.com, sthemmin@microsoft.com, linux-kernel@vger.kernel.org In-Reply-To: <20180622170625.30688-3-vkuznets@redhat.com> References: <20180622170625.30688-3-vkuznets@redhat.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:x86/hyperv] x86/hyper-v: Use 'fast' hypercall for HVCALL_SEND_IPI Git-Commit-ID: d8e6b232cfdd5d141c03e40a14c1c781480ea05e 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 X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00, T_DATE_IN_FUTURE_96_Q autolearn=ham autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on terminus.zytor.com Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: d8e6b232cfdd5d141c03e40a14c1c781480ea05e Gitweb: https://git.kernel.org/tip/d8e6b232cfdd5d141c03e40a14c1c781480ea05e Author: Vitaly Kuznetsov AuthorDate: Fri, 22 Jun 2018 19:06:23 +0200 Committer: Thomas Gleixner CommitDate: Tue, 3 Jul 2018 09:00:33 +0200 x86/hyper-v: Use 'fast' hypercall for HVCALL_SEND_IPI Current Hyper-V TLFS (v5.0b) claims that HvCallSendSyntheticClusterIpi hypercall can't be 'fast' (passing parameters through registers) but apparently this is not true, Windows always uses 'fast' version. We can do the same in Linux too. Signed-off-by: Vitaly Kuznetsov Signed-off-by: Thomas Gleixner Reviewed-by: Michael Kelley Cc: devel@linuxdriverproject.org Cc: "K. Y. Srinivasan" Cc: Haiyang Zhang Cc: Stephen Hemminger Cc: "H. Peter Anvin" Cc: Tianyu Lan Cc: "Michael Kelley (EOSG)" Link: https://lkml.kernel.org/r/20180622170625.30688-3-vkuznets@redhat.com --- arch/x86/hyperv/hv_apic.c | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) diff --git a/arch/x86/hyperv/hv_apic.c b/arch/x86/hyperv/hv_apic.c index f68855499391..90055f89223b 100644 --- a/arch/x86/hyperv/hv_apic.c +++ b/arch/x86/hyperv/hv_apic.c @@ -128,10 +128,8 @@ ipi_mask_ex_done: static bool __send_ipi_mask(const struct cpumask *mask, int vector) { int cur_cpu, vcpu; - struct ipi_arg_non_ex **arg; - struct ipi_arg_non_ex *ipi_arg; + struct ipi_arg_non_ex ipi_arg; int ret = 1; - unsigned long flags; if (cpumask_empty(mask)) return true; @@ -145,16 +143,8 @@ static bool __send_ipi_mask(const struct cpumask *mask, int vector) if ((ms_hyperv.hints & HV_X64_EX_PROCESSOR_MASKS_RECOMMENDED)) return __send_ipi_mask_ex(mask, vector); - local_irq_save(flags); - arg = (struct ipi_arg_non_ex **)this_cpu_ptr(hyperv_pcpu_input_arg); - - ipi_arg = *arg; - if (unlikely(!ipi_arg)) - goto ipi_mask_done; - - ipi_arg->vector = vector; - ipi_arg->reserved = 0; - ipi_arg->cpu_mask = 0; + ipi_arg.vector = vector; + ipi_arg.cpu_mask = 0; for_each_cpu(cur_cpu, mask) { vcpu = hv_cpu_number_to_vp_number(cur_cpu); @@ -165,13 +155,13 @@ static bool __send_ipi_mask(const struct cpumask *mask, int vector) if (vcpu >= 64) goto ipi_mask_done; - __set_bit(vcpu, (unsigned long *)&ipi_arg->cpu_mask); + __set_bit(vcpu, (unsigned long *)&ipi_arg.cpu_mask); } - ret = hv_do_hypercall(HVCALL_SEND_IPI, ipi_arg, NULL); + ret = hv_do_fast_hypercall16(HVCALL_SEND_IPI, ipi_arg.vector, + ipi_arg.cpu_mask); ipi_mask_done: - local_irq_restore(flags); return ((ret == 0) ? true : false); }