All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Valentine Sinitsyn <valentine.sinitsyn@gmail.com>,
	Jan Kiszka <jan.kiszka@siemens.com>,
	kvm@vger.kernel.org
Subject: Re: Nested paging in nested SVM setup
Date: Thu, 21 Aug 2014 13:24:57 +0200	[thread overview]
Message-ID: <53F5D709.3060207@redhat.com> (raw)
In-Reply-To: <53F5B250.3000206@gmail.com>

Il 21/08/2014 10:48, Valentine Sinitsyn ha scritto:
> 
> No kvm_apic: after NPTs are set up, no page faults caused by register
> read (error_code: d), to trap and emulate APIC access.

It seems to work for VMX (see the testcase I just sent).  For SVM, can you
check if this test works for you, so that we can work on a simple testcase?

The patch applies to git://git.kernel.org/pub/scm/virt/kvm/kvm-unit-tests.git
and you can run the test like this (64-bit host):

   ./configure
   make
   ./x86-run x86/svm.flat -cpu host

Paolo

diff --git a/x86/svm.c b/x86/svm.c
index a9b29b1..aff00da 100644
--- a/x86/svm.c
+++ b/x86/svm.c
@@ -797,6 +797,27 @@ static bool npt_pfwalk_check(struct test *test)
 	   && (test->vmcb->control.exit_info_2 == read_cr3());
 }
 
+static void npt_l1mmio_prepare(struct test *test)
+{
+    vmcb_ident(test->vmcb);
+}
+
+u32 nested_apic_version;
+
+static void npt_l1mmio_test(struct test *test)
+{
+    u64 *data = (void*)(0xfee00030UL);
+
+    nested_apic_version = *data;
+}
+
+static bool npt_l1mmio_check(struct test *test)
+{
+    u64 *data = (void*)(0xfee00030);
+
+    return (nested_apic_version == *data);
+}
+
 static void latency_prepare(struct test *test)
 {
     default_prepare(test);
@@ -962,6 +983,8 @@ static struct test tests[] = {
 	    default_finished, npt_rw_check },
     { "npt_pfwalk", npt_supported, npt_pfwalk_prepare, null_test,
 	    default_finished, npt_pfwalk_check },
+    { "npt_l1mmio", npt_supported, npt_l1mmio_prepare, npt_l1mmio_test,
+	    default_finished, npt_l1mmio_check },
     { "latency_run_exit", default_supported, latency_prepare, latency_test,
       latency_finished, latency_check },
     { "latency_svm_insn", default_supported, lat_svm_insn_prepare, null_test,


  parent reply	other threads:[~2014-08-21 11:25 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-18 11:36 Nested paging in nested SVM setup Valentine Sinitsyn
2014-06-18 12:47 ` Jan Kiszka
2014-06-18 16:59   ` Valentine Sinitsyn
2014-06-19  9:32     ` Paolo Bonzini
2014-06-19  5:03   ` Valentine Sinitsyn
2014-08-20  6:46   ` Valentine Sinitsyn
2014-08-20  6:55     ` Paolo Bonzini
2014-08-20  7:37       ` Valentine Sinitsyn
2014-08-20  8:11         ` Paolo Bonzini
2014-08-20  9:49           ` Valentine Sinitsyn
2014-08-21  6:28           ` Valentine Sinitsyn
2014-08-21  8:48             ` Valentine Sinitsyn
2014-08-21 11:04               ` Paolo Bonzini
2014-08-21 11:06                 ` Jan Kiszka
2014-08-21 11:12                   ` Valentine Sinitsyn
2014-08-21 11:16                 ` Valentine Sinitsyn
2014-08-21 11:24               ` Paolo Bonzini [this message]
2014-08-21 12:28                 ` Valentine Sinitsyn
2014-08-21 12:38                   ` Valentine Sinitsyn
2014-08-21 13:40                   ` Valentine Sinitsyn
2014-09-01 17:41                   ` Paolo Bonzini
2014-09-01 19:21                     ` Valentine Sinitsyn
2014-09-02  8:25                       ` Paolo Bonzini
2014-09-02  9:16                         ` Valentine Sinitsyn
2014-09-02 11:21                           ` Paolo Bonzini
2014-09-02 11:26                             ` Valentine Sinitsyn
2014-08-21 17:35                 ` Valentine Sinitsyn
2014-08-21 20:31                   ` Paolo Bonzini
2014-08-22  4:33                     ` Valentine Sinitsyn
2014-08-22  8:53                       ` Paolo Bonzini
2014-09-01 16:11                       ` Paolo Bonzini
2014-09-01 17:04     ` Paolo Bonzini
2014-09-02  6:09       ` Valentine Sinitsyn
2014-09-02  6:21         ` Valentine Sinitsyn
2014-09-02  9:45         ` Paolo Bonzini
2014-09-02  9:53           ` Valentine Sinitsyn
2014-09-02 11:48             ` Paolo Bonzini
2014-09-02 10:31           ` Valentine Sinitsyn

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=53F5D709.3060207@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=jan.kiszka@siemens.com \
    --cc=kvm@vger.kernel.org \
    --cc=valentine.sinitsyn@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.