x86: Clean up asm/msr.h

Now that content has been split out, minimise the header files as msr.h is
included by many translation units.  A few more TUs were pulling dependencies
in transitively, so fix them up.

Give asm/time.h an SPDX tag, update it's guards, and drop the unused rdpmc().
If we do re-gain uses, the helper will want a proper API.

No functional change.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
This commit is contained in:
Andrew Cooper committed 2025-08-19 19:52:48 +01:00
1 parent 1373eca837
commit 5ea2d0952e
5 files changed
+19 -17

No files matched your search

+2
View File
@@ -14,8 +14,10 @@
#include <xen/delay.h>
#include <xen/errno.h>
#include <xen/param.h>
#include <xen/smp.h>
#include <asm/msr.h>
#include <asm/processor.h>
#include <acpi/acpi.h>
#include <acpi/cpufreq/cpufreq.h>
+4
View File
@@ -8,8 +8,12 @@
#include <xen/cpumask.h>
#include <xen/init.h>
#include <xen/param.h>
#include <xen/smp.h>
#include <xen/xmalloc.h>
#include <asm/msr.h>
#include <asm/processor.h>
#include <acpi/cpufreq/cpufreq.h>
static bool __ro_after_init hwp_in_use;
+4
View File
@@ -23,8 +23,12 @@
#include <xen/err.h>
#include <xen/init.h>
#include <xen/lib.h>
#include <xen/string.h>
#include <xen/xmalloc.h>
#include <asm/msr.h>
#include <asm/processor.h>
#include <asm/system.h>
#include "private.h"
+7 -17
View File
@@ -1,18 +1,13 @@
#ifndef __ASM_MSR_H
#define __ASM_MSR_H
/* SPDX-License-Identifier: GPL-2.0-only */
#ifndef X86_MSR_H
#define X86_MSR_H
#include "msr-index.h"
#include <xen/types.h>
#include <xen/percpu.h>
#include <xen/errno.h>
#include <xen/kernel.h>
#include <xen/lib/x86/cpu-policy.h>
#include <xen/percpu.h>
#include <asm/alternative.h>
#include <asm/asm_defns.h>
#include <asm/cpufeature.h>
#include <asm/processor.h>
#include <asm/msr-index.h>
#define rdmsr(msr,val1,val2) \
__asm__ __volatile__("rdmsr" \
@@ -87,11 +82,6 @@ static inline int wrmsr_safe(unsigned int msr, uint64_t val)
return -EFAULT;
}
#define rdpmc(counter,low,high) \
__asm__ __volatile__("rdpmc" \
: "=a" (low), "=d" (high) \
: "c" (counter))
DECLARE_PER_CPU(uint64_t, efer);
static inline uint64_t read_efer(void)
{
@@ -118,4 +108,4 @@ static inline void wrmsr_tsc_aux(uint32_t val)
}
}
#endif /* __ASM_MSR_H */
#endif /* X86_MSR_H */
+2
View File
@@ -1,7 +1,9 @@
#include <xen/init.h>
#include <xen/param.h>
#include <asm/microcode.h>
#include <asm/msr.h>
#include <asm/processor.h>
/*
* Valid values:
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.