All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/8] Introduce AMD SVM AVIC
@ 2018-04-03 23:01 Janakarajan Natarajan
  2018-04-03 23:01 ` [PATCH 1/8] x86/SVM: Modify VMCB fields to add AVIC support Janakarajan Natarajan
                   ` (8 more replies)
  0 siblings, 9 replies; 35+ messages in thread
From: Janakarajan Natarajan @ 2018-04-03 23:01 UTC (permalink / raw)
  To: xen-devel
  Cc: Jun Nakajima, Kevin Tian, Stefano Stabellini, Wei Liu,
	Suravee Suthikulpanit, Janakarajan Natarajan, George Dunlap,
	Andrew Cooper, Ian Jackson, Tim Deegan, Julien Grall,
	Jan Beulich, Boris Ostrovsky

OVERVIEW
========
This patchset is the first of a two-part patch series to introduce
the AMD Advanced Virtual Interrupt Controller (AVIC) support.

The AVIC hardware virtualizes local APIC registers of each vCPU via
the virtual APIC (vAPIC) backing page. This allows the guest to access
certain APIC registers without the need for emulation of hardware
behaviour in the hypervisor. More information about AVIC can be found in

* AMD64 Architecture Programmers Manual Volume 2 - System Programming
  https://support.amd.com/TechDocs/24593.pdf

For SVM AVIC, we extend the existing SVM driver to:
* Check CPUID to detect AVIC support in the processor.
* Program new fields in VMCB to enable AVIC.
* Introduce new AVIC data structures and add code to manage them.
* Handle two new AVIC #VMEXITs.
* Add new interrupt injection code using vAPIC backing page
  instead of the existing V_IRQ, V_INTR_PRIO, V_INTR_VECTOR and
  V_IGN_TPR fields.

This patchset does not enable AVIC by default since it does not
yet support nested VMs. Until then, users can enable SVM AVIC by
specifying Xen parameter svm=avic.

Later, in Part 2, we will introduce the IOMMU AVIC support, which
provides speed-up for the PCI device passthrough use case by allowing
the IOMMU hardware to inject interrupts directly into the guest via
the vAPIC backing page.

OVERALL PERFORMANCE
===================
AVIC is available on AMD Family 15h models 6Xh (Carrizo) processors
and newer. An AMD Family 17h Epyc processor is used to collect the
performance data shown below.

Generally, SVM AVIC alone (w/o IOMMU AVIC) should provide overall
speed-up for HVM guest since it does not require #VMEXIT into the
hypervisor to emulate certain guest accesses to local APIC registers.

It should also improve performance when the hypervisor wants to
inject interrupts into a running vcpu. It can do this by setting the 
corresponding IRR bit in the vAPIC backing page and triggering the
AVIC_DOORBELL.

For sending IPI interrupts between running vcpus in a Linux guest,
Xen defaults to using event channels. However, in case of
non-paravirtualized guests, AVIC can also provide performance
improvements for sending IPIs.

BENCHMARK: HACKBENCH
====================
For measuring IPI performance used for scheduling workload, some
performance numbers are collected using hackbench.

    # hackbench -p -l 100000
    Running in process mode with 10 groups using 40 file descriptors
    each (== 400 tasks)
    Each sender will pass 100000 messages of 100 bytes
			  |	 3 vcpus (sec)        |
    --------------------------------------------------
    No AVIC w/  xen_nopv  |           517             |
    AVIC w/ xen_nopv      |           173             |
    No AVIC w/o xen_nopv  |           141             |
    AVIC w/o xen_nopv     |           135             |

Each benchmark test was averaged over 10 runs.

CURRENT UNTESTED USE_CASES
==========================
* Nested VM

Any feedback and comments are very much appreciated.

Suravee Suthikulpanit (8):
  x86/SVM: Modify VMCB fields to add AVIC support
  x86/HVM/SVM: Add AVIC initialization code
  x86/SVM: Add AVIC vmexit handlers
  x86/SVM: Add vcpu scheduling support for AVIC
  x86/SVM: Add interrupt management code via AVIC
  x86/HVM: Hook up miscellaneous AVIC functions
  x86/SVM: Introduce svm command line option
  x86/SVM: Add AMD AVIC key handler

 docs/misc/xen-command-line.markdown |  16 +
 xen/arch/x86/hvm/svm/Makefile       |   1 +
 xen/arch/x86/hvm/svm/avic.c         | 626 ++++++++++++++++++++++++++++++++++++
 xen/arch/x86/hvm/svm/intr.c         |   4 +
 xen/arch/x86/hvm/svm/svm.c          |  77 ++++-
 xen/arch/x86/hvm/svm/vmcb.c         |   3 +
 xen/arch/x86/hvm/vlapic.c           |  20 +-
 xen/arch/x86/hvm/vmx/vmx.c          |   8 +-
 xen/include/asm-x86/hvm/hvm.h       |   4 +-
 xen/include/asm-x86/hvm/svm/avic.h  |  43 +++
 xen/include/asm-x86/hvm/svm/svm.h   |   2 +
 xen/include/asm-x86/hvm/svm/vmcb.h  |  52 ++-
 xen/include/asm-x86/hvm/vlapic.h    |   4 +
 xen/include/asm-x86/msr-index.h     |   1 +
 14 files changed, 831 insertions(+), 30 deletions(-)
 create mode 100644 xen/arch/x86/hvm/svm/avic.c
 create mode 100644 xen/include/asm-x86/hvm/svm/avic.h

-- 
2.11.0


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

^ permalink raw reply	[flat|nested] 35+ messages in thread

end of thread, other threads:[~2018-04-30 23:06 UTC | newest]

Thread overview: 35+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-03 23:01 [PATCH 0/8] Introduce AMD SVM AVIC Janakarajan Natarajan
2018-04-03 23:01 ` [PATCH 1/8] x86/SVM: Modify VMCB fields to add AVIC support Janakarajan Natarajan
2018-04-03 23:01 ` [PATCH 2/8] x86/HVM/SVM: Add AVIC initialization code Janakarajan Natarajan
2018-04-13 17:35   ` Andrew Cooper
2018-04-19 15:46     ` Natarajan, Janakarajan
2018-04-16 15:55   ` Jan Beulich
2018-04-16 16:15     ` Roger Pau Monné
2018-04-26 15:32     ` Natarajan, Janakarajan
2018-04-26 15:39       ` Andrew Cooper
2018-04-23 19:33   ` Konrad Rzeszutek Wilk
2018-04-23 20:26     ` Natarajan, Janakarajan
2018-04-03 23:01 ` [PATCH 3/8] x86/SVM: Add AVIC vmexit handlers Janakarajan Natarajan
2018-04-13 17:48   ` Andrew Cooper
2018-04-30 21:23     ` Natarajan, Janakarajan
2018-04-30 23:06       ` Andrew Cooper
2018-04-17 12:58   ` Jan Beulich
2018-04-19 16:31     ` Natarajan, Janakarajan
2018-04-20 20:02     ` Natarajan, Janakarajan
2018-04-23  7:54       ` Jan Beulich
2018-04-03 23:01 ` [PATCH 4/8] x86/SVM: Add vcpu scheduling support for AVIC Janakarajan Natarajan
2018-04-13 17:57   ` Andrew Cooper
2018-04-19 15:54     ` Natarajan, Janakarajan
2018-04-19 18:18       ` Andrew Cooper
2018-04-19 23:04         ` Boris Ostrovsky
2018-04-20 10:09           ` Andrew Cooper
2018-04-20 10:12         ` Jan Beulich
2018-04-03 23:01 ` [PATCH 5/8] x86/SVM: Add interrupt management code via AVIC Janakarajan Natarajan
2018-04-17 13:06   ` Jan Beulich
2018-04-03 23:01 ` [PATCH 6/8] x86/HVM: Hook up miscellaneous AVIC functions Janakarajan Natarajan
2018-04-17 13:10   ` Jan Beulich
2018-04-03 23:01 ` [PATCH 7/8] x86/SVM: Introduce svm command line option Janakarajan Natarajan
2018-04-13 18:04   ` Andrew Cooper
2018-04-03 23:01 ` [PATCH 8/8] x86/SVM: Add AMD AVIC key handler Janakarajan Natarajan
2018-04-17 13:36   ` Jan Beulich
2018-04-13 17:04 ` [PATCH 0/8] Introduce AMD SVM AVIC Brian Woods

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.