mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-18 20:54:20 +00:00
KVM: vmx: speed up TPR below threshold vmexits
Since we're already in VCPU context, all we have to do here is recompute the PPR value. That will in turn generate a KVM_REQ_EVENT if necessary. Reviewed-by: Roman Kagan <rkagan@virtuozzo.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
0f1e261ead
commit
eb90f3417a
3 changed files with 8 additions and 1 deletions
|
@ -595,6 +595,12 @@ static void apic_update_ppr(struct kvm_lapic *apic)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void kvm_apic_update_ppr(struct kvm_vcpu *vcpu)
|
||||||
|
{
|
||||||
|
apic_update_ppr(vcpu->arch.apic);
|
||||||
|
}
|
||||||
|
EXPORT_SYMBOL_GPL(kvm_apic_update_ppr);
|
||||||
|
|
||||||
static void apic_set_tpr(struct kvm_lapic *apic, u32 tpr)
|
static void apic_set_tpr(struct kvm_lapic *apic, u32 tpr)
|
||||||
{
|
{
|
||||||
kvm_lapic_set_reg(apic, APIC_TASKPRI, tpr);
|
kvm_lapic_set_reg(apic, APIC_TASKPRI, tpr);
|
||||||
|
|
|
@ -73,6 +73,7 @@ bool kvm_apic_match_dest(struct kvm_vcpu *vcpu, struct kvm_lapic *source,
|
||||||
|
|
||||||
void __kvm_apic_update_irr(u32 *pir, void *regs);
|
void __kvm_apic_update_irr(u32 *pir, void *regs);
|
||||||
void kvm_apic_update_irr(struct kvm_vcpu *vcpu, u32 *pir);
|
void kvm_apic_update_irr(struct kvm_vcpu *vcpu, u32 *pir);
|
||||||
|
void kvm_apic_update_ppr(struct kvm_vcpu *vcpu);
|
||||||
int kvm_apic_set_irq(struct kvm_vcpu *vcpu, struct kvm_lapic_irq *irq,
|
int kvm_apic_set_irq(struct kvm_vcpu *vcpu, struct kvm_lapic_irq *irq,
|
||||||
struct dest_map *dest_map);
|
struct dest_map *dest_map);
|
||||||
int kvm_apic_local_deliver(struct kvm_lapic *apic, int lvt_type);
|
int kvm_apic_local_deliver(struct kvm_lapic *apic, int lvt_type);
|
||||||
|
|
|
@ -6152,7 +6152,7 @@ static int handle_wrmsr(struct kvm_vcpu *vcpu)
|
||||||
|
|
||||||
static int handle_tpr_below_threshold(struct kvm_vcpu *vcpu)
|
static int handle_tpr_below_threshold(struct kvm_vcpu *vcpu)
|
||||||
{
|
{
|
||||||
kvm_make_request(KVM_REQ_EVENT, vcpu);
|
kvm_apic_update_ppr(vcpu);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue