Yinghai Lu [Wed, 3 Sep 2008 23:58:33 +0000 (16:58 -0700)]
dmar: initialize the return value in dmar_parse_dev()
initialize the return value in dmar_parse_dev()
Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
Signed-off-by: Suresh Siddha <suresh.b.siddha@intel.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Yinghai Lu [Wed, 3 Sep 2008 23:58:32 +0000 (16:58 -0700)]
dmar: fix using early fixmap mapping for DMAR table parsing
Very early detection of the DMAR tables will setup fixmap mapping. For
parsing these tables later (while enabling dma and/or interrupt remapping),
early fixmap mapping shouldn't be used. Fix it by calling table detection
routines again, which will call generic apci_get_table() for setting up
the correct mapping.
Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
Signed-off-by: Suresh Siddha <suresh.b.siddha@intel.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Yinghai Lu [Wed, 3 Sep 2008 23:58:31 +0000 (16:58 -0700)]
x2apic: fix reserved APIC register accesses in print_local_APIC()
APIC_ARBPRI is a reserved register for XAPIC and beyond.
APIC_RRR is a reserved register except for 82489DX, APIC for Pentium processors.
APIC_EOI is a write only register.
APIC_DFR is reserved in x2apic mode.
Access to these registers in x2apic will result in #GP fault. Fix these
apic register accesses.
Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
Signed-off-by: Suresh Siddha <suresh.b.siddha@intel.com>
Cc: Maciej W. Rozycki <macro@linux-mips.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Ingo Molnar [Thu, 28 Aug 2008 06:56:33 +0000 (08:56 +0200)]
sparseirq: export nr_irqs on m68k/sparc/s390
Stephen Rothwell reported such build failures on m68k/sparc/s390:
> ERROR: "nr_irqs" [drivers/net/hamradio/baycom_ser_fdx.ko] undefined!
> ERROR: "nr_irqs" [drivers/net/3c59x.ko] undefined!
export nr_irqs on these architectures too.
Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Cyrill Gorcunov [Mon, 25 Aug 2008 17:27:26 +0000 (21:27 +0400)]
x86: apic - unify smp_spurious/error_interrupt declaration
According to entry_64.S we do pass pt_regs pointer
into interrupt handlers but don't use them. So we
safely may merge the declarations.
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Yinghai Lu [Mon, 25 Aug 2008 19:41:19 +0000 (12:41 -0700)]
sparseirq: move kstat_irqs from kstat to irq_desc - fix
fix non-sparseirq architectures.
Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Yinghai Lu [Mon, 25 Aug 2008 05:41:26 +0000 (22:41 -0700)]
x86: let 64 bit to use 32 bit calibrate_apic_clock
Use the 32-bit APIC calibration code - it's more mature.
Signed-of-by: Yinghai Lu <yhlu.kernel@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Yinghai Lu [Sun, 24 Aug 2008 09:01:56 +0000 (02:01 -0700)]
x86: rename apic_32.c and apic_64.c to apic.c
Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Yinghai Lu [Sun, 24 Aug 2008 09:01:55 +0000 (02:01 -0700)]
x86: apic copy apic_64.c to apic_32.c
Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Yinghai Lu [Sun, 24 Aug 2008 09:01:54 +0000 (02:01 -0700)]
x86: apic copy calibrate_APIC_clock to each other in apic_32/64.c
Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Yinghai Lu [Sun, 24 Aug 2008 09:01:53 +0000 (02:01 -0700)]
x86: apic unify smp_spurious/error_interrupt
Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Yinghai Lu [Sun, 24 Aug 2008 09:01:52 +0000 (02:01 -0700)]
x86: merge header files in apic_xx.c
Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Yinghai Lu [Sun, 24 Aug 2008 09:01:51 +0000 (02:01 -0700)]
x86: copy detect_init_APIC to the other
Signed-off-by: Yinghai Lu <yhlu.kernel@mgail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Yinghai Lu [Sun, 24 Aug 2008 09:01:50 +0000 (02:01 -0700)]
x86: merge APIC_init_uniprocessor
Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Yinghai Lu [Sun, 24 Aug 2008 09:01:49 +0000 (02:01 -0700)]
x86: make apic_32/64.c more like
except x2apic, detec_init_APIC, and calibrating_APIC_clock
Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Yinghai Lu [Sun, 24 Aug 2008 09:01:48 +0000 (02:01 -0700)]
x86: add hard_smp_prossor_id with MACRO in io_apic_xx.c
Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Yinghai Lu [Sun, 24 Aug 2008 09:01:47 +0000 (02:01 -0700)]
x86: use HAVE_X2APIC in apic_64.c
Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Yinghai Lu [Sun, 24 Aug 2008 09:01:46 +0000 (02:01 -0700)]
x86: apic_xx.c order variables
Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Cyrill Gorcunov [Sun, 24 Aug 2008 09:01:45 +0000 (02:01 -0700)]
x86: apic - unify smp_apic_timer_interrupt
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Cyrill Gorcunov [Sun, 24 Aug 2008 09:01:44 +0000 (02:01 -0700)]
x86: apic_32.c should use __cpuinit section
All callers are __init or __cpuinit so there is no need
to hold this code without CPU_HOTPLUG being set.
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Cyrill Gorcunov [Sun, 24 Aug 2008 09:01:43 +0000 (02:01 -0700)]
x86: apic - unify setup_local_APIC
- remove useless read of APIC_LVR
- wrap with preempt_disable/enable
- check for integrated APIC just in place
v2: fix by Yinghai Lu.
fix lapic_is_integrated using
let 64-bit too have pic_mode
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Cyrill Gorcunov [Sun, 24 Aug 2008 09:01:42 +0000 (02:01 -0700)]
x86: apic_64.c - add sanity check for spurious vector definition
Do not check for SPUTIOUS_APIC_VECTOR definition twice.
Check it once - is what we need.
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Cyrill Gorcunov [Sun, 24 Aug 2008 09:01:41 +0000 (02:01 -0700)]
x86: apic - unify setup_apicpmtimer
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Cyrill Gorcunov [Sun, 24 Aug 2008 09:01:40 +0000 (02:01 -0700)]
x86: apic - introduce get_physical_broadcast for 64bit
We don't really use it now on 64bit mode but
could reserve it for future.
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Cyrill Gorcunov [Sun, 24 Aug 2008 09:01:39 +0000 (02:01 -0700)]
x86: apic_64.c - setup_APIC_timer has to be __cpuinit function
There is no need to hold this code if CPU_HOTPLUG is not
defined.
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Alok Kataria [Thu, 21 Aug 2008 18:26:43 +0000 (11:26 -0700)]
x86: VMI, initialize IRQ vector
Initialize vector_irq for the vmi used vector, to point to correct irq.
Signed-off-by: Alok N Kataria <akataria@vmware.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Yinghai Lu [Thu, 21 Aug 2008 20:10:09 +0000 (13:10 -0700)]
x86: fix probe_nr_irqs for xen
otherwise Xen is _completely_ unusable with 5 or more VCPUs.
(when !CONFIG_HAVE_SPARSE_IRQ).
based on Alex Nixon's patch.
also add +1 offset after redir_entries
Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
Acked-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Acked-by: Alex Nixon <alex.nixon@citrix.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Yinghai Lu [Thu, 21 Aug 2008 19:56:32 +0000 (12:56 -0700)]
x86: fix 32-bit ioapic lockup with sparseirqs
Missed two lines when copying.
Fix panic on one of Ingo's machines that need to adjust ioapic id when
acpi off/ 32bit.
Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Yinghai Lu [Thu, 21 Aug 2008 03:46:25 +0000 (20:46 -0700)]
x86: sparse_irq needs spin_lock in allocations
Suresh Siddha noticed that we should have a spinlock around it.
Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Suresh Siddha [Thu, 21 Aug 2008 00:22:51 +0000 (17:22 -0700)]
sparseirq: fix intr-remap with dyn_array/nr_irqs changes]
In irq_2_iommu_alloc() and set_irte_irq(), irq_to_desc or
irq_2_iommu pointers may not be allocated. So use the routines
which will allocate them if they are not already allocated.
Signed-off-by: Suresh Siddha <suresh.b.siddha@intel.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Ingo Molnar [Mon, 18 Aug 2008 11:04:26 +0000 (13:04 +0200)]
warning: fix arch x86 kernel io_apic c
fix warning:
arch/x86/kernel/io_apic.c: In function ‘print_local_APIC’:
arch/x86/kernel/io_apic.c:1786: warning: format ‘%08x’ expects type ‘unsigned int’, but argument 2 has type ‘u64’
arch/x86/kernel/io_apic.c:1787: warning: format ‘%08x’ expects type ‘unsigned int’, but argument 2 has type ‘u64’
By creating uniform behavior on 32-bit and 64-bit and printing out the ICR
value in two 32-bit words.
Code has changed:
text data bss dec hex filename
22901 19650 17040 59591 e8c7 io_apic.o.before
22899 19650 17040 59589 e8c5 io_apic.o.after
Due to the 32-bit cast narrowing the printed out value on 64-bit.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Alex Nixon [Tue, 19 Aug 2008 05:17:08 +0000 (22:17 -0700)]
xen: Fix bug `do_IRQ: cannot handle IRQ -1 vector 0x6 cpu 1'
Following commit
9c3f2468d8339866d9ef6a25aae31a8909c6be0d, do_IRQ()
looks up the IRQ number in the per-cpu variable vector_irq.
This commit makes Xen initialise an identity vector_irq map for both X86_32 and X86_64.
Signed-off-by: Alex Nixon <alex.nixon@citrix.com>
Acked-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Yinghai Lu [Wed, 20 Aug 2008 03:50:54 +0000 (20:50 -0700)]
dyn_array: split dyn_array functions from init/main.c
Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Alex Nixon [Wed, 20 Aug 2008 03:50:53 +0000 (20:50 -0700)]
xen: fix memory access violation bug when CONFIG_HAVE_SPARSE_IRQ is enabled
When sparse IRQs are enabled, it is not safe to assume an IRQ descriptor
exists for every possible IRQ. This patch causes init_evtchn_cpu_bindings
to skip initialisation of IRQ descriptors which don't exist.
Signed-off-by: Alex Nixon <alex.nixon@citrix.com>
Acked-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Yinghai Lu [Wed, 20 Aug 2008 03:50:52 +0000 (20:50 -0700)]
x86: probe nr_irqs even only mptable is used
for !CONFIG_HAVE_SPARSE_IRQ
fix:
In file included from arch/x86/kernel/early-quirks.c:18:
include/asm/io_apic.h: In function 'probe_nr_irqs':
include/asm/io_apic.h:209: error: 'NR_IRQS' undeclared (first use in this function)
include/asm/io_apic.h:209: error: (Each undeclared identifier is reported only once
include/asm/io_apic.h:209: error: for each function it appears in.)
v2: fix by Ingo
Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Yinghai Lu [Wed, 20 Aug 2008 03:50:51 +0000 (20:50 -0700)]
x86: make HAVE_SPARSE_IRQ support selectable
Ingo said sparse_irq is some intrusive. need to make it selectable
to make it simple, remove irq_desc as parameter in some functions.
(ack, eoi, set_affinity).
may need to make member if irq_chip to take irq_desc, or struct irq later.
Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Yinghai Lu [Wed, 20 Aug 2008 03:50:50 +0000 (20:50 -0700)]
x86: print local APIC of APs one by one
instead of print that of all APs at the time
Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Yinghai Lu [Wed, 20 Aug 2008 03:50:49 +0000 (20:50 -0700)]
x86: remove first_free_entry/pin_map_size
no user now
Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Yinghai Lu [Wed, 20 Aug 2008 03:50:48 +0000 (20:50 -0700)]
x86: unify ack_apic_edge
use code in 64 to replace
move_native_irq(irq, desc);
in 32 bit
Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Yinghai Lu [Wed, 20 Aug 2008 03:50:47 +0000 (20:50 -0700)]
x86: unify mask_IO_APIC_irq
use MACRO for 32 bit too
Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Yinghai Lu [Wed, 20 Aug 2008 03:50:46 +0000 (20:50 -0700)]
x86: irq: interrupt array size should be NR_VECTORS
Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Yinghai Lu [Wed, 20 Aug 2008 03:50:45 +0000 (20:50 -0700)]
pci: change msi-x vector to 32bit
we are using 28bit pci (bus/dev/fn + 12 bits) as irq number, so the
cache for irq number should be 32 bit too.
Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Yinghai Lu [Wed, 20 Aug 2008 03:50:43 +0000 (20:50 -0700)]
io_apic: make 32 bit have io_apic resource in /proc/iomem
Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Yinghai Lu [Wed, 20 Aug 2008 03:50:42 +0000 (20:50 -0700)]
rename io_apic_64.c and io_apic_32.c to io_apic.c
The two files are now line by line equal. (sans a printk)
Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Ingo Molnar [Wed, 20 Aug 2008 07:07:45 +0000 (09:07 +0200)]
x86: make io_apic_32.c the same as io_apic_64.c
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Yinghai Lu [Wed, 20 Aug 2008 03:50:41 +0000 (20:50 -0700)]
x86: make io_apic_64.c and io_apic_32.c the same
all the same except INTR_REMAPPING related and ioapic io resource.
Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Yinghai Lu [Wed, 20 Aug 2008 03:50:40 +0000 (20:50 -0700)]
x86: remove ioapic_force
no user left.
Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Yinghai Lu [Wed, 20 Aug 2008 03:50:39 +0000 (20:50 -0700)]
x86: make 64 handle sis_apic_bug like the 32 bit
do we have 64bit system with sis chipset?
[ mingo@elte.hu: nope, the problem chipset was 32-bit only.
The code symmetry is good nevertheless. ]
Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Yinghai Lu [Wed, 20 Aug 2008 03:50:38 +0000 (20:50 -0700)]
x86: make headers files the same in io_apic_xx.c
also make no_timer_check to be global on 64 bit, because vmi_32 is using that.
Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Ingo Molnar [Wed, 20 Aug 2008 03:50:37 +0000 (20:50 -0700)]
sparseirq: fix lockdep
-tip testing found this lockdep splat:
[ 0.000000] Initializing CPU#0
[ 0.000000] found new irq_desc for irq 0
[ 0.000000] INFO: trying to register non-static key.
[ 0.000000] the code is fine but needs lockdep annotation.
[ 0.000000] turning off the locking correctness validator.
[ 0.000000] Pid: 0, comm: swapper Not tainted
2.6.27-rc3-tip-00191-g98ccb89-dirty #1
[ 0.000000] [<
c0153c22>] register_lock_class+0x3d2/0x400
[ 0.000000] [<
c0104d87>] ? mcount_call+0x5/0xa
[ 0.000000] [<
c0154f3a>] __lock_acquire+0x22a/0x5d0
[ 0.000000] [<
c0104d87>] ? mcount_call+0x5/0xa
[ 0.000000] [<
c0155351>] lock_acquire+0x71/0xa0
[ 0.000000] [<
c016d61f>] ? set_irq_chip+0x3f/0x90
[ 0.000000] [<
c070f148>] _spin_lock_irqsave+0x58/0x90
[ 0.000000] [<
c016d61f>] ? set_irq_chip+0x3f/0x90
[ 0.000000] [<
c016d61f>] set_irq_chip+0x3f/0x90
[ 0.000000] [<
c016d7e0>] ? handle_level_irq+0x0/0xe0
[ 0.000000] [<
c016da1a>] set_irq_chip_and_handler_name+0x1a/0x40
[ 0.000000] [<
c0a396c1>] init_ISA_irqs+0x51/0xa0
[ 0.000000] [<
c0a4a365>] pre_intr_init_hook+0x25/0x30
[ 0.000000] [<
c0a39723>] native_init_IRQ+0x13/0x370
[ 0.000000] [<
c015569c>] ? lock_release+0xcc/0x1d0
[ 0.000000] [<
c0104d87>] ? mcount_call+0x5/0xa
[ 0.000000] [<
c070dc22>] ? __mutex_unlock_slowpath+0x92/0x110
[ 0.000000] [<
c070dcad>] ? mutex_unlock+0xd/0x10
[ 0.000000] [<
c0135f62>] ? cpu_maps_update_done+0x12/0x20
[ 0.000000] [<
c06c6743>] ? register_cpu_notifier+0x23/0x30
[ 0.000000] [<
c011e8ae>] init_IRQ+0xe/0x10
[ 0.000000] [<
c0a357a5>] start_kernel+0x1c5/0x340
[ 0.000000] [<
c0a35280>] ? unknown_bootoption+0x0/0x210
[ 0.000000] [<
c0a3506b>] i386_start_kernel+0x6b/0x80
[ 0.000000] =======================
[ 0.000000] found new irq_desc for irq 1
[ 0.000000] found new irq_desc for irq 2
[ 0.000000] found new irq_desc for irq 3
this:
static void init_one_irq_desc(struct irq_desc *desc)
{
memcpy(desc, &irq_desc_init, sizeof(struct irq_desc));
#ifdef CONFIG_TRACE_IRQFLAGS
lockdep_set_class(&desc->lock, &irq_desc_lock_class);
#endif
}
should be unconditional.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Yinghai Lu [Wed, 20 Aug 2008 03:50:36 +0000 (20:50 -0700)]
x86: order variables in io_apic_xx.c
move first_system_vector to apic_64.c.
also add #ifdef CONFIG_INTR_REMAP to prepare 32 bit to use
same file.
Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Yinghai Lu [Wed, 20 Aug 2008 03:50:35 +0000 (20:50 -0700)]
x86: ordering functions in io_apic_64.c
try to make functions have the same order between 32-bit and 64-bit.
Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Yinghai Lu [Wed, 20 Aug 2008 03:50:34 +0000 (20:50 -0700)]
x86: ordering functions in io_apic_32.c
prepare for unification:
try to make functions be of the same order to io_apic_64.c.
v2: add calling setup_msi_irq back to arch_setup_msi_irq
Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Yinghai Lu [Wed, 20 Aug 2008 03:50:33 +0000 (20:50 -0700)]
x86, io-apic: remove union about dest for log/phy
let user decide the meaning of the bits.
This unifies the 32-bit and 64-bit io-apic code a bit.
Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Yinghai Lu [Wed, 20 Aug 2008 03:50:32 +0000 (20:50 -0700)]
x86: add debug info for 32bit sparse_irq
so could figure out bugs where we get an interrupt, but vector_irq is
not initialized yet.
Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Yinghai Lu [Wed, 20 Aug 2008 03:50:28 +0000 (20:50 -0700)]
x86: make 32bit support per_cpu vector
so we can merge io_apic_32.c and io_apic_64.c
v2: Use cpu_online_map as target cpus for bigsmp, just like 64-bit is doing.
Also remove some unused TARGET_CPUS macro.
v3: need to check if desc is null in smp_irq_move_cleanup
also migration needs to reset vector too, so copy __target_IO_APIC_irq
from 64bit.
(the duplication will go away once the two files are unified.)
Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Yinghai Lu [Wed, 20 Aug 2008 03:50:27 +0000 (20:50 -0700)]
x86: make 32 bit to use sparse_irq
but actually irq still needs to be less than NR_IRQS, because
interrupt[NR_IRQS] in entry.S.
need to enable per_cpu vector...
Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Yinghai Lu [Wed, 20 Aug 2008 03:50:26 +0000 (20:50 -0700)]
x86: make 32bit to use irq_2_pin in irq_cfg
so it is more like 64 bit.
Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Yinghai Lu [Wed, 20 Aug 2008 03:50:25 +0000 (20:50 -0700)]
x86: make 32bit use irq_cfg_alloc, etc
Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Yinghai Lu [Wed, 20 Aug 2008 03:50:24 +0000 (20:50 -0700)]
x86: add irq_cfg for 32bit
it only contains vector ...
Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Yinghai Lu [Wed, 20 Aug 2008 03:50:23 +0000 (20:50 -0700)]
x86: remove irqbalance in kernel for 32 bit
This has been deprecated for years, the user space irqbalanced utility
works better with numa, has configurable policies, etc...
Signed-off-by: Yinghai Lu <yhlu.kernel@gmai.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Yinghai Lu [Wed, 20 Aug 2008 03:50:22 +0000 (20:50 -0700)]
x86: use 28 bits irq NR for pci msi/msix and ht
also print out irq no in /proc/interrups and /proc/stat in hex, so could
tell bus/dev/func.
Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Yinghai Lu [Wed, 20 Aug 2008 03:50:21 +0000 (20:50 -0700)]
x86: put irq_2_iommu pointer into irq_desc
when CONFIG_HAVE_SPARSE_IRQ
preallocate some irq_2_iommu entries, and use get_one_free_irq_2_iomm to
get new one and link to irq_desc if needed.
else will use dyn_array or static array.
v2: <= nr_irqs fix
Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Yinghai Lu [Wed, 20 Aug 2008 03:50:20 +0000 (20:50 -0700)]
x86_64: make /proc/interrupts work with dyn irq_desc
loop with irq_desc list
Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Yinghai Lu [Wed, 20 Aug 2008 03:50:19 +0000 (20:50 -0700)]
x86_64: separate irq_cfgx from irq_cfgx_free
so later don't need to compare with -1U
Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Yinghai Lu [Wed, 20 Aug 2008 03:50:18 +0000 (20:50 -0700)]
irq: separate sparse_irqs from sparse_irqs_free
so later don't need compare with -1U
Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Yinghai Lu [Wed, 20 Aug 2008 03:50:17 +0000 (20:50 -0700)]
x86_64: rename irq_desc/irq_desc_alloc
change names:
irq_desc() ==> irq_desc_alloc
__irq_desc() ==> irq_desc
Also split a few of the uses in lowlevel x86 code.
v2: need to check if desc is null in smp_irq_move_cleanup
Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Yinghai Lu [Wed, 20 Aug 2008 03:50:16 +0000 (20:50 -0700)]
x86: check with without_new in show_interrupts
so we don't get new one that we don't need it.
Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Yinghai Lu [Wed, 20 Aug 2008 03:50:15 +0000 (20:50 -0700)]
generic: add irq_desc in function in parameter
So we could remove some duplicated calling to irq_desc
v2: make sure irq_desc in init/main.c is not used without generic_hardirqs
Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Yinghai Lu [Wed, 20 Aug 2008 03:50:14 +0000 (20:50 -0700)]
irq: remove >= nr_irqs checking with config_have_sparse_irq
remove irq limit checks - nr_irqs is dynamic and we expand anytime.
v2: fix checking about result irq_cfg_without_new, so could use msi again
v3: use irq_desc_without_new to check irq is valid
Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Yinghai Lu [Wed, 20 Aug 2008 03:50:13 +0000 (20:50 -0700)]
x86, ioapic: replace loop with nr_irqs with for_each_irq_icfg
Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Yinghai Lu [Wed, 20 Aug 2008 03:50:12 +0000 (20:50 -0700)]
irq, fs/proc: replace loop with nr_irqs for proc/stat
Replace another nr_irqs loop to avoid the allocation of all sparse
irq entries - use for_each_irq_desc instead.
v2: make sure arch without GENERIC_HARDIRQS works too
Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Yinghai Lu [Wed, 20 Aug 2008 03:50:11 +0000 (20:50 -0700)]
irq: replace loop with nr_irqs with for_each_irq_desc
There are a handful of loops that go from 0 to nr_irqs and use
get_irq_desc() on them. These would allocate all the irq_desc
entries, regardless of the need for them.
Use the smarter for_each_irq_desc() iterator that will only iterate
over the present ones.
v2: make sure arch without GENERIC_HARDIRQS work too
Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Yinghai Lu [Wed, 20 Aug 2008 03:50:10 +0000 (20:50 -0700)]
irq: add irq_desc_without_new
add an irq_desc accessor that will not allocate any sparse entry
but returns failure if there's no entry present.
Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Yinghai Lu [Wed, 20 Aug 2008 03:50:09 +0000 (20:50 -0700)]
x86: move kstat_irqs from kstat to irq_desc
based on Eric's patch ...
together mold it with dyn_array for irq_desc, will allcate kstat_irqs for
nr_irq_desc alltogether if needed. -- at that point nr_cpus is known already.
v2: make sure system without generic_hardirqs works they don't have irq_desc
v3: fix merging
v4: [mingo@elte.hu] fix typo
[ mingo@elte.hu ] irq: build fix
fix:
arch/x86/xen/spinlock.c: In function 'xen_spin_lock_slow':
arch/x86/xen/spinlock.c:90: error: 'struct kernel_stat' has no member named 'irqs'
Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Yinghai Lu [Wed, 20 Aug 2008 03:50:08 +0000 (20:50 -0700)]
x86: put timer_rand_state pointer into irq_desc
irq_timer_state[] is a NR_IRQS sized array that is a side-by array to
the real irq_desc[] array.
Integrate that field into the (now dynamic) irq_desc dynamic array and
save some RAM.
v2: keep the old way to support arch not support irq_desc
Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Yinghai Lu [Wed, 20 Aug 2008 03:50:07 +0000 (20:50 -0700)]
x86: put irq_2_pin pointer into irq_cfg
preallocate 32 irq_2_pin entries, and use get_one_free_irq_2_pin() to get
one more and link to irq_cfg if needed.
so don't waste one where no irq is enabled.
Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Yinghai Lu [Wed, 20 Aug 2008 03:50:06 +0000 (20:50 -0700)]
x86: add irq_cfg in io_apic_64.c
preallocate size is 32, and if it is not enough, irq_cfg will more
via alloc_bootmem() or kzalloc(). (depending on how early we are in
system setup)
v2: fix typo about size of init_one_irq_cfg ... should use sizeof(struct irq_cfg)
v3: according to Eric, change get_irq_cfg() to irq_cfg()
v4: squash add irq_cfg_alloc in
Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Ingo Molnar [Wed, 20 Aug 2008 03:50:29 +0000 (20:50 -0700)]
irq: sparse irqs, fix IRQ auto-probe crash
fix:
[ 10.631533] calling yenta_socket_init+0x0/0x20
[ 10.631533] Yenta: CardBus bridge found at 0000:15:00.0 [17aa:2012]
[ 10.631533] Yenta: Using INTVAL to route CSC interrupts to PCI
[ 10.631533] Yenta: Routing CardBus interrupts to PCI
[ 10.631533] Yenta TI: socket 0000:15:00.0, mfunc 0x01d01002, devctl 0x64
[ 10.731599] BUG: unable to handle kernel NULL pointer dereference at
00000040
[ 10.731838] IP: [<
c0c95b5f>] _spin_lock_irq+0xf/0x20
[ 10.732221] *pde =
00000000
[ 10.732741] Oops: 0002 [#1] SMP
[ 10.733453]
[ 10.734253] Pid: 1, comm: swapper Tainted: G W (
2.6.27-rc3-tip-00173-gd7eaa4f-dirty #1)
[ 10.735188] EIP: 0060:[<
c0c95b5f>] EFLAGS:
00010002 CPU: 0
[ 10.735523] EIP is at _spin_lock_irq+0xf/0x20
[ 10.735523] EAX:
00000040 EBX:
00000000 ECX:
f6e04c90 EDX:
00000100
[ 10.735523] ESI:
000000df EDI:
f6e04c90 EBP:
f7867df0 ESP:
f7867df0
[ 10.735523] DS: 007b ES: 007b FS: 00d8 GS: 0000 SS: 0068
[ 10.735523] Process swapper (pid: 1, ti=
f7867000 task=
f7870000 task.ti=
f7867000)
[ 10.735523] Stack:
f7867e04 c0155fbd 00000000 00000000 f6e04c90 f7867e5c c0c6e319 c0f6a074
[ 10.735523]
f6e04c90 000017aa 00002012 c112b648 f791f240 c112b5e0 f7867e44 c010440b
[ 10.735523]
f791f240 f791f29c c112b8ec f791f240 00000000 f7867e5c c048f893 03c0b648
[ 10.735523] Call Trace:
[ 10.735523] [<
c0155fbd>] ? probe_irq_on+0x3d/0x140
[ 10.735523] [<
c0c6e319>] ? yenta_probe+0x529/0x640
[ 10.735523] [<
c010440b>] ? mcount_call+0x5/0xa
[ 10.735523] [<
c048f893>] ? pci_match_device+0xa3/0xb0
[ 10.735523] [<
c048fc1e>] ? pci_device_probe+0x5e/0x80
[ 10.735523] [<
c0515423>] ? driver_probe_device+0x83/0x180
[ 10.735523] [<
c0515594>] ? __driver_attach+0x74/0x80
[ 10.735523] [<
c0514b69>] ? bus_for_each_dev+0x49/0x70
[ 10.735523] [<
c051528e>] ? driver_attach+0x1e/0x20
[ 10.735523] [<
c0515520>] ? __driver_attach+0x0/0x80
[ 10.735523] [<
c05150d3>] ? bus_add_driver+0x1a3/0x220
[ 10.735523] [<
c048fb60>] ? pci_device_remove+0x0/0x40
[ 10.735523] [<
c05157f4>] ? driver_register+0x54/0x130
[ 10.735523] [<
c048fe2f>] ? __pci_register_driver+0x4f/0x90
[ 10.735523] [<
c11e9419>] ? yenta_socket_init+0x19/0x20
[ 10.735523] [<
c0101125>] ? do_one_initcall+0x35/0x160
[ 10.735523] [<
c11e9400>] ? yenta_socket_init+0x0/0x20
[ 10.735523] [<
c01391a6>] ? __queue_work+0x36/0x50
[ 10.735523] [<
c013922d>] ? queue_work_on+0x3d/0x50
[ 10.735523] [<
c11a2758>] ? kernel_init+0x148/0x210
[ 10.735523] [<
c11a2610>] ? kernel_init+0x0/0x210
[ 10.735523] [<
c01043f3>] ? kernel_thread_helper+0x7/0x10
[ 10.735523] =======================
[ 10.735523] Code: 10 38 f2 74 06 f3 90 8a 10 eb f6 5d 89 c8 c3 8d b6 00 00 00 00 8d bc 27 00 00 00 00 55 89 e5 e8 a4 e8 46 ff fa ba 00 01 00 00 90 <66> 0f c1 10 38 f2 74 06 f3 90 8a 10 eb f6 5d c3 90 55 89 e5 53
as auto-probing wants to iterate over existing irqs.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Yinghai Lu [Wed, 20 Aug 2008 03:50:05 +0000 (20:50 -0700)]
generic: sparse irqs: use irq_desc() together with dyn_array, instead of irq_desc[]
add CONFIG_HAVE_SPARSE_IRQ to for use condensed array.
Get rid of irq_desc[] array assumptions.
Preallocate 32 irq_desc, and irq_desc() will try to get more.
( No change in functionality is expected anywhere, except the odd build
failure where we missed a code site or where a crossing commit itroduces
new irq_desc[] usage. )
v2: according to Eric, change get_irq_desc() to irq_desc()
Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Yinghai Lu [Wed, 20 Aug 2008 03:50:04 +0000 (20:50 -0700)]
x86: remove nr_irq_vectors
remove unused defines derived from the (now obsolete) NR_IRQS define.
Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Yinghai Lu [Wed, 20 Aug 2008 03:50:03 +0000 (20:50 -0700)]
x86, irq: get nr_irqs from madt
Until now, NR_IRQS was derived from black magic defines that had to
be "large enough" to both accomodate NR_CPUS and MAX_NR_IO_APICs.
This resulted in a way too large irq_desc[] array on most x86 systems.
Especially with larger CPU masks, the size of irq_desc can spiral out
of control quickly.
So be smarter about it and use precise allocation instead: determine the
default maximum possible IRQ number from the ACPI MADT. Use a minimum limit
of at least 32 IRQs for broken BIOSes.
Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Ingo Molnar [Wed, 20 Aug 2008 03:50:31 +0000 (20:50 -0700)]
irq: sparse irqs, fix #3
fix non-APIC UP build:
arch/x86/kernel/built-in.o: In function `setup_arch':
: undefined reference to `pin_map_size'
arch/x86/kernel/built-in.o: In function `setup_arch':
: undefined reference to `first_free_entry'
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Yinghai Lu [Wed, 20 Aug 2008 03:50:02 +0000 (20:50 -0700)]
x86: use dyn_array in io_apic_xx.c
Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Yinghai Lu [Wed, 20 Aug 2008 03:50:01 +0000 (20:50 -0700)]
irq: make irqs in kernel stat use per_cpu_dyn_array
Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Ingo Molnar [Wed, 20 Aug 2008 03:50:30 +0000 (20:50 -0700)]
irq: sparse irqs, export nr_irqs
fix:
Building modules, stage 2.
MODPOST 458 modules
ERROR: "nr_irqs" [drivers/serial/8250.ko] undefined!
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Yinghai Lu [Wed, 20 Aug 2008 03:50:00 +0000 (20:50 -0700)]
irq: make irq_desc to use dyn_array
Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Yinghai Lu [Wed, 20 Aug 2008 03:49:59 +0000 (20:49 -0700)]
irq: make irq2_iommu to use dyn_array
Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Yinghai Lu [Wed, 20 Aug 2008 03:49:58 +0000 (20:49 -0700)]
irqs: make irq_timer_state to use dyn_array
Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Yinghai Lu [Wed, 20 Aug 2008 03:49:57 +0000 (20:49 -0700)]
drivers/xen: use nr_irqs
Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Yinghai Lu [Wed, 20 Aug 2008 03:49:56 +0000 (20:49 -0700)]
fs/proc: use nr_irqs
Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Yinghai Lu [Wed, 20 Aug 2008 03:49:55 +0000 (20:49 -0700)]
drivers/serial: use nr_irqs
Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Yinghai Lu [Wed, 20 Aug 2008 03:49:54 +0000 (20:49 -0700)]
drivers/scsi: use nr_irqs
Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Yinghai Lu [Wed, 20 Aug 2008 03:49:53 +0000 (20:49 -0700)]
drivers/rtc: use nr_irqs
Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Yinghai Lu [Wed, 20 Aug 2008 03:49:52 +0000 (20:49 -0700)]
drivers/pcmcia: use nr_irqs
Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Yinghai Lu [Wed, 20 Aug 2008 03:49:51 +0000 (20:49 -0700)]
drivers/pci/ intr remapping: use nr_irqs
Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Yinghai Lu [Wed, 20 Aug 2008 03:49:50 +0000 (20:49 -0700)]
drivers/net: use nr_irqs
Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Yinghai Lu [Wed, 20 Aug 2008 03:49:49 +0000 (20:49 -0700)]
drivers/char: use nr_irqs
convert them to nr_irqs.
Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Yinghai Lu [Wed, 20 Aug 2008 03:49:48 +0000 (20:49 -0700)]
x86: use nr_irqs
also add first_free_entry and pin_map_size, which were NR_IRQS derived
constants.
Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Yinghai Lu [Wed, 20 Aug 2008 03:49:47 +0000 (20:49 -0700)]
irq: introduce nr_irqs
at this point nr_irqs is equal NR_IRQS
convert a few easy users from NR_IRQS to dynamic nr_irqs.
v2: according to Eric, we need to take care of arch without generic_hardirqs
Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>