Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp1554971iog; Tue, 14 Jun 2022 08:18:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx0wnxK59+UmmCUHd2CuzIdm9GLXIPl00d9VQG+jTCMd6qJDc9CXuiazhlzIj9qJBobirLl X-Received: by 2002:a63:1209:0:b0:3fc:e453:5420 with SMTP id h9-20020a631209000000b003fce4535420mr4900411pgl.189.1655219928309; Tue, 14 Jun 2022 08:18:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655219928; cv=none; d=google.com; s=arc-20160816; b=SM6aEMYnB0/qznG4hK78GIhEcUijKfGRKnm5T/TiQI9s0e8WPCradTQOjeihiAm27S avLU7xAcSIVZVZ3PpclYKMkREPkuYzIXQ2b6xC7E7cc33XJjohuCYcWanY9nR2fMKi8U +omK6XLSVg5AaZWOUcDJY1tdw/6qmA1+8uFVXYxiVtYWHNKkIjU76Mri0d/X5nkWD4L4 yvH4dZPJG8E09QTUGmgT8eiRsEtsJJOZ4iuXvtPJ9O18fYvLUgKjmiRIrtiqDkNguQvP qFV4M/3Ssp60x9DEfmyHwjSOK/i9+MRzycySI5aVWY690TL42Hp+fkRl/V/s3Ki58Tx5 35oQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature :dkim-filter; bh=FkQMQGX0LVO9I/XM4yvyBKhBtSij68FznSIyshwEEEU=; b=g2jLDFSq9XF49mbI9PHo7wAz/0QOpLqm7aozR4FD2X1CD4dJ333EqLoYPcZvHDNl3t /hx/Vq0iP+yI+c2v0ageQ8dJ6mhitz+FJDIhmA4FNUZ3YwnNQxMmH4NFtZBIsq+DMMvt LcyfW+NEEhybB1fjl7lZ4ymIb49YCUMwT7uSM4mGg1q1zleGGKjW/ySvtlQfzAmMFIQQ osRMKscEs/sGdCWV0Z/YTCjB0qyWCO/RQK4rEgE5MMBIWL78D4qSgDVmphMhJClOGdvo OhJOKR2ZFwTx0nvdDlgc5TeBBSNpvtzIBTPhZjk5HVPwOCZkpvJYaKCD9fiBCBRpCb6q mn2Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.microsoft.com header.s=default header.b=J7txp6N9; 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=linux.microsoft.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ci12-20020a17090afc8c00b001eaa975a866si8353117pjb.57.2022.06.14.08.18.32; Tue, 14 Jun 2022 08:18:48 -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=@linux.microsoft.com header.s=default header.b=J7txp6N9; 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=linux.microsoft.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1356350AbiFNPNX (ORCPT + 99 others); Tue, 14 Jun 2022 11:13:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45032 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347938AbiFNPNV (ORCPT ); Tue, 14 Jun 2022 11:13:21 -0400 Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 5A0CB36694; Tue, 14 Jun 2022 08:13:20 -0700 (PDT) Received: from anrayabh-desk (unknown [167.220.238.193]) by linux.microsoft.com (Postfix) with ESMTPSA id 7A4F320C317B; Tue, 14 Jun 2022 08:13:14 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 7A4F320C317B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1655219599; bh=FkQMQGX0LVO9I/XM4yvyBKhBtSij68FznSIyshwEEEU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=J7txp6N9pbLDFHwrrSMl9uqBj9P36cwVuqE3pVCV57bdHryoRJ14mUHSaUMQInKkq 7hmIjgSnPkrVNpk/S0yF7HhOodfrjuv7kFWHMbGwkp+KvZKh0+I27xwc2iKvBat8/C 3Znfzfj/22YfjpXiOMHD8zT1jLCO/9bU472AJJoQ= Date: Tue, 14 Jun 2022 20:43:08 +0530 From: Anirudh Rayabharam To: Paolo Bonzini 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 Subject: Re: [PATCH] KVM: nVMX: Don't expose TSC scaling to L1 when on Hyper-V Message-ID: References: <20220613161611.3567556-1-anrayabh@linux.microsoft.com> <592ab920-51f3-4794-331f-8737e1f5b20a@redhat.com> <75bdc7ee-bac5-ae05-dffb-cb749c9005e1@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <75bdc7ee-bac5-ae05-dffb-cb749c9005e1@redhat.com> X-Spam-Status: No, score=-19.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_MED, SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL, USER_IN_DEF_SPF_WL 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 Tue, Jun 14, 2022 at 02:16:00PM +0200, Paolo Bonzini wrote: > On 6/14/22 06:55, Anirudh Rayabharam wrote: > > > That said, I think a better implementation of this patch is to just add > > > a version of evmcs_sanitize_exec_ctrls that takes a struct > > > nested_vmx_msrs *, and call it at the end of nested_vmx_setup_ctl_msrs like > > > > > > evmcs_sanitize_nested_vmx_vsrs(msrs); > > 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? Thanks! Anirudh. > > Paolo