Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp574941pxf; Thu, 8 Apr 2021 08:47:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz8ixQNQiYZVTGmvxVerk4gPo35fxXQtt82G/pgGXQhLc7LrympFYBSO0r9ViY5mQRJMeBh X-Received: by 2002:a65:4046:: with SMTP id h6mr8447946pgp.345.1617896838854; Thu, 08 Apr 2021 08:47:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617896838; cv=none; d=google.com; s=arc-20160816; b=A01MCzBdQFwwxyLuIj6IkwBbAEPNVkt+IYEXYl+nFV+hK8w38PmMe0oKjPh+DjOb30 VOYgsbL//QG4TC0PUCvfmx1JOLyU8fxFvbTs8XD9EQI4M8+wXVQiGIOktGDxF9Hwd6Vv i9MfOpwHt6fNNX0dtExn7FjdkaV3kkEp7a8Y9XGYAr3j2Y21gpFPdDgjW5XqTE7A9Rnd 354WOtPRMaSGGfuZN7TlezARLWnMWEW0TigMLzDDP172OLi5TVGlT3EVMPruCnFJkjXp lhGN/ufdjuiKFGkoBKTMaY+X+FSWfZS6QCeBh0Rssy9aa14fXZUMykhCo524/L9Fvm/1 Dddw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=gOL3sTNX0RwE6pH2lJFzbMjnBq2QDb8tnzvHvFcdpy4=; b=fyZ8wuCOWS123UdEQT4pCPSe1OVKtbnX0tcmVp64pm4SpRF5TGezx/RGLAKmyBjjX9 pOA5qxVrlstA+qOu9ddFaySqMr4FK8K/Z/JKr8OCMSHWQpT+SNl5aa1zVO65MRG6UNXH maO5CzsEHVQZoLKeZAcDj23BbsmCZdUlelJGDrH3VOPCblZPU0kxXNneMOU6TQ5DSzFL WdBdz1pKfn6wyFuw4OdVkXDGc4x5dN3SQYcnohZpo+TgROYF57BDeWVlKVp0QmYocC/O 1GhWA5LzrjA2QK6B1n4q42ufabGH6VPKGLfE7ffBEjbRSDw20JtCH3O9QWOqbnRufiSI TgVg== ARC-Authentication-Results: i=1; mx.google.com; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w191si32271907pfd.304.2021.04.08.08.47.05; Thu, 08 Apr 2021 08:47:18 -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; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232282AbhDHPpD (ORCPT + 99 others); Thu, 8 Apr 2021 11:45:03 -0400 Received: from mail-wm1-f47.google.com ([209.85.128.47]:50889 "EHLO mail-wm1-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232268AbhDHPpB (ORCPT ); Thu, 8 Apr 2021 11:45:01 -0400 Received: by mail-wm1-f47.google.com with SMTP id a76so1462564wme.0; Thu, 08 Apr 2021 08:44:48 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=gOL3sTNX0RwE6pH2lJFzbMjnBq2QDb8tnzvHvFcdpy4=; b=W1MvREWKix4lsduPy5Hw6cjgFcIEk6YfOXc9fWT0fj3mVWr1+Tt1B7TWHI1myJbfho n+M/iZLgZ5EnbVi7t5bV9qb446HBzEs3sTvwlV2w1v0WAAxklex1JivckLqywDT9mMNn JCZMO3jYQkEkRYnfpacXA4P4lTPErZgZjub+cZjH4HDuBF88V2x4nRJ2Ap5BCPiC5ozZ ihE3CqK36cqd54FEjZy6qaAqhwlza6wuFNT1si/HPyeIe0h+PyHTCj4mroEBHIroUYFI 6AsQfRQhwESvB8t638TpecpI7P1/3rmBcBynnSwttY6I6wmGIoqdqaoQYHGIGsXKU7cT rHnw== X-Gm-Message-State: AOAM530rX2qCwfQM+ysgzk8kXQPKDYrVn2Wx29pYbdQ9Wan5cWG288/v e58L5wt8w2sMjmBbeDfNhJs= X-Received: by 2002:a1c:b007:: with SMTP id z7mr9268464wme.14.1617896688085; Thu, 08 Apr 2021 08:44:48 -0700 (PDT) Received: from liuwe-devbox-debian-v2 ([51.145.34.42]) by smtp.gmail.com with ESMTPSA id v7sm1285626wrs.2.2021.04.08.08.44.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Apr 2021 08:44:47 -0700 (PDT) Date: Thu, 8 Apr 2021 15:44:46 +0000 From: Wei Liu To: Siddharth Chandrasekaran Cc: Vitaly Kuznetsov , Alexander Graf , Evgeny Iakovlev , linux-hyperv@vger.kernel.org, linux-kernel@vger.kernel.org, kvm@vger.kernel.org, "K. Y. Srinivasan" , Haiyang Zhang , Stephen Hemminger , Wei Liu , Thomas Gleixner , Ingo Molnar , Borislav Petkov , x86@kernel.org, "H. Peter Anvin" , Paolo Bonzini , Sean Christopherson , Wanpeng Li , Jim Mattson , Joerg Roedel Subject: Re: [PATCH 4/4] KVM: hyper-v: Advertise support for fast XMM hypercalls Message-ID: <20210408154446.mtatlrheoq7hpoaq@liuwe-devbox-debian-v2> References: <20210407211954.32755-1-sidcha@amazon.de> <20210407211954.32755-5-sidcha@amazon.de> <87blap7zha.fsf@vitty.brq.redhat.com> <20210408142053.GA10636@u366d62d47e3651.ant.amazon.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210408142053.GA10636@u366d62d47e3651.ant.amazon.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Apr 08, 2021 at 04:20:54PM +0200, Siddharth Chandrasekaran wrote: > On Thu, Apr 08, 2021 at 02:05:53PM +0200, Vitaly Kuznetsov wrote: > > Siddharth Chandrasekaran writes: > > > > > 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 | 4 ++-- > > > arch/x86/kvm/hyperv.c | 1 + > > > 2 files changed, 3 insertions(+), 2 deletions(-) > > > > > > diff --git a/arch/x86/include/asm/hyperv-tlfs.h b/arch/x86/include/asm/hyperv-tlfs.h > > > index e6cd3fee562b..1f160ef60509 100644 > > > --- a/arch/x86/include/asm/hyperv-tlfs.h > > > +++ b/arch/x86/include/asm/hyperv-tlfs.h > > > @@ -49,10 +49,10 @@ > > > /* Support for physical CPU dynamic partitioning events is available*/ > > > #define HV_X64_CPU_DYNAMIC_PARTITIONING_AVAILABLE BIT(3) > > > /* > > > - * Support for passing hypercall input parameter block via XMM > > > + * Support for passing hypercall input and output parameter block via XMM > > > * registers is available > > > */ > > > -#define HV_X64_HYPERCALL_PARAMS_XMM_AVAILABLE BIT(4) > > > +#define HV_X64_HYPERCALL_PARAMS_XMM_AVAILABLE BIT(4) | BIT(15) > > > > TLFS 6.0b states that there are two distinct bits for input and output: > > > > CPUID Leaf 0x40000003.EDX: > > Bit 4: support for passing hypercall input via XMM registers is available. > > Bit 15: support for returning hypercall output via XMM registers is available. > > > > and HV_X64_HYPERCALL_PARAMS_XMM_AVAILABLE is not currently used > > anywhere, I'd suggest we just rename > > > > HV_X64_HYPERCALL_PARAMS_XMM_AVAILABLE to HV_X64_HYPERCALL_XMM_INPUT_AVAILABLE > > and add HV_X64_HYPERCALL_XMM_OUTPUT_AVAILABLE (bit 15). > > That is how I had it initially; but then noticed that we would never > need to use either of them separately. So it seemed like a reasonable > abstraction to put them together. > They are two separate things in TLFS. Please use two macros here. Wei.