All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH][RFC] SVM: Add Support for Nested Paging in AMD Fam16 CPUs
@ 2008-01-25 20:53 ` Joerg Roedel
  0 siblings, 0 replies; 70+ messages in thread
From: Joerg Roedel @ 2008-01-25 20:53 UTC (permalink / raw)
  To: Avi Kivity, kvm-devel, linux-kernel

Hi,                                                                                                                              

here is the first release of patches for KVM to support the Nested Paging (NPT)
feature of AMD QuadCore CPUs for comments and public testing. This feature
improves the guest performance significantly. I measured an improvement of
around 17% using kernbench in my first tests.

This patch series is basically tested with Linux guests (32 bit legacy
paging, 32 bit PAE paging and 64 bit Long Mode). Also tested with Windows Vista
32 bit and 64 bit. All these guests ran successfully with these patches. The
patch series only enables NPT for 64 bit Linux hosts at the moment.

Please give these patches a good and deep testing. I hope we have this patchset
ready for merging soon.

Joerg

Here is the diffstat:

 arch/x86/kvm/mmu.c         |   81 +++++++++++++++++++++++++++++++++++---
 arch/x86/kvm/mmu.h         |    6 +++
 arch/x86/kvm/svm.c         |   94 +++++++++++++++++++++++++++++++++++++++++--
 arch/x86/kvm/vmx.c         |    7 +++
 arch/x86/kvm/x86.c         |    1 +
 include/asm-x86/kvm_host.h |    4 ++
 6 files changed, 182 insertions(+), 11 deletions(-)





^ permalink raw reply	[flat|nested] 70+ messages in thread
* KVM: add support for SVM Nested Paging
@ 2008-02-07 12:47 Joerg Roedel
  2008-02-07 12:47   ` Joerg Roedel
  0 siblings, 1 reply; 70+ messages in thread
From: Joerg Roedel @ 2008-02-07 12:47 UTC (permalink / raw)
  To: Avi Kivity; +Cc: kvm-devel, linux-kernel

Hi,

here is the improved patchset which adds support for the Nested Paging
feature of the AMD Barcelona and Phenom processors to KVM. The patch set
was successfully install- and runtime-tested with various guest
operating systems (64 bit, 32 bit legacy and 32 bit PAE Linux,
Windows 64 bit and 32 bit versions too).

To the previous post of these patches they were extended with support
for KVM on 32 bit PAE hosts. Live migration is also implemented and
tested in various situations (migration between 32 bit and 64 bit host,
Non-NPT to/from NPT migration, NPT to NPT migration, all with various
kinds of guests, including Windows).  After all these tests I am pretty
sure that these patches don't introduce any regression to KVM and
therefore the NPT feature is enabled per default.

Some new performance numbers are also available. For this test I started
an Ubuntu 7.10 guest with 4 vcpus and 3G of RAM on a dual socket Opteron
box and ran kernbench -M in it with a 2.6.24 kernel as the source tree.
The test was done with traditional Shadow Paging and using Nested
Paging. The tests ran on the text console with GDM stopped. Here are the
results:

-----------------------------------------------------------------------
Average Half load -j 3 Run:
-----------------+-------------------------+---------------------------
                 | Nested Paging           | Shadow Paging
-----------------+-------------------------+---------------------------
                 | Time    (std deviation) | Time    (std deviation)
-----------------+-------------------------+---------------------------
Elapsed Time     |   147.574 (0.642168)    |   211.73  (0.802963)
User Time        |   382.036 (1.14742)     |   416.254 (1.91732)
System Time      |    48.29  (0.261151)    |   221.608 (0.706307)
Percent CPU      |   291     (0.707107)    |   300.8   (0.447214)
Context Switches | 33605.4   (148.788)     | 34901     (434.318)
Sleeps           | 47351     (98.2395)     | 47017.8   (378.582)
-----------------+-------------------------+---------------------------
Average Half load -j 16 Run:
-----------------+-------------------------+---------------------------
                 | Nested Paging           | Shadow Paging
-----------------+-------------------------+---------------------------
                 | Time    (std deviation) | Time    (std deviation)
-----------------+-------------------------+---------------------------
Elapsed Time     |   120.156 (0.337757)    |   179.162 (1.49999)
User Time        |   385.318 (3.57206)     |   421.624 (5.82785)
System Time      |    48.959 (0.811411)    |   230.8   (9.70806)
Percent CPU      |   327.6   (38.5982)     |   336.2   (37.3655)
Context Switches | 42435.5   (9312.09)     | 46190.7   (11909.6)
Sleeps           | 50297.5   (3111.73)     | 50688     (3882.49)
-----------------+-------------------------+---------------------------

In other words, Nested Paging gave 30% performance improvement in the
'make -j 3' run and a 33% improvement in the 'make -j 16' run for this
benchmark.

I think these patches are ready for merging into the KVM tree. Please
consider for inclusion.

Joerg Roedel





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

end of thread, other threads:[~2008-02-10 10:35 UTC | newest]

Thread overview: 70+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-01-25 20:53 [PATCH][RFC] SVM: Add Support for Nested Paging in AMD Fam16 CPUs Joerg Roedel
2008-01-25 20:53 ` Joerg Roedel
2008-01-25 20:53 ` [PATCH 1/8] SVM: move feature detection to hardware setup code Joerg Roedel
2008-01-25 20:53   ` Joerg Roedel
2008-01-25 20:53 ` [PATCH 2/8] SVM: add detection of Nested Paging feature Joerg Roedel
2008-01-25 20:53   ` Joerg Roedel
2008-01-25 20:53 ` [PATCH 3/8] SVM: add module parameter to disable Nested Paging Joerg Roedel
2008-01-25 21:35   ` [kvm-devel] " Anthony Liguori
2008-01-25 21:35     ` Anthony Liguori
2008-01-25 22:10     ` [kvm-devel] " Joerg Roedel
2008-01-25 22:10       ` Joerg Roedel
2008-01-26 18:38       ` [kvm-devel] " Avi Kivity
2008-01-26 18:38         ` Avi Kivity
2008-01-26  1:47   ` [kvm-devel] [PATCH 3/8] SVM: add module parameter to disable NestedPaging Nakajima, Jun
2008-01-26  1:47     ` Nakajima, Jun
2008-01-26  7:25     ` [kvm-devel] " Joerg Roedel
2008-01-26  7:25       ` Joerg Roedel
2008-01-26  9:49       ` [kvm-devel] " Alexey Eremenko
2008-01-26  9:49         ` Alexey Eremenko
2008-01-26 10:06         ` [kvm-devel] " Joerg Roedel
2008-01-26 10:06           ` Joerg Roedel
2008-01-26 16:36         ` [kvm-devel] " Anthony Liguori
2008-01-26 16:36           ` Anthony Liguori
2008-01-26 18:23       ` [kvm-devel] " Avi Kivity
2008-01-25 20:53 ` [PATCH 4/8] X86: export information about NPT to generic x86 code Joerg Roedel
2008-01-25 20:53   ` Joerg Roedel
2008-01-25 21:37   ` [kvm-devel] " Anthony Liguori
2008-01-25 21:37     ` Anthony Liguori
2008-01-25 21:40     ` [kvm-devel] " Anthony Liguori
2008-01-25 21:40       ` Anthony Liguori
2008-01-27  8:40   ` [kvm-devel] " Avi Kivity
2008-01-27  8:40     ` Avi Kivity
2008-01-25 20:53 ` [PATCH 5/8] MMU: make the __nonpaging_map function generic Joerg Roedel
2008-01-25 20:53   ` Joerg Roedel
2008-01-25 20:53 ` [PATCH 6/8] X86: export the load_pdptrs() function to modules Joerg Roedel
2008-01-25 20:53   ` Joerg Roedel
2008-01-25 20:53 ` [PATCH 7/8] MMU: add HAP support to the KVM MMU Joerg Roedel
2008-01-25 20:53   ` Joerg Roedel
2008-01-25 20:53 ` [PATCH 8/8] SVM: add support for Nested Paging Joerg Roedel
2008-01-25 20:53   ` Joerg Roedel
2008-01-27  8:52   ` [kvm-devel] " Avi Kivity
2008-01-27  8:52     ` Avi Kivity
2008-01-27  9:41     ` [kvm-devel] " Joerg Roedel
2008-01-27  9:41       ` Joerg Roedel
2008-01-27  9:51       ` [kvm-devel] " Avi Kivity
2008-01-27  9:51         ` Avi Kivity
2008-01-27 10:05         ` [kvm-devel] " Joerg Roedel
2008-01-27 10:05           ` Joerg Roedel
2008-01-27 10:24           ` [kvm-devel] " Avi Kivity
2008-01-27 10:24             ` Avi Kivity
2008-01-25 21:32 ` [kvm-devel] [PATCH][RFC] SVM: Add Support for Nested Paging in AMD Fam16 CPUs Anthony Liguori
2008-01-25 21:32   ` Anthony Liguori
2008-01-25 22:47   ` [kvm-devel] " Joerg Roedel
2008-01-25 22:47     ` Joerg Roedel
2008-01-26  1:57 ` [kvm-devel] " Nakajima, Jun
2008-01-26  1:57   ` Nakajima, Jun
2008-01-27  8:57 ` [kvm-devel] " Avi Kivity
2008-01-27  8:57   ` Avi Kivity
2008-01-27  9:51   ` [kvm-devel] " Joerg Roedel
2008-01-27  9:51     ` Joerg Roedel
2008-01-28  3:20   ` [kvm-devel] " Jeremy Fitzhardinge
2008-01-28  3:20     ` Jeremy Fitzhardinge
2008-01-28 11:08     ` [kvm-devel] " Avi Kivity
2008-01-28 11:08       ` Avi Kivity
2008-02-07 12:09   ` [kvm-devel] " Joerg Roedel
2008-02-07 12:09     ` Joerg Roedel
2008-02-10 10:35     ` [kvm-devel] " Avi Kivity
2008-02-10 10:35       ` Avi Kivity
2008-02-07 12:47 KVM: add support for SVM Nested Paging Joerg Roedel
2008-02-07 12:47 ` [PATCH 1/8] SVM: move feature detection to hardware setup code Joerg Roedel
2008-02-07 12:47   ` Joerg Roedel

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.