diff mbox

[U-Boot,10/15] x86: quark: Assign a unique I/O APIC ID

Message ID 1463906739-934-11-git-send-email-bmeng.cn@gmail.com
State Accepted
Commit 911d6f693292dbf9b54de43f18ac95427e9accd8
Delegated to: Bin Meng
Headers show

Commit Message

Bin Meng May 22, 2016, 8:45 a.m. UTC
After power-on, both LAPIC and I/O APIC appear with the same APIC ID
zero, which creates an ID conflict. When generating MP table, U-Boot
reports zero as the LAPIC ID in the processor entry, and zero as the
I/O APIC ID in the I/O APIC as well as the I/O interrupt assignment
entries. Such MP table confuses Linux kernel and finally a kernel
panic is seen during boot:

  BUG: unable to handle kernel paging request at ffff9000
  IP: [<c101d462>] native_io_apic_write+0x22/0x30
  *pdpt = 00000000014fb001 *pde = 00000000014ff067 *pte = 0000000000000000
  Oops: 0002 [#1]
  Modules linked in:
  Pid: 1, comm: swapper Tainted: G        W    3.8.7 #3 intel galileo/galileo
  EIP: 0060:[<c101d462>] EFLAGS: 00010086 CPU: 0
  EIP is at native_io_apic_write+0x22/0x30
  ...
  Kernel panic - not syncing: Attempted to kill init! exitcode=0x00000009

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
---

 arch/x86/cpu/quark/quark.c | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Simon Glass May 23, 2016, 12:19 a.m. UTC | #1
On 22 May 2016 at 02:45, Bin Meng <bmeng.cn@gmail.com> wrote:
> After power-on, both LAPIC and I/O APIC appear with the same APIC ID
> zero, which creates an ID conflict. When generating MP table, U-Boot
> reports zero as the LAPIC ID in the processor entry, and zero as the
> I/O APIC ID in the I/O APIC as well as the I/O interrupt assignment
> entries. Such MP table confuses Linux kernel and finally a kernel
> panic is seen during boot:
>
>   BUG: unable to handle kernel paging request at ffff9000
>   IP: [<c101d462>] native_io_apic_write+0x22/0x30
>   *pdpt = 00000000014fb001 *pde = 00000000014ff067 *pte = 0000000000000000
>   Oops: 0002 [#1]
>   Modules linked in:
>   Pid: 1, comm: swapper Tainted: G        W    3.8.7 #3 intel galileo/galileo
>   EIP: 0060:[<c101d462>] EFLAGS: 00010086 CPU: 0
>   EIP is at native_io_apic_write+0x22/0x30
>   ...
>   Kernel panic - not syncing: Attempted to kill init! exitcode=0x00000009
>
> Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
> ---
>
>  arch/x86/cpu/quark/quark.c | 4 ++++
>  1 file changed, 4 insertions(+)

Reviewed-by: Simon Glass <sjg@chromium.org>
Bin Meng May 23, 2016, 8:19 a.m. UTC | #2
On Mon, May 23, 2016 at 8:19 AM, Simon Glass <sjg@chromium.org> wrote:
> On 22 May 2016 at 02:45, Bin Meng <bmeng.cn@gmail.com> wrote:
>> After power-on, both LAPIC and I/O APIC appear with the same APIC ID
>> zero, which creates an ID conflict. When generating MP table, U-Boot
>> reports zero as the LAPIC ID in the processor entry, and zero as the
>> I/O APIC ID in the I/O APIC as well as the I/O interrupt assignment
>> entries. Such MP table confuses Linux kernel and finally a kernel
>> panic is seen during boot:
>>
>>   BUG: unable to handle kernel paging request at ffff9000
>>   IP: [<c101d462>] native_io_apic_write+0x22/0x30
>>   *pdpt = 00000000014fb001 *pde = 00000000014ff067 *pte = 0000000000000000
>>   Oops: 0002 [#1]
>>   Modules linked in:
>>   Pid: 1, comm: swapper Tainted: G        W    3.8.7 #3 intel galileo/galileo
>>   EIP: 0060:[<c101d462>] EFLAGS: 00010086 CPU: 0
>>   EIP is at native_io_apic_write+0x22/0x30
>>   ...
>>   Kernel panic - not syncing: Attempted to kill init! exitcode=0x00000009
>>
>> Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
>> ---
>>
>>  arch/x86/cpu/quark/quark.c | 4 ++++
>>  1 file changed, 4 insertions(+)
>
> Reviewed-by: Simon Glass <sjg@chromium.org>

applied to u-boot-x86, thanks!
diff mbox

Patch

diff --git a/arch/x86/cpu/quark/quark.c b/arch/x86/cpu/quark/quark.c
index cf3fe7f..bdd360a 100644
--- a/arch/x86/cpu/quark/quark.c
+++ b/arch/x86/cpu/quark/quark.c
@@ -7,6 +7,7 @@ 
 #include <common.h>
 #include <mmc.h>
 #include <asm/io.h>
+#include <asm/ioapic.h>
 #include <asm/mrccache.h>
 #include <asm/mtrr.h>
 #include <asm/pci.h>
@@ -338,6 +339,9 @@  int arch_misc_init(void)
 	mrccache_save();
 #endif
 
+	/* Assign a unique I/O APIC ID */
+	io_apic_set_id(1);
+
 	return 0;
 }