Commit:     152ff9be2ed11e76ed3014b94eacdd6bc9275518
Parent:     e5314067f6a77688a3d36548e7618430ce4a6236
Author:     Joerg Roedel <[EMAIL PROTECTED]>
AuthorDate: Thu Dec 6 15:46:52 2007 +0100
Committer:  Avi Kivity <[EMAIL PROTECTED]>
CommitDate: Wed Jan 30 17:53:19 2008 +0200

    KVM: SVM: Emulate read/write access to cr8
    This patch adds code to emulate the access to the cr8 register to the x86
    instruction emulator in kvm.  This is needed on svm, where there is no
    hardware decode for control register access.
    Signed-off-by: Joerg Roedel <[EMAIL PROTECTED]>
    Signed-off-by: Markus Rechberger <[EMAIL PROTECTED]>
    Signed-off-by: Avi Kivity <[EMAIL PROTECTED]>
 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 
                return vcpu->cr3;
        case 4:
                return vcpu->cr4;
+       case 8:
+               return get_cr8(vcpu);
                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));
+       case 8:
+               set_cr8(vcpu, val & 0xfUL);
+               break;
                vcpu_printf(vcpu, "%s: unexpected cr %u\n", __FUNCTION__, cr);
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at

Reply via email to