*** SUBJECT HERE ***
PATCH 1/1 *** SUBJECT HERE ***
Hi all,
This series of patches (against tip/x86/apic) makes some fairly uncontroversial changes and cleanups to lay the groundwork for some more Xen-specific patches (which will no doubt cause more of a discussion).
These changes can also be pulled from
git://git.kernel.org/pub/scm/linux/kernel/git/jeremy/xen.git x86/apic
Thanks,
J
Ian Campbell (1):
xen: expose enable_IO_APIC for 32-bit
Jeremy Fitzhardinge (4):
x86: make apic_* operations inline functions
x86: unstatic mp_find_ioapic so it can be used elsewhere
x86: add mp_find_ioapic_pin
x86: unstatic ioapic entry funcs
arch/x86/include/asm/apic.h | 35 +++++++++++++++++++++++++++++------ arch/x86/include/asm/hw_irq.h | 2 -- arch/x86/include/asm/io_apic.h | 6 ++++++ arch/x86/include/asm/mpspec.h | 2 ++ arch/x86/kernel/acpi/boot.c | 18 ++++++++++++++---- arch/x86/kernel/io_apic.c | 10 +++++----- 6 files changed, 56 insertions(+), 17 deletions(-)
PATCH 1/1 x86: make apic_* operations inline functions
Mainly to get proper type-checking and consistency.
--- arch/x86/include/asm/apic.h | 35 +++++++++++++++++++++++++++++------ 1 files changed, 29 insertions(+), 6 deletions(-)
arch/x86/include/asm/apic.h +29 -6
@@ -139,12 +139,35 @@ struct apic_ops {extern struct apic_ops *apic_ops; -#define apic_read (apic_ops->read) -#define apic_write (apic_ops->write) -#define apic_icr_read (apic_ops->icr_read) -#define apic_icr_write (apic_ops->icr_write) -#define apic_wait_icr_idle (apic_ops->wait_icr_idle) -#define safe_apic_wait_icr_idle (apic_ops->safe_wait_icr_idle) +static inline u32 apic_read (u32 reg) +{ +return apic_ops->read (reg); +} + +static inline void apic_write (u32 reg,u32 val) +{ + apic_ops->write (reg, val); +} + +static inline u64 apic_icr_read (void ) +{ +return apic_ops->icr_read (); +} + +static inline void apic_icr_write (u32 low,u32 high) +{ + apic_ops->icr_write (low, high); +} + +static inline void apic_wait_icr_idle (void ) +{ + apic_ops->wait_icr_idle (); +} + +static inline u32 safe_apic_wait_icr_idle (void ) +{ +return apic_ops->safe_wait_icr_idle (); +}extern int get_physical_broadcast (void );
Signature · 1 line
1.6.0.6
PATCH 1/1 x86: unstatic mp_find_ioapic so it can be used elsewhere
In reply to Jeremy Fitzhardinge--- arch/x86/include/asm/mpspec.h | 1 + arch/x86/kernel/acpi/boot.c | 2 +- 2 files changed, 2 insertions(+), 1 deletions(-)
arch/x86/include/asm/mpspec.h +1 -0
@@ -77,6 +77,7 @@ extern int acpi_probe_gsi(void);#ifdef CONFIG_X86_IO_APIC extern int mp_config_acpi_gsi (unsigned char number,unsigned int devfn,u8 pin,u32 gsi,int triggering,int polarity); +extern int mp_find_ioapic (int gsi);#else static inline int mp_config_acpi_gsi(unsigned char number, unsigned int devfn, u8 pin,
arch/x86/kernel/acpi/boot.c +1 -1
@@ -872,7 +872,7 @@ static struct {DECLARE_BITMAP (pin_programmed,MP_MAX_IOAPIC_PIN +1 ); } mp_ioapic_routing[MAX_IO_APICS ]; -static int mp_find_ioapic (int gsi) +int mp_find_ioapic (int gsi) {int i =0 ;
Signature · 1 line
1.6.0.6
PATCH 1/1 x86: add mp_find_ioapic_pin
In reply to Jeremy FitzhardingeAdd mp_find_ioapic_pin() to find an IO APIC's specific pin from a GSI, and use this function within acpi/boot. Make it non-static so other code can use it too.
--- arch/x86/include/asm/mpspec.h | 1 + arch/x86/kernel/acpi/boot.c | 16 +++++++++++++--- 2 files changed, 14 insertions(+), 3 deletions(-)
arch/x86/include/asm/mpspec.h +1 -0
@@ -78,6 +78,7 @@ extern int acpi_probe_gsi(void);extern int mp_config_acpi_gsi (unsigned char number,unsigned int devfn,u8 pin,u32 gsi,int triggering,int polarity);extern int mp_find_ioapic (int gsi); +extern int mp_find_ioapic_pin (int ioapic,int gsi);#else static inline int mp_config_acpi_gsi(unsigned char number, unsigned int devfn, u8 pin,
arch/x86/kernel/acpi/boot.c +13 -3
@@ -887,6 +887,16 @@ int mp_find_ioapic(int gsi)return -1 ; } +int mp_find_ioapic_pin (int ioapic,int gsi) +{ +if (WARN_ON (ioapic ==-1 )) +return -1 ; +if (WARN_ON (gsi > mp_ioapic_routing[ioapic].gsi_end)) +return -1 ; + +return gsi - mp_ioapic_routing[ioapic].gsi_base; +} +static u8 __init uniq_ioapic_id (u8 id) {#ifdef CONFIG_X86_32
@@ -1022,7 +1032,7 @@ void __init mp_override_legacy_irq(u8 bus_irq, u8 polarity, u8 trigger, u32 gsi) ioapic =mp_find_ioapic (gsi);if (ioapic <0 )return ; - pin = gsi - mp_ioapic_routing[ioapic].gsi_base; + pin =mp_find_ioapic_pin (ioapic, gsi);/* * TBD: This check is for faulty timer entries, where the override
@@ -1142,7 +1152,7 @@ int mp_register_gsi(u32 gsi, int triggering, int polarity)return gsi; } - ioapic_pin = gsi - mp_ioapic_routing[ioapic].gsi_base; + ioapic_pin =mp_find_ioapic_pin (ioapic, gsi);#ifdef CONFIG_X86_32 if (ioapic_renumber_irq)
@@ -1231,7 +1241,7 @@ int mp_config_acpi_gsi(unsigned char number, unsigned int devfn, u8 pin, mp_irq.srcbusirq = (((devfn >>3 ) &0x1f ) <<2 ) | ((pin -1 ) &3 ); ioapic =mp_find_ioapic (gsi); mp_irq.dstapic = mp_ioapic_routing[ioapic].apic_id; - mp_irq.dstirq = gsi - mp_ioapic_routing[ioapic].gsi_base; + mp_irq.dstirq =mp_find_ioapic_pin (ioapic, gsi);save_mp_irq (&mp_irq);#endif
Signature · 1 line
1.6.0.6
PATCH 1/1 x86: unstatic ioapic entry funcs
In reply to Jeremy FitzhardingeUnstatic ioapic_write_entry and setup_ioapic_entry functions so that the Xen code can do its own ioapic routing setup.
--- arch/x86/include/asm/io_apic.h | 6 ++++++ arch/x86/kernel/io_apic.c | 10 +++++----- 2 files changed, 11 insertions(+), 5 deletions(-)
arch/x86/include/asm/io_apic.h +6 -0
@@ -169,6 +169,12 @@ extern void reinit_intr_remapped_IO_APIC(int);extern void probe_nr_irqs_gsi (void ); +extern int setup_ioapic_entry (int apic,int irq, +struct IO_APIC_route_entry *entry, +unsigned int destination,int trigger, +int polarity,int vector); +extern void ioapic_write_entry (int apic,int pin, +struct IO_APIC_route_entry e);#else /* !CONFIG_X86_IO_APIC */ #define io_apic_assign_pci_irqs 0static const int timer_through_8259 =0 ;
arch/x86/kernel/io_apic.c +5 -5
@@ -486,7 +486,7 @@ __ioapic_write_entry(int apic, int pin, struct IO_APIC_route_entry e)io_apic_write (apic,0x10 +2 *pin, eu.w1); } -static void ioapic_write_entry (int apic,int pin,struct IO_APIC_route_entry e) +void ioapic_write_entry (int apic,int pin,struct IO_APIC_route_entry e) {unsigned long flags;spin_lock_irqsave (&ioapic_lock, flags);
@@ -1478,10 +1478,10 @@ static void ioapic_register_intr(int irq, struct irq_desc *desc, unsigned long t handle_edge_irq, "edge"); } -static int setup_ioapic_entry (int apic_id,int irq, -struct IO_APIC_route_entry *entry, -unsigned int destination,int trigger, -int polarity,int vector) +int setup_ioapic_entry (int apic_id,int irq, +struct IO_APIC_route_entry *entry, +unsigned int destination,int trigger, +int polarity,int vector) {/* * add it to the IO-APIC irq-routing table:
Signature · 1 line
1.6.0.6
PATCH 1/1 xen: expose enable_IO_APIC for 32-bit
In reply to Jeremy Fitzhardingeenable_IO_APIC() is defined for both 32- and 64-bit x86, so it should be declared for both.
--- arch/x86/include/asm/hw_irq.h | 2 -- 1 files changed, 0 insertions(+), 2 deletions(-)
arch/x86/include/asm/hw_irq.h +0 -2
@@ -65,9 +65,7 @@ extern void disable_IO_APIC(void);extern int IO_APIC_get_PCI_irq_vector (int bus,int slot,int fn);extern void setup_ioapic_dest (void ); -#ifdef CONFIG_X86_64 extern void enable_IO_APIC (void ); -#endif /* Statistics */ extern atomic_t irq_err_count;
Signature · 1 line
1.6.0.6
Re: [PATCH] xen: expose enable_IO_APIC for 32-bit
Quoted 26 lines · Ian Campbell
enable_IO_APIC()is defined for both 32- and 64-bit x86, so it should be declared for both.Signed-off-by Ian Campbell <[email protected]>Signed-off-by Jeremy Fitzhardinge <[email protected]>--- arch/x86/include/asm/hw_irq.h | 2 -- 1 files changed, 0 insertions(+), 2 deletions(-)arch/x86/include/asm/hw_irq.h +0
-3@@ -65,9 +65,7 @@ extern void disable_IO_APIC(void);extern int IO_APIC_get_PCI_irq_vector (int bus,int slot,int fn);extern void setup_ioapic_dest (void ); -#ifdef CONFIG_X86_64 extern void enable_IO_APIC (void ); -#endif /* Statistics */ extern atomic_t irq_err_count; --1.6.0.6
Quoted 1 line
--
wonder if we should call enable_IO_APIC in 32bit like 64bit... should be ok.
YH
Re: apic cleanups
In reply to Jeremy FitzhardingeQuoted 21 lines · Jeremy Fitzhardinge
Hi all,
This series of patches (against tip/x86/apic) makes some fairly uncontroversial changes and cleanups to lay the groundwork for some more Xen-specific patches (which will no doubt cause more of a discussion).
These changes can also be pulled from
git://git.kernel.org/pub/scm/linux/kernel/git/jeremy/xen.gitx86/apicThanks,
JIan Campbell (1):
xen: exposeenable_IO_APICfor 32-bitJeremy Fitzhardinge (4):
x86: make apic_* operations inline functions
x86: unstaticmp_find_ioapicso it can be used elsewhere
x86: addmp_find_ioapic_pin
x86: unstatic ioapic entry funcs
Quoted 7 lines
arch/x86/include/asm/apic.h | 35 +++++++++++++++++++++++++++++------ arch/x86/include/asm/hw_irq.h | 2 -- arch/x86/include/asm/io_apic.h | 6 ++++++ arch/x86/include/asm/mpspec.h | 2 ++ arch/x86/kernel/acpi/boot.c | 18 ++++++++++++++---- arch/x86/kernel/io_apic.c | 10 +++++----- 6 files changed, 56 insertions(+), 17 deletions(-)
Pulled into tip:x86/apic, thanks guys!
Ingo