Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3296378pxj; Tue, 1 Jun 2021 01:51:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJylQk4ZAUkwB1hm3Ae3yeqP1EJoi8vdS6WDHwyk18ovhQVXXr9yrgz0mrmci63ad0NgszSC X-Received: by 2002:a05:6402:268f:: with SMTP id w15mr30430299edd.321.1622537510790; Tue, 01 Jun 2021 01:51:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622537510; cv=none; d=google.com; s=arc-20160816; b=Lw/5jv7BMT35/Inmr68JQcUorY2WAGW/3qiyBZ/xtmRTCO+FEvZTSnUf1xBya5cX0c rnyrVZbQiss6HnrPx56qsMVIE4rc+UefZJc2SmefGJnjfB0SwusOPar64AClwOBIeJga 84nEzugUvc9S/F3Zu/H2PX8YoxEpE+xmTliTuMdhBtmDrHLZpzoZ13+kuJKhL3FihA6r 4z8I9h1xnH0KyIE7XbW4UKlO0qLPIlJrwj8QEcRaNKoXdQNLFrrtLdqedSerqqfm9NEJ xlzVz7dNH2zmJVJF7LAsE9qD4a0NyDpxyDeGPxKw4QfLaH+uGjTEbbn3qNnZJqX5SSGp 457g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from:ironport-sdr:ironport-sdr; bh=CvF+O+gLp3uotFQqE4LiqictTFcUioB0FpSs1iy94XQ=; b=rRuk8CrJi2JYmfDHk9C4agb1DLvlqFUh5SP4b0RDrp16SXynRKr0q3Bm+sooZgYiiS e8IX+3+ZPGinAuMyfMyRwRVY/koCWypZh9C+Pxiq0W8SoiK10RbR/y+7u9R/dknZze3M wTyrIAr3FsKSB1QbXIZ68mDtK1ZrCwlHDRZQZE1H2cbanzoS8AE98DEIuC7npsli8Nko W4rTvWo+7hTKXXhCXwux2fR2anEIHEz+AphH7/ktdIo/FSKa+wB4ZmRUPmVgZNmxVLQw LFx0c3U7z03ddpQYPF4awXIIeplLESaFqE/BP/QbE9Of+r+ejeGGqI8ZPsKUtdM88lgu MvbQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u19si17211114edo.74.2021.06.01.01.51.28; Tue, 01 Jun 2021 01:51:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234081AbhFAIv0 (ORCPT + 99 others); Tue, 1 Jun 2021 04:51:26 -0400 Received: from mga07.intel.com ([134.134.136.100]:45201 "EHLO mga07.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234084AbhFAIvA (ORCPT ); Tue, 1 Jun 2021 04:51:00 -0400 IronPort-SDR: HgYWY3P5/3LQVlgOT2khHS4HFkAMkHuJiEvfJ8nmywHG6GbOF20IFRXB79AzLanD5MUs4IrmyA 7PeIMw/HOD7Q== X-IronPort-AV: E=McAfee;i="6200,9189,10001"; a="267381514" X-IronPort-AV: E=Sophos;i="5.83,239,1616482800"; d="scan'208";a="267381514" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Jun 2021 01:48:39 -0700 IronPort-SDR: JGnnY3k+FKSOY0ZiyMIU5Mx88us40VVwLQXda7mFKL+sHvZUaKE7uUqtmW5TWoe2N8EAzUcRaU CTks3GR+77Ug== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.83,239,1616482800"; d="scan'208";a="437967856" Received: from sqa-gate.sh.intel.com (HELO robert-ivt.tsp.org) ([10.239.48.212]) by orsmga007.jf.intel.com with ESMTP; 01 Jun 2021 01:48:36 -0700 From: Robert Hoo To: pbonzini@redhat.com, seanjc@google.com, vkuznets@redhat.com, wanpengli@tencent.com, jmattson@google.com, joro@8bytes.org, kvm@vger.kernel.org Cc: x86@kernel.org, linux-kernel@vger.kernel.org, chang.seok.bae@intel.com, robert.hu@intel.com, robert.hu@linux.intel.com Subject: [PATCH 14/15] kvm/vmx/nested: Support CR4.KL in nested Date: Tue, 1 Jun 2021 16:47:53 +0800 Message-Id: <1622537274-146420-15-git-send-email-robert.hu@linux.intel.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1622537274-146420-1-git-send-email-robert.hu@linux.intel.com> References: <1622537274-146420-1-git-send-email-robert.hu@linux.intel.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add CR4.KL in nested.msr.cr4_fixed1 when guest CPUID supports KeyLocker. So that it can pass check when preparing vmcs02. Signed-off-by: Robert Hoo --- arch/x86/kvm/vmx/vmx.c | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/x86/kvm/vmx/vmx.c b/arch/x86/kvm/vmx/vmx.c index 5b46d7b..070ba81 100644 --- a/arch/x86/kvm/vmx/vmx.c +++ b/arch/x86/kvm/vmx/vmx.c @@ -7440,6 +7440,7 @@ static void nested_vmx_cr_fixed1_bits_update(struct kvm_vcpu *vcpu) cr4_fixed1_update(X86_CR4_PKE, ecx, feature_bit(PKU)); cr4_fixed1_update(X86_CR4_UMIP, ecx, feature_bit(UMIP)); cr4_fixed1_update(X86_CR4_LA57, ecx, feature_bit(LA57)); + cr4_fixed1_update(X86_CR4_KEYLOCKER, ecx, feature_bit(KEYLOCKER)); #undef cr4_fixed1_update } -- 1.8.3.1