* [PATCH] Update cr8 intercept when APIC/CR8 is changed by userspace.
@ 2009-08-09 12:17 Gleb Natapov
2009-08-09 13:46 ` Avi Kivity
0 siblings, 1 reply; 2+ messages in thread
From: Gleb Natapov @ 2009-08-09 12:17 UTC (permalink / raw)
To: avi; +Cc: kvm
Since on vcpu entry we do it only if apic is enabled we should do
it when TPR is changed while apic is disabled. This happens when windows
resets HW without setting TPR to zero.
Signed-off-by: Gleb Natapov <gleb@redhat.com>
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index 44777a6..5a69ad1 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -77,6 +77,7 @@ static u64 __read_mostly efer_reserved_bits = 0xfffffffffffffffeULL;
#define VM_STAT(x) offsetof(struct kvm, stat.x), KVM_STAT_VM
#define VCPU_STAT(x) offsetof(struct kvm_vcpu, stat.x), KVM_STAT_VCPU
+static void update_cr8_intercept(struct kvm_vcpu *vcpu);
static int kvm_dev_ioctl_get_supported_cpuid(struct kvm_cpuid2 *cpuid,
struct kvm_cpuid_entry2 __user *entries);
@@ -1629,6 +1630,7 @@ static int kvm_vcpu_ioctl_set_lapic(struct kvm_vcpu *vcpu,
vcpu_load(vcpu);
memcpy(vcpu->arch.apic->regs, s->regs, sizeof *s);
kvm_apic_post_state_restore(vcpu);
+ update_cr8_intercept(vcpu);
vcpu_put(vcpu);
return 0;
@@ -4412,6 +4414,7 @@ int kvm_arch_vcpu_ioctl_set_sregs(struct kvm_vcpu *vcpu,
vcpu->arch.cr3 = sregs->cr3;
kvm_set_cr8(vcpu, sregs->cr8);
+ update_cr8_intercept(vcpu);
mmu_reset_needed |= vcpu->arch.shadow_efer != sregs->efer;
kvm_x86_ops->set_efer(vcpu, sregs->efer);
--
Gleb.
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] Update cr8 intercept when APIC/CR8 is changed by userspace.
2009-08-09 12:17 [PATCH] Update cr8 intercept when APIC/CR8 is changed by userspace Gleb Natapov
@ 2009-08-09 13:46 ` Avi Kivity
0 siblings, 0 replies; 2+ messages in thread
From: Avi Kivity @ 2009-08-09 13:46 UTC (permalink / raw)
To: Gleb Natapov; +Cc: kvm
On 08/09/2009 03:17 PM, Gleb Natapov wrote:
> Since on vcpu entry we do it only if apic is enabled we should do
> it when TPR is changed while apic is disabled. This happens when windows
> resets HW without setting TPR to zero.
>
>
Applied, thanks.
> @@ -4412,6 +4414,7 @@ int kvm_arch_vcpu_ioctl_set_sregs(struct kvm_vcpu *vcpu,
> vcpu->arch.cr3 = sregs->cr3;
>
> kvm_set_cr8(vcpu, sregs->cr8);
> + update_cr8_intercept(vcpu);
>
> mmu_reset_needed |= vcpu->arch.shadow_efer != sregs->efer;
> kvm_x86_ops->set_efer(vcpu, sregs->efer);
>
Already had this bit, so dropped it.
--
error compiling committee.c: too many arguments to function
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2009-08-09 13:40 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-08-09 12:17 [PATCH] Update cr8 intercept when APIC/CR8 is changed by userspace Gleb Natapov
2009-08-09 13:46 ` Avi Kivity
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox