x86/ucode: Move interface from processor.h to microcode.h
authorAndrew Cooper <andrew.cooper3@citrix.com>
Wed, 18 Mar 2020 20:18:21 +0000 (20:18 +0000)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Fri, 20 Mar 2020 18:42:24 +0000 (18:42 +0000)
This reduces the complexity of processor.h, particularly the need to include
public/xen.h.  Substitute processor.h includes for microcode.h in some
sources, and add microcode.h includes in others.

Only 4 of the function declarations are actually called externally.  Move the
vendor init declarations to private.h

No functional change.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
xen/arch/x86/acpi/power.c
xen/arch/x86/cpu/microcode/private.h
xen/arch/x86/efi/efi-boot.h
xen/arch/x86/platform_hypercall.c
xen/arch/x86/setup.c
xen/arch/x86/smpboot.c
xen/arch/x86/spec_ctrl.c
xen/include/asm-x86/microcode.h
xen/include/asm-x86/processor.h

index b5df00b22c4065e358927f76c5f1c86b6ff1d668..e3d6eefe6590925e38d19769e984f100a00a43fc 100644 (file)
@@ -30,6 +30,7 @@
 #include <asm/tboot.h>
 #include <asm/apic.h>
 #include <asm/io_apic.h>
+#include <asm/microcode.h>
 #include <asm/spec_ctrl.h>
 #include <acpi/cpufreq/cpufreq.h>
 
index 2e3be79eaf74ade7f80cf41cbe647364e56ede9c..459b6a4c54bb018a1c94736d42715cdb783286d7 100644 (file)
@@ -34,4 +34,7 @@ struct microcode_ops {
 
 extern const struct microcode_ops *microcode_ops;
 
+int microcode_init_intel(void);
+int microcode_init_amd(void);
+
 #endif /* ASM_X86_MICROCODE_PRIVATE_H */
index bf7b0a61dc2c1ef31a5079da684c982191418789..7bfb96875c9673d9cdda1c1ad72d49d9c761ae99 100644 (file)
@@ -6,8 +6,8 @@
 #include <xen/vga.h>
 #include <asm/e820.h>
 #include <asm/edd.h>
+#include <asm/microcode.h>
 #include <asm/msr.h>
-#include <asm/processor.h>
 
 static struct file __initdata ucode;
 static multiboot_info_t __initdata mbi = {
index 80efb84328951430b07ff74185f4312bc6f74ed5..ee2efdd875ee13a42ff8d73a7c163b495316e8dc 100644 (file)
@@ -27,6 +27,7 @@
 #include <public/platform.h>
 #include <acpi/cpufreq/processor_perf.h>
 #include <asm/edd.h>
+#include <asm/microcode.h>
 #include <asm/mtrr.h>
 #include <asm/io_apic.h>
 #include <asm/setup.h>
index c87040c8906e0537993a242c1a70ecca9ef3418e..885919d5c3c4d6f200bfed123e291f62c36ff84b 100644 (file)
@@ -52,6 +52,7 @@
 #include <asm/cpuid.h>
 #include <asm/spec_ctrl.h>
 #include <asm/guest.h>
+#include <asm/microcode.h>
 
 /* opt_nosmp: If true, secondary processors are ignored. */
 static bool __initdata opt_nosmp;
index 0e54bd14f3c5b516f570c420f33126404d734448..09264b02d1752398da6482e16c341a3ab39042ca 100644 (file)
@@ -39,6 +39,7 @@
 #include <asm/div64.h>
 #include <asm/flushtlb.h>
 #include <asm/guest.h>
+#include <asm/microcode.h>
 #include <asm/msr.h>
 #include <asm/mtrr.h>
 #include <asm/spec_ctrl.h>
index aed2c6613a53eda7ea6ba2aed5c45d448cdc6f69..c5d8e587a805b7d695d1fef0d81dccac95b8cfb5 100644 (file)
@@ -24,7 +24,6 @@
 
 #include <asm/microcode.h>
 #include <asm/msr.h>
-#include <asm/processor.h>
 #include <asm/pv/domain.h>
 #include <asm/pv/shim.h>
 #include <asm/setup.h>
index 9b6ff7db085ebf2cb7a40833f9637b83e0a56fc2..89b9aaa02d5871d70da4c8114b631577029e8980 100644 (file)
@@ -1,8 +1,11 @@
 #ifndef ASM_X86__MICROCODE_H
 #define ASM_X86__MICROCODE_H
 
+#include <xen/types.h>
 #include <xen/percpu.h>
 
+#include <public/xen.h>
+
 struct cpu_signature {
     unsigned int sig;
     unsigned int pf;
@@ -11,4 +14,9 @@ struct cpu_signature {
 
 DECLARE_PER_CPU(struct cpu_signature, cpu_sig);
 
+void microcode_set_module(unsigned int idx);
+int microcode_update(XEN_GUEST_HANDLE_PARAM(const_void), unsigned long len);
+int early_microcode_init(void);
+int microcode_update_one(bool start_update);
+
 #endif /* ASM_X86__MICROCODE_H */
index 895c7032b9a56dd12234fa7638017ad209327416..fe231c50728c705604a802ab142797a31b73e717 100644 (file)
@@ -9,7 +9,6 @@
 #include <xen/types.h>
 #include <xen/smp.h>
 #include <xen/percpu.h>
-#include <public/xen.h>
 #include <asm/types.h>
 #include <asm/cpufeature.h>
 #include <asm/desc.h>
@@ -579,13 +578,6 @@ void cpuid_hypervisor_leaves(const struct vcpu *v, uint32_t leaf,
 int guest_rdmsr_xen(const struct vcpu *v, uint32_t idx, uint64_t *val);
 int guest_wrmsr_xen(struct vcpu *v, uint32_t idx, uint64_t val);
 
-void microcode_set_module(unsigned int);
-int microcode_update(XEN_GUEST_HANDLE_PARAM(const_void), unsigned long len);
-int early_microcode_init(void);
-int microcode_update_one(bool start_update);
-int microcode_init_intel(void);
-int microcode_init_amd(void);
-
 static inline uint8_t get_cpu_family(uint32_t raw, uint8_t *model,
                                      uint8_t *stepping)
 {