xen/pci: Use APIC directly when APIC virtualization hardware is available
authorBoris Ostrovsky <boris.ostrovsky@oracle.com>
Tue, 2 Dec 2014 20:19:13 +0000 (15:19 -0500)
committerDavid Vrabel <david.vrabel@citrix.com>
Thu, 4 Dec 2014 13:02:43 +0000 (13:02 +0000)
commit14520c92cbd7619ae097a3087b140c992b5c270b
tree61a2753722c43559087af44abcce2de742bd8790
parent066d79e4e2a41fbd0da62bd994f9b77ef8fa040a
xen/pci: Use APIC directly when APIC virtualization hardware is available

When hardware supports APIC/x2APIC virtualization we don't need to use
pirqs for MSI handling and instead use APIC since most APIC accesses
(MMIO or MSR) will now be processed without VMEXITs.

As an example, netperf on the original code produces this profile
(collected wih 'xentrace -e 0x0008ffff -T 5'):

    342 cpu_change
    260 CPUID
  34638 HLT
  64067 INJ_VIRQ
  28374 INTR
  82733 INTR_WINDOW
     10 NPF
  24337 TRAP
 370610 vlapic_accept_pic_intr
 307528 VMENTRY
 307527 VMEXIT
 140998 VMMCALL
    127 wrap_buffer

After applying this patch the same test shows

    230 cpu_change
    260 CPUID
  36542 HLT
    174 INJ_VIRQ
  27250 INTR
    222 INTR_WINDOW
     20 NPF
  24999 TRAP
 381812 vlapic_accept_pic_intr
 166480 VMENTRY
 166479 VMEXIT
  77208 VMMCALL
     81 wrap_buffer

ApacheBench results (ab -n 10000 -c 200) improve by about 10%

Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
Signed-off-by: David Vrabel <david.vrabel@citrix.com>
arch/x86/include/asm/xen/cpuid.h [new file with mode: 0644]
arch/x86/pci/xen.c