Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp1032956imm; Fri, 22 Jun 2018 09:11:59 -0700 (PDT) X-Google-Smtp-Source: ADUXVKK6uavg/2S8SuRnv5Fo6WZ/Rhf8aedfqcGehN+nL/RVe/PfzdtUyYZRJF+eM/Nt7FOcxHYX X-Received: by 2002:a17:902:bb05:: with SMTP id l5-v6mr2341011pls.246.1529683919794; Fri, 22 Jun 2018 09:11:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529683919; cv=none; d=google.com; s=arc-20160816; b=eN5jETFhKCFcrTIEPVRBmelZTXvj0ePcaoWzVO5aPSiyoZI9J/+PNkaPG2IuVmvmRb Xr78ty8+LQYQCj6tUAPCdgB2sDVQd4oru4vp0SMIp1d4FcH21uz9+p3KLnBFpRHFJc7a amwBgKmlODq84t8DtnHR+BF0e5xAPTNOuprZmJovk3o2x214NC5Elatnl7wapHZ8nYB3 cAZZepQga7VFYy4ROuvPhGLhvOfVM3lCH9AgEuEyTU4mfQD4LiUyA38bVgkinGct/Pl1 guxNc+V9/rRSroQ4p/DQeNNhvO5Czk+nUQfIbWfRDSeCHGckTNKj461KK+XOXSnBQ8ry vMBQ== 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=Aknf5KSP5rADVcwENSz++BxmASuDrwPngcyq5/7MLCc=; b=h1hsHPGBBlQm1FWurXsQT/oYeqdTnpBdKcga1EHd7cQ4F3HkL9PYN0OplDrzeTeuD1 7fYuytILVHIL5mHypEsw4xBCfQ+FETb4HeAPoQ2SMkwSm53jB9whQFMKc/48GJ5WC/kU AUdF/xG5KmK8x2JNtoWVhNgULDlYjHpwMOm9rqTa8DLyG2ZnTwYsXHETlCc8IpIgftmR XU4NqzqTJ7+awRQBN/WyTDEJfAc0MYL1Vt2bgnt7BGvjXR+650a0w0jG4qh25FYcN4ys lR+DD2275DUcvA2QcGlM5oa/j/+azTKWiJUPpcLoaCb1a8iomYM0Th5DdNHXVYNm9iKn 0r2Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amacapital-net.20150623.gappssmtp.com header.s=20150623 header.b=P6a+NFQH; 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 125-v6si3661553pgg.298.2018.06.22.09.11.45; Fri, 22 Jun 2018 09:11:59 -0700 (PDT) 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=P6a+NFQH; 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 S934274AbeFVQJF (ORCPT + 99 others); Fri, 22 Jun 2018 12:09:05 -0400 Received: from mail-pl0-f68.google.com ([209.85.160.68]:38020 "EHLO mail-pl0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933961AbeFVQJC (ORCPT ); Fri, 22 Jun 2018 12:09:02 -0400 Received: by mail-pl0-f68.google.com with SMTP id d10-v6so3712984plo.5 for ; Fri, 22 Jun 2018 09:09:02 -0700 (PDT) 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=Aknf5KSP5rADVcwENSz++BxmASuDrwPngcyq5/7MLCc=; b=P6a+NFQHWSWEMsb/nWCmMQ+uomVmEKhpMBk0w77cJVHrYULtB5SjZ8O+rLcrvdlgZ6 3BK4ZgWLm2dW+qVhjPVz9WEYq6M0wBN/OoCr2C0O7Uo/X0q/dadX7U5pml/Q2zkftAhq 9qMNRlYy8RRiKsRfZ0Vj6tcccpnrCa9QaHxT/ZhYKdLFJCfJNd+PYzWVPVGy2TbJyEJU S4WsXtI4prGmOn2XIzrl0cjdZrAy4dwNTaznpjBeUojjlT1UgPZEVACza1lboiqGoxHI 2m8Nzbt8MjVYvI42wrRMZujdImHLGfZJhY9P/Omvb8+haSo0XWpatGko9C0AA5wANT/H grFQ== 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=Aknf5KSP5rADVcwENSz++BxmASuDrwPngcyq5/7MLCc=; b=AYD5vOheoEvGe59w3WA/XL/PoXQzsAQY913MmT7p7SdUg27Kw0gMhY6jii8xw/Lzj0 9Z3xgq4sbSH+EexZR68H+vRvRtG5sjmDzGsPhbHAjdYe53ctnIqK8i522h57llZiecoz izjAnXWcSR+UV2gGPvbmFw7hRq9cfW3fsqtmmaLpbDMn+tlbVraigRmlVlidOSsU0MP6 7s+/VNADqev0lzptD0BWHmXRFmG59+sqjX+xKeZdZNyuEASqbIJVDKmy+h3zy0NhUYLC YdMg8XnDgSbFuRlZI/UmviABcOKaiq6cmGod9HrW0JZvwqECN0LTZBsJsfTlIScRjX8b 7sfA== X-Gm-Message-State: APt69E2gYQdDdv3DHJ7ero/MvVQM1UVy74UexTFFbJfgGnP0qotDF5vb ju4/wrKPHZxqkGYyrNu+YNCqaw== X-Received: by 2002:a17:902:b48f:: with SMTP id y15-v6mr2320063plr.261.1529683741866; Fri, 22 Jun 2018 09:09:01 -0700 (PDT) Received: from ?IPv6:2600:1010:b065:2cd9:e530:8535:a508:f820? ([2600:1010:b065:2cd9:e530:8535:a508:f820]) by smtp.gmail.com with ESMTPSA id p16-v6sm14943709pfd.47.2018.06.22.09.09.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 22 Jun 2018 09:09:00 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (1.0) Subject: Re: [PATCH v4 1/7] x86/fsgsbase/64: Introduce FS/GS base helper functions From: Andy Lutomirski X-Mailer: iPhone Mail (15F79) In-Reply-To: Date: Fri, 22 Jun 2018 09:08:59 -0700 Cc: Andy Lutomirski , "Bae, Chang Seok" , "H. Peter Anvin" , Ingo Molnar , Andi Kleen , Dave Hansen , "Metzger, Markus T" , "Ravi V. Shankar" , LKML Content-Transfer-Encoding: quoted-printable Message-Id: <851713FF-90E1-434A-BC31-5DE437AB530E@amacapital.net> References: <1529536506-26237-1-git-send-email-chang.seok.bae@intel.com> <1529536506-26237-2-git-send-email-chang.seok.bae@intel.com> To: Thomas Gleixner Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > On Jun 22, 2018, at 8:39 AM, Thomas Gleixner wrote: >=20 >> On Fri, 22 Jun 2018, Andy Lutomirski wrote: >> On Fri, Jun 22, 2018 at 7:28 AM Thomas Gleixner wrot= e: >>>> +unsigned long read_task_fsbase(struct task_struct *task) >>>> +{ >>>> + unsigned long fsbase; >>>> + >>>> + if (task =3D=3D current) { >>>> + fsbase =3D read_fsbase(); >>>> + } else { >>>> + /* >>>> + * XXX: This will not behave as expected if called >>>> + * if fsindex !=3D 0. This preserves an existing bug >>>> + * that will be fixed. >>>=20 >>> I'm late to this party, but let me ask the obvious question: >>>=20 >>> Why is the existing bug not fixed as the first patch in the series? >>=20 >> IIRC that was how I did it in the old version of this code. I think >> it did it because it was less messy to fix the bug after cleaning up >> the code, but I could be remembering wrong. >=20 > Fair enough. Though the general rule is: Fix bugs first and then do > features, unless you really need the extra step to fix it proper. >=20 > Now in that case the real question is whether this is a bug or just a > slight incorrectness which has no practical impact. If it's the latter, > then introduce the new function which does the right thing first and make > the new fs/gs base functions use it without having a blurb about preservin= g > bugs. The idea was to have one patch that was intended to have no observable effec= t (pure refactor) and another to change behavior in an easily reviewable way= . I should probably not have used the word bug :) >=20 > Thanks, >=20 > tglx >=20 >=20 >=20