Skip to content

Commit a49a879

Browse files
committed
Merge tag 'x86-cleanups-2025-03-22' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull x86 cleanups from Ingo Molnar: "Miscellaneous x86 cleanups by Arnd Bergmann, Charles Han, Mirsad Todorovac, Randy Dunlap, Thorsten Blum and Zhang Kunbo" * tag 'x86-cleanups-2025-03-22' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/coco: Replace 'static const cc_mask' with the newly introduced cc_get_mask() function x86/delay: Fix inconsistent whitespace selftests/x86/syscall: Fix coccinelle WARNING recommending the use of ARRAY_SIZE() x86/platform: Fix missing declaration of 'x86_apple_machine' x86/irq: Fix missing declaration of 'io_apic_irqs' x86/usercopy: Fix kernel-doc func param name in clean_cache_range()'s description x86/apic: Use str_disabled_enabled() helper in print_ipi_mode()
2 parents 71b639a + ec73859 commit a49a879

File tree

8 files changed

+19
-6
lines changed

8 files changed

+19
-6
lines changed

arch/x86/include/asm/coco.h

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@ enum cc_vendor {
1515
extern enum cc_vendor cc_vendor;
1616
extern u64 cc_mask;
1717

18+
static inline u64 cc_get_mask(void)
19+
{
20+
return cc_mask;
21+
}
22+
1823
static inline void cc_set_mask(u64 mask)
1924
{
2025
RIP_REL_REF(cc_mask) = mask;
@@ -25,7 +30,10 @@ u64 cc_mkdec(u64 val);
2530
void cc_random_init(void);
2631
#else
2732
#define cc_vendor (CC_VENDOR_NONE)
28-
static const u64 cc_mask = 0;
33+
static inline u64 cc_get_mask(void)
34+
{
35+
return 0;
36+
}
2937

3038
static inline u64 cc_mkenc(u64 val)
3139
{

arch/x86/include/asm/pgtable_types.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ enum page_cache_mode {
179179
};
180180
#endif
181181

182-
#define _PAGE_CC (_AT(pteval_t, cc_mask))
182+
#define _PAGE_CC (_AT(pteval_t, cc_get_mask()))
183183
#define _PAGE_ENC (_AT(pteval_t, sme_me_mask))
184184

185185
#define _PAGE_CACHE_MASK (_PAGE_PWT | _PAGE_PCD | _PAGE_PAT)

arch/x86/kernel/apic/ipi.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
#include <linux/cpumask.h>
44
#include <linux/delay.h>
55
#include <linux/smp.h>
6+
#include <linux/string_choices.h>
67

78
#include <asm/io_apic.h>
89

@@ -23,7 +24,7 @@ __setup("no_ipi_broadcast=", apic_ipi_shorthand);
2324
static int __init print_ipi_mode(void)
2425
{
2526
pr_info("IPI shorthand broadcast: %s\n",
26-
apic_ipi_shorthand_off ? "disabled" : "enabled");
27+
str_disabled_enabled(apic_ipi_shorthand_off));
2728
return 0;
2829
}
2930
late_initcall(print_ipi_mode);

arch/x86/kernel/i8259.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
#include <asm/desc.h>
2424
#include <asm/apic.h>
2525
#include <asm/i8259.h>
26+
#include <asm/io_apic.h>
2627

2728
/*
2829
* This is the 'legacy' 8259A Programmable Interrupt Controller,

arch/x86/kernel/quirks.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
#include <asm/setup.h>
1111
#include <asm/mce.h>
1212

13+
#include <linux/platform_data/x86/apple.h>
14+
1315
#if defined(CONFIG_X86_IO_APIC) && defined(CONFIG_SMP) && defined(CONFIG_PCI)
1416

1517
static void quirk_intel_irqbalance(struct pci_dev *dev)

arch/x86/lib/delay.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ static void delay_halt_mwaitx(u64 unused, u64 cycles)
131131
* Use cpu_tss_rw as a cacheline-aligned, seldom accessed per-cpu
132132
* variable as the monitor target.
133133
*/
134-
__monitorx(raw_cpu_ptr(&cpu_tss_rw), 0, 0);
134+
__monitorx(raw_cpu_ptr(&cpu_tss_rw), 0, 0);
135135

136136
/*
137137
* AMD, like Intel, supports the EAX hint and EAX=0xf means, do not

arch/x86/lib/usercopy_64.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
#ifdef CONFIG_ARCH_HAS_UACCESS_FLUSHCACHE
1919
/**
2020
* clean_cache_range - write back a cache range with CLWB
21-
* @vaddr: virtual start address
21+
* @addr: virtual start address
2222
* @size: number of bytes to write back
2323
*
2424
* Write back a cache range using the CLWB (cache line write back)

tools/testing/selftests/x86/syscall_numbering.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
#include <sys/mman.h>
2626

2727
#include <linux/ptrace.h>
28+
#include "../kselftest.h"
2829

2930
/* Common system call numbers */
3031
#define SYS_READ 0
@@ -313,7 +314,7 @@ static void test_syscall_numbering(void)
313314
* The MSB is supposed to be ignored, so we loop over a few
314315
* to test that out.
315316
*/
316-
for (size_t i = 0; i < sizeof(msbs)/sizeof(msbs[0]); i++) {
317+
for (size_t i = 0; i < ARRAY_SIZE(msbs); i++) {
317318
int msb = msbs[i];
318319
run("Checking system calls with msb = %d (0x%x)\n",
319320
msb, msb);

0 commit comments

Comments
 (0)