Received: by 2002:a25:2c96:0:0:0:0:0 with SMTP id s144csp189235ybs; Tue, 26 May 2020 06:55:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzwJ0v7l2YUpdsPbKV00QxEqWNigR/k7jLYFB91e1/U1b9tcJsBHohXtz6eMpTlKQuUrF2r X-Received: by 2002:aa7:c6d1:: with SMTP id b17mr2325379eds.39.1590501322627; Tue, 26 May 2020 06:55:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590501322; cv=none; d=google.com; s=arc-20160816; b=qHL9UUK3qDV+EPCjibp/f/FzP2YZe0oCHs+4aJBOy0cF95aEMSZAd/BC/inWXbyOl1 WYt74o6WhJtvB+JegQ6SjvK0f8rJATCBVIM2n8nEMEFCE0fIo1SUMuHVUyJwurI0JeeF 9721lfh2eZLTIfKyhvnBZifwjIWbGbNCzjgCJzczmA9UNYum5mENWEiM7HmKfa09c9Rh 637AM2gUuyMdgv4cDMF48T6cn3uZ5xuTKAb/OHhdQ0C/de7DUa9qdY95HDBo7z8ZV+UT PtkUiuLAl3ecP6H0KIvFcHSX1CTM6rayYJMwNUyYQ6gNbcWO01NbEsx5y7HqIA7I5rQ5 NVoA== 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:ironport-sdr:ironport-sdr; bh=zG/iQW2xutahZZopBojYt+GXoRQbMT6De+rU3hAY2mA=; b=IEP1SO+uMn/ZJP2wxx/m1+8wkEW5k1P8uLgK8naumsa5KOZxGfSdmG391/1hwSijzf s4uWrUnVJWeNgok+p5wV8JdGpehWd8hE5M2cvUDLXLhaE2SK7HVuYuav3v7BSh3+ohZi W+mSX5tytTqh7r/ErPIe5w+cvlHA0ekkKhB4ibcmV0wzmS+5nslHdOW7Sx47DGjc2Wcn 7e56ogDzD0Jb/Kz7WnqMS/D2fJwfslVoBZ4L6KV1cV5Nc9olAFngP4Ej6dwKD6TKmGAa oWaYiPdrCWjw0ddN1Fx6iGsiexf/3WgPw+FewgmaiLw2/d6rR0bjgCFrZBQ30c8C9Ku4 ziOg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id e21si11593125ejh.710.2020.05.26.06.54.58; Tue, 26 May 2020 06:55:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S1728965AbgEZNdF (ORCPT + 99 others); Tue, 26 May 2020 09:33:05 -0400 Received: from mga03.intel.com ([134.134.136.65]:57902 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726437AbgEZNdF (ORCPT ); Tue, 26 May 2020 09:33:05 -0400 IronPort-SDR: 2n4cEgzIrKD/tRQdzkPQyXUsonBWUj0HbfBOpfXNFMzBZKGQAotUOP/Le4A7x8bZHTy7mnOEgY OBKwcDP3CNYA== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 May 2020 06:33:04 -0700 IronPort-SDR: zaMEbV0489KP+M6dd6VhdAyfyz8b7DBMVGuds/ebfJytRH1kWPI/zXLSawIKTODnr5y+SDuU6V 8iBtSShzgBow== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,437,1583222400"; d="scan'208";a="310256423" Received: from ranerica-svr.sc.intel.com ([172.25.110.23]) by FMSMGA003.fm.intel.com with ESMTP; 26 May 2020 06:33:04 -0700 Date: Tue, 26 May 2020 06:33:18 -0700 From: Ricardo Neri To: Andreas Rammhold Cc: Brendan Shanks , Thomas Gleixner , Ingo Molnar , Borislav Petkov , x86@kernel.org, "H. Peter Anvin" , "Eric W. Biederman" , Sergey Senozhatsky , Babu Moger , Kefeng Wang , Jason Yan , linux-kernel@vger.kernel.org Subject: Re: umip: AMD Ryzen 3900X, pagefault after emulate SLDT/SIDT instruction Message-ID: <20200526133318.GA3796@ranerica-svr.sc.intel.com> References: <20200519143815.cpsd2xfx2kl3khsq@wrt> <2330FAB4-A6CE-49E7-921C-B7D55763BDED@codeweavers.com> <20200519194320.GA25138@ranerica-svr.sc.intel.com> <20200523021739.bbq5m6ze63ctouh6@wrt> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200523021739.bbq5m6ze63ctouh6@wrt> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, May 23, 2020 at 04:17:39AM +0200, Andreas Rammhold wrote: > On 12:43 19.05.20, Ricardo Neri wrote: > > I have a patch for this already that I wrote for testing purposes: > > https://github.com/ricardon/tip/commit/1692889cb3f8accb523d44b682458e234b93be50 > > Perhaps it can be used as a starting point? Not sure what the spoofing > > value should be, though. Perhaps 0? > > I tried the above patch (in modified/rebased version; hope that didn't > kill it [0]). The results are negative, as without the patch. Ah. My patch above is based on a rather old kernel. There is a check in fixup_umip_exception() for SLDT and STR. I think this causes the exception you see. Perhaps you can try by removing such check: diff --git a/arch/x86/kernel/umip.c b/arch/x86/kernel/umip.c @@ -383,10 +389,6 @@ bool fixup_umip_exception(struct pt_regs *regs) umip_pr_warn(regs, "%s instruction cannot be used by applications.\n", umip_insns[umip_inst]); - /* Do not emulate (spoof) SLDT or STR. */ - if (umip_inst == UMIP_INST_STR || umip_inst == UMIP_INST_SLDT) - return false; - umip_pr_warn(regs, "For now, expensive software emulation returns the result.\n"); if (emulate_umip_insn(&insn, umip_inst, dummy_data, &dummy_data_size, You would still need my old patch. Thanks and BR, Ricardo