kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Feng Wu <feng.wu@intel.com>,
	gleb@redhat.com, hpa@zytor.com, kvm@vger.kernel.org
Subject: Re: [PATCH v4 0/4] KVM: enable Intel SMAP for KVM
Date: Thu, 03 Apr 2014 18:46:06 +0200	[thread overview]
Message-ID: <533D904E.30801@redhat.com> (raw)
In-Reply-To: <1396345596-25682-1-git-send-email-feng.wu@intel.com>

Il 01/04/2014 11:46, Feng Wu ha scritto:
> Feng Wu (4):
>   KVM: Remove SMAP bit from CR4_RESERVED_BITS.
>   KVM: Add SMAP support when setting CR4
>   KVM: Disable SMAP for guests in EPT realmode and EPT unpaging mode
>   KVM: expose SMAP feature to guest
>

Hi,

I prepared some testcases.  You can find them in branch "smap" of 
git://git.kernel.org/pub/scm/virt/kvm/kvm-unit-tests.git

To compile them for 32-bits:
	git clean -xdf
	./configure --arch=i386
	make
	./x86-run x86/smap.flat -cpu host

For 64-bits:
	git clean -xdf
	./configure
	make
	./x86-run x86/smap.flat -cpu host

I tried them with QEMU and they all pass.  The output should be 
something like this:

	enabling apic
	paging enabled
	cr0 = 80010011
	cr3 = 7fff000
	cr4 = 10
	testing without INVLPG
	PASS: write to supervisor page
	PASS: read from user page with AC=1
	PASS: read from user page with AC=0
	PASS: write to user page with AC=1
	PASS: read from user page with AC=0
	PASS: write to user stack with AC=1
	PASS: write to user stack with AC=0
	PASS: executing on user page with AC=0
	testing with INVLPG
	PASS: write to supervisor page
	PASS: read from user page with AC=1
	PASS: read from user page with AC=0
	PASS: write to user page with AC=1
	PASS: read from user page with AC=0
	PASS: write to user stack with AC=1
	PASS: write to user stack with AC=0
	PASS: executing on user page with AC=0
	
	SUMMARY: 16 tests, 0 failures

Please test them (both 32- and 64-bits) with both ept=1 and ept=0.  If 
the tests pass, the series is okay.

The only part that is not covered is the implicit kernel accesses at 
CPL=3, which QEMU doesn't implement that (I fixed it, but didn't have 
time to think about tests).  Since I'm going on vacation next week, I 
wanted to throw this out today.  I'll post the test patches when I'm back.

Paolo

  parent reply	other threads:[~2014-04-03 16:46 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-01  9:46 [PATCH v4 0/4] KVM: enable Intel SMAP for KVM Feng Wu
2014-04-01  9:46 ` [PATCH v4 1/4] KVM: Remove SMAP bit from CR4_RESERVED_BITS Feng Wu
2014-04-01  9:46 ` [PATCH v4 2/4] KVM: Add SMAP support when setting CR4 Feng Wu
2014-04-10 20:12   ` Marcelo Tosatti
2014-04-12  0:14     ` Paolo Bonzini
2014-04-01  9:46 ` [PATCH v4 3/4] KVM: Disable SMAP for guests in EPT realmode and EPT unpaging mode Feng Wu
2014-04-01  9:46 ` [PATCH v4 4/4] KVM: expose SMAP feature to guest Feng Wu
2014-04-03 16:46 ` Paolo Bonzini [this message]
2014-04-04  2:22   ` [PATCH v4 0/4] KVM: enable Intel SMAP for KVM Wu, Feng
2014-04-04  7:27     ` Paolo Bonzini
2014-04-08  1:06       ` Wu, Feng
2014-04-08 20:38         ` Paolo Bonzini
2014-04-10 20:01           ` Marcelo Tosatti
2014-04-12  0:16             ` Paolo Bonzini
2014-04-12  0:17               ` Paolo Bonzini
2014-04-13 21:57               ` Marcelo Tosatti
2014-04-13 22:48                 ` H. Peter Anvin
2014-04-10 20:16 ` Marcelo Tosatti

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=533D904E.30801@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=feng.wu@intel.com \
    --cc=gleb@redhat.com \
    --cc=hpa@zytor.com \
    --cc=kvm@vger.kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).