* [patch 0/2] Fix busy-spin of lapic_timer_int_injected with APIC-v
@ 2015-02-02 17:26 Marcelo Tosatti
2015-02-02 17:26 ` [patch 1/2] KVM: x86: fix " Marcelo Tosatti
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: Marcelo Tosatti @ 2015-02-02 17:26 UTC (permalink / raw)
To: Paolo Bonzini, Radim Krcmar; +Cc: kvm
See patches for details.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [patch 1/2] KVM: x86: fix lapic_timer_int_injected with APIC-v
2015-02-02 17:26 [patch 0/2] Fix busy-spin of lapic_timer_int_injected with APIC-v Marcelo Tosatti
@ 2015-02-02 17:26 ` Marcelo Tosatti
2015-02-02 17:26 ` [patch 2/2] KVM: x86: revert "add method to test PIR bitmap vector" Marcelo Tosatti
2015-02-02 17:37 ` [patch 0/2] Fix busy-spin of lapic_timer_int_injected with APIC-v Paolo Bonzini
2 siblings, 0 replies; 6+ messages in thread
From: Marcelo Tosatti @ 2015-02-02 17:26 UTC (permalink / raw)
To: Paolo Bonzini, Radim Krcmar; +Cc: kvm, Marcelo Tosatti
[-- Attachment #1: lapic-advancement-fix-APICv --]
[-- Type: text/plain, Size: 982 bytes --]
With APICv, LAPIC timer interrupt is always delivered via IRR:
apic_find_highest_irr syncs PIR to IRR.
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
---
arch/x86/kvm/lapic.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
Index: kvm/arch/x86/kvm/lapic.c
===================================================================
--- kvm.orig/arch/x86/kvm/lapic.c 2015-02-02 14:57:19.903066983 -0200
+++ kvm/arch/x86/kvm/lapic.c 2015-02-02 15:25:40.197299923 -0200
@@ -1086,13 +1086,13 @@
if (kvm_apic_hw_enabled(apic)) {
int vec = reg & APIC_VECTOR_MASK;
+ void *bitmap = apic->regs + APIC_ISR;
- if (kvm_x86_ops->test_posted_interrupt)
- return kvm_x86_ops->test_posted_interrupt(vcpu, vec);
- else {
- if (apic_test_vector(vec, apic->regs + APIC_ISR))
- return true;
- }
+ if (kvm_x86_ops->deliver_posted_interrupt)
+ bitmap = apic->regs + APIC_IRR;
+
+ if (apic_test_vector(vec, bitmap))
+ return true;
}
return false;
}
^ permalink raw reply [flat|nested] 6+ messages in thread
* [patch 2/2] KVM: x86: revert "add method to test PIR bitmap vector"
2015-02-02 17:26 [patch 0/2] Fix busy-spin of lapic_timer_int_injected with APIC-v Marcelo Tosatti
2015-02-02 17:26 ` [patch 1/2] KVM: x86: fix " Marcelo Tosatti
@ 2015-02-02 17:26 ` Marcelo Tosatti
2015-02-02 17:37 ` [patch 0/2] Fix busy-spin of lapic_timer_int_injected with APIC-v Paolo Bonzini
2 siblings, 0 replies; 6+ messages in thread
From: Marcelo Tosatti @ 2015-02-02 17:26 UTC (permalink / raw)
To: Paolo Bonzini, Radim Krcmar; +Cc: kvm, Marcelo Tosatti
[-- Attachment #1: revert-test-pir --]
[-- Type: text/plain, Size: 2364 bytes --]
Revert 7c6a98dfa1ba9dc64a62e73624ecea9995736bbd, given
that testing PIR is not necessary anymore.
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
---
arch/x86/include/asm/kvm_host.h | 1 -
arch/x86/kvm/vmx.c | 14 --------------
2 files changed, 15 deletions(-)
Index: kvm/arch/x86/include/asm/kvm_host.h
===================================================================
--- kvm.orig/arch/x86/include/asm/kvm_host.h 2015-02-02 15:19:06.361568508 -0200
+++ kvm/arch/x86/include/asm/kvm_host.h 2015-02-02 15:19:46.376032645 -0200
@@ -767,7 +767,6 @@
void (*set_virtual_x2apic_mode)(struct kvm_vcpu *vcpu, bool set);
void (*set_apic_access_page_addr)(struct kvm_vcpu *vcpu, hpa_t hpa);
void (*deliver_posted_interrupt)(struct kvm_vcpu *vcpu, int vector);
- bool (*test_posted_interrupt)(struct kvm_vcpu *vcpu, int vector);
void (*sync_pir_to_irr)(struct kvm_vcpu *vcpu);
int (*set_tss_addr)(struct kvm *kvm, unsigned int addr);
int (*get_tdp_level)(void);
Index: kvm/arch/x86/kvm/vmx.c
===================================================================
--- kvm.orig/arch/x86/kvm/vmx.c 2015-02-02 15:19:06.361568508 -0200
+++ kvm/arch/x86/kvm/vmx.c 2015-02-02 15:19:46.377032631 -0200
@@ -438,11 +438,6 @@
return test_and_set_bit(vector, (unsigned long *)pi_desc->pir);
}
-static int pi_test_pir(int vector, struct pi_desc *pi_desc)
-{
- return test_bit(vector, (unsigned long *)pi_desc->pir);
-}
-
struct vcpu_vmx {
struct kvm_vcpu vcpu;
unsigned long host_rsp;
@@ -5908,7 +5903,6 @@
kvm_x86_ops->hwapic_irr_update = NULL;
kvm_x86_ops->hwapic_isr_update = NULL;
kvm_x86_ops->deliver_posted_interrupt = NULL;
- kvm_x86_ops->test_posted_interrupt = NULL;
kvm_x86_ops->sync_pir_to_irr = vmx_sync_pir_to_irr_dummy;
}
@@ -6994,13 +6988,6 @@
return 1;
}
-static bool vmx_test_pir(struct kvm_vcpu *vcpu, int vector)
-{
- struct vcpu_vmx *vmx = to_vmx(vcpu);
-
- return pi_test_pir(vector, &vmx->pi_desc);
-}
-
static int handle_pml_full(struct kvm_vcpu *vcpu)
{
unsigned long exit_qualification;
@@ -9753,7 +9740,6 @@
.hwapic_isr_update = vmx_hwapic_isr_update,
.sync_pir_to_irr = vmx_sync_pir_to_irr,
.deliver_posted_interrupt = vmx_deliver_posted_interrupt,
- .test_posted_interrupt = vmx_test_pir,
.set_tss_addr = vmx_set_tss_addr,
.get_tdp_level = get_ept_level,
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [patch 0/2] Fix busy-spin of lapic_timer_int_injected with APIC-v
2015-02-02 17:26 [patch 0/2] Fix busy-spin of lapic_timer_int_injected with APIC-v Marcelo Tosatti
2015-02-02 17:26 ` [patch 1/2] KVM: x86: fix " Marcelo Tosatti
2015-02-02 17:26 ` [patch 2/2] KVM: x86: revert "add method to test PIR bitmap vector" Marcelo Tosatti
@ 2015-02-02 17:37 ` Paolo Bonzini
2015-02-02 17:44 ` Marcelo Tosatti
2 siblings, 1 reply; 6+ messages in thread
From: Paolo Bonzini @ 2015-02-02 17:37 UTC (permalink / raw)
To: Marcelo Tosatti, Radim Krcmar; +Cc: kvm
On 02/02/2015 18:26, Marcelo Tosatti wrote:
> See patches for details.
Nicer indeed. It would be good to know what bug made you do this, though.
Paolo
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [patch 0/2] Fix busy-spin of lapic_timer_int_injected with APIC-v
2015-02-02 17:37 ` [patch 0/2] Fix busy-spin of lapic_timer_int_injected with APIC-v Paolo Bonzini
@ 2015-02-02 17:44 ` Marcelo Tosatti
2015-02-02 18:14 ` Paolo Bonzini
0 siblings, 1 reply; 6+ messages in thread
From: Marcelo Tosatti @ 2015-02-02 17:44 UTC (permalink / raw)
To: Paolo Bonzini; +Cc: Radim Krcmar, kvm
On Mon, Feb 02, 2015 at 06:37:08PM +0100, Paolo Bonzini wrote:
>
>
> On 02/02/2015 18:26, Marcelo Tosatti wrote:
> > See patches for details.
>
> Nicer indeed. It would be good to know what bug made you do this, though.
>
> Paolo
kvm-unit-test tscdeadline-latency shows negative delta.
Do you want me to resend with the modified changelog?
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [patch 0/2] Fix busy-spin of lapic_timer_int_injected with APIC-v
2015-02-02 17:44 ` Marcelo Tosatti
@ 2015-02-02 18:14 ` Paolo Bonzini
0 siblings, 0 replies; 6+ messages in thread
From: Paolo Bonzini @ 2015-02-02 18:14 UTC (permalink / raw)
To: Marcelo Tosatti; +Cc: Radim Krcmar, kvm
On 02/02/2015 18:44, Marcelo Tosatti wrote:
> > Nicer indeed. It would be good to know what bug made you do this, though.
>
> kvm-unit-test tscdeadline-latency shows negative delta.
>
> Do you want me to resend with the modified changelog?
No, it's okay.
Thanks,
Paolo
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2015-02-02 18:14 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-02-02 17:26 [patch 0/2] Fix busy-spin of lapic_timer_int_injected with APIC-v Marcelo Tosatti
2015-02-02 17:26 ` [patch 1/2] KVM: x86: fix " Marcelo Tosatti
2015-02-02 17:26 ` [patch 2/2] KVM: x86: revert "add method to test PIR bitmap vector" Marcelo Tosatti
2015-02-02 17:37 ` [patch 0/2] Fix busy-spin of lapic_timer_int_injected with APIC-v Paolo Bonzini
2015-02-02 17:44 ` Marcelo Tosatti
2015-02-02 18:14 ` Paolo Bonzini
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.