Skip to contentSkip to conversation

A small fix

DISCUSSION Willow Schlanger 2 participants 2 messages Jun 26, 2007 – Jun 27, 2007 1 message not in the archive KVM

lore
Share & tools
lore
#0 lore raw

Hi, in vmx_vcpu_setup() is this code:

	vmcs_writel(GUEST_IDTR_BASE, 0);
	vmcs_write32(GUEST_IDTR_LIMIT, 0xffff);

But if you use SIDT on a real processor, after boot-up, you will see the real-mode base is in fact 0, but the limit is 0x3ff. That is, in fact, the base an limit you are supposed to use when you switch back to real mode from protected mode.

So 0xffff should be changed to 0x03ff in the lines above.

Please write back with any comments...
Willow Schlanger

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/

#2 lore raw
In reply to a message not in the archive
Quoted 5 lines · Willow Schlanger

Hi, in vmx_vcpu_setup() is this code:

	vmcs_writel(GUEST_IDTR_BASE, 0);
	vmcs_write32(GUEST_IDTR_LIMIT, 0xffff);
Quoted 8 lines

But if you use SIDT on a real processor, after boot-up, you will see the real-mode base is in fact 0, but the limit is 0x3ff. That is, in fact, the base an limit you are supposed to use when you switch back to real mode from protected mode.

So 0xffff should be changed to 0x03ff in the lines above.

Makes sense. Care to prepare (and test!) a patch?

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/