All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nadav Amit <namit@vmware.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: <kvm@vger.kernel.org>, Nadav Amit <namit@vmware.com>
Subject: [kvm-unit-tests PATCH 1/4] x86: svm: clear CR4.DE on DR intercept test
Date: Fri, 10 Jul 2020 11:33:17 -0700	[thread overview]
Message-ID: <20200710183320.27266-2-namit@vmware.com> (raw)
In-Reply-To: <20200710183320.27266-1-namit@vmware.com>

DR4/DR5 can only be written when CR4.DE is clear, and otherwise trigger
a #GP exception. The BIOS might not clear CR4.DE so update the tests not
to make this assumption.

Signed-off-by: Nadav Amit <namit@vmware.com>
---
 x86/svm_tests.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/x86/svm_tests.c b/x86/svm_tests.c
index d4d130f..9adee23 100644
--- a/x86/svm_tests.c
+++ b/x86/svm_tests.c
@@ -171,6 +171,7 @@ static void prepare_dr_intercept(struct svm_test *test)
     default_prepare(test);
     vmcb->control.intercept_dr_read = 0xff;
     vmcb->control.intercept_dr_write = 0xff;
+    vmcb->save.cr4 &= ~X86_CR4_DE;
 }
 
 static void test_dr_intercept(struct svm_test *test)
-- 
2.25.1


  reply	other threads:[~2020-07-10 18:35 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-10 18:33 [kvm-unit-tests PATCH 0/4] x86: svm: bare-metal fixes Nadav Amit
2020-07-10 18:33 ` Nadav Amit [this message]
2020-07-10 20:45   ` [kvm-unit-tests PATCH 1/4] x86: svm: clear CR4.DE on DR intercept test Paolo Bonzini
2020-07-10 21:21     ` Nadav Amit
2020-07-10 21:56       ` Paolo Bonzini
2020-07-10 18:33 ` [kvm-unit-tests PATCH 2/4] x86: svm: present bit is set on nested page-faults Nadav Amit
2020-07-10 18:33 ` [kvm-unit-tests PATCH 3/4] x86: remove blind writes from setup_mmu() Nadav Amit
2020-07-10 18:33 ` [kvm-unit-tests PATCH 4/4] x86: Allow to limit maximum RAM address Nadav Amit
2020-07-10 23:35   ` Nadav Amit
2020-07-10 20:47 ` [kvm-unit-tests PATCH 0/4] x86: svm: bare-metal fixes Paolo Bonzini

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=20200710183320.27266-2-namit@vmware.com \
    --to=namit@vmware.com \
    --cc=kvm@vger.kernel.org \
    --cc=pbonzini@redhat.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.