Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp1679935iog; Tue, 14 Jun 2022 10:45:54 -0700 (PDT) X-Google-Smtp-Source: AGRyM1techi3b6tKKrWaPaduyvCoGIWpFjiglYhuTcoJ5scyVW/pkjKbxiGFEYB++9RSqBaLvMiz X-Received: by 2002:a17:90a:cc0d:b0:1e3:1256:faa3 with SMTP id b13-20020a17090acc0d00b001e31256faa3mr5792947pju.107.1655228754008; Tue, 14 Jun 2022 10:45:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655228754; cv=none; d=google.com; s=arc-20160816; b=WNdIFk8x6bxly9xRrTljxRnrA/uEDQsC+jjwnoyiLw5qRr3k/pD/u/zM8v143NX3Q1 Kd0zqqWgyqyBTKIuP/7EA667P6JpB6lZuspuLRBFcZAVU7Zepro7a1dOGLWqkYccAYdl 7JZXJoKrnzBhOWGMefiRiD4Os2NGZzCJD4cVSFXowiSGUkOCfZVBbffZ2aK5qjHeYIOK ywh49F4j4My2l2lbAvweY0jdr9qoIqvVd8aXowhzm94+1PJBx+bjcQ1YLm/+sewrmmH3 tbVjfuZMAGDQm+BMeqky6MSmLKtqN9DPH69SOvOFgEVhjwA62SBn8dtrNyRn1dFRnUXk /6HA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:subject :from:references:cc:to:content-language:user-agent:mime-version:date :message-id:dkim-signature; bh=iSH+DYmRkKMqWyNjrkzYbk9as1pR1wnvGMJve2jezd4=; b=E1PG21AY8Ra+cVhZE7IawL8nQYZqK4+j8AEtH+WhQ7+0K7tUq4631fLMJACG5YjW+8 YJG26/q6FB4VrOLL44ZS7RiJuJSeED58S6d3ZGZQlM7GWZAThW8YPsswTn/O88OcGiv4 ajLyVAmyB65/poaRIz1hP2CHpYsDqnqs1iU06bq7yl/jjnSHjd/ucn2rgkFcNlclK48b LHUybQ86kaTsgXNDwXDUe3TpeufuBV0P1PngVsA3qgmjEp1EHmPI4Gd53+XLKNSAZKy1 TuYgQKTRuDZ44S2tBiuYdgt+MyPhIKp9VuXdB9BkvjgF9xjk/ihgRBm3leT7MJxfsj01 Vkjg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=WsBKiJzw; 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 k8-20020aa788c8000000b005228146096esi9610676pff.340.2022.06.14.10.45.41; Tue, 14 Jun 2022 10:45:53 -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=WsBKiJzw; 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 S1351730AbiFNR2Y (ORCPT + 99 others); Tue, 14 Jun 2022 13:28:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49178 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1350483AbiFNR2T (ORCPT ); Tue, 14 Jun 2022 13:28:19 -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 A5F4936696 for ; Tue, 14 Jun 2022 10:28:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1655227697; 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=iSH+DYmRkKMqWyNjrkzYbk9as1pR1wnvGMJve2jezd4=; b=WsBKiJzwXRQjYB62PKzHxF5IiK+ej53AUGXZ9kXL509nZIdqJW8IimTDRjqt3uhdTIOKss Z8ks2CRy62eB7F22gTV2bXmZydeE4EehpqjkI7a5sN79UZDYhjDlmwV3o1aFGFP/vXkoRR wqY/zBQ2twOMw+HeXZFBzObfF8FsfY0= Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-269-Af51m9E0OtWlGsapN1480Q-1; Tue, 14 Jun 2022 13:28:16 -0400 X-MC-Unique: Af51m9E0OtWlGsapN1480Q-1 Received: by mail-wm1-f71.google.com with SMTP id l4-20020a05600c1d0400b0039c60535405so4067634wms.6 for ; Tue, 14 Jun 2022 10:28:15 -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:date:mime-version:user-agent :content-language:to:cc:references:from:subject:in-reply-to :content-transfer-encoding; bh=iSH+DYmRkKMqWyNjrkzYbk9as1pR1wnvGMJve2jezd4=; b=y9AwYEK9ysn0jLm9rs9crtGxhFzGjZwxzJ+lD/IWi2N/lnCCGpMVjgnyqZRU3d4s5Z CVBKjsSyQenctWy0jNI93ldjwk6uTDMl0dH+ZgxPUQ1FhkzVI+MLCBffy7ioChDOsu2B bvQP07LUzjZtDAGXaO2pCUItWHIz9H/xoRsqEsOqfapCaR1p5Idy32dySZdHblFpvxF4 7FgCraOgY71YRu4aRGFTa8ZKxHvOw063X7LXcxjA+oU9MsiTX8OOWWc+4uWYRZxxtqtz ZsHgEZZaa7dR4xFyGPldX2bnz1BK78kYl4Ut438AI56Q8brOnT51RurGOfs9jlAZO9gg dlsw== X-Gm-Message-State: AJIora+FjuuB1DIZUQkc5YSQjPNJ1qeE/xRKyH2o3OxvPd7Boj5MVBy4 q1Xqo42wX+eG6p7PtEllA24o4TDVcuVmKMlRMP59MD5STJ9Bpyo4OfTjUF3HDvlOkyP9BcYwDok 2el5U0qg49zEfKRtb1VNX769c X-Received: by 2002:adf:f592:0:b0:213:711d:55ad with SMTP id f18-20020adff592000000b00213711d55admr5953665wro.540.1655227694677; Tue, 14 Jun 2022 10:28:14 -0700 (PDT) X-Received: by 2002:adf:f592:0:b0:213:711d:55ad with SMTP id f18-20020adff592000000b00213711d55admr5953651wro.540.1655227694453; Tue, 14 Jun 2022 10:28:14 -0700 (PDT) Received: from ?IPV6:2001:b07:6468:f312:9af8:e5f5:7516:fa89? ([2001:b07:6468:f312:9af8:e5f5:7516:fa89]) by smtp.googlemail.com with ESMTPSA id v22-20020a7bcb56000000b0039482d95ab7sm13632257wmj.24.2022.06.14.10.28.11 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 14 Jun 2022 10:28:13 -0700 (PDT) Message-ID: Date: Tue, 14 Jun 2022 19:28:10 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.0 Content-Language: en-US To: Anirudh Rayabharam Cc: Sean Christopherson , Vitaly Kuznetsov , 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 References: <20220613161611.3567556-1-anrayabh@linux.microsoft.com> <592ab920-51f3-4794-331f-8737e1f5b20a@redhat.com> <75bdc7ee-bac5-ae05-dffb-cb749c9005e1@redhat.com> From: Paolo Bonzini Subject: Re: [PATCH] KVM: nVMX: Don't expose TSC scaling to L1 when on Hyper-V In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_NONE,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 6/14/22 17:13, Anirudh Rayabharam wrote: >>> Sanitize at the end might not work because I see some cases in >>> nested_vmx_setup_ctls_msrs() where we want to expose some things to L1 >>> even though the hardware doesn't support it. >> >> Yes, but these will never include eVMCS-unsupported features. > > How are you so sure? > > For example, SECONDARY_EXEC_SHADOW_VMCS is unsupported in eVMCS but in > nested_vmx_setup_ctls_msrs() we do: > > 6675 /* > 6676 * We can emulate "VMCS shadowing," even if the hardware > 6677 * doesn't support it. > 6678 */ > 6679 msrs->secondary_ctls_high |= > 6680 SECONDARY_EXEC_SHADOW_VMCS; > > If we sanitize this out it might cause some regression right? Yes, you're right, shadow VMCS is special: it is not supported by enlightened VMCS, but it is emulated rather than virtualized. Therefore, if L1 does not use the enlightened VMCS, it can indeed use shadow VMCS. Paolo