Skip to content

Commit

Permalink
KVM: x86/mmu: Include mmu.h in spte.h
Browse files Browse the repository at this point in the history
Explicitly include mmu.h in spte.h instead of relying on the "parent" to
include mmu.h.  spte.h references a variety of macros and variables that
are defined/declared in mmu.h, and so including spte.h before (or instead
of) mmu.h will result in build errors, e.g.

  arch/x86/kvm/mmu/spte.h: In function ‘is_mmio_spte’:
  arch/x86/kvm/mmu/spte.h:242:23: error: ‘enable_mmio_caching’ undeclared
    242 |                likely(enable_mmio_caching);
        |                       ^~~~~~~~~~~~~~~~~~~

  arch/x86/kvm/mmu/spte.h: In function ‘is_large_pte’:
  arch/x86/kvm/mmu/spte.h:302:22: error: ‘PT_PAGE_SIZE_MASK’ undeclared
    302 |         return pte & PT_PAGE_SIZE_MASK;
        |                      ^~~~~~~~~~~~~~~~~

  arch/x86/kvm/mmu/spte.h: In function ‘is_dirty_spte’:
  arch/x86/kvm/mmu/spte.h:332:56: error: ‘PT_WRITABLE_MASK’ undeclared
    332 |         return dirty_mask ? spte & dirty_mask : spte & PT_WRITABLE_MASK;
        |                                                        ^~~~~~~~~~~~~~~~

Fixes: 5a9624a ("KVM: mmu: extract spte.h and spte.c")
Link: https://lore.kernel.org/r/20230808224059.2492476-1-seanjc@google.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
  • Loading branch information
sean-jc committed Aug 25, 2023
1 parent a328a35 commit bfd9262
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions arch/x86/kvm/mmu/spte.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#ifndef KVM_X86_MMU_SPTE_H
#define KVM_X86_MMU_SPTE_H

#include "mmu.h"
#include "mmu_internal.h"

/*
Expand Down

0 comments on commit bfd9262

Please sign in to comment.