Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp3071565ybi; Tue, 2 Jul 2019 01:35:59 -0700 (PDT) X-Google-Smtp-Source: APXvYqzfKohVoaS45RfgBqagHQWgz7hF9OVJ1OvQBLhELKYiDTNBsgIyh1NJgO9/AhZVNb/4NIbD X-Received: by 2002:a17:902:f46:: with SMTP id 64mr25210615ply.235.1562056559377; Tue, 02 Jul 2019 01:35:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562056559; cv=none; d=google.com; s=arc-20160816; b=RA4WfLhgLikTV4qo0vF1J+D7see5DEJlkKIbQ6CC7Ae/jc51l1Wj/ZSqte1jr++jeJ +tHWlGzNC+rkmSU5RiSOHzaLevsDmS3DNUQAPxWxcUmH9KiR07yWjAD/XSaj3MEu4pUa PI0Qt2ER3Ncoti50Ni+rKkp0L5661Kzi/TVfBiCZBCqW2+bvt5KuVqB4I4elr4ka2Nra j6iQ/stfrU91Y2rE5xcqQW0GZFqzcqtEBe+zWoF9sAcIhxmA+Kih3CJ5JcaSB9kr2ZaS cUX/It9wjkjszMd5w5wg6f5mIzCBMJxB2U//D6bR+nj4Aep7moR9nv8foOyrG2x/sM9L wjVg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=HGFtC+if6HsV82CDQo+ksze+GTabjinS2JLCyjcvLLc=; b=IFloz9HnjPqzFeNwGqVpuapwyi4FlO7TDJmv27LTRJSEeFivhjhdzEa2Wenvti/A0l wYFio0lSfbRUFLynueWXookZrEIuoHdf/9r/21Oz6EEVOKTZJ6JuNzPIjPoE5W4zjUcZ YDBn/5/1gbiyXRz46TcTrc0uDJTw2UMIjK7JfOwESW0rh22M0DHmmy936YMJOZ16mSea dt6ieyzmk9S49qz92wEZqvMdKSi4PKLbY12ouBCMqi1WlM3RvJ3g7mdtpRSjGBLGsg/q 59Xx38kr7J1FXwpsuhS8pGuaL0n8704AVEDiXnipWjVCv8w4++RptzrXXBjz26hca5yv Yd3Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a24si11715202pgw.395.2019.07.02.01.35.43; Tue, 02 Jul 2019 01:35:59 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726193AbfGBIfR (ORCPT + 99 others); Tue, 2 Jul 2019 04:35:17 -0400 Received: from mga01.intel.com ([192.55.52.88]:56562 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725867AbfGBIfR (ORCPT ); Tue, 2 Jul 2019 04:35:17 -0400 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 02 Jul 2019 01:35:16 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.63,442,1557212400"; d="scan'208";a="163948244" Received: from xpf-desktop.sh.intel.com (HELO xpf-desktop) ([10.239.13.102]) by fmsmga008.fm.intel.com with ESMTP; 02 Jul 2019 01:35:14 -0700 Date: Tue, 2 Jul 2019 16:40:18 +0800 From: Pengfei Xu To: Li Wang Cc: Ricardo Neri , Paolo Bonzini , tglx@linutronix.de, kernellwp@gmail.com, ricardo.neri@intel.com, LTP List , linux-kernel , Ping Fang Subject: Re: [Kernel BUG?] SMSW operation get success on UMIP KVM guest Message-ID: <20190702084018.tnwefzqzar3xiaww@xpf-desktop> References: <5622c0ac-236f-4e3e-a132-c8d3bd8fadc4@redhat.com> <20190701160352.GA19921@ranerica-svr.sc.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20170609 (1.8.3) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Seems no issue now. Thanks all. On 2019-07-02 at 09:52:39 +0800, Li Wang wrote: > On Tue, Jul 2, 2019 at 12:04 AM Ricardo Neri < > ricardo.neri-calderon@linux.intel.com> wrote: > > > On Mon, Jul 01, 2019 at 08:57:28PM +0800, Li Wang wrote: > > > On Mon, Jul 1, 2019 at 8:02 PM Paolo Bonzini > > wrote: > > > > > > > On 01/07/19 09:50, 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. > > > > > > > > In addition to what Thomas said, perhaps you are using a host that does > > > > *not* have UMIP, and configuring KVM to emulate it(*). In that case, > > it > > > > is not possible to intercept SMSW, and therefore it will incorrectly > > > > succeed. > > > > > > > > > > Right, I checked the host system, and confirmed that CPU doesn't support > > > UMIP. > > > > > > > > > > > Paolo > > > > > > > > (*) before the x86 people jump at me, this won't happen unless you > > > > explicitly pass an option to QEMU, such as "-cpu host,+umip". :) The > > > > incorrect emulation of SMSW when CR4.UMIP=1 is why. > > > > > > > Good to know this, is there any document for that declaration? It seems > > > neither LTP issue nor kernel bug here. But anyway we'd better do > > something > > > to avoid the error in the test. > > > > The test case already checks for umip in /proc/cpuinfo, right? And in > > long mode it always expects a SIGSEGV signal. If you did not add -cpu > > host,+umip, > > how come umip was present in /proc/cpuinfo? > > > > Yes, right. > > 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. > > Thank you all for a reply to this. > > -- > Regards, > Li Wang