From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6EA6AC43334 for ; Tue, 14 Jun 2022 15:13:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1356310AbiFNPNX (ORCPT ); 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> Precedence: bulk List-ID: X-Mailing-List: kvm@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