Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp151685ybk; Tue, 19 May 2020 18:13:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwx27Avp08LzNR0OOQhofl6KWVXmVdT4P8rjj7cjXtcG1xtUBnD/TUZZUJzWFxrzg4L9rmu X-Received: by 2002:a17:906:c950:: with SMTP id fw16mr1652759ejb.65.1589937181708; Tue, 19 May 2020 18:13:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589937181; cv=none; d=google.com; s=arc-20160816; b=kS9hTInmpFqvASFQlJqmAWsR8FGPAKoxl0GiQan3I4XYHVeiFwZ8zG1O7yLXASEW+D jz5fl7JzHaJoe0dLRi4rsgxWGXrnLVJHe1dkIuK73e/+MiAFszBgSMyA31FQB0agvtRd OAo7t0eGtXNCwi1evGvBAn63ggwMZdQV7ue2BirvOn2IFeunJUsMf08IVz+Wwek5crM4 iEU7koV/28Zys1N5zWSOnIIE/vPCf++V608TQhH6y38bxE8Tm3na/5PkAGqWBX9NUmVX Sh0eDhu3C7AAboxyqJxBAfDL2ARO7nw4+hWgYJMDyrS9/4RBVlrR6a1ILQw+8VcXJDm8 jTAQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:dkim-signature:date; bh=eD1JwKxV0IM6VPh2p6kr6Xs6kEAiC5RCKFBXJxQjb4A=; b=oFIFPmt9nMGuzCNer0JXJzDf8+K2cUj63qHcUinbknRIHc/4Eb/CL9dRnq4XiLbb/z 55XKGwgRq+D3FckBzYdL3N7iLNbJnB2CapjdXecJkWvRn15Pbuh1IyCxmMBIoDMzFPYz QNUeMVvkNf1e+axA78gwJOsOXwGy5jIzrtuvkCXjZlaWH2hmJkZSL4kclNSqLfE+vAFp ikIr9QTlIVUeix35i3LuYtJauOXMEd4olrh07R0GyCn7B7ZjxTTUqa8VBbx7FJBeAlOL iOo43/3Lxo50tlQ1leR7bT02PWGnjwqlNCI5F8tMBYZ+M4ASixMh19CX1aghqhIq3Ycu vsKQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@notmuch.email header.s=mail header.b=kACaUp8r; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id cd20si844698ejb.435.2020.05.19.18.12.39; Tue, 19 May 2020 18:13:01 -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; dkim=pass header.i=@notmuch.email header.s=mail header.b=kACaUp8r; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728361AbgETBI4 (ORCPT + 99 others); Tue, 19 May 2020 21:08:56 -0400 Received: from mx.h4ck.space ([159.69.146.50]:58828 "EHLO mx.h4ck.space" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726352AbgETBIz (ORCPT ); Tue, 19 May 2020 21:08:55 -0400 Date: Wed, 20 May 2020 03:08:53 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=notmuch.email; s=mail; t=1589936933; bh=eD1JwKxV0IM6VPh2p6kr6Xs6kEAiC5RCKFBXJxQjb4A=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=kACaUp8rFsWqT+WvaE/embZRx2TrgrMj05jZLSFPC2E6wqVW+NSUYDl6D5UsSdxl5 D9BYIyjLWIFczonYdLbGwxFAz6M4m0NJc3MBxwjqmy7WXxSzQDlQoP0hchZd/nGrHn fYbyQeUFkONBUHaHqwVLOMNs070TXS3WD5O02VV0= From: andi@notmuch.email To: Brendan Shanks Cc: Thomas Gleixner , Ingo Molnar , Borislav Petkov , x86@kernel.org, "H. Peter Anvin" , Ricardo Neri , "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: <20200520010853.635wep2ewq4zpn2y@wrt> References: <20200519143815.cpsd2xfx2kl3khsq@wrt> <2330FAB4-A6CE-49E7-921C-B7D55763BDED@codeweavers.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <2330FAB4-A6CE-49E7-921C-B7D55763BDED@codeweavers.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11:56 19.05.20, Brendan Shanks wrote: > The problem is that the kernel does not emulate/spoof the SLDT instruction, only SGDT, SIDT, and SMSW. > SLDT and STR weren't thought to be commonly used, so emulation/spoofing wasn’t added. > In the last few months I have seen reports of one or two (32-bit) Windows games that use SLDT though. > Can you share more information about the application you’re running? I'll try to create a very simple reproducer for this case in the next days. Unfortunately I don't have the source of the original application. I can mail you instructions about it directly, if required. > Maybe the best path is to add kernel emulation/spoofing for SLDT and > STR on 32 and 64-bit, just to cover all the cases. It should be a > pretty simple patch, I’ll start working on it. Check the other mail from Ricardo, you can probably safe that effort :-) > Alternately, I did work on a Wine patch to emulate the UMIP > instructions in user-space, but it adds a lot of code and I don’t > think there’s much appetite for it in upstream Wine (especially since > the kernel emulation is sufficient for almost all cases). > https://www.winehq.org/pipermail/wine-devel/2020-February/160027.html Yeah that seems like the less favorable effort. My best guess is that this might not be limited to Wine thus handling in the kernel might be best. > In the meantime, an easy way to disable UMIP without rebuilding the > kernel is to pass 'clearcpuid=514’ on the kernel command line. Nice, I'll use that next time :-)