mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Thomas Gleixner <tglx@linutronix.de>
To: Li Wang <liwang@redhat.com>
Cc: ricardo.neri-calderon@linux.intel.com, pbonzini@redhat.com,
	kernellwp@gmail.com, ricardo.neri@intel.com,
	pengfei.xu@intel.com, LTP List <ltp@lists.linux.it>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	Ping Fang <pifang@redhat.com>
Subject: Re: [Kernel BUG?] SMSW operation get success on UMIP KVM guest
Date: Mon, 1 Jul 2019 10:03:28 +0200 (CEST)	[thread overview]
Message-ID: <alpine.DEB.2.21.1907010959390.1802@nanos.tec.linutronix.de> (raw)
In-Reply-To: <CAEemH2cg01cdz=amrCWU00Xof9+cxmfR_DqCBaQe36QoGsakmA@mail.gmail.com>

On Mon, 1 Jul 2019, Li Wang wrote:

> Hello there,
> 
> LTP/umip_basic_test get failed on KVM UMIP system(kernel-v5.2-rc4.x86_64).
> The test is only trying to do
>      asm volatile("smsw %0\n" : "=m" (val));
> and expect to get SIGSEGV in this SMSW operation, but it exits with 0
> unexpectedly.
> 
> ====================
> # grep CONFIG_X86_INTEL_UMIP /boot/config-5.2.0-0.rc4.x86_64
> CONFIG_X86_INTEL_UMIP=y
> 
> # lscpu |grep umip
> Flags:               fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge
> mca cmov pat pse36 clflush mmx fxsr sse sse2 ss syscall nx pdpe1gb rdtscp
> lm constant_tsc rep_good nopl xtopology cpuid tsc_known_freq pni pclmulqdq
> ssse3 fma cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer
> aes xsave avx f16c rdrand hypervisor lahf_lm abm 3dnowprefetch cpuid_fault
> invpcid_single pti ssbd ibrs ibpb stibp fsgsbase tsc_adjust bmi1 hle avx2
> smep bmi2 erms invpcid rtm mpx avx512f avx512dq rdseed adx smap clflushopt
> clwb avx512cd avx512bw avx512vl xsaveopt xsavec xgetbv1 xsaves arat umip
> pku ospke md_clear
> 
> # ./umip_basic_test
> ...
> umip_basic_test.c:68: INFO: TEST smsw, smsw result save at [0x7ffda00dca70]
> umip_basic_test.c:118: FAIL: Didn't receive SIGSEGV, child exited with
> exited with 0

SMSW is emulated and returns a constant value:

#define CR0_STATE       (X86_CR0_PE | X86_CR0_MP | X86_CR0_ET | \
                         X86_CR0_NE | X86_CR0_WP | X86_CR0_AM | \
                         X86_CR0_PG)

IIRC that is done to not break stuff like Wine. Ricardo should know the
details.

Thanks,

	tglx


       reply	other threads:[~2019-07-01  8:03 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CAEemH2cg01cdz=amrCWU00Xof9+cxmfR_DqCBaQe36QoGsakmA@mail.gmail.com>
2019-07-01  8:03 ` Thomas Gleixner [this message]
2019-07-01 12:02 ` Paolo Bonzini
2019-07-01 14:53   ` Ricardo Neri
2019-07-01 17:30     ` Paolo Bonzini
     [not found]   ` <CAEemH2fqMpoiBo+asyawHsOWgdXy-ggV0mwQs9A9EJ1kh=uhAA@mail.gmail.com>
2019-07-01 16:03     ` Ricardo Neri
     [not found]       ` <CAEemH2fR98TBHaOM37aGmzbgdZ_XPokJeUNN6dU1r=1WhOSmEw@mail.gmail.com>
2019-07-02  8:40         ` Pengfei Xu

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=alpine.DEB.2.21.1907010959390.1802@nanos.tec.linutronix.de \
    --to=tglx@linutronix.de \
    --cc=kernellwp@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=liwang@redhat.com \
    --cc=ltp@lists.linux.it \
    --cc=pbonzini@redhat.com \
    --cc=pengfei.xu@intel.com \
    --cc=pifang@redhat.com \
    --cc=ricardo.neri-calderon@linux.intel.com \
    --cc=ricardo.neri@intel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®