x86/debug: Include percpu.h in debugreg.h to get DECLARE_PER_CPU() et al
authorSean Christopherson <seanjc@google.com>
Thu, 10 Nov 2022 20:17:07 +0000 (20:17 +0000)
committerPeter Zijlstra <peterz@infradead.org>
Wed, 16 Nov 2022 09:12:56 +0000 (10:12 +0100)
Include percpu.h to pick up the definition of DECLARE_PER_CPU() and
friends instead of relying on the parent to provide the #include.  E.g.
swapping the order of includes in arch/x86/kvm/vmx/nested.c (simulating
KVM code movement being done for other purposes) results in build errors:

  In file included from arch/x86/kvm/vmx/nested.c:3:
  arch/x86/include/asm/debugreg.h:9:32: error: unknown type name â\80\98cpu_dr7â\80=99
      9 | DECLARE_PER_CPU(unsigned long, cpu_dr7);
        |                                ^~~~~~~

Signed-off-by: Sean Christopherson <seanjc@google.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lkml.kernel.org/r/20221110201707.1976032-1-seanjc@google.com
arch/x86/include/asm/debugreg.h

index cfdf307ddc0129019f64efebc01bf5a5159578fa..b049d950612fdd7c01b0508adcb9d8014ad9545f 100644 (file)
@@ -2,8 +2,8 @@
 #ifndef _ASM_X86_DEBUGREG_H
 #define _ASM_X86_DEBUGREG_H
 
-
 #include <linux/bug.h>
+#include <linux/percpu.h>
 #include <uapi/asm/debugreg.h>
 
 DECLARE_PER_CPU(unsigned long, cpu_dr7);