Commit ac633ba7 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge tag 'x86-cleanups-2026-04-13' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull x86 cleanups from Ingo Molnar:

 - Consolidate AMD and Hygon cases in parse_topology() (Wei Wang)

 - asm constraints cleanups in __iowrite32_copy() (Uros Bizjak)

 - Drop AMD Extended Interrupt LVT macros (Naveen N Rao)

 - Don't use REALLY_SLOW_IO for delays (Juergen Gross)

 - paravirt cleanups (Juergen Gross)

 - FPU code cleanups (Borislav Petkov)

 - split-lock handling code cleanups (Borislav Petkov, Ronan Pigott)

* tag 'x86-cleanups-2026-04-13' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  x86/fpu: Correct the comment explaining what xfeatures_in_use() does
  x86/split_lock: Don't warn about unknown split_lock_detect parameter
  x86/fpu: Correct misspelled xfeaures_to_write local var
  x86/apic: Drop AMD Extended Interrupt LVT macros
  x86/cpu/topology: Consolidate AMD and Hygon cases in parse_topology()
  block/floppy: Don't use REALLY_SLOW_IO for delays
  x86/paravirt: Replace io_delay() hook with a bool
  x86/irqflags: Preemptively move include paravirt.h directive where it belongs
  x86/split_lock: Restructure the unwieldy switch-case in sld_state_show()
  x86/local: Remove trailing semicolon from _ASM_XADD in local_add_return()
  x86/asm: Use inout "+" asm onstraint modifiers in __iowrite32_copy()
parents 2ee08a89 9b8ad2b6
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -1748,7 +1748,7 @@ EXPORT_SYMBOL(get_ibs_caps);

static inline int get_eilvt(int offset)
{
	return !setup_APIC_eilvt(offset, 0, APIC_EILVT_MSG_NMI, 1);
	return !setup_APIC_eilvt(offset, 0, APIC_DELIVERY_MODE_NMI, 1);
}

static inline int put_eilvt(int offset)
@@ -1897,7 +1897,7 @@ static void setup_APIC_ibs(void)
	if (offset < 0)
		goto failed;

	if (!setup_APIC_eilvt(offset, 0, APIC_EILVT_MSG_NMI, 0))
	if (!setup_APIC_eilvt(offset, 0, APIC_DELIVERY_MODE_NMI, 0))
		return;
failed:
	pr_warn("perf: IBS APIC setup failed on cpu #%d\n",
@@ -1910,7 +1910,7 @@ static void clear_APIC_ibs(void)

	offset = get_ibs_lvt_offset();
	if (offset >= 0)
		setup_APIC_eilvt(offset, 0, APIC_EILVT_MSG_FIX, 1);
		setup_APIC_eilvt(offset, 0, APIC_DELIVERY_MODE_FIXED, 1);
}

static int x86_pmu_amd_ibs_starting_cpu(unsigned int cpu)
+0 −7
Original line number Diff line number Diff line
@@ -138,15 +138,8 @@
#define APIC_SEOI	0x420
#define APIC_IER	0x480
#define APIC_EILVTn(n)	(0x500 + 0x10 * n)
#define		APIC_EILVT_NR_AMD_K8	1	/* # of extended interrupts */
#define		APIC_EILVT_NR_AMD_10H	4
#define		APIC_EILVT_NR_MAX	APIC_EILVT_NR_AMD_10H
#define		APIC_EILVT_LVTOFF(x)	(((x) >> 4) & 0xF)
#define		APIC_EILVT_MSG_FIX	0x0
#define		APIC_EILVT_MSG_SMI	0x2
#define		APIC_EILVT_MSG_NMI	0x4
#define		APIC_EILVT_MSG_EXT	0x7
#define		APIC_EILVT_MASKED	(1 << 16)

#define APIC_BASE (fix_to_virt(FIX_APIC_BASE))
#define APIC_BASE_MSR		0x800
+22 −5
Original line number Diff line number Diff line
@@ -29,9 +29,6 @@
#define CSW fd_routine[can_use_virtual_dma & 1]


#define fd_inb(base, reg)		inb_p((base) + (reg))
#define fd_outb(value, base, reg)	outb_p(value, (base) + (reg))

#define fd_request_dma()	CSW._request_dma(FLOPPY_DMA, "floppy")
#define fd_free_dma()		CSW._free_dma(FLOPPY_DMA)
#define fd_enable_irq()		enable_irq(FLOPPY_IRQ)
@@ -49,6 +46,26 @@ static char *virtual_dma_addr;
static int virtual_dma_mode;
static int doing_pdma;

static inline u8 fd_inb(u16 base, u16 reg)
{
	u8 ret = inb_p(base + reg);

	native_io_delay();
	native_io_delay();
	native_io_delay();

	return ret;
}

static inline void fd_outb(u8 value, u16 base, u16 reg)
{
	outb_p(value, base + reg);

	native_io_delay();
	native_io_delay();
	native_io_delay();
}

static irqreturn_t floppy_hardint(int irq, void *dev_id)
{
	unsigned char st;
@@ -79,9 +96,9 @@ static irqreturn_t floppy_hardint(int irq, void *dev_id)
			if (st != (STATUS_DMA | STATUS_READY))
				break;
			if (virtual_dma_mode)
				outb_p(*lptr, virtual_dma_port + FD_DATA);
				fd_outb(*lptr, virtual_dma_port, FD_DATA);
			else
				*lptr = inb_p(virtual_dma_port + FD_DATA);
				*lptr = fd_inb(virtual_dma_port, FD_DATA);
		}
		virtual_dma_count = lcount;
		virtual_dma_addr = lptr;
+1 −1
Original line number Diff line number Diff line
@@ -23,7 +23,7 @@ static inline void xsetbv(u32 index, u64 value)

/*
 * Return a mask of xfeatures which are currently being tracked
 * by the processor as being in the initial configuration.
 * by the processor as being not in the initial configuration.
 *
 * Callers should check X86_FEATURE_XGETBV1.
 */
+8 −11
Original line number Diff line number Diff line
@@ -218,9 +218,8 @@ static inline void __iowrite32_copy(void __iomem *to, const void *from,
				    size_t count)
{
	asm volatile("rep movsl"
		     : "=&c"(count), "=&D"(to), "=&S"(from)
		     : "0"(count), "1"(to), "2"(from)
		     : "memory");
		     : "+D"(to), "+S"(from), "+c"(count)
		     : : "memory");
}
#define __iowrite32_copy __iowrite32_copy
#endif
@@ -243,21 +242,19 @@ extern int io_delay_type;
extern void io_delay_init(void);

#if defined(CONFIG_PARAVIRT)
#include <asm/paravirt.h>
#include <asm/paravirt-base.h>
#else
#define call_io_delay() true
#endif

static inline void slow_down_io(void)
{
	if (!call_io_delay())
		return;

	native_io_delay();
#ifdef REALLY_SLOW_IO
	native_io_delay();
	native_io_delay();
	native_io_delay();
#endif
}

#endif

#define BUILDIO(bwl, type)						\
static inline void out##bwl##_p(type value, u16 port)			\
{									\
Loading