OSDev.org

The Place to Start for Operating System Developers
It is currently Mon Apr 29, 2024 4:16 am

All times are UTC - 6 hours




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: how to handle lapic / xapic error
PostPosted: Fri Sep 29, 2023 4:27 pm 
Offline

Joined: Fri Sep 29, 2023 4:00 pm
Posts: 3
Hi everyone
I have been studying an OS -- MIT SV6, from https://github.com/aclements/sv6. These days I am migrating UHCI driver code (https://github.com/pdoane/osdev) to SV6. I am working on a real machine, a 2010 year Asus Z8-NA server computer, which are equiped with 2 Xeon CPU packages, and 4 cores for each package. There two front USB ports and 2 rear USB ports in this server. I set two I/O modes for the UHCI driver code -- Polling mode and Interrupt-driven mode. Polling mode works well, at each timer interrupt tick, it checks each UHCI controller and each attached keyboard and mouse to pick up the incoming data if any. However, the interrupt-driven mode works only on the two rear ports. On the two front ports, the interrupt-driven mode does not work prorperly. A keystroke on a front port keyboard triggers "lapic error" messages endlessly. Anyone please offer some help. Thank you so much, best regards.

The following is a code snippet from kernel/trap.cc of SV6 source code, which traps into the corresponding handler according to their interrupt types. Particularly, on the 4th line to the last line it displays "lapic error" when receiving IRQ_ERROR event.

...
case T_IRQ0 + IRQ_IDE:
ideintr();
lapiceoi();
piceoi();
break;
case T_IRQ0 + IRQ_KBD:
kbdintr();
lapiceoi();
piceoi();
break;
case T_IRQ0 + IRQ_COM2:
case T_IRQ0 + IRQ_COM1:
uartintr();
lapiceoi();
piceoi();
break;
case T_IRQ0 + 7:
case T_IRQ0 + IRQ_SPURIOUS:
cprintf("cpu%d: spurious interrupt at %x:%lx\n",
mycpu()->id, tf->cs, tf->rip);
// [Intel SDM 10.9 Spurious Interrupt] The spurious interrupt
// vector handler should return without an EOI.
//lapiceoi();
break;
case T_IRQ0 + IRQ_ERROR:
cprintf("cpu%d: lapic error?\n", mycpu()->id);
lapiceoi();
break;
...


Top
 Profile  
 
 Post subject: Re: how to handle lapic / xapic error
PostPosted: Sun Oct 15, 2023 5:29 pm 
Offline
Member
Member

Joined: Mon Mar 25, 2013 7:01 pm
Posts: 5146
Which interrupt vector is assigned to the USB controller? Could it be assigned to the same vector as the APIC error interrupt?

If they're not assigned to the same interrupt, check the local APIC's Error Status Register. That should help you figure out where to look next.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: Bing [Bot], DotBot [Bot] and 27 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group