Received: by 10.223.176.5 with SMTP id f5csp3228269wra; Mon, 29 Jan 2018 10:27:57 -0800 (PST) X-Google-Smtp-Source: AH8x227NwMfkewaU5CG18TB9RlgUs5Mbf+j26EUGpsCU7TSecB6U/+MqHJJr8v3IgPgZdlrbSSyF X-Received: by 2002:a17:902:b43:: with SMTP id 61-v6mr22998052plq.127.1517250477736; Mon, 29 Jan 2018 10:27:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517250477; cv=none; d=google.com; s=arc-20160816; b=tQIjrjatOHv9BsxMbEYmhFWt31RoW8E6UEvF2aNuYUSiTY4j9s/HnnUQSiTd+piQhl WyZUjS7g9BDgrfrFnc4e4WCLuNe9kA15siutr7w6ZgCF8mFI1rc+zUckG1bpWjfgFgXs RI4wzFdM802c8lBU9lG/nKAStGZzYIHHoGQkybYjiBTCoyBnZlVS9uHRPxcPLiNuwfND uhHM2ANtRa3MsLIsKjjxFsxlh4VsRq6js9zu9xWhFk9doHlkf9X8VXw4NGYr3AtxgIlG x+v2yHRiALSTqwMyXRIKH7wlrxSWl4p81ontvpIwms8L5o0/bvegta90J3c7PozN+gtV Eniw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:references:message-id :content-transfer-encoding:cc:date:in-reply-to:from:subject :mime-version:dkim-signature:arc-authentication-results; bh=E2T52nehOPWV1gTF/bKjktDFexwoU/nKI6A5RRfsZGg=; b=BvhhdUjqy9YWEdm4ol+RHrV7OJm2hxQP4aP+xgm8ilrd5An5JEGN9YIEqNo+Zd2Flu r7e9DgCec/QabGxtZ55i1hTlWepyc4fnjrEM3isrlgOcsqeKovRchyic2SNWvA9+17/A R5GlbbiJHBZDpUigYrUWghkNZVCX7rpFHzlLCRmikSCYAY+3Xtkdw3We0V0tFmOvqtgz 7F3cmW1+fanwZyPTVE/spbjmeAxIOVHLEVjAMTOoKx9mAGbQB4OSsRYgRp5AH1wNe2qO 6pJSIjlP916aQHgMdffbWaJtndM0XvhVKCV+UeDz4dlX2/e9c5WTgsa7KF0VVu/qypEu CFnQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amacapital-net.20150623.gappssmtp.com header.s=20150623 header.b=Ka7HiQUK; 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 i72si410158pfe.310.2018.01.29.10.27.42; Mon, 29 Jan 2018 10:27:57 -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; dkim=pass header.i=@amacapital-net.20150623.gappssmtp.com header.s=20150623 header.b=Ka7HiQUK; 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 S1751573AbeA2S0v (ORCPT + 99 others); Mon, 29 Jan 2018 13:26:51 -0500 Received: from mail-pg0-f47.google.com ([74.125.83.47]:37658 "EHLO mail-pg0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751350AbeA2S0u (ORCPT ); Mon, 29 Jan 2018 13:26:50 -0500 Received: by mail-pg0-f47.google.com with SMTP id z17so5104296pgc.4 for ; Mon, 29 Jan 2018 10:26:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amacapital-net.20150623.gappssmtp.com; s=20150623; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=E2T52nehOPWV1gTF/bKjktDFexwoU/nKI6A5RRfsZGg=; b=Ka7HiQUKISq8f5Crse0bDRdBuEmGvb27y7Yv/OvenjBoL6SuUhe5Ifh1MywpgIktiY ZTh9FegSbd6oD7dm+uzXpqwrWpVp1gHUIFbSdUODotDTI0ihSjZN0RhYsaY7QFYJH5v4 Ta9Jm23Ywp4VO7LA79bM3jmK8ugkh7UcxZQ7YiabsnqYH37PamwEV86Ki65vuGe0bKz6 OVu8QpOXMsVYvtOQ+nO94YAzP8vMU5rFHJVnOL1lU/5K7At3iSMALbIihf0dBwsE/CsZ 48GWwHdTQv7OpNNEKBlngo/cu9+tWDtVZwNBKU/GRgJsgFLkeLbRRvTCXuCWPINkSbvf yo2Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=E2T52nehOPWV1gTF/bKjktDFexwoU/nKI6A5RRfsZGg=; b=LOts3tIsEtA3tu+UcN87FPvAlStn4JLnLI5sz1ezwn8eQSJHrhK6PT9lc8godx+NYf UBrA9QrchXqAPQlAu2U/a9tO8en/PgBXCjvF7jrPd3A4FpKld8b7IsB3maMVtjiCakpW jbf1RctTTC9kWpINaWrm6Unt9/X8E7NDr/DueiVQy2biX+dg1X5HVtSJxDTg3ihZq4LK XtslKs0cdNnAwUFL4orgswJZulrP5elMnk83dqwws2c5MV0xR3+jesmJwPNT+vkOttvf vDMys7RPLk3DVvgW5357Opy4k+tB3apGDEN+iW7p9w8c+IJoN9wCLc35LSLGqZ5v957O 3CCA== X-Gm-Message-State: AKwxytdoaUANhHaKi/r8KAGEUVtHlHt0YhqFLvJYF6yoZmpcBl2VfoMB 45wZlpwIwIEYphohe3xwWVC1NQ== X-Received: by 10.98.65.193 with SMTP id g62mr27561098pfd.60.1517250409180; Mon, 29 Jan 2018 10:26:49 -0800 (PST) Received: from ?IPv6:2600:1010:b012:ea6:dc7:7fe:8643:2c24? ([2600:1010:b012:ea6:dc7:7fe:8643:2c24]) by smtp.gmail.com with ESMTPSA id b6sm37907371pfc.139.2018.01.29.10.26.46 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 29 Jan 2018 10:26:48 -0800 (PST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (1.0) Subject: Re: selftests/x86/fsgsbase_64 test problem From: Andy Lutomirski X-Mailer: iPhone Mail (15C202) In-Reply-To: <624b9e67-14ee-6882-e55e-f337ec2471d3@zytor.com> Date: Mon, 29 Jan 2018 10:26:44 -0800 Cc: Andy Lutomirski , Borislav Petkov , Dan Rue , Shuah Khan , Ingo Molnar , Dmitry Safonov , "open list:KERNEL SELFTEST FRAMEWORK" , LKML Content-Transfer-Encoding: quoted-printable Message-Id: References: <20180126153631.ha7yc33fj5uhitjo@xps> <46328204-e363-e517-f30c-c8c94ac1442c@zytor.com> <624b9e67-14ee-6882-e55e-f337ec2471d3@zytor.com> To: "H. Peter Anvin" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > On Jan 29, 2018, at 10:12 AM, H. Peter Anvin wrote: >=20 >> On 01/29/18 08:37, Andy Lutomirski wrote: >>=20 >> 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. >>=20 >>> 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: >>>=20 >>> 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 >>=20 >> That will utterly suck on non-UMIP machines that have >> hypervisor-provided UMIP emulation. >>=20 >=20 > Is that a valid thing to optimize for, especially given that paranoid > entries aren't the most common anyway? >=20 A bunch of people seem to care about NMI performance for perf. And the curr= ent patch set works without this trick. FWIW, if we switch all entries to the entry text trampoline, we get direct p= ercpu access for free.=