<div dir="ltr"><div dir="ltr"><div class="gmail_default" style="font-size:small"><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Jul 2, 2019 at 12:04 AM Ricardo Neri <<a href="mailto:ricardo.neri-calderon@linux.intel.com">ricardo.neri-calderon@linux.intel.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Mon, Jul 01, 2019 at 08:57:28PM +0800, Li Wang wrote:<br>
> On Mon, Jul 1, 2019 at 8:02 PM Paolo Bonzini <<a href="mailto:pbonzini@redhat.com" target="_blank">pbonzini@redhat.com</a>> wrote:<br>
> <br>
> > On 01/07/19 09:50, Li Wang wrote:<br>
> > > Hello there,<br>
> > ><br>
> > > LTP/umip_basic_test get failed on KVM UMIP<br>
> > > system(kernel-v5.2-rc4.x86_64). The test is only trying to do<br>
> > >      asm volatile("smsw %0\n" : "=m" (val));<br>
> > > and expect to get SIGSEGV in this SMSW operation, but it exits with 0<br>
> > > unexpectedly.<br>
> ><br>
> > In addition to what Thomas said, perhaps you are using a host that does<br>
> > *not* have UMIP, and configuring KVM to emulate it(*).  In that case, it<br>
> > is not possible to intercept SMSW, and therefore it will incorrectly<br>
> > succeed.<br>
> ><br>
> <br>
> Right, I checked the host system, and confirmed that CPU doesn't support<br>
> UMIP.<br>
> <br>
> ><br>
> > Paolo<br>
> ><br>
> > (*) before the x86 people jump at me, this won't happen unless you<br>
> > explicitly pass an option to QEMU, such as "-cpu host,+umip". :)  The<br>
> > incorrect emulation of SMSW when CR4.UMIP=1 is why.<br>
> ><br>
> Good to know this, is there any document for that declaration? It seems<br>
> neither LTP issue nor kernel bug here. But anyway we'd better do something<br>
> to avoid the error in the test.<br>
<br>
The test case already checks for umip in /proc/cpuinfo, right? And in<br>
long mode it always expects a SIGSEGV signal. If you did not add -cpu host,+umip,<br>
how come umip was present in /proc/cpuinfo?<br></blockquote><div><br></div><div><div class="gmail_default" style="font-size:small">Yes, right. </div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">But the KVM guest is not customized in manual, I reserved that system for automation test and did not aware of the '-cpu host,+umip,' parameter until Paolo points it out. In the last email, I was hoping to find a way to recognize this situation for the LTP test intelligently.</div></div><div><br></div></div><div class="gmail_default" style="font-size:small">Thank you all for a reply to this.</div><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div>Regards,<br></div><div>Li Wang<br></div></div></div></div>