public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] x86: emulate read/write access to cr8
@ 2007-12-06 14:46 Joerg Roedel
       [not found] ` <1196952412156-git-send-email-joerg.roedel-5C7GfCeVMHo@public.gmane.org>
  0 siblings, 1 reply; 5+ messages in thread
From: Joerg Roedel @ 2007-12-06 14:46 UTC (permalink / raw)
  To: Avi Kivity
  Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f, Joerg Roedel,
	Markus Rechberger, Joerg Roedel

From: Joerg Roedel <jroedel-Ug2OvFXVNAT2eFz/2MeuCQ@public.gmane.org>

This patch adds code to emulate the access to the cr8 register to the x86
instruction emulator in kvm.

Signed-off-by: Joerg Roedel <joerg.roedel-5C7GfCeVMHo@public.gmane.org>
Signed-off-by: Markus Rechberger <markus.rechberger-5C7GfCeVMHo@public.gmane.org>
---
 drivers/kvm/x86.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/drivers/kvm/x86.c b/drivers/kvm/x86.c
index 6deb052..9db4e32 100644
--- a/drivers/kvm/x86.c
+++ b/drivers/kvm/x86.c
@@ -2236,6 +2236,8 @@ unsigned long realmode_get_cr(struct kvm_vcpu *vcpu, int cr)
 		return vcpu->cr3;
 	case 4:
 		return vcpu->cr4;
+	case 8:
+		return get_cr8(vcpu);
 	default:
 		vcpu_printf(vcpu, "%s: unexpected cr %u\n", __FUNCTION__, cr);
 		return 0;
@@ -2259,6 +2261,9 @@ void realmode_set_cr(struct kvm_vcpu *vcpu, int cr, unsigned long val,
 	case 4:
 		set_cr4(vcpu, mk_cr_64(vcpu->cr4, val));
 		break;
+	case 8:
+		set_cr8(vcpu, val & 0xfUL);
+		break;
 	default:
 		vcpu_printf(vcpu, "%s: unexpected cr %u\n", __FUNCTION__, cr);
 	}
-- 
1.5.2.5




-------------------------------------------------------------------------
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell.  From the desktop to the data center, Linux is going
mainstream.  Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2007-12-06 19:04 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-12-06 14:46 [PATCH] x86: emulate read/write access to cr8 Joerg Roedel
     [not found] ` <1196952412156-git-send-email-joerg.roedel-5C7GfCeVMHo@public.gmane.org>
2007-12-06 15:34   ` Avi Kivity
2007-12-06 17:38   ` Avi Kivity
     [not found]     ` <47583398.1080303-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2007-12-06 17:51       ` Avi Kivity
     [not found]         ` <475836B5.5070505-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2007-12-06 19:04           ` Joerg Roedel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox