Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 93905
b: refs/heads/master
c: 649d686
h: refs/heads/master
i:
  93903: f1a74ba
v: v3
  • Loading branch information
Joerg Roedel authored and Avi Kivity committed Apr 27, 2008
1 parent 2fdbb46 commit 97980cf
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: bbf45ba57eaec56569918a8bab96ab653bd45ec1
refs/heads/master: 649d68643ebf02f31859ffbb16676aa44c72e6e9
18 changes: 16 additions & 2 deletions trunk/arch/x86/kvm/svm.c
Original file line number Diff line number Diff line change
Expand Up @@ -486,8 +486,7 @@ static void init_vmcb(struct vcpu_svm *svm)

control->intercept_cr_read = INTERCEPT_CR0_MASK |
INTERCEPT_CR3_MASK |
INTERCEPT_CR4_MASK |
INTERCEPT_CR8_MASK;
INTERCEPT_CR4_MASK;

control->intercept_cr_write = INTERCEPT_CR0_MASK |
INTERCEPT_CR3_MASK |
Expand Down Expand Up @@ -1621,6 +1620,19 @@ static void svm_prepare_guest_switch(struct kvm_vcpu *vcpu)
{
}

static inline void sync_lapic_to_cr8(struct kvm_vcpu *vcpu)
{
struct vcpu_svm *svm = to_svm(vcpu);
u64 cr8;

if (!irqchip_in_kernel(vcpu->kvm))
return;

cr8 = kvm_get_cr8(vcpu);
svm->vmcb->control.int_ctl &= ~V_TPR_MASK;
svm->vmcb->control.int_ctl |= cr8 & V_TPR_MASK;
}

static void svm_vcpu_run(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run)
{
struct vcpu_svm *svm = to_svm(vcpu);
Expand All @@ -1630,6 +1642,8 @@ static void svm_vcpu_run(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run)

pre_svm_run(svm);

sync_lapic_to_cr8(vcpu);

save_host_msrs(vcpu);
fs_selector = read_fs();
gs_selector = read_gs();
Expand Down

0 comments on commit 97980cf

Please sign in to comment.