Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp1937306pxb; Mon, 12 Apr 2021 10:04:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx1nh9q84bhhFgz0IOHVHxM0cDBA2Xwdme5nRqcZM+LZuAyM1xtWFXSz/9mRIx5ZowV6gnG X-Received: by 2002:a63:dd14:: with SMTP id t20mr27929881pgg.258.1618247047332; Mon, 12 Apr 2021 10:04:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618247047; cv=none; d=google.com; s=arc-20160816; b=QcVD3oheT3Fpj3w3jDt2xFn+I58HxNgx82fr1D+FjEsUh/8MMil33bAHK0adQkicNu 4BwMy2ejAohTj4Ox8H9D46pZu7Ond5UWTWzpD552l0eM1oot5ShXj+fcJmQ/ZMKBvOqo 00zvCFkLOYM60d6I/q2M1X8W22xZGEF2VEV/9bLpnhGGa6DISRYkeOTsgCm11Dx2Io3u dTnkm5jkwNhcYI3O2tWxr2a38UOPq/LYCbksdA3nGC68fwDDUMzfCm3NFwNqIbW46s54 VuksJPfgeedSaGz4NOBTXiiUldCpWVOtGCsRNpUAW8ILGmzlLC7yMdMDyawBz4VEj0or p5Wg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=SREwCn/7PKpxf2gVwo9+N6e1u7Bhm84NejJPWzPCEhg=; b=HgEQL4LI/99ti5qU7ev5bOqT1Us8jEq9/UvdwkbWr9OdoGSna88u8nKMF+Re60TdxL Rm9r7+1qErbKCrJAgB2QD+rVWXZPh6VBklkp1YGs4N9qdloCSy6QDcM+YQVwLOhWDSMO Rmfr4o0xo+AwnYi5kAIwaSptihQiD0VCzb0s858xglDB227cSMLi+NKyhy3GqIxPmkwU W/EAiLYASR+6GWENw+yJNc7Y1Ka0ZJO60Lu6wGPddnMfa19wdUg6pIlC8g9sEPUCr+Cx 8ZT1v2zr4MpjS3+ilL65CkF1vPLaxBVcUxFPiVjc37jdjLy9+NXv5UKxaty7YLGUGY0t rRIA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amazon.de header.s=amazon201209 header.b="d/UAtoXf"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amazon.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ot14si17136pjb.55.2021.04.12.10.03.54; Mon, 12 Apr 2021 10:04:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@amazon.de header.s=amazon201209 header.b="d/UAtoXf"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amazon.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244383AbhDLRDL (ORCPT + 99 others); Mon, 12 Apr 2021 13:03:11 -0400 Received: from smtp-fw-4101.amazon.com ([72.21.198.25]:47810 "EHLO smtp-fw-4101.amazon.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244072AbhDLRCI (ORCPT ); Mon, 12 Apr 2021 13:02:08 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.de; i=@amazon.de; q=dns/txt; s=amazon201209; t=1618246911; x=1649782911; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version; bh=SREwCn/7PKpxf2gVwo9+N6e1u7Bhm84NejJPWzPCEhg=; b=d/UAtoXf/3A6naBSekLot1rHQPho/2PRTD4piwf47bOrAx2EBsEE2+Z3 s7T47csuBSk3Zw6nObrNIQ+TexFV8mdduqOTYYIG9qVsbqw8QFBjxsGiU PqGlwkDKnkjEhk/YKEqAAL3bd0fPPQjj9yswqvKV6gQy6tcVRhD86c8ig c=; X-IronPort-AV: E=Sophos;i="5.82,216,1613433600"; d="scan'208";a="101147888" Received: from iad12-co-svc-p1-lb1-vlan2.amazon.com (HELO email-inbound-relay-1d-474bcd9f.us-east-1.amazon.com) ([10.43.8.2]) by smtp-border-fw-out-4101.iad4.amazon.com with ESMTP; 12 Apr 2021 17:01:43 +0000 Received: from EX13D28EUC003.ant.amazon.com (iad12-ws-svc-p26-lb9-vlan2.iad.amazon.com [10.40.163.34]) by email-inbound-relay-1d-474bcd9f.us-east-1.amazon.com (Postfix) with ESMTPS id 4958EA1C65; Mon, 12 Apr 2021 17:01:36 +0000 (UTC) Received: from uc8bbc9586ea454.ant.amazon.com (10.43.161.253) by EX13D28EUC003.ant.amazon.com (10.43.164.43) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Mon, 12 Apr 2021 17:01:28 +0000 From: Siddharth Chandrasekaran To: "K. Y. Srinivasan" , Haiyang Zhang , Stephen Hemminger , Wei Liu , Thomas Gleixner , Ingo Molnar , Borislav Petkov , , "H. Peter Anvin" , Paolo Bonzini , "Sean Christopherson" , Vitaly Kuznetsov , Wanpeng Li , Jim Mattson , "Joerg Roedel" CC: Siddharth Chandrasekaran , Alexander Graf , Evgeny Iakovlev , Liran Alon , Ioannis Aslanidis , , , Subject: [PATCH v2 4/4] KVM: hyper-v: Advertise support for fast XMM hypercalls Date: Mon, 12 Apr 2021 19:00:17 +0200 Message-ID: <5ec20918b06cad17cb43f04be212c5e21c18caea.1618244920.git.sidcha@amazon.de> X-Mailer: git-send-email 2.17.1 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.43.161.253] X-ClientProxiedBy: EX13D16UWB001.ant.amazon.com (10.43.161.17) To EX13D28EUC003.ant.amazon.com (10.43.164.43) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Now that all extant hypercalls that can use XMM registers (based on spec) for input/outputs are patched to support them, we can start advertising this feature to guests. Cc: Alexander Graf Cc: Evgeny Iakovlev Signed-off-by: Siddharth Chandrasekaran --- arch/x86/include/asm/hyperv-tlfs.h | 7 ++++++- arch/x86/kvm/hyperv.c | 2 ++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/arch/x86/include/asm/hyperv-tlfs.h b/arch/x86/include/asm/hyperv-tlfs.h index e6cd3fee562b..716f12be411e 100644 --- a/arch/x86/include/asm/hyperv-tlfs.h +++ b/arch/x86/include/asm/hyperv-tlfs.h @@ -52,7 +52,7 @@ * Support for passing hypercall input parameter block via XMM * registers is available */ -#define HV_X64_HYPERCALL_PARAMS_XMM_AVAILABLE BIT(4) +#define HV_X64_HYPERCALL_XMM_INPUT_AVAILABLE BIT(4) /* Support for a virtual guest idle state is available */ #define HV_X64_GUEST_IDLE_STATE_AVAILABLE BIT(5) /* Frequency MSRs available */ @@ -61,6 +61,11 @@ #define HV_FEATURE_GUEST_CRASH_MSR_AVAILABLE BIT(10) /* Support for debug MSRs available */ #define HV_FEATURE_DEBUG_MSRS_AVAILABLE BIT(11) +/* + * Support for returning hypercall ouput block via XMM + * registers is available + */ +#define HV_X64_HYPERCALL_XMM_OUTPUT_AVAILABLE BIT(15) /* stimer Direct Mode is available */ #define HV_STIMER_DIRECT_MODE_AVAILABLE BIT(19) diff --git a/arch/x86/kvm/hyperv.c b/arch/x86/kvm/hyperv.c index 1f9959aba70d..55838c266bcd 100644 --- a/arch/x86/kvm/hyperv.c +++ b/arch/x86/kvm/hyperv.c @@ -2254,6 +2254,8 @@ int kvm_get_hv_cpuid(struct kvm_vcpu *vcpu, struct kvm_cpuid2 *cpuid, ent->ebx |= HV_POST_MESSAGES; ent->ebx |= HV_SIGNAL_EVENTS; + ent->edx |= HV_X64_HYPERCALL_XMM_INPUT_AVAILABLE; + ent->edx |= HV_X64_HYPERCALL_XMM_OUTPUT_AVAILABLE; ent->edx |= HV_FEATURE_FREQUENCY_MSRS_AVAILABLE; ent->edx |= HV_FEATURE_GUEST_CRASH_MSR_AVAILABLE; -- 2.17.1 Amazon Development Center Germany GmbH Krausenstr. 38 10117 Berlin Geschaeftsfuehrung: Christian Schlaeger, Jonathan Weiss Eingetragen am Amtsgericht Charlottenburg unter HRB 149173 B Sitz: Berlin Ust-ID: DE 289 237 879