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 X-Spam-Level: X-Spam-Status: No, score=-26.3 required=3.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_GIT,USER_IN_DEF_DKIM_WL autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5C942C48BCD for ; Wed, 9 Jun 2021 23:44:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3B82F613EF for ; Wed, 9 Jun 2021 23:44:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230455AbhFIXqV (ORCPT ); Wed, 9 Jun 2021 19:46:21 -0400 Received: from mail-yb1-f201.google.com ([209.85.219.201]:42897 "EHLO mail-yb1-f201.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230385AbhFIXqM (ORCPT ); Wed, 9 Jun 2021 19:46:12 -0400 Received: by mail-yb1-f201.google.com with SMTP id 22-20020a250d160000b0290532b914c9f4so33366341ybn.9 for ; Wed, 09 Jun 2021 16:44:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=reply-to:date:in-reply-to:message-id:mime-version:references :subject:from:to:cc; bh=JW6PtqG5EBBMLWfIzHJuPDSiGDz3QYcEpSpJG7r7k4g=; b=Wbx/J0n9iESf85d0G1L74LLD2eLDijf8SWts0pPqgG2Sh6Qt30OBZcAeexQRuv2Eic AdDdnF7Ylc2SOHlJdoC3UVNxMt/X7lyHmAFrIxYmvsssBjq2lE/qjMVC5Ywox/b4dmbK 6Or2DNy9yEyhVAPfwLdxCSxfRL9wl/nJtSKM2e0/naTxCLKa7n1DZDteuLHsWHbSEP7k ywPmFqd7HCMdpm/KUzBcwG+HN20+uUH2hHynJtjnXjLJVRXqGxt9qgntherm675NlU2o tRNazhW5B1ioLVhGBf9yD6NY4i0tH3UR7T73lP+Sbzl2JFxhoSF4dnkXP/Slxro3GFgI eN+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:reply-to:date:in-reply-to:message-id :mime-version:references:subject:from:to:cc; bh=JW6PtqG5EBBMLWfIzHJuPDSiGDz3QYcEpSpJG7r7k4g=; b=I4o9jj1ArNDtpTVGeslAhCbERfpPZrmZFlYjIK5ex6EFmUvZf1vO99kLiqPIljYtVV 1Uw20wv12t5JpMR85JslYi3kJU3wJhlTDW+Wc5ddax1igP/XFzYRUJHfofZJgglaAqUB zSbzKcuAWu8xcGfRUnRVPoX2uH/QkwXxQSrItetpbNH47DMMlX+5fawbidDcQp11iAdy wii8gy6s0LnC/af5v18uvwFp51u+R9QPA1TXkwWJVbsmHF7Ar6fI3QfOobnlO982pbkI vRq6LBYmKP7q2zUZKaUZt5maFAYb9Tv2yGd8iaUT7T3AYZ3Myb+j5nYxqGEU63SDdyNg 58bA== X-Gm-Message-State: AOAM530/0jiK1cKvxom/S9RgjyT5OQdQYDN+ZcRxe2DoCl2mVnshWNS4 wc3zo4V4lOHSroq2kLd91z6PuH6Bqzo= X-Google-Smtp-Source: ABdhPJz/9YQGh8Mu2InFaNSyU2MwVQXomSR7fbxj6idTc8vdJENDrCVczbkCOzHIWvle3h2EcYAz7iWtxKw= X-Received: from seanjc798194.pdx.corp.google.com ([2620:15c:f:10:8daf:e5e:ae50:4f28]) (user=seanjc job=sendgmr) by 2002:a25:aa53:: with SMTP id s77mr3153575ybi.89.1623282197388; Wed, 09 Jun 2021 16:43:17 -0700 (PDT) Reply-To: Sean Christopherson Date: Wed, 9 Jun 2021 16:42:35 -0700 In-Reply-To: <20210609234235.1244004-1-seanjc@google.com> Message-Id: <20210609234235.1244004-16-seanjc@google.com> Mime-Version: 1.0 References: <20210609234235.1244004-1-seanjc@google.com> X-Mailer: git-send-email 2.32.0.rc1.229.g3e70b5a671-goog Subject: [PATCH 15/15] KVM: nVMX: Drop redundant checks on vmcs12 in EPTP switching emulation From: Sean Christopherson To: Paolo Bonzini Cc: Sean Christopherson , Vitaly Kuznetsov , Wanpeng Li , Jim Mattson , Joerg Roedel , kvm@vger.kernel.org, linux-kernel@vger.kernel.org, Junaid Shahid , Maxim Levitsky , Lai Jiangshan Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Drop the explicit checks on EPTP switching and EPT itself being enabled. The EPTP switching check is handled in the generic VMFUNC function check, the underlying VMFUNC enablement check is done by hardware and redone by generic VMFUNC emulation, and the vmcs12 EPT check is handled by KVM at VM-Enter in the form of a consistency check. Signed-off-by: Sean Christopherson --- arch/x86/kvm/vmx/nested.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/arch/x86/kvm/vmx/nested.c b/arch/x86/kvm/vmx/nested.c index 0075d3f0f8fa..479ec9378609 100644 --- a/arch/x86/kvm/vmx/nested.c +++ b/arch/x86/kvm/vmx/nested.c @@ -5448,10 +5448,6 @@ static int nested_vmx_eptp_switching(struct kvm_vcpu *vcpu, u32 index = kvm_rcx_read(vcpu); u64 new_eptp; - if (!nested_cpu_has_eptp_switching(vmcs12) || - !nested_cpu_has_ept(vmcs12)) - return 1; - if (index >= VMFUNC_EPTP_ENTRIES) return 1; -- 2.32.0.rc1.229.g3e70b5a671-goog