From patchwork Mon Dec 3 21:52:50 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Sean Christopherson X-Patchwork-Id: 10710751 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5208116B1 for ; Mon, 3 Dec 2018 21:54:20 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 422AC29506 for ; Mon, 3 Dec 2018 21:54:20 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 364AB29EE5; Mon, 3 Dec 2018 21:54:20 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AFE3C29506 for ; Mon, 3 Dec 2018 21:54:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725915AbeLCVxU (ORCPT ); Mon, 3 Dec 2018 16:53:20 -0500 Received: from mga05.intel.com ([192.55.52.43]:29434 "EHLO mga05.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725800AbeLCVxU (ORCPT ); Mon, 3 Dec 2018 16:53:20 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 03 Dec 2018 13:53:20 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.56,311,1539673200"; d="scan'208";a="106704383" Received: from sjchrist-coffee.jf.intel.com ([10.54.74.154]) by fmsmga008.fm.intel.com with ESMTP; 03 Dec 2018 13:53:20 -0800 From: Sean Christopherson To: Paolo Bonzini , =?utf-8?b?UmFkaW0gS3LEjW3DocWZ?= Cc: kvm@vger.kernel.org Subject: [PATCH 00/28] KVM: VMX: Add "vmx" dir and shatter vmx.c Date: Mon, 3 Dec 2018 13:52:50 -0800 Message-Id: <20181203215318.15545-1-sean.j.christopherson@intel.com> X-Mailer: git-send-email 2.19.2 MIME-Version: 1.0 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The ultimate goal of this series is to break vmx.c's monopoly on all things VMX so that it's size goes from utterly ludicrous to merely ridiculous. For the most part the patches are simply moving code around. There are a few actual code changes sprinkled in, primarily to allow moving the nested code out of vmx.c without having to expose variables unnecessarily. Sean Christopherson (28): KVM: nVMX: Free the VMREAD/VMWRITE bitmaps if alloc_kvm_area() fails KVM: nVMX: Allocate and configure VM{READ,WRITE} bitmaps iff enable_shadow_vmcs KVM: VMX: Alphabetize the includes in vmx.c KVM: x86: Add requisite includes to kvm_cache_regs.h KVM: x86: Add requisite includes to hyperv.h KVM: VMX: Move VMX specific files to a "vmx" subdirectory KVM: VMX: rename vmx_shadow_fields.h to vmcs_shadow_fields.h KVM: VMX: Drop the "vmx" prefix from vmx_evmcs.h KVM: VMX: Move caching of MSR_IA32_XSS to hardware_setup() KVM: VMX: Properly handle dynamic VM Entry/Exit controls KVM: VMX: Pass vmx_capability struct to setup_vmcs_config() KVM: VMX: Move capabilities structs and helpers to dedicated file KVM: VMX: Expose various module param vars via capabilities.h KVM: VMX: Move VMCS definitions to dedicated file KVM: nVMX: Move vmcs12 code to dedicated files KVM: VMX: Move eVMCS code dedicated files KVM: VMX: Move VMX instruction wrappers to a dedicated header file KVM: VMX: Add vmx.h to hold VMX definitions and inline functions KVM: VMX: Move nested hardware/vcpu {un}setup to helper functions KVM: x86: nVMX: Allow nested_enable_evmcs to be NULL KVM: VMX: Move the hardware {un}setup functions to the bottom KVM: nVMX: Set callbacks for nested functions during hardware setup KVM: nVMX: Call nested_vmx_setup_ctls_msrs() iff @nested is true KVM: nVMX: Move "vmcs12 to shadow/evmcs sync" to helper function KVM: VMX: Expose misc variables needed for nested VMX KVM: VMX: Expose various getters and setters to nested VMX KVM: VMX: Expose nested_vmx_allowed() to nested VMX as a non-inline KVM: nVMX: Move nested code to dedicated files arch/x86/kvm/Makefile | 2 +- arch/x86/kvm/hyperv.h | 2 + arch/x86/kvm/kvm_cache_regs.h | 2 + arch/x86/kvm/vmx.c | 15290 ---------------- arch/x86/kvm/vmx/capabilities.h | 328 + arch/x86/kvm/{vmx_evmcs.h => vmx/evmcs.c} | 47 +- arch/x86/kvm/vmx/evmcs.h | 198 + arch/x86/kvm/vmx/nested.c | 5703 ++++++ arch/x86/kvm/vmx/nested.h | 282 + arch/x86/kvm/vmx/ops.h | 285 + arch/x86/kvm/{ => vmx}/pmu_intel.c | 0 arch/x86/kvm/vmx/vmcs.h | 136 + arch/x86/kvm/vmx/vmcs12.c | 157 + arch/x86/kvm/vmx/vmcs12.h | 462 + .../vmcs_shadow_fields.h} | 0 arch/x86/kvm/vmx/vmx.c | 7392 ++++++++ arch/x86/kvm/vmx/vmx.h | 602 + arch/x86/kvm/x86.c | 2 + 18 files changed, 15570 insertions(+), 15320 deletions(-) delete mode 100644 arch/x86/kvm/vmx.c create mode 100644 arch/x86/kvm/vmx/capabilities.h rename arch/x86/kvm/{vmx_evmcs.h => vmx/evmcs.c} (94%) create mode 100644 arch/x86/kvm/vmx/evmcs.h create mode 100644 arch/x86/kvm/vmx/nested.c create mode 100644 arch/x86/kvm/vmx/nested.h create mode 100644 arch/x86/kvm/vmx/ops.h rename arch/x86/kvm/{ => vmx}/pmu_intel.c (100%) create mode 100644 arch/x86/kvm/vmx/vmcs.h create mode 100644 arch/x86/kvm/vmx/vmcs12.c create mode 100644 arch/x86/kvm/vmx/vmcs12.h rename arch/x86/kvm/{vmx_shadow_fields.h => vmx/vmcs_shadow_fields.h} (100%) create mode 100644 arch/x86/kvm/vmx/vmx.c create mode 100644 arch/x86/kvm/vmx/vmx.h Acked-by: Radim Krčmář