Commit 152ff9be authored by Joerg Roedel's avatar Joerg Roedel Committed by Avi Kivity

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: default avatarJoerg Roedel <joerg.roedel@amd.com>
Signed-off-by: default avatarMarkus Rechberger <markus.rechberger@amd.com>
Signed-off-by: default avatarAvi Kivity <avi@qumranet.com>
parent e5314067
...@@ -2236,6 +2236,8 @@ unsigned long realmode_get_cr(struct kvm_vcpu *vcpu, int cr) ...@@ -2236,6 +2236,8 @@ unsigned long realmode_get_cr(struct kvm_vcpu *vcpu, int cr)
return vcpu->cr3; return vcpu->cr3;
case 4: case 4:
return vcpu->cr4; return vcpu->cr4;
case 8:
return get_cr8(vcpu);
default: default:
vcpu_printf(vcpu, "%s: unexpected cr %u\n", __FUNCTION__, cr); vcpu_printf(vcpu, "%s: unexpected cr %u\n", __FUNCTION__, cr);
return 0; return 0;
...@@ -2259,6 +2261,9 @@ void realmode_set_cr(struct kvm_vcpu *vcpu, int cr, unsigned long val, ...@@ -2259,6 +2261,9 @@ void realmode_set_cr(struct kvm_vcpu *vcpu, int cr, unsigned long val,
case 4: case 4:
set_cr4(vcpu, mk_cr_64(vcpu->cr4, val)); set_cr4(vcpu, mk_cr_64(vcpu->cr4, val));
break; break;
case 8:
set_cr8(vcpu, val & 0xfUL);
break;
default: default:
vcpu_printf(vcpu, "%s: unexpected cr %u\n", __FUNCTION__, cr); vcpu_printf(vcpu, "%s: unexpected cr %u\n", __FUNCTION__, cr);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment