VMware problem with AP bootup and POPF

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
xyzzy
Member
Member
Posts: 391
Joined: Wed Jul 25, 2007 8:45 am
Libera.chat IRC: aejsmith
Location: London, UK
Contact:

VMware problem with AP bootup and POPF

Post by xyzzy »

I've come across an interesting problem when testing my SMP support in VMware. In both my BSP and AP bootup code, I clear EFLAGS by doing the following:

Code: Select all

push $0
popf
This works fine in both cases in QEMU, and on 2 real machines. In VMware, however, it works fine in the BSP case, but not on the AP, instead it causes a triple fault on the POPF. Even this faults:

Code: Select all

pushf
popf
Unfortunately I can't see exactly what exception it's causing, but am I missing something obvious here? I have a stack set up correctly and a GDT, and all segment registers are set correctly. Anyone know what could be causing this?
xyzzy
Member
Member
Posts: 391
Joined: Wed Jul 25, 2007 8:45 am
Libera.chat IRC: aejsmith
Location: London, UK
Contact:

Re: VMware problem with AP bootup and POPF

Post by xyzzy »

Eeek, I feel such an idiot now! Minutes after I posted this I realised that I'd allocated the AP's stack using the kernel heap, and then attempted to convert the allocated address to a physical address as if it were an address in the physical map area. That's what I get for coding while tired :roll:
User avatar
Stevo14
Member
Member
Posts: 179
Joined: Fri Mar 07, 2008 3:40 am
Location: Arad, Romania

Re: VMware problem with AP bootup and POPF

Post by Stevo14 »

The scary part is that the code worked fine in Qemu and on two real machines with that bug in it... :? weird.
xyzzy
Member
Member
Posts: 391
Joined: Wed Jul 25, 2007 8:45 am
Libera.chat IRC: aejsmith
Location: London, UK
Contact:

Re: VMware problem with AP bootup and POPF

Post by xyzzy »

I assume it was because the address I was ending up with was free physical memory, whereas VMware was probably using it for special purposes (i.e. it wasn't usable memory, and instead some memory-mapped I/O or something).
Post Reply