Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp4568958iog; Wed, 22 Jun 2022 01:12:08 -0700 (PDT) X-Google-Smtp-Source: AGRyM1uZmwp9yiUg8xNlGr495/WEwbgxGu9Y5tOTlYYXqw5Eo/iZL/3CNGiVoG8CWBJCcNEK9kLI X-Received: by 2002:a17:90b:350f:b0:1e6:94e1:bd17 with SMTP id ls15-20020a17090b350f00b001e694e1bd17mr48917680pjb.162.1655885527889; Wed, 22 Jun 2022 01:12:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655885527; cv=none; d=google.com; s=arc-20160816; b=bzpo61/iAfy0BeUuvem9SNrQ0HZ3oRumObvD3DW6Yjz3GVMbeS2Zd3tfBtdFz+LW+S VTQiKYF8dPnk1uw+oQWwO9WkxmwPfZcaksJ4IVMoPtXL8EqpHL/PHvLVXOHe3C1HuzRS j88E5VzQMf3zojDaOTkeksLnVcJpsjgR5JF7fGYeOvIYsmF1F5fCXl7uyQ7e7yjFN3Pg zGOTkZHmL7R1m7elDznTkmGDy6i9lsG38BobMneLfuHNLNgml+Tn9KifgTyES/KXJ8FD pUGzn1ZSEBlljOHFov7gqOGAhsXIquACX/q9OQba/+i33bBWEnJ1aA+6br9ghopJ2kPZ oyWQ== 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=p1O7sFFlmBgOcKNYL09qPTXcCanshyqj/I9EvbrMxCk=; b=kAfzhzVrWTcTSCXMGDa7imuhHLO/YjpGtasslInddydhQlGdfh0mCMwjlXA/kiFuks Qe5sgA1jGp2UQEn55h/uc/KWHzkCy2U1d8pyfO+vBVxAcXVMdPizdKlz2bfE+WMBBCU+ PCyP0S13ACYWh05SQC5Oz/pAM1oAvPLcZ1TYy2D9/QfbClQmWTrXn1Esr6SiHKxCA1gZ elPNOgBj86ytseJEZ6Rmkdj0HL2E/0JE5MlgD+NGbGh19XFPhLl3KjIhYriqI8abU3sl 7s7AX5tq6IP7LjweyzMwPWwfrfKC+E0J8IfTRb/uBKa95j45jV4sq0XCYiVI9zlTsqVl jRVQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Cqgp3tKL; 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 2-20020a17090a030200b001e3446e5c51si21208794pje.179.2022.06.22.01.11.54; Wed, 22 Jun 2022 01:12:07 -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=Cqgp3tKL; 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 S1351875AbiFVIAh (ORCPT + 99 others); Wed, 22 Jun 2022 04:00:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60444 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234751AbiFVIAg (ORCPT ); Wed, 22 Jun 2022 04:00:36 -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 F1B0937A3C for ; Wed, 22 Jun 2022 01:00:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1655884834; 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=p1O7sFFlmBgOcKNYL09qPTXcCanshyqj/I9EvbrMxCk=; b=Cqgp3tKL9gpHFOHDyeLWGrVvPKbukUOp2+MqmUGhsiAvac44hu7/a+mG3nMSyGTWDLFPY3 AGicdNq5gDdkTcnbWPFuE0tweryObxgO557RbTlJFtQC+L9x76nLrm8kMJ+3dlK5QebmHt 1FsoZMEablY/LKEspjlTb4gMW2jf3rg= 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-451-K_i1k_mONF6gE_1lB696oQ-1; Wed, 22 Jun 2022 04:00:33 -0400 X-MC-Unique: K_i1k_mONF6gE_1lB696oQ-1 Received: by mail-wm1-f70.google.com with SMTP id n15-20020a05600c4f8f00b0039c3e76d646so7447177wmq.7 for ; Wed, 22 Jun 2022 01:00:32 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references:date :message-id:mime-version; bh=p1O7sFFlmBgOcKNYL09qPTXcCanshyqj/I9EvbrMxCk=; b=IfUIGnUpoIW1udaVUOIIg2AF/glWYJeqYmzCy6xYwXT1zdYnCnh+0CR9F0ojc7bAQF /ygNZS96US5WrFnJTYLvnM2P6MI1H3Ilr0uMKJtAd0jzI/ovtetCStLMYCOuG/6s7fuN msLV4FTMO7vT/ahlFhKWGnLLC019EGY0gVj+e6WG2C87amqCQVnc1mKKQuOVwlEoPzzH sYh6icaZbNNXx3bKYY47so7wuFScbE8qOCeBgTBxE3476xF2SNQWu95jqEik91g1IFPM dD5VC4sM2bgACDLa/Ghd1z7GlofChQEY0tRs9zNaVwh6JqZOFPpwHsZ0Ojnb0jvIjs/5 /2zA== X-Gm-Message-State: AOAM530/U6SMkSzA29b0FB8I79onceksK1wui9akq3lORi7BuUM++yn0 oml7YUfFHJ3xn1IevtVRMpnd/O2TGbxAbkxeJnb4qLt3mtBSJmRoXNXK5cF01PhWJ5BCb/tqK2o MZnN0Xruxn/LF5DUCuetKoA6hsLyR0/PtW/qXHMfjpBpDIXlfmpXwVREDYhuoH7y44DcTmtEVhL JU X-Received: by 2002:a05:600c:128c:b0:39c:85a4:d334 with SMTP id t12-20020a05600c128c00b0039c85a4d334mr44541253wmd.159.1655884831755; Wed, 22 Jun 2022 01:00:31 -0700 (PDT) X-Received: by 2002:a05:600c:128c:b0:39c:85a4:d334 with SMTP id t12-20020a05600c128c00b0039c85a4d334mr44541196wmd.159.1655884831411; Wed, 22 Jun 2022 01:00:31 -0700 (PDT) Received: from fedora (nat-2.ign.cz. [91.219.240.2]) by smtp.gmail.com with ESMTPSA id h4-20020a5d6e04000000b0020d02262664sm18307926wrz.25.2022.06.22.01.00.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Jun 2022 01:00:30 -0700 (PDT) From: Vitaly Kuznetsov To: Paolo Bonzini , Sean Christopherson , Anirudh Rayabharam Cc: Wanpeng Li , Jim Mattson , Joerg Roedel , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , Ilias Stamatis , Maxim Levitsky , mail@anirudhrb.com, kumarpraveen@linux.microsoft.com, wei.liu@kernel.org, robert.bradford@intel.com, liuwe@microsoft.com, kvm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] KVM: nVMX: Don't expose TSC scaling to L1 when on Hyper-V In-Reply-To: References: <20220613161611.3567556-1-anrayabh@linux.microsoft.com> <592ab920-51f3-4794-331f-8737e1f5b20a@redhat.com> Date: Wed, 22 Jun 2022 10:00:29 +0200 Message-ID: <87zgi5xh42.fsf@redhat.com> MIME-Version: 1.0 Content-Type: text/plain 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 Sean Christopherson writes: > On Tue, Jun 14, 2022, Anirudh Rayabharam wrote: >> On Mon, Jun 13, 2022 at 04:57:49PM +0000, Sean Christopherson wrote: ... >> > >> > Any reason not to use the already sanitized vmcs_config? I can't think of any >> > reason why the nested path should blindly use the raw MSR values from hardware. >> >> vmcs_config has the sanitized exec controls. But how do we construct MSR >> values using them? > > I was thinking we could use the sanitized controls for the allowed-1 bits, and then > take the required-1 bits from the CPU. And then if we wanted to avoid the redundant > RDMSRs in a follow-up patch we could add required-1 fields to vmcs_config. > > Hastily constructed and compile-tested only, proceed with caution :-) Independently from "[PATCH 00/11] KVM: VMX: Support TscScaling and EnclsExitingBitmap whith eVMCS" which is supposed to fix the particular TSC scaling issue, I like the idea to make nested_vmx_setup_ctls_msrs() use both allowed-1 and required-1 bits from vmcs_config. I'll pick up the suggested patch and try to construct something for required-1 bits. Thanks! -- Vitaly