The patch titled paravirtualization: Add APIC accessors to paravirt-ops. has been added to the -mm tree. Its filename is paravirtualization-add-apic-accessors-to-paravirt-ops.patch See http://www.zip.com.au/~akpm/linux/patches/stuff/added-to-mm.txt to find out what to do about this ------------------------------------------------------ Subject: paravirtualization: Add APIC accessors to paravirt-ops. From: Rusty Russell <rusty@xxxxxxxxxxxxxxx> Add APIC accessors to paravirt-ops. Unfortunately, we need two write functions, as some older broken hardware requires workarounds for Pentium APIC errata - this is the purpose of apic_write_atomic. Signed-off-by: Zachary Amsden <zach@xxxxxxxxxx> Signed-off-by: Chris Wright <chrisw@xxxxxxxxxxxx> Cc: Rusty Russell <rusty@xxxxxxxxxxxxxxx> Cc: Jeremy Fitzhardinge <jeremy@xxxxxxxx> Cc: Andi Kleen <ak@xxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxx> --- arch/i386/kernel/paravirt.c | 8 ++++++++ include/asm-i386/apic.h | 15 ++++++++++++--- include/asm-i386/paravirt.h | 27 +++++++++++++++++++++++++++ 3 files changed, 47 insertions(+), 3 deletions(-) diff -puN arch/i386/kernel/paravirt.c~paravirtualization-add-apic-accessors-to-paravirt-ops arch/i386/kernel/paravirt.c --- a/arch/i386/kernel/paravirt.c~paravirtualization-add-apic-accessors-to-paravirt-ops +++ a/arch/i386/kernel/paravirt.c @@ -29,6 +29,8 @@ #include <asm/time.h> #include <asm/irq.h> #include <asm/delay.h> +#include <asm/fixmap.h> +#include <asm/apic.h> /* nop stub */ static void native_nop(void) @@ -441,6 +443,12 @@ struct paravirt_ops paravirt_ops = { .io_delay = native_io_delay, .const_udelay = __const_udelay, +#ifdef CONFIG_X86_LOCAL_APIC + .apic_write = native_apic_write, + .apic_write_atomic = native_apic_write_atomic, + .apic_read = native_apic_read, +#endif + .irq_enable_sysexit = native_irq_enable_sysexit, .iret = native_iret, }; diff -puN include/asm-i386/apic.h~paravirtualization-add-apic-accessors-to-paravirt-ops include/asm-i386/apic.h --- a/include/asm-i386/apic.h~paravirtualization-add-apic-accessors-to-paravirt-ops +++ a/include/asm-i386/apic.h @@ -37,18 +37,27 @@ extern void generic_apic_probe(void); /* * Basic functions accessing APICs. */ +#ifdef CONFIG_PARAVIRT +#include <asm/paravirt.h> +#else +#define apic_write native_apic_write +#define apic_write_atomic native_apic_write_atomic +#define apic_read native_apic_read +#endif -static __inline void apic_write(unsigned long reg, unsigned long v) +static __inline fastcall void native_apic_write(unsigned long reg, + unsigned long v) { *((volatile unsigned long *)(APIC_BASE+reg)) = v; } -static __inline void apic_write_atomic(unsigned long reg, unsigned long v) +static __inline fastcall void native_apic_write_atomic(unsigned long reg, + unsigned long v) { xchg((volatile unsigned long *)(APIC_BASE+reg), v); } -static __inline unsigned long apic_read(unsigned long reg) +static __inline fastcall unsigned long native_apic_read(unsigned long reg) { return *((volatile unsigned long *)(APIC_BASE+reg)); } diff -puN include/asm-i386/paravirt.h~paravirtualization-add-apic-accessors-to-paravirt-ops include/asm-i386/paravirt.h --- a/include/asm-i386/paravirt.h~paravirtualization-add-apic-accessors-to-paravirt-ops +++ a/include/asm-i386/paravirt.h @@ -115,6 +115,12 @@ struct paravirt_ops void (fastcall *io_delay)(void); void (*const_udelay)(unsigned long loops); +#ifdef CONFIG_X86_LOCAL_APIC + void (fastcall *apic_write)(unsigned long reg, unsigned long v); + void (fastcall *apic_write_atomic)(unsigned long reg, unsigned long v); + unsigned long (fastcall *apic_read)(unsigned long reg); +#endif + /* These two are jmp to, not actually called. */ void (fastcall *irq_enable_sysexit)(void); void (fastcall *iret)(void); @@ -275,6 +281,27 @@ static inline void slow_down_io(void) { #endif } +#ifdef CONFIG_X86_LOCAL_APIC +/* + * Basic functions accessing APICs. + */ +static __inline void apic_write(unsigned long reg, unsigned long v) +{ + paravirt_ops.apic_write(reg,v); +} + +static __inline void apic_write_atomic(unsigned long reg, unsigned long v) +{ + paravirt_ops.apic_write_atomic(reg,v); +} + +static __inline unsigned long apic_read(unsigned long reg) +{ + return paravirt_ops.apic_read(reg); +} +#endif + + /* These all sit in the .parainstructions section to tell us what to patch. */ struct paravirt_patch { u8 *instr; /* original instructions */ _ Patches currently in -mm which might be from rusty@xxxxxxxxxxxxxxx are printk-timed-ratelimit.patch schedule-removal-of-futex_fd.patch prep-for-paravirt-be-careful-about-touching-bios.patch prep-for-paravirt-be-careful-about-touching-bios-warning-fix.patch prep-for-paravirt-desch-clearer-parameter-names.patch prep-for-paravirt-desch-clearer-parameter-names-fix.patch prep-for-paravirt-rearrange-processorh.patch paravirtualization-header-and-stubs-for.patch paravirtualization-patch-inline-replacements-for.patch paravirtualization-more-generic-paravirtualization.patch paravirtualization-allow-selected-bug-checks-to-be.patch paravirtualization-allow-disabling-legacy-power.patch paravirtualization-add-apic-accessors-to-paravirt-ops.patch paravirtualization-add-mmu-virtualization-to.patch generic-bug-implementation.patch generic-bug-for-i386.patch generic-bug-for-x86-64.patch bug-test-1.patch - To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html