Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp6388899rwr; Mon, 24 Apr 2023 19:47:05 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6wUcW9NxY+SNwhxYXt8kSQetVJfQgBUBpvtwAy5EghDI2JPZHvGwz1eF590o4Ij7+Waqxm X-Received: by 2002:a17:903:1109:b0:1a9:7b5e:14ba with SMTP id n9-20020a170903110900b001a97b5e14bamr5189459plh.29.1682390825272; Mon, 24 Apr 2023 19:47:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682390825; cv=none; d=google.com; s=arc-20160816; b=av5VR+8gfyZkwsPB3tqXpuwte6ebG4BU7XAEjIdah6F5IraR7Ly+rfdJvAfkmRq01h H3EqX5uFXiB8pScP/bN2kfEXULD/YDL7plRZ2/H6Nf9hV2nywwwHmD/R5YpILvwpINAn dasGhpqokKlYUuRP204vlUCTVubPXcTh/ITT5dLbAgrWeQ7TqW6ddtxiv0TYQvVbQzor GGZEk6PJPHv5QO55JKi64rNd/IqUJ3/Btt0WAA7mgO9JhAhSO+ql4LZN+HfBtKa6NR0z KaFVEAYCpuQbp/b8l3DjHk1fIGy8Nl1nmScQaFMHPl2eTabHCkxBDN5+Un8qNj2kBgXJ V4IQ== 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:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=aIlEpDOAPea0PG87slYcEJiwDlC51Vn1iwXFEY+WCKs=; b=OrQtUtVFZYMmSK19P8WyViMv3o4Jp2+RC+bVvi5SjCWjHrAUJQ13jLxPnBz+q/77cG jbhdK41fbDouoS+MHQTiu050I+EAVSosvR0mR7PsUh5XsHNIs9CvxzRhec571AeG2yul MLEwo4pP58/M2o1r3MHuTMipeqjrhE3rfCiKc6+43jgX0wzyIadsbTYKjtLLBrzS7zVl LMKbj8aHVwtqQTwh4Peav9V8z7CIeIvkqqK10u4UzDDlcHcC68o3WgAd6tUmF2NcGCLW 8+n++8yLtakpK+JtSSdev+lfW/wYSBfVBtCgsw8AhRr1QOdtCbRZ6sgETSKOugUh9q1z L91Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=N7n3HQPu; 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=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p3-20020a17090a868300b00247abbe9aadsi15300086pjn.79.2023.04.24.19.46.51; Mon, 24 Apr 2023 19:47:05 -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=@intel.com header.s=Intel header.b=N7n3HQPu; 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=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233106AbjDYCfj (ORCPT + 99 others); Mon, 24 Apr 2023 22:35:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58882 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232845AbjDYCfi (ORCPT ); Mon, 24 Apr 2023 22:35:38 -0400 Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E8F4B5277; Mon, 24 Apr 2023 19:35:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1682390134; x=1713926134; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=HnndgSw2hkm6qwVldvp2S2bsgVjK2XmJ95F+bAcDGyg=; b=N7n3HQPugrEIPr1ZvVKFkxCwdJzVaQAoKgY9W+2OznZeNDtTarFsfUJJ wZfOUKfUK6pHP4VsMpdWMVxOmivT3vPPFuotjri4J5hSbBvAGpOCMqSG3 056HMCzaQkwjI1s4IXO/5SjxLjlSsTYTKB9WHPHnZpkNjZVI9dmUHQ33j IQyxe7Gx6wGsSsx6rC1FeYogSxB/9UvffVDp4JtVsca1q8cRm3QrnTigb 4eurUCMvAvMccPh2B5ZiHgVmaVuQjuE8po/duLuFRfEch4OD502NznVxv Ib/s96BYKU/jYeQvMNnR4lGtJbqBYQUkcqp3DJ87wxfCaNAGsGDXTwyFw w==; X-IronPort-AV: E=McAfee;i="6600,9927,10690"; a="348548970" X-IronPort-AV: E=Sophos;i="5.99,224,1677571200"; d="scan'208";a="348548970" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Apr 2023 19:35:34 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10690"; a="725923676" X-IronPort-AV: E=Sophos;i="5.99,224,1677571200"; d="scan'208";a="725923676" Received: from zengguan-mobl1.ccr.corp.intel.com (HELO [10.238.0.183]) ([10.238.0.183]) by orsmga001-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Apr 2023 19:35:31 -0700 Message-ID: <848cb820-e634-4608-5d09-a9bd9ee6de18@intel.com> Date: Tue, 25 Apr 2023 10:35:25 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.10.0 Subject: Re: [PATCH 1/6] KVM: x86: Virtualize CR4.LASS Content-Language: en-US To: "Gao, Chao" Cc: Paolo Bonzini , "Christopherson,, Sean" , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , H Peter Anvin , "kvm@vger.kernel.org" , "x86@kernel.org" , "linux-kernel@vger.kernel.org" References: <20230420133724.11398-1-guang.zeng@intel.com> <20230420133724.11398-2-guang.zeng@intel.com> From: Zeng Guang In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-5.8 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_MED,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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 4/24/2023 3:32 PM, Gao, Chao wrote: > On Thu, Apr 20, 2023 at 09:37:19PM +0800, Zeng Guang wrote: >> Virtualize CR4.LASS[bit 27] under KVM control instead of being guest-owned >> as CR4.LASS generally set once for each vCPU at boot time and won't be >> toggled at runtime. Besides, only if VM has LASS capability enumerated with >> CPUID.(EAX=07H.ECX=1):EAX.LASS[bit 6], KVM allows guest software to be able >> to set CR4.LASS. >> By design CR4.LASS can be manipulated by nested guest as >> well. > This is inaccurate. The change in nested_vmx_cr_fixed1_bits_update() is > to allow L1 guests to set CR4.LASS in VMX operation. Essentially it allows nested guest to set CR4.LASS. L1 guest uses cr4_fixed1 to check cr4 value requested to set by nested guest valid or not. Nested guest will get #GP fault if it's not allowed. > I would say: > > Set the CR4.LASS bit in the emulated IA32_VMX_CR4_FIXED1 MSR for guests > to allow guests to enable LASS in nested VMX operation.