Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp374491imw; Thu, 14 Jul 2022 03:04:01 -0700 (PDT) X-Google-Smtp-Source: AGRyM1t1T/2KwhoTIKbU2TtQ5VRvbYxfrhHL5c3mBkENrkwHDWzwKfhJtG63a4V/xxjUEHetxwi9 X-Received: by 2002:a17:906:93f7:b0:72b:8acd:d8ba with SMTP id yl23-20020a17090693f700b0072b8acdd8bamr7820310ejb.496.1657793041664; Thu, 14 Jul 2022 03:04:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657793041; cv=none; d=google.com; s=arc-20160816; b=0co9wkSw4MWzaJIKrWhOua65cW4RD9ShKYHoqFBQgXD56B3FpFzRIa6r6AbibupmWr wJ1CFE+UAdMoRPeG5MGK5vexE8TgGDg6wMDB3Q0isQ8BsNZb55mWGt989V5u2LTzvn4D uzPxF2HFohxMI4dJ3AtdsXVwhkdHYRuZvw85B3omNTJLJBc3I14f+sju9UtyIKbeCh9R wNJswNM0359t6WbYHpRThqi00IKG2ppA9MJIzk1VVDRqjo+qfajK9RsT6vl+owhJo4C9 5WAMMtSwCAAwV5eFAlnRsqgPVuwmtWr8eKNESp67AW4PErZddnTxrTsOn8TR6oFPQSxp PwVw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:date:cc:to:from:subject :message-id:dkim-signature; bh=due5AmS56nwKHQURWRio6Jj0V5YHWUHW3moonKZbp+k=; b=FfsYBDHz9MCvWhD5mfpQCnTPf0CFurE5kRSFFC4IAQLmP8Q0vm67uYrLbz5Xonwk3M 7brLpw++SGT4Y6z40H8maQAmKlgVPjKqJwWh1qbtFIMM/TPYrNW8YA++fQPdFURj1zBy KFYZAzjxbDxHn2SHS1XuE3OVUxsUpRGVyK2AdV5hyzaoOk7PCYHE+YPsov0q4IQPeKoU kV7UXRtw8gszL+YpWasL0CyDjhjZF6Ved1d/TbqYDatN/QZjdILNc/tjZ7qnNBDrbnhu stvmgLPgooqboF+YT344Jc3W8h5hmxwXv5IJW7hyPuVMfTixhFkPMGApZI3E41wX+k7y i+8w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=jKt76gTp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t17-20020aa7d711000000b0043adae91e5csi1452535edq.611.2022.07.14.03.03.36; Thu, 14 Jul 2022 03:04:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=jKt76gTp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238106AbiGNJ5o (ORCPT + 99 others); Thu, 14 Jul 2022 05:57:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36600 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237551AbiGNJ51 (ORCPT ); Thu, 14 Jul 2022 05:57:27 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id D3B4650182 for ; Thu, 14 Jul 2022 02:57:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1657792639; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=due5AmS56nwKHQURWRio6Jj0V5YHWUHW3moonKZbp+k=; b=jKt76gTpcOjv4x+mHomcPP6DK2cyJQWVEE9y7Tl5r+YlyLzRUdNs0vwUn0UhlB/XMiEK1U ASCXnK976G9hXN6PnGyJv4a3D3VFlhhMYmRZv5pvU7YA7VjSSFC0zrZTw5gIbCz0z0CRdp NNmxU+fUrs+S3bUt0fgODD5lE2roQoY= Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-649-0WmbUmN1NsC1jn5Nq3AMEQ-1; Thu, 14 Jul 2022 05:57:18 -0400 X-MC-Unique: 0WmbUmN1NsC1jn5Nq3AMEQ-1 Received: by mail-wm1-f70.google.com with SMTP id c17-20020a7bc011000000b003a2bfaf8d3dso448750wmb.0 for ; Thu, 14 Jul 2022 02:57:18 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:subject:from:to:cc:date:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=due5AmS56nwKHQURWRio6Jj0V5YHWUHW3moonKZbp+k=; b=g33JSYeHwbLJobT9cHOf6RIXu1CLkE09+w13iHFWe9xjDv8TzvzG9IPrQgTe1BZ/l+ w+EBi/DgRFfoBFFFX1c+cUDCc0IP7f+rHVAWBNrLkgWg9A1lvOuML/MQxuvGAY9fSChr rtD/1y0ufHV3bVKVhpchy1k/vaflxNQ3mX64C6gcdRZWfwePQJ5HjiTgHKx+pUt3+7DC /RN2WzEGaW1RuNrbp5QlJzIxWCPutNM8ubWWLhs0g6MHfnB5Y+qGStBPDNa+dIbmPzlL IcKYwD7zu9aSkxcv2q+KpbOvNrkeGNKx+9MuIB2HpNiiqr75HSfhG4IFQqsbPl4V4hS8 UH6g== X-Gm-Message-State: AJIora8VvbG12nnksrspAaFrirvLzRkFJkmvJUbPDAKmhH7UUvyRAL+p FF1z/1KSE1cqU5yw3vmILECuxxJrfstktHv6ImTCM9TrxkYorMicW9EUiHBhZGSjNrdm3s5Ih0w EjtOIhtYiNC1/ZM0PZaOevP2W X-Received: by 2002:a5d:6e8d:0:b0:21d:7adc:7102 with SMTP id k13-20020a5d6e8d000000b0021d7adc7102mr7322823wrz.9.1657792637714; Thu, 14 Jul 2022 02:57:17 -0700 (PDT) X-Received: by 2002:a5d:6e8d:0:b0:21d:7adc:7102 with SMTP id k13-20020a5d6e8d000000b0021d7adc7102mr7322802wrz.9.1657792637491; Thu, 14 Jul 2022 02:57:17 -0700 (PDT) Received: from [10.35.4.238] (bzq-82-81-161-50.red.bezeqint.net. [82.81.161.50]) by smtp.gmail.com with ESMTPSA id o12-20020adfca0c000000b0021dbaa4f38dsm1287018wrh.18.2022.07.14.02.57.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Jul 2022 02:57:16 -0700 (PDT) Message-ID: Subject: Re: [PATCH v4 03/25] x86/hyperv: Update 'struct hv_enlightened_vmcs' definition From: Maxim Levitsky To: Vitaly Kuznetsov , kvm@vger.kernel.org, Paolo Bonzini , Sean Christopherson Cc: Anirudh Rayabharam , Wanpeng Li , Jim Mattson , linux-hyperv@vger.kernel.org, linux-kernel@vger.kernel.org Date: Thu, 14 Jul 2022 12:57:15 +0300 In-Reply-To: <20220714091327.1085353-4-vkuznets@redhat.com> References: <20220714091327.1085353-1-vkuznets@redhat.com> <20220714091327.1085353-4-vkuznets@redhat.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.40.4 (3.40.4-5.fc34) MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 2022-07-14 at 11:13 +0200, 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 > > 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. > + * > + * 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 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 All look good now. I really don't like the new 'online' TLFS spec - as you said, they can indeed change it any moment without any traces. Seems it was done with good intentions, and it much easier to use, but they should also provide a PDF, or at least some form or archive of these web pages. Reviewed-by: Maxim Levitsky Best regards, Maxim Levitsky