OSDev.org

The Place to Start for Operating System Developers
It is currently Thu May 23, 2024 1:30 am

All times are UTC - 6 hours




Post new topic Reply to topic  [ 7 posts ] 
Author Message
 Post subject: x2APIC question
PostPosted: Wed Apr 22, 2020 1:37 pm 
Offline
Member
Member

Joined: Sun Jun 23, 2019 5:36 pm
Posts: 623
Location: North Dakota, United States
Just reading the Intel SDMs, volume 3A, ch. 10, on the APIC. I have a question that I can't seem to find an answer to - if I have an IDT loaded, will the processor call these interrupts when the x2APIC fires them, without me needing to change the interrupt routines or mapping them somewhere else? I can disable the PIC, verify that the APIC is enabled and switch to x2APIC mode, but I don't want mu interrupts getting suddenly broken because I forgot something.


Top
 Profile  
 
 Post subject: Re: x2APIC question
PostPosted: Wed Apr 22, 2020 8:48 pm 
Offline
Member
Member

Joined: Wed Aug 30, 2017 8:24 am
Posts: 1618
The x2APIC is merely an interrupt controller. It does not change how the CPU handles interrupts, only how it receives them. The IDT is therefore unaffected.

_________________
Carpe diem!


Top
 Profile  
 
 Post subject: Re: x2APIC question
PostPosted: Wed Apr 22, 2020 9:11 pm 
Offline
Member
Member

Joined: Sun Jun 23, 2019 5:36 pm
Posts: 623
Location: North Dakota, United States
Thanks. Now I just need to figure out how to get QEMU to emulate it...


Top
 Profile  
 
 Post subject: Re: x2APIC question
PostPosted: Thu Apr 23, 2020 2:09 pm 
Offline
Member
Member
User avatar

Joined: Mon Jan 15, 2018 2:27 pm
Posts: 201
QEMU virtualizes x2APIC mode when using KVM (-enable-kvm option). I think, your host CPU has to support x2APIC (which is about guaranteed these days) for this to work. But beware. GDB stub is not very reliable when using KVM.


Top
 Profile  
 
 Post subject: Re: x2APIC question
PostPosted: Thu Apr 23, 2020 7:52 pm 
Offline
Member
Member

Joined: Sun Jun 23, 2019 5:36 pm
Posts: 623
Location: North Dakota, United States
I'd use KVM, but I'm trying to find a way to get it to emulate it on all platforms. For some reason, HAXM (on Windows) causes an immeduate VCPU shutdown request for some reason, and I can't find any way of locating HAXM logs. And WHPX doesn't want to work for some reason (even though I have it enabled in windows features). It might be because I disabled it at boot (mainly so windows wouldn't cause pretty much every other VM solution to fail to run properly).


Top
 Profile  
 
 Post subject: Re: x2APIC question
PostPosted: Fri Apr 24, 2020 2:50 am 
Offline
Member
Member
User avatar

Joined: Thu Oct 13, 2016 4:55 pm
Posts: 1584
Ethin wrote:
I'd use KVM, but I'm trying to find a way to get it to emulate it on all platforms.
Try
Code:
-cpu IvyBridge,+x2apic
This works for me, however I'm using KVM too, haven't disabled x2APIC at boot, and I'm running qemu under Linux. You could also try VirtualBox, it supports x2APIC emulation as well.

Cheers,
bzt


Top
 Profile  
 
 Post subject: Re: x2APIC question
PostPosted: Thu Apr 18, 2024 9:11 pm 
Offline

Joined: Fri Sep 29, 2023 4:00 pm
Posts: 3
XV6 for x86 is a good reference, it supports xAPIC, and does not support x2APIC


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

All times are UTC - 6 hours


Who is online

Users browsing this forum: Bing [Bot], Majestic-12 [Bot] and 35 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