Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp822550imm; Tue, 3 Jul 2018 00:08:14 -0700 (PDT) X-Google-Smtp-Source: AAOMgpeeARod6tk+Dk3pFOxp18cdc6fifimDMCqevhrndF2++0iOCJOp016G6pH+U+s/zXDqOdWk X-Received: by 2002:a63:5421:: with SMTP id i33-v6mr9153545pgb.417.1530601694403; Tue, 03 Jul 2018 00:08:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530601694; cv=none; d=google.com; s=arc-20160816; b=xZmst4H8dTasPBZcEI5RSjgnM79yM6PMH5ZTKNREVgytO9v9c8BUnDn5KqwYMfH0BA lBMRFClAgO+4ZohnjaHvAOPe73Or+bGDA+whXwLZcqEA6iqy/Oow/jxsVeVAKOw4ezoi L+Sh/a9fQ9xYRafdBpVn4GzxKaGbRFxDmpz2gOOrF73z1YuSXj6K8OrPl15veOvSUJf+ Obw7A7mBZaI18gCuWOyOxLHzdXtTzHYuh4n8PTBoIQxp98NmFLSaJOUzwYAyT8xplM4O M6mLd39Sz6cANg84bqYKhGCSocfwiHqN09jyASJk9RL6V5tXag2XORDIr3fkdLn6Qugf FZYg== 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=fnBy1xCfprbHxBjUQoignVUogOT/q+zxQ+H/1OwrBWM=; b=V01LQg2kC8kDcidG99HvyktYjNrZSfSpcTmzm7KEZhwgeXl3qs+Z3dZjhgcMslhsoi sVhDsqLeDP3PFAZQ1+2zg1SviWnSxH+/kiAttGzEyiwd4EFQHOJLF6qcQ/ZUOf3nPaSI ExnC9cKiBUsLPjgcWN+JUF0GqF9vCNXCjnxhIL0PKwI0RzyoDbzAjEXH/Y1fNXAjJnfs catErZ3qUT3r7+rbASLuyLo9bQqJ27vJzNvUG2fFSc308WLcM9SjF6V6VjUe+vzcOzzj 0Jse8y24Yqgo4IHh9ko09ItlcW2CP9WFoy4/Kmo3VOgKikEsPkRaJpPIZzNRKb+ktnjY Sovw== 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 n1-v6si433514pge.263.2018.07.03.00.08.00; Tue, 03 Jul 2018 00:08:14 -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 S1754522AbeGCHGm (ORCPT + 99 others); Tue, 3 Jul 2018 03:06:42 -0400 Received: from terminus.zytor.com ([198.137.202.136]:37705 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753812AbeGCHD5 (ORCPT ); Tue, 3 Jul 2018 03:03:57 -0400 Received: from terminus.zytor.com (localhost [127.0.0.1]) by terminus.zytor.com (8.15.2/8.15.2) with ESMTPS id w6373lAr188316 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 3 Jul 2018 00:03:47 -0700 Received: (from tipbot@localhost) by terminus.zytor.com (8.15.2/8.15.2/Submit) id w6373lCF188313; Tue, 3 Jul 2018 00:03:47 -0700 Date: Tue, 3 Jul 2018 00:03:47 -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, sthemmin@microsoft.com, Tianyu.Lan@microsoft.com, Michael.H.Kelley@microsoft.com, mingo@kernel.org, linux-kernel@vger.kernel.org, hpa@zytor.com, vkuznets@redhat.com, haiyangz@microsoft.com, tglx@linutronix.de Reply-To: kys@microsoft.com, Tianyu.Lan@microsoft.com, sthemmin@microsoft.com, Michael.H.Kelley@microsoft.com, mingo@kernel.org, haiyangz@microsoft.com, tglx@linutronix.de, linux-kernel@vger.kernel.org, hpa@zytor.com, vkuznets@redhat.com In-Reply-To: <20180622170625.30688-2-vkuznets@redhat.com> References: <20180622170625.30688-2-vkuznets@redhat.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:x86/hyperv] x86/hyper-v: Implement hv_do_fast_hypercall16 Git-Commit-ID: 53e52966901a5b14caa2a7c77428a693fe71f734 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: 53e52966901a5b14caa2a7c77428a693fe71f734 Gitweb: https://git.kernel.org/tip/53e52966901a5b14caa2a7c77428a693fe71f734 Author: Vitaly Kuznetsov AuthorDate: Fri, 22 Jun 2018 19:06:22 +0200 Committer: Thomas Gleixner CommitDate: Tue, 3 Jul 2018 09:00:33 +0200 x86/hyper-v: Implement hv_do_fast_hypercall16 Implement 'Fast' hypercall with two 64-bit input parameter. This is going to be used for HvCallSendSyntheticClusterIpi hypercall. Signed-off-by: Vitaly Kuznetsov Signed-off-by: Thomas Gleixner 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-2-vkuznets@redhat.com --- arch/x86/include/asm/mshyperv.h | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/arch/x86/include/asm/mshyperv.h b/arch/x86/include/asm/mshyperv.h index 3cd14311edfa..da25642940d3 100644 --- a/arch/x86/include/asm/mshyperv.h +++ b/arch/x86/include/asm/mshyperv.h @@ -193,6 +193,40 @@ static inline u64 hv_do_fast_hypercall8(u16 code, u64 input1) return hv_status; } +/* Fast hypercall with 16 bytes of input */ +static inline u64 hv_do_fast_hypercall16(u16 code, u64 input1, u64 input2) +{ + u64 hv_status, control = (u64)code | HV_HYPERCALL_FAST_BIT; + +#ifdef CONFIG_X86_64 + { + __asm__ __volatile__("mov %4, %%r8\n" + CALL_NOSPEC + : "=a" (hv_status), ASM_CALL_CONSTRAINT, + "+c" (control), "+d" (input1) + : "r" (input2), + THUNK_TARGET(hv_hypercall_pg) + : "cc", "r8", "r9", "r10", "r11"); + } +#else + { + u32 input1_hi = upper_32_bits(input1); + u32 input1_lo = lower_32_bits(input1); + u32 input2_hi = upper_32_bits(input2); + u32 input2_lo = lower_32_bits(input2); + + __asm__ __volatile__ (CALL_NOSPEC + : "=A"(hv_status), + "+c"(input1_lo), ASM_CALL_CONSTRAINT + : "A" (control), "b" (input1_hi), + "D"(input2_hi), "S"(input2_lo), + THUNK_TARGET(hv_hypercall_pg) + : "cc"); + } +#endif + return hv_status; +} + /* * Rep hypercalls. Callers of this functions are supposed to ensure that * rep_count and varhead_size comply with Hyper-V hypercall definition.