public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: "Joerg Roedel" <joerg.roedel-5C7GfCeVMHo@public.gmane.org>
To: "Avi Kivity" <avi-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org,
	Joerg Roedel <joerg.roedel-5C7GfCeVMHo@public.gmane.org>,
	Markus Rechberger
	<markus.rechberger-5C7GfCeVMHo@public.gmane.org>,
	Joerg Roedel <jroedel-Ug2OvFXVNAT2eFz/2MeuCQ@public.gmane.org>
Subject: [PATCH] x86: emulate read/write access to cr8
Date: Thu,  6 Dec 2007 15:46:52 +0100	[thread overview]
Message-ID: <1196952412156-git-send-email-joerg.roedel@amd.com> (raw)

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

             reply	other threads:[~2007-12-06 14:46 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-12-06 14:46 Joerg Roedel [this message]
     [not found] ` <1196952412156-git-send-email-joerg.roedel-5C7GfCeVMHo@public.gmane.org>
2007-12-06 15:34   ` [PATCH] x86: emulate read/write access to cr8 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1196952412156-git-send-email-joerg.roedel@amd.com \
    --to=joerg.roedel-5c7gfcevmho@public.gmane.org \
    --cc=avi-atKUWr5tajBWk0Htik3J/w@public.gmane.org \
    --cc=jroedel-Ug2OvFXVNAT2eFz/2MeuCQ@public.gmane.org \
    --cc=kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org \
    --cc=markus.rechberger-5C7GfCeVMHo@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox