Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp1091939imm; Fri, 22 Jun 2018 10:10:13 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJXYdPNOHRx7HtpFvBaKIEOAeCPPaYlmZyDGAh8S0NhDkmmF+64KPmPF/6nL1jnYNkVBCCS X-Received: by 2002:a17:902:900a:: with SMTP id a10-v6mr2562621plp.41.1529687413453; Fri, 22 Jun 2018 10:10:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529687413; cv=none; d=google.com; s=arc-20160816; b=T9MJUTy5UaJMJ8lrTHSjz0SrwjKrO+kyu4WDazVVgdwe6C7aIuF3YtetP1xDFYXZUo d5cXK8wzQeXxtNsUffu0dbeGhe2Ekeagp808AaAB5dN/Uoj7TO+/46NBY+RxrEtzdnc0 05ZYv7UG1NTUaYOggYF7Fu1A1b2KBZPBiOd4di9bRmSlst8+aHtk2tmZ8NdmKZmqWHYD HWyhgPFp2Oi8gG2wcGJsjqHaYUsJ6OS/3zJ7Nr0DVHMdZyqczcOgCbea+PPjFpQAhoiy Xhg2nprsmxT2T8dYGCRgkfHKIVTRiyO7uVkGDFe8DH4hWnAjd7SlX2gBhyRkHY90vKRI hxMQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=eJOz9Hmj7OY63lLL/gPSJlNg/fYZwxd7Y0+VcqdmESE=; b=TNP/B9xHbF2BWlC5WDIsx85iMRnggjnut4488qRTtmL40yFfUYfAoCAvBwKg4pmTB6 vwoAhzhNsMpzmEqhN3TIu0zrKFl/NXAumh6yj7iqGPzqF/1sd+XcJEfc7z363qJN9LPV Ux0hP3WfNUdMZTQE3FaotKy0sJ8ZF7HmXoLYEyXY10lF+44oier5USO4u7Sbc95CXF3r qNW6HmtOIpQYOomsTx/GnLoQFbFEnyZI1bgclB0ngdZoxiZjxqyRl0G/DETI+ZiLhWbV SQMMgjl/pweJi4W5UGdvCj6Bb35zEszfn2yYZoU+uQKnoMZnYKw2V1yTTcr+47fDVdff Spkw== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w11-v6si6796812pge.422.2018.06.22.10.09.59; Fri, 22 Jun 2018 10:10:13 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754736AbeFVRGd (ORCPT + 99 others); Fri, 22 Jun 2018 13:06:33 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:34540 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754633AbeFVRGb (ORCPT ); Fri, 22 Jun 2018 13:06:31 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 7BEDC401C9AA; Fri, 22 Jun 2018 17:06:30 +0000 (UTC) Received: from vitty.brq.redhat.com (unknown [10.43.2.155]) by smtp.corp.redhat.com (Postfix) with ESMTP id C09061C71B; Fri, 22 Jun 2018 17:06:28 +0000 (UTC) From: Vitaly Kuznetsov To: x86@kernel.org Cc: devel@linuxdriverproject.org, linux-kernel@vger.kernel.org, "K. Y. Srinivasan" , Haiyang Zhang , Stephen Hemminger , Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , Tianyu Lan , "Michael Kelley (EOSG)" Subject: [PATCH 1/4] x86/hyper-v: implement hv_do_fast_hypercall16 Date: Fri, 22 Jun 2018 19:06:22 +0200 Message-Id: <20180622170625.30688-2-vkuznets@redhat.com> In-Reply-To: <20180622170625.30688-1-vkuznets@redhat.com> References: <20180622170625.30688-1-vkuznets@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Fri, 22 Jun 2018 17:06:30 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Fri, 22 Jun 2018 17:06:30 +0000 (UTC) for IP:'10.11.54.5' DOMAIN:'int-mx05.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'vkuznets@redhat.com' RCPT:'' Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Implement 'Fast' hypercall with two 64-bit input parameter. This is going to be used for HvCallSendSyntheticClusterIpi hypercall. Signed-off-by: Vitaly Kuznetsov --- 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. -- 2.14.4