Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp1885795pxv; Fri, 2 Jul 2021 15:09:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwXdjPmMGXZCGBAbtjEKn2dJka3wj0NG1YJ+qfh76B6rbKJbMyWBhfFbKrBSXPSaUAnMfjl X-Received: by 2002:a17:907:7b9b:: with SMTP id ne27mr1971411ejc.266.1625263766839; Fri, 02 Jul 2021 15:09:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625263766; cv=none; d=google.com; s=arc-20160816; b=HJ77/Fca8R83kKaSvVt98hqB215bq5WEw+2oqT3Goe44obHVAVFpByypAelzw0r+kp tVKO8u5MByGqSB7fW4y75Tm/zt0AbmMs3SmnkP3cq5wa2rbkC3EsBKRDYD44S8YLozOQ zz6YwW1ExzN04MfT8Cemu5nd0KPnhlZ7W6aiE/LDVg7rLYMlueJdLEmq3f6L0P3novJN D7t6Fjpv+nO6KHKRf2kqR4CcmK9lZEDEnU9lciFxidE36PhZwLvyfvAQzi/DGinKq8P8 TqQEmQlWaNY6I5gi5QnuNJMekHOC2jCMGMr2bB8HS1F98jzB77OBKsdUJTB80hz/RWyg PhSw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=NNkxrjj33JRm1N241WvoJ+IFDDlykaL6zankCN+jAbU=; b=c5WlRGTTRNN00orSJ8uTjtt/fdfr0EhEuH0AWXSzAy2rJlWstts17mvob2gAg51l5Z zlvmP+17ttmnTfMRzSqqiKV63uy1navxQR7bSL+aZV8EILjYbTIVG/WJsbYno2M/Q59q QetUw41ePaTzB0EXnZeKubJys6AA8/0d/q1XQ0pC21/UHR/R8F4isfxSLmS+/EhgtMPA 45QRMDM0tGLxBYUe/rFF4yjqDev9i2hy3PS8/Q6o62mC6ITW4iOe5zR6XDOuMdinUuEI MZ2vlQjkxrxT1OoAYBHjiNNBpxJDpnJbH+RU4TukEg9klyujJh7X9d3RH5WAdceBuNWY zfMg== 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 er22si4389802ejc.499.2021.07.02.15.09.04; Fri, 02 Jul 2021 15:09:26 -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 S234385AbhGBWJv (ORCPT + 99 others); Fri, 2 Jul 2021 18:09:51 -0400 Received: from mga17.intel.com ([192.55.52.151]:15273 "EHLO mga17.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233344AbhGBWIS (ORCPT ); Fri, 2 Jul 2021 18:08:18 -0400 X-IronPort-AV: E=McAfee;i="6200,9189,10033"; a="189168391" X-IronPort-AV: E=Sophos;i="5.83,320,1616482800"; d="scan'208";a="189168391" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Jul 2021 15:05:30 -0700 X-IronPort-AV: E=Sophos;i="5.83,320,1616482800"; d="scan'208";a="642814866" Received: from ls.sc.intel.com (HELO localhost) ([143.183.96.54]) by fmsmga006-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Jul 2021 15:05:30 -0700 From: isaku.yamahata@intel.com To: Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H . Peter Anvin" , Paolo Bonzini , Vitaly Kuznetsov , Wanpeng Li , Jim Mattson , Joerg Roedel , erdemaktas@google.com, Connor Kuehl , Sean Christopherson , x86@kernel.org, linux-kernel@vger.kernel.org, kvm@vger.kernel.org Cc: isaku.yamahata@intel.com, isaku.yamahata@gmail.com, Sean Christopherson Subject: [RFC PATCH v2 56/69] KVM: VMX: Move setting of EPT MMU masks to common VT-x code Date: Fri, 2 Jul 2021 15:05:02 -0700 Message-Id: X-Mailer: git-send-email 2.25.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Sean Christopherson Signed-off-by: Sean Christopherson Signed-off-by: Isaku Yamahata --- arch/x86/kvm/vmx/main.c | 4 ++++ arch/x86/kvm/vmx/vmx.c | 4 ---- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/arch/x86/kvm/vmx/main.c b/arch/x86/kvm/vmx/main.c index c3fefa0e5a63..0d8d2a0a2979 100644 --- a/arch/x86/kvm/vmx/main.c +++ b/arch/x86/kvm/vmx/main.c @@ -34,6 +34,10 @@ static __init int vt_hardware_setup(void) if (ret) return ret; + if (enable_ept) + kvm_mmu_set_ept_masks(enable_ept_ad_bits, + cpu_has_vmx_ept_execute_only()); + return 0; } diff --git a/arch/x86/kvm/vmx/vmx.c b/arch/x86/kvm/vmx/vmx.c index 77b2b2cf76db..e315a46d1566 100644 --- a/arch/x86/kvm/vmx/vmx.c +++ b/arch/x86/kvm/vmx/vmx.c @@ -7644,10 +7644,6 @@ static __init int hardware_setup(void) set_bit(0, vmx_vpid_bitmap); /* 0 is reserved for host */ - if (enable_ept) - kvm_mmu_set_ept_masks(enable_ept_ad_bits, - cpu_has_vmx_ept_execute_only()); - if (!enable_ept) ept_lpage_level = 0; else if (cpu_has_vmx_ept_1g_page()) -- 2.25.1