Skip to content

Commit

Permalink
Merge tag 'x86-cleanups-2025-03-22' of git://git.kernel.org/pub/scm/l…
Browse files Browse the repository at this point in the history
…inux/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()
  • Loading branch information
Linus Torvalds committed Mar 25, 2025
2 parents 71b639a + ec73859 commit a49a879
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 6 deletions.
10 changes: 9 additions & 1 deletion arch/x86/include/asm/coco.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ enum cc_vendor {
extern enum cc_vendor cc_vendor;
extern u64 cc_mask;

static inline u64 cc_get_mask(void)
{
return cc_mask;
}

static inline void cc_set_mask(u64 mask)
{
RIP_REL_REF(cc_mask) = mask;
Expand All @@ -25,7 +30,10 @@ u64 cc_mkdec(u64 val);
void cc_random_init(void);
#else
#define cc_vendor (CC_VENDOR_NONE)
static const u64 cc_mask = 0;
static inline u64 cc_get_mask(void)
{
return 0;
}

static inline u64 cc_mkenc(u64 val)
{
Expand Down
2 changes: 1 addition & 1 deletion arch/x86/include/asm/pgtable_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ enum page_cache_mode {
};
#endif

#define _PAGE_CC (_AT(pteval_t, cc_mask))
#define _PAGE_CC (_AT(pteval_t, cc_get_mask()))
#define _PAGE_ENC (_AT(pteval_t, sme_me_mask))

#define _PAGE_CACHE_MASK (_PAGE_PWT | _PAGE_PCD | _PAGE_PAT)
Expand Down
3 changes: 2 additions & 1 deletion arch/x86/kernel/apic/ipi.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#include <linux/cpumask.h>
#include <linux/delay.h>
#include <linux/smp.h>
#include <linux/string_choices.h>

#include <asm/io_apic.h>

Expand All @@ -23,7 +24,7 @@ __setup("no_ipi_broadcast=", apic_ipi_shorthand);
static int __init print_ipi_mode(void)
{
pr_info("IPI shorthand broadcast: %s\n",
apic_ipi_shorthand_off ? "disabled" : "enabled");
str_disabled_enabled(apic_ipi_shorthand_off));
return 0;
}
late_initcall(print_ipi_mode);
Expand Down
1 change: 1 addition & 0 deletions arch/x86/kernel/i8259.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#include <asm/desc.h>
#include <asm/apic.h>
#include <asm/i8259.h>
#include <asm/io_apic.h>

/*
* This is the 'legacy' 8259A Programmable Interrupt Controller,
Expand Down
2 changes: 2 additions & 0 deletions arch/x86/kernel/quirks.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
#include <asm/setup.h>
#include <asm/mce.h>

#include <linux/platform_data/x86/apple.h>

#if defined(CONFIG_X86_IO_APIC) && defined(CONFIG_SMP) && defined(CONFIG_PCI)

static void quirk_intel_irqbalance(struct pci_dev *dev)
Expand Down
2 changes: 1 addition & 1 deletion arch/x86/lib/delay.c
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ static void delay_halt_mwaitx(u64 unused, u64 cycles)
* Use cpu_tss_rw as a cacheline-aligned, seldom accessed per-cpu
* variable as the monitor target.
*/
__monitorx(raw_cpu_ptr(&cpu_tss_rw), 0, 0);
__monitorx(raw_cpu_ptr(&cpu_tss_rw), 0, 0);

/*
* AMD, like Intel, supports the EAX hint and EAX=0xf means, do not
Expand Down
2 changes: 1 addition & 1 deletion arch/x86/lib/usercopy_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#ifdef CONFIG_ARCH_HAS_UACCESS_FLUSHCACHE
/**
* clean_cache_range - write back a cache range with CLWB
* @vaddr: virtual start address
* @addr: virtual start address
* @size: number of bytes to write back
*
* Write back a cache range using the CLWB (cache line write back)
Expand Down
3 changes: 2 additions & 1 deletion tools/testing/selftests/x86/syscall_numbering.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#include <sys/mman.h>

#include <linux/ptrace.h>
#include "../kselftest.h"

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

0 comments on commit a49a879

Please sign in to comment.