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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 76F2BC00140 for ; Thu, 18 Aug 2022 15:22:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344276AbiHRPWV (ORCPT ); Thu, 18 Aug 2022 11:22:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38134 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344259AbiHRPWT (ORCPT ); Thu, 18 Aug 2022 11:22:19 -0400 Received: from mail-pf1-x42e.google.com (mail-pf1-x42e.google.com [IPv6:2607:f8b0:4864:20::42e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3B28A76965 for ; Thu, 18 Aug 2022 08:22:04 -0700 (PDT) Received: by mail-pf1-x42e.google.com with SMTP id o7so1825062pfb.9 for ; Thu, 18 Aug 2022 08:22:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc; bh=rhQW8wtozjWF3HGibH/hmWhRxd+6MVNHu/SAHJnuLEc=; b=f6//pOErDLPHd1qSNJ6w7EtZZP4/zk0eXgK/NqZ4rp9ZIZ9+nXwDrJL8Yw2ms9c4V+ q5IpxVxScLGFYwKqNz+zjrAkdGx86VokP+XBDEn3iZMSTHDeWgpPDWnatT0RQafS0goZ OkVfnHhwCLHp4BN/vYZMDsL/sIn3BIWsrhlQIyf8K0FcVZt0oMlX02n6UqFB5UchDYLt 6mcNkn95UkGiGa2/3E8bNMO4mRpXGtk2zDC6ptlHJ6PUyZhWvOS0tz7ekEljcsa0gkBu 2dupBQln9wtns+ZxbM8UNXKtUBprK8Zla5FoFoCNBUJT2XL2sBXHcsYKq2Yr541a+TD6 HxuQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc; bh=rhQW8wtozjWF3HGibH/hmWhRxd+6MVNHu/SAHJnuLEc=; b=6uhnlDNCRQ3SDnUC8rBtOIz1un57z4MF1D7m6WvqB94vHO6b7lbMvLPTaztuXEqj0o HzhBZOAKv8ZTIYDI7kmXwAbxiGQ/z6/+YAUyiceoIHR8qr27N2Wdj77sRhX7ujC9LxT/ aXC0xrunSFQ+wKyz/F/8wsGayMrXpqPDeKdnsB6B9I5zGbs8S2W4eInCkch0M+oy6C4i IF2JjZ8jAtyTZb78LxKA3kegpgNq+aeVAAJ8+oy4yTyMGfiouUy4YL3R7+y9J0FpcAKN pU7g17cQKNptSHTqOxJJHUiL3HbZ49SjngBemLtZDDGP+1ZAF907f4v9eoip0dW+eWZs MXJg== X-Gm-Message-State: ACgBeo2pFz5nrZkIzqoj0Kty8ibJDm9EUdyjp/bTmJT2ioY7DGsfi45S sdDNQNKxadLsdo8fGtTXWqTKxw== X-Google-Smtp-Source: AA6agR5vNg4AZiDCWVBlsHoSfs5B2gPrwRDzidwiEq69ooGPNnoP7C38ZuFXqwZu2MlDx6G13n/pJw== X-Received: by 2002:a63:f003:0:b0:429:fde8:4992 with SMTP id k3-20020a63f003000000b00429fde84992mr2676470pgh.134.1660836122834; Thu, 18 Aug 2022 08:22:02 -0700 (PDT) Received: from google.com (7.104.168.34.bc.googleusercontent.com. [34.168.104.7]) by smtp.gmail.com with ESMTPSA id n11-20020a63a50b000000b0041c8e489cc2sm1423692pgf.19.2022.08.18.08.22.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Aug 2022 08:22:02 -0700 (PDT) Date: Thu, 18 Aug 2022 15:21:58 +0000 From: Sean Christopherson To: Vitaly Kuznetsov Cc: kvm@vger.kernel.org, Paolo Bonzini , Anirudh Rayabharam , Wanpeng Li , Jim Mattson , Maxim Levitsky , Nathan Chancellor , Michael Kelley , linux-hyperv@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v5 03/26] x86/hyperv: Update 'struct hv_enlightened_vmcs' definition Message-ID: References: <20220802160756.339464-1-vkuznets@redhat.com> <20220802160756.339464-4-vkuznets@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220802160756.339464-4-vkuznets@redhat.com> Precedence: bulk List-ID: X-Mailing-List: linux-hyperv@vger.kernel.org On Tue, Aug 02, 2022, Vitaly Kuznetsov wrote: > Updated Hyper-V Enlightened VMCS specification lists several new > fields for the following features: > > - PerfGlobalCtrl > - EnclsExitingBitmap > - Tsc Scaling > - GuestLbrCtl > - CET > - SSP > > Update the definition. The updated definition is available only when > CPUID.0x4000000A.EBX BIT(0) is '1'. Add a define for it as well. > > Note: The latest TLFS is available at > https://docs.microsoft.com/en-us/virtualization/hyper-v-on-windows/tlfs/tlfs > > Reviewed-by: Maxim Levitsky > Signed-off-by: Vitaly Kuznetsov > --- > arch/x86/include/asm/hyperv-tlfs.h | 26 ++++++++++++++++++++++++-- > 1 file changed, 24 insertions(+), 2 deletions(-) > > diff --git a/arch/x86/include/asm/hyperv-tlfs.h b/arch/x86/include/asm/hyperv-tlfs.h > index 6f0acc45e67a..ebc27017fa48 100644 > --- a/arch/x86/include/asm/hyperv-tlfs.h > +++ b/arch/x86/include/asm/hyperv-tlfs.h > @@ -138,6 +138,17 @@ > #define HV_X64_NESTED_GUEST_MAPPING_FLUSH BIT(18) > #define HV_X64_NESTED_MSR_BITMAP BIT(19) > > +/* > + * Nested quirks. These are HYPERV_CPUID_NESTED_FEATURES.EBX bits. The "quirks" part is very confusing, largely because KVM has a well-established quirks mechanism. I also don't see "quirks" anywhere in the TLFS documentation. Can the "Nested quirks" part simply be dropped? > + * > + * Note: HV_X64_NESTED_EVMCS1_2022_UPDATE is not currently documented in any > + * published TLFS version. When the bit is set, nested hypervisor can use > + * 'updated' eVMCSv1 specification (perf_global_ctrl, s_cet, ssp, lbr_ctl, > + * encls_exiting_bitmap, tsc_multiplier fields which were missing in 2016 > + * specification). > + */ > +#define HV_X64_NESTED_EVMCS1_2022_UPDATE BIT(0) This bit is now defined[*], but the docs says it's only for perf_global_ctrl. Are we expecting an update to the TLFS? Indicates support for the GuestPerfGlobalCtrl and HostPerfGlobalCtrl fields in the enlightened VMCS. [*] https://docs.microsoft.com/en-us/virtualization/hyper-v-on-windows/tlfs/feature-discovery#hypervisor-nested-virtualization-features---0x4000000a > + > /* > * This is specific to AMD and specifies that enlightened TLB flush is > * supported. If guest opts in to this feature, ASID invalidations only > @@ -559,9 +570,20 @@ struct hv_enlightened_vmcs { > u64 partition_assist_page; > u64 padding64_4[4]; > u64 guest_bndcfgs; > - u64 padding64_5[7]; > + u64 guest_ia32_perf_global_ctrl; > + u64 guest_ia32_s_cet; > + u64 guest_ssp; > + u64 guest_ia32_int_ssp_table_addr; > + u64 guest_ia32_lbr_ctl; > + u64 padding64_5[2]; > u64 xss_exit_bitmap; > - u64 padding64_6[7]; > + u64 encls_exiting_bitmap; > + u64 host_ia32_perf_global_ctrl; > + u64 tsc_multiplier; > + u64 host_ia32_s_cet; > + u64 host_ssp; > + u64 host_ia32_int_ssp_table_addr; > + u64 padding64_6; > } __packed; > > #define HV_VMX_ENLIGHTENED_CLEAN_FIELD_NONE 0 > -- > 2.35.3 >