Skip to contentSkip to conversation

KVM: x86 emulator: handle smsw

PATCH New Avi Kivity 1 participant 1 message Nov 30, 2006 KVM

lore
Share & tools
lore

Avi Kivity

author
#0 lore raw

PATCH 1/1 KVM: x86 emulator: handle smsw

This allows FreeBSD 6.2rc1 to boot.

Also, don't pretend to support lmsw (mem).

drivers/kvm/x86_emulate.c +8 -0
Index: linux-2.6/drivers/kvm/x86_emulate.c
===================================================================
@@ -1166,7 +1166,15 @@ twobyte_insn:
 				goto done;
 			realmode_lidt(ctxt->vcpu, size, address);
 			break;
+		case 4: /* smsw */
+			if (modrm_mod != 3)
+				goto cannot_emulate;
+			*(u16 *)&_regs[modrm_rm]
+				= realmode_get_cr(ctxt->vcpu, 0);
+			break;
 		case 6: /* lmsw */
+			if (modrm_mod != 3)
+				goto cannot_emulate;
 			realmode_lmsw(ctxt->vcpu, (u16)modrm_val, &_eflags);
 			break;
 		case 7: /* invlpg*/

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV