Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp703276rwb; Tue, 27 Sep 2022 03:36:01 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6ci93T09vpaPiAgKhx1WDNaHboxzjww5AAJeWU12VQllZRbYdytGEzYS/cREnhbaNqmox4 X-Received: by 2002:a17:90b:4a06:b0:202:c03b:eb5c with SMTP id kk6-20020a17090b4a0600b00202c03beb5cmr3975079pjb.6.1664274961212; Tue, 27 Sep 2022 03:36:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664274961; cv=none; d=google.com; s=arc-20160816; b=0pfrNCZljykfP8gUmmSbii8m1/IRhV41mJzzoDqrnL6UsX3GAXWCYmFpbJbrqNlzqN 9i5aURKpw4Eee9qe/2xkfgaCPZN8flafYBi+9rmCE4xap3a9S88ikcUw1iymgzzQ8vk7 PW9foqvwW5XngmIS9rL0rH4+8aTUR5BLp3xTA3fwHle1jIu4ErRyAVSMwo+AdMj0h56Y H0SNfK/cTTqEednpvxcHkyaW2KR1dG5UrkF9dULWozFGr7zs1eIypVhLaoPFX0F/PNWc S8ZPPBRaJast61/hWiEzs4/PGolIcD+Py4eWSFI5oXb+UG7t1S8U13lpgdFUR40kmReR gknA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from:dkim-signature; bh=OQd8FYCDQy3HQURocCej6OC1RjFJIa51YDrjxzf/0AM=; b=TnZEzyaq7CnSzkm3l0syGDwdd0Yk9ELXT5xqcJ2Gn8hFhfhAmco7KK0zisKUQPm5lv Ngik0ko9a2KNC8l4kAFmTtiA9jI2E0HF48UaEu3PgUr6vXaUxaJ/DivR5KSbKBLFDbme 7DQIWYZXRifxcuhlmTSSrGe9m+ziyHMKu2l35ve/bIX/kZseRlFCVAm2M9rXBI99CHgT kcoO6s04FTG1bgAtUYWjuRwWWAykCEEulcaBIIQSJaDzxNCDkELpeOOo+on4rJuc7O8A h3WXu3rDaeqPDj2Zzuw/5XMpGSryr4ZEU5fqrk5eadT30N9TOBjuVjG+OW6+F6WFOfDr /w6g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=U3vvgK87; 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 a18-20020a637052000000b0043502500e54si1579376pgn.575.2022.09.27.03.35.38; Tue, 27 Sep 2022 03:36: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=U3vvgK87; 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 S232032AbiI0KM4 (ORCPT + 99 others); Tue, 27 Sep 2022 06:12:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45068 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231969AbiI0KMh (ORCPT ); Tue, 27 Sep 2022 06:12:37 -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 ESMTPS id 81F5AD01FD for ; Tue, 27 Sep 2022 03:12:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1664273526; 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: in-reply-to:in-reply-to:references:references; bh=OQd8FYCDQy3HQURocCej6OC1RjFJIa51YDrjxzf/0AM=; b=U3vvgK875JIM9z9kWf5FjyLm5AnzuAqNKknVpvMAT6+oIWN5CyksLOqIhqJ60WT344YdML vVLE5Mw1bggsDvzt15W7JlVDkBm1N6DZk5sHJzo50pys1jAdChpkiJdyx5hdmNr/e1AjEj 54pcZ/V5K5pw9C6rRNnO0atbXsVE4Ro= Received: from mail-ej1-f70.google.com (mail-ej1-f70.google.com [209.85.218.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-169-qh24kdziOP28_dRX_oTLzg-1; Tue, 27 Sep 2022 06:11:59 -0400 X-MC-Unique: qh24kdziOP28_dRX_oTLzg-1 Received: by mail-ej1-f70.google.com with SMTP id gv43-20020a1709072beb00b0077c3f58a03eso3542812ejc.4 for ; Tue, 27 Sep 2022 03:11:59 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:x-gm-message-state:from:to:cc:subject:date; bh=OQd8FYCDQy3HQURocCej6OC1RjFJIa51YDrjxzf/0AM=; b=aMWXwSmH7cWmEQYyMT/QridPHfIHFV8pyQBjIXCro589//QI1WpU3t/pMkjaj8qMVf lF09Q067FK4uOpH5CM8FTkUCJD0GhzfchirlWh2oYNm2IObrv1xsFCcBI91phK8ppY8r gYNjEClk1JFZPgafY7rRfrxyE9PB67iM9eDTEbqGGbDgLOPHMixI9MrjMX5fT0EukdUo nvDmpiM7pWVI/ZnkKBD4xpo1ZVgI/hCPhAEmt5GqrEuUwX26LMoLQSHNrqB08k79hJ1Z ahqLyrYn3LhnMwYUqxA/wSP8TNZZxcY/Z5AEHndZ3p3dUReVeDUxFKbie3J3EeITwjOl hhJQ== X-Gm-Message-State: ACrzQf23NjSSrDch84ryUXn+qkonpeAwNUQx06OgtaLtO/x7dfxVDEf+ ROopWYYPHZ3t8OFb0Llh0t2rGnhd0cWBGSVIH5InOUB8nlkgvm9Xil1fyux6XjaxvnYv5QysPXt AQBRArYS5P/+OCom0NDJ6NrOlpBPgknFBDZaEYPYp144mZMaeicnki5moiYkeMzhOUpyiXLuwcr UF X-Received: by 2002:a17:907:2d09:b0:781:d793:f51e with SMTP id gs9-20020a1709072d0900b00781d793f51emr4056435ejc.628.1664273518639; Tue, 27 Sep 2022 03:11:58 -0700 (PDT) X-Received: by 2002:a17:907:2d09:b0:781:d793:f51e with SMTP id gs9-20020a1709072d0900b00781d793f51emr4056405ejc.628.1664273518308; Tue, 27 Sep 2022 03:11:58 -0700 (PDT) Received: from fedora (nat-2.ign.cz. [91.219.240.2]) by smtp.gmail.com with ESMTPSA id d41-20020a056402402900b0045703d699b9sm931101eda.78.2022.09.27.03.11.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Sep 2022 03:11:57 -0700 (PDT) From: Vitaly Kuznetsov To: Sean Christopherson , "Michael Kelley (LINUX)" Cc: KY Srinivasan , Haiyang Zhang , Stephen Hemminger , Wei Liu , Dexuan Cui , Paolo Bonzini , "linux-hyperv@vger.kernel.org" , "kvm@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH 1/4] x86/hyperv: Move VMCB enlightenment definitions to hyperv-tlfs.h In-Reply-To: References: <20220921201607.3156750-1-seanjc@google.com> <20220921201607.3156750-2-seanjc@google.com> Date: Tue, 27 Sep 2022 12:11:56 +0200 Message-ID: <87tu4tktxv.fsf@redhat.com> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-2.9 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 autolearn=unavailable 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 Sean Christopherson writes: > On Thu, Sep 22, 2022, Michael Kelley (LINUX) wrote: >> From: Sean Christopherson Sent: Wednesday, September 21, 2022 1:16 PM >> > >> > Move Hyper-V's VMCB enlightenment definitions to the TLFS header; the >> > definitions come directly from the TLFS[*], not from KVM. >> > >> > No functional change intended. >> > >> > [*] https://learn.microsoft.com/en-us/virtualization/hyper-v-on-windows/tlfs/datatypes/hv_svm_enlightened_vmcb_fields> >> > Signed-off-by: Sean Christopherson >> > --- >> > arch/x86/include/asm/hyperv-tlfs.h | 22 +++++++++++++++++++ >> > arch/x86/kvm/svm/hyperv.h | 35 ------------------------------ >> > arch/x86/kvm/svm/svm_onhyperv.h | 3 ++- >> > 3 files changed, 24 insertions(+), 36 deletions(-) >> > delete mode 100644 arch/x86/kvm/svm/hyperv.h >> > >> > diff --git a/arch/x86/include/asm/hyperv-tlfs.h b/arch/x86/include/asm/hyperv-tlfs.h >> > index 0a9407dc0859..4c4f81daf5a2 100644 >> > --- a/arch/x86/include/asm/hyperv-tlfs.h >> > +++ b/arch/x86/include/asm/hyperv-tlfs.h >> > @@ -584,6 +584,28 @@ struct hv_enlightened_vmcs { >> > >> > #define HV_VMX_ENLIGHTENED_CLEAN_FIELD_ALL 0xFFFF >> > >> > +/* >> > + * Hyper-V uses the software reserved 32 bytes in VMCB control area to expose >> > + * SVM enlightenments to guests. >> > + */ >> > +struct hv_enlightenments { >> > + struct __packed hv_enlightenments_control { >> > + u32 nested_flush_hypercall:1; >> > + u32 msr_bitmap:1; >> > + u32 enlightened_npt_tlb: 1; >> > + u32 reserved:29; >> > + } __packed hv_enlightenments_control; >> > + u32 hv_vp_id; >> > + u64 hv_vm_id; >> > + u64 partition_assist_page; >> > + u64 reserved; >> > +} __packed; >> > + >> > +/* >> > + * Hyper-V uses the software reserved clean bit in VMCB. >> > + */ >> > +#define VMCB_HV_NESTED_ENLIGHTENMENTS 31 >> >> Is it feasible to change this identifier so it starts with HV_ like >> everything else in this source code file, such as >> HV_VMCB_NESTED_ENLIGHTENMENTS? It doesn't look like it is >> used in very many places. > > Most definitely, IIRC it's used in only one spot. > I'll take these 4 patches to the next iteration of my "KVM: x86: hyper-v: Fine-grained TLB flush + L2 TLB flush features" series and I'll change VMCB_HV_NESTED_ENLIGHTENMENTS to HV_VMCB_NESTED_ENLIGHTENMENTS. -- Vitaly