diff options
author | Michael S. Tsirkin <mst@redhat.com> | 2012-06-24 12:25:07 -0400 |
---|---|---|
committer | Avi Kivity <avi@redhat.com> | 2012-06-25 05:40:55 -0400 |
commit | ae7a2a3fb6f8b784c2752863f4f1f20c656f76fb (patch) | |
tree | 5f4053265d244bb12ccff88494d70124b6d603c3 /arch/x86/kvm/trace.h | |
parent | d905c0693514e6f713b207377b67c9972c5d7d49 (diff) |
KVM: host side for eoi optimization
Implementation of PV EOI using shared memory.
This reduces the number of exits an interrupt
causes as much as by half.
The idea is simple: there's a bit, per APIC, in guest memory,
that tells the guest that it does not need EOI.
We set it before injecting an interrupt and clear
before injecting a nested one. Guest tests it using
a test and clear operation - this is necessary
so that host can detect interrupt nesting -
and if set, it can skip the EOI MSR.
There's a new MSR to set the address of said register
in guest memory. Otherwise not much changed:
- Guest EOI is not required
- Register is tested & ISR is automatically cleared on exit
For testing results see description of previous patch
'kvm_para: guest side for eoi avoidance'.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'arch/x86/kvm/trace.h')
-rw-r--r-- | arch/x86/kvm/trace.h | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/arch/x86/kvm/trace.h b/arch/x86/kvm/trace.h index 911d2641f14c..851914e207fc 100644 --- a/arch/x86/kvm/trace.h +++ b/arch/x86/kvm/trace.h | |||
@@ -517,6 +517,40 @@ TRACE_EVENT(kvm_apic_accept_irq, | |||
517 | __entry->coalesced ? " (coalesced)" : "") | 517 | __entry->coalesced ? " (coalesced)" : "") |
518 | ); | 518 | ); |
519 | 519 | ||
520 | TRACE_EVENT(kvm_eoi, | ||
521 | TP_PROTO(struct kvm_lapic *apic, int vector), | ||
522 | TP_ARGS(apic, vector), | ||
523 | |||
524 | TP_STRUCT__entry( | ||
525 | __field( __u32, apicid ) | ||
526 | __field( int, vector ) | ||
527 | ), | ||
528 | |||
529 | TP_fast_assign( | ||
530 | __entry->apicid = apic->vcpu->vcpu_id; | ||
531 | __entry->vector = vector; | ||
532 | ), | ||
533 | |||
534 | TP_printk("apicid %x vector %d", __entry->apicid, __entry->vector) | ||
535 | ); | ||
536 | |||
537 | TRACE_EVENT(kvm_pv_eoi, | ||
538 | TP_PROTO(struct kvm_lapic *apic, int vector), | ||
539 | TP_ARGS(apic, vector), | ||
540 | |||
541 | TP_STRUCT__entry( | ||
542 | __field( __u32, apicid ) | ||
543 | __field( int, vector ) | ||
544 | ), | ||
545 | |||
546 | TP_fast_assign( | ||
547 | __entry->apicid = apic->vcpu->vcpu_id; | ||
548 | __entry->vector = vector; | ||
549 | ), | ||
550 | |||
551 | TP_printk("apicid %x vector %d", __entry->apicid, __entry->vector) | ||
552 | ); | ||
553 | |||
520 | /* | 554 | /* |
521 | * Tracepoint for nested VMRUN | 555 | * Tracepoint for nested VMRUN |
522 | */ | 556 | */ |