From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-14.0 required=3.0 tests=BAYES_00,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D68D0C433B4 for ; Thu, 8 Apr 2021 15:44:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A80B86113A for ; Thu, 8 Apr 2021 15:44:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232267AbhDHPpC (ORCPT ); Thu, 8 Apr 2021 11:45:02 -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-Google-Smtp-Source: ABdhPJwSpb5Stp3amI2L7Io5ucL56hT0ZnW8d2a3faPDA5PjlUX6ZhbOnkBbhPE1ciDMRe6iK9ZU9A== 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-hyperv@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.