Received: by 10.223.176.5 with SMTP id f5csp3213618wra; Mon, 29 Jan 2018 10:17:42 -0800 (PST) X-Google-Smtp-Source: AH8x2240fBGrlNBNr60DHtvGc0g2WbZHqPmNIaMfcdDkL5o0vyYVWFiwiZVduTpHFV7CfpNhnxtJ X-Received: by 10.107.132.158 with SMTP id o30mr12866769ioi.70.1517249862630; Mon, 29 Jan 2018 10:17:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517249862; cv=none; d=google.com; s=arc-20160816; b=Aoa7DROYbqZO/vavQV/k+E69gQZgWkQcf5YUyBGITjEBbWwlZ9IG9Pz+2ES701pBMF Ihw7a7kEOKzd6PdqCUZEWT0Az2wIMgIwVz5+dCsMMeG9fCf2OWNxqncW68koKHYo7vk4 l6f/4BAydYA4BIbJ+Wy0iWWmzoY92XKN3dnbVsSUMkolrLTpFp+L/ZHzzqKx86RmU61M SYnp/hLoB11n7rbvPIH/Jw86h0E/NW9dpFrynhVCJ3ib9eSEx407V1B9yLWYWO4TDK38 Q6bfBxBtPCs+eSV+szGqctdlNM3uXBIJyn7Bxhk/I/fpGSEvPALBIdeIzm4HCh3BX0kd rSAQ== 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=qw976hTHsH2jb4AZVe2rDA/dFkyTxz0kygRpK6dyQbY=; b=nX6KervxnNtLYmJb7C3xtcVl/2bWJwHEbngCNDNOUo4oN06xAHhGuR6S2zfAVjn9r9 7bdoUbnyJE5JYPifp/wsJLUaDfJh0pPxeMQBRsuh6XdoSzT8PwVRDCr7cstOXLHv8aZG 1WOKJieaOti9voxH0tEAt1dJ4LzQe2IN396uRQFLlB65aVmvRmhr2dmuMGm2VKZn4QhM /dfUsx2P5y9UD1diq07ZvB5nRUh6pO1P87KJzOmTQxgdreuiqbXbvIxODpOrDV9R6JCN rnPLsCfcteHOI+U6pOYBGLcqlcjd1QI4bkVfnca0YcAlr8WSpYEylBCvWs94A1i14fSl tLrA== 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 r142si4592802itr.18.2018.01.29.10.17.29; Mon, 29 Jan 2018 10:17:42 -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 S1751473AbeA2SRH (ORCPT + 99 others); Mon, 29 Jan 2018 13:17:07 -0500 Received: from terminus.zytor.com ([65.50.211.136]:42159 "EHLO mail.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751072AbeA2SRF (ORCPT ); Mon, 29 Jan 2018 13:17:05 -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 w0TICbCt031437 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO); Mon, 29 Jan 2018 10:12:37 -0800 Subject: Re: selftests/x86/fsgsbase_64 test problem To: Andy Lutomirski Cc: Borislav Petkov , Dan Rue , Shuah Khan , Ingo Molnar , Dmitry Safonov , "open list:KERNEL SELFTEST FRAMEWORK" , LKML References: <20180126153631.ha7yc33fj5uhitjo@xps> <46328204-e363-e517-f30c-c8c94ac1442c@zytor.com> From: "H. Peter Anvin" Message-ID: <624b9e67-14ee-6882-e55e-f337ec2471d3@zytor.com> Date: Mon, 29 Jan 2018 10:12:32 -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/29/18 08:37, Andy Lutomirski wrote: > > That's what I thought, too, and the SDM does say that, but the SDM > says all kinds of not-quite-correct things about segmentation. > >> It is pretty much scratch space (I have >> suggested using it for the gsbase once all those issues get sorted out, >> because it lets the paranoid code do something like: >> >> rdgsbase %rax >> push %rax /* Save old gsbase */ >> push %rax /* Reserve space on stack */ >> sgdt -2(%rsp) /* We don't care about the limit */ >> pop %rax /* %rax <- gdtbase */ >> mov (%rax),%rax /* GDT[0] holds the gsbase for this cpu */ >> wrgsbase %rax > > That will utterly suck on non-UMIP machines that have > hypervisor-provided UMIP emulation. > Is that a valid thing to optimize for, especially given that paranoid entries aren't the most common anyway? -hpa