Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp3041059ybt; Mon, 22 Jun 2020 13:24:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxxOrCNcPfvq98oblTR11QdSaxyPeSaCAKpXzYPZRpEDd71UihGkYw5tBw58TqkSCuUWrDl X-Received: by 2002:a05:6402:459:: with SMTP id p25mr18423044edw.383.1592857489848; Mon, 22 Jun 2020 13:24:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592857489; cv=none; d=google.com; s=arc-20160816; b=v9YI8DQs+rYLl9ZRkkyQyZrfW/5e8M+2yqlvPxfEGZYeukdijLUyvJSnVwfFJc1f78 T3XCMuwAAeEnqiIfH+hYyQMAkrKtrOq75SGpU0AkXMfmFMkuXDTTdCru2f4bQUx5etEQ DNrmwOAVwsar9YLfo1cChVlrJMQtj4XvWPGhzJvDuJCXyEVbCzHMvbpW03tHYvTOjZ1F 8BD6dH4nuxD99zx6F+PSI+bKUJvkppfZaDsIUNTu+v2XPxM1hQw9/mNf9kIoaAcDEqni HZiHFYH/K4BQ9oLiz/8ewpr8IquzdOnm+b+7wExHnVP00M8O5X/v5l1uclkwI04DnYYg 9P6Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :ironport-sdr:ironport-sdr; bh=tqNrETvHoh1uAIFEoCBMfccBUVKtCi0rTb6OvX/Lsg8=; b=XARl9ILR9IQA9lJySfxPAqBurnD2GTCg2/Ao+uV94unVvllmp0d5YkivMTO2y/XcJ6 mqWVd1uS2D66HYNtONljGSaVvXNFVAmDEkpA9D9vETjbhuzdLrQ3sa0WvraG80xd5APC ZLe3s8Dgrc3gtBh249AZ3lR5onwAdv9LA4n3gxWsjftiCfMsXU+/yCYcRtYE7G0ZR6Je +FXnlACnX3KRvQ8c4poPDOZPWkb0GiwVp+0cthnTJY4B4/4ZJBwTq7u+842k6CAb4XP8 NL586h7lrxB8Z3xl0WTABpaeJcYCJ4u7qYX/Bp53JuLQAKmA1T6ZGzUorvsvB/X8Fo4U EQZg== 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 a2si10327278edk.226.2020.06.22.13.24.27; Mon, 22 Jun 2020 13:24:49 -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 S1730283AbgFVUUm (ORCPT + 99 others); Mon, 22 Jun 2020 16:20:42 -0400 Received: from mga07.intel.com ([134.134.136.100]:62019 "EHLO mga07.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728873AbgFVUUi (ORCPT ); Mon, 22 Jun 2020 16:20:38 -0400 IronPort-SDR: QP0icH5NLimKnRuzWPE+secECg6sQBbWONr8Ykxdy7PRNOyD3Zp6UUPyrOqw0TJ84GTM07UBnR 9V8HDTqrft0w== X-IronPort-AV: E=McAfee;i="6000,8403,9660"; a="209057480" X-IronPort-AV: E=Sophos;i="5.75,268,1589266800"; d="scan'208";a="209057480" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Jun 2020 13:20:37 -0700 IronPort-SDR: CFCRnBS8ZevUWM4CFXbpCpIhHc1N5xei/GmT6ngoO6YU1nh+yS9qqo5/lfyIHLOxizbEHUuqlt +RCVKu9gyLmw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,268,1589266800"; d="scan'208";a="478506330" Received: from sjchrist-coffee.jf.intel.com ([10.54.74.152]) by fmsmga006.fm.intel.com with ESMTP; 22 Jun 2020 13:20:37 -0700 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 Subject: [PATCH 3/6] KVM: x86/mmu: Add MMU-internal header Date: Mon, 22 Jun 2020 13:20:31 -0700 Message-Id: <20200622202034.15093-4-sean.j.christopherson@intel.com> X-Mailer: git-send-email 2.26.0 In-Reply-To: <20200622202034.15093-1-sean.j.christopherson@intel.com> References: <20200622202034.15093-1-sean.j.christopherson@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add mmu/mmu_internal.h to hold declarations and definitions that need to be shared between various mmu/ files, but should not be used by anything outside of the MMU. Begin populating mmu_internal.h with declarations of the helpers used by page_track.c. Signed-off-by: Sean Christopherson --- arch/x86/kvm/mmu.h | 4 ---- arch/x86/kvm/mmu/mmu.c | 1 + arch/x86/kvm/mmu/mmu_internal.h | 10 ++++++++++ arch/x86/kvm/mmu/page_track.c | 2 +- 4 files changed, 12 insertions(+), 5 deletions(-) create mode 100644 arch/x86/kvm/mmu/mmu_internal.h diff --git a/arch/x86/kvm/mmu.h b/arch/x86/kvm/mmu.h index d46944488e72..434acfcbf710 100644 --- a/arch/x86/kvm/mmu.h +++ b/arch/x86/kvm/mmu.h @@ -209,10 +209,6 @@ static inline u8 permission_fault(struct kvm_vcpu *vcpu, struct kvm_mmu *mmu, void kvm_zap_gfn_range(struct kvm *kvm, gfn_t gfn_start, gfn_t gfn_end); -void kvm_mmu_gfn_disallow_lpage(struct kvm_memory_slot *slot, gfn_t gfn); -void kvm_mmu_gfn_allow_lpage(struct kvm_memory_slot *slot, gfn_t gfn); -bool kvm_mmu_slot_gfn_write_protect(struct kvm *kvm, - struct kvm_memory_slot *slot, u64 gfn); int kvm_arch_write_log_dirty(struct kvm_vcpu *vcpu); int kvm_mmu_post_init_vm(struct kvm *kvm); diff --git a/arch/x86/kvm/mmu/mmu.c b/arch/x86/kvm/mmu/mmu.c index 1b4d45b8f462..c1bf30e24bfc 100644 --- a/arch/x86/kvm/mmu/mmu.c +++ b/arch/x86/kvm/mmu/mmu.c @@ -18,6 +18,7 @@ #include "irq.h" #include "ioapic.h" #include "mmu.h" +#include "mmu_internal.h" #include "x86.h" #include "kvm_cache_regs.h" #include "kvm_emulate.h" diff --git a/arch/x86/kvm/mmu/mmu_internal.h b/arch/x86/kvm/mmu/mmu_internal.h new file mode 100644 index 000000000000..d7938c37c7de --- /dev/null +++ b/arch/x86/kvm/mmu/mmu_internal.h @@ -0,0 +1,10 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +#ifndef __KVM_X86_MMU_INTERNAL_H +#define __KVM_X86_MMU_INTERNAL_H + +void kvm_mmu_gfn_disallow_lpage(struct kvm_memory_slot *slot, gfn_t gfn); +void kvm_mmu_gfn_allow_lpage(struct kvm_memory_slot *slot, gfn_t gfn); +bool kvm_mmu_slot_gfn_write_protect(struct kvm *kvm, + struct kvm_memory_slot *slot, u64 gfn); + +#endif /* __KVM_X86_MMU_INTERNAL_H */ diff --git a/arch/x86/kvm/mmu/page_track.c b/arch/x86/kvm/mmu/page_track.c index a7bcde34d1f2..a84a141a2ad2 100644 --- a/arch/x86/kvm/mmu/page_track.c +++ b/arch/x86/kvm/mmu/page_track.c @@ -16,7 +16,7 @@ #include -#include "mmu.h" +#include "mmu_internal.h" void kvm_page_track_free_memslot(struct kvm_memory_slot *slot) { -- 2.26.0