Received: by 10.223.176.46 with SMTP id f43csp1260169wra; Fri, 26 Jan 2018 14:56:37 -0800 (PST) X-Google-Smtp-Source: AH8x227LTSSP+j2nyy1bWq7/fHtgdFQzf3ufz3tsmjaiOdAxNZGo+GE9r6UeFItlNwDOz8w8bShV X-Received: by 10.98.18.10 with SMTP id a10mr20685372pfj.140.1517007397217; Fri, 26 Jan 2018 14:56:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517007397; cv=none; d=google.com; s=arc-20160816; b=WSmd7WRDPvDgIShc+UNNjnuptsfoGdj0r9MTrVOLJsMQ26HS6G1AKyRaUjbvTStvep G0jkdhGKjfhVfQjx39KS3TBTeEwi/4YcWq3QpMHAvqPPeCHT+/hdJuAVQwnYl+NH0p6h nRzu+jiegg1+0BISvf/CVBCwvI2WHJhYj9Ofoul+KisB2oqyC5sxoEmrfAOJ8vB+r5at pNkZcI7YQ9K1iSOoQsryWdXxPJgxBBtJczlanfZSezg4LoR0lCuKaxM/e1MBXjm/1aOC nPLEDxUCWGhPm6yzYSTON1wo7r31hSt1wFdE/rDNG/ZuWkE6eYL+bE058DrRxSO7CYiH +MdQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:arc-authentication-results; bh=qG1egt1nWx+/1N3Zb2cwMpESqy7dp0IFbmTMe8MM4P0=; b=VC84VPLb28O2PQJqHzMrKbSFmGZZIOcD80CDp1i8kz++AOOuaNE/gF+6DPb3ftZi2R Qv/JHRYGPD7RhHxWbJogZqn4iQIJxnOc4gRM0TQZ1qQlE2Mi4WJyncLyeQGhV26akbYY HiKyv89ntSFT2w/sBxsZBvS6//5lZ7nsxlvlzrZZqFr8VdKbmeOZpVvu1bLK+PRAYKIq LD0ZvRRx3OuOo2b4AKNXdItK84UrLbBzMe3qThsDBwlI3AWXW5rIXk7epCY+/jkMSsqw E27GzHiX1p2eJ66Cm4Nc/L3eEHzxR757++dHSnEokqIOphKrX/2LzThD4ridz/Hxn3aZ b9yA== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j7-v6si4349327plk.553.2018.01.26.14.56.22; Fri, 26 Jan 2018 14:56:37 -0800 (PST) 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752178AbeAZWz4 (ORCPT + 99 others); Fri, 26 Jan 2018 17:55:56 -0500 Received: from terminus.zytor.com ([65.50.211.136]:42321 "EHLO mail.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751409AbeAZWzz (ORCPT ); Fri, 26 Jan 2018 17:55:55 -0500 Received: from tazenda.hos.anvin.org (c-24-5-245-234.hsd1.ca.comcast.net [24.5.245.234] (may be forged)) (authenticated bits=0) by mail.zytor.com (8.15.2/8.15.2) with ESMTPSA id w0QMpP3g014251 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO); Fri, 26 Jan 2018 14:51:26 -0800 Subject: Re: selftests/x86/fsgsbase_64 test problem To: Andy Lutomirski Cc: Dan Rue , Shuah Khan , Ingo Molnar , Dmitry Safonov , Borislav Petkov , "open list:KERNEL SELFTEST FRAMEWORK" , LKML References: <20180126153631.ha7yc33fj5uhitjo@xps> From: "H. Peter Anvin" Message-ID: <9630de94-83ba-85ad-c5f3-a515f7aa7243@zytor.com> Date: Fri, 26 Jan 2018 14:51:19 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 01/26/18 11:46, Andy Lutomirski wrote: > > Under QEMU TCG, gs stays equal to 1. On native or KVM, on Skylake, it > changes to 0. > > On KVM or native, I do not observe do_debug getting called with %gs == > 1. On TCG, I do. I don't think that's precisely the problem that's > causing the test to fail, since the test doesn't use TF or ptrace, but > I wouldn't be shocked if it's related. > > hpa, any insight? > > (NB: if you want to play with this as I've described it, you may need > to make invalid_selector() in ptrace.c always return false. The > current implementation is too strict and causes problems.) > Looking at it. I want to grok this in the general context of fsgsbase as well, of course. -hpa