Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp999406imm; Fri, 22 Jun 2018 08:41:50 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKf2AmFOJkEbWBYf6cG7cqTgN7/DCl3Pt5gAcDEaybRtvUou5uuzo2n7v6dMf+VwieIyb1m X-Received: by 2002:a63:d8:: with SMTP id 207-v6mr1836936pga.94.1529682109936; Fri, 22 Jun 2018 08:41:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529682109; cv=none; d=google.com; s=arc-20160816; b=l0ePldfCErT9xhTib8cWeb/vq7vZ+i7GPv3jvf0UrLjQPtHz9ndqjIgsaQUU4rTB/Y K/EozLnWtz7CoR1jw5wyyrRZ07uvrrdORaJUBqX1oeT9C4brrdTcRCR6sJzy2uWvtOWM qiRikpG+xr8fO/RNcwv9WfT5bTP7jeskvN9gmu9vra9Y6hEmmOuz6FZTrjoDgbdg3in3 6cU7XVXHDL2HLGolBxl7PYKBEgZzZ4WzHcHQkEYKmVfRlFwnW144wznR8vRQ0wzG6tPk EuvBN5RN8CYQnEgOUE5seqqDjzuOEoLlL6YRmNVcO5lO4NTjppEQPdUGkGCoVFk1GV+p iZxQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date :arc-authentication-results; bh=Xj5ArWLa56j/WBluV1/2yHXArPV7D/7hPyEv0h81tWY=; b=qwwKJvuDO11Hxo0lK0Lhoomgtisy6POQX46zdxpYJ1ckb6eJr5S5n79nSXcoVG7xsc 2zFJZv9fD7/B+Y+j1qqVN3/qEEDNQGRqoOBezDU25CuOQjBd3OWazJ6dbqfbdlXHBXOH O8bhIWXVj4VlEpOA1Qx1+/7SmEAC8njqcxXKkx9RWhj81KfltCTdJ/luXApYgZlZf0fZ LK8TYpgfzy2uNSS4PcTX3PZ9dt4FIKkT44SQH9ifZogv/uax1cq1Im22M5nABUv0NSdV PMFDS8gUqJ6mZ0Lg822Y1UW75QD6/pcaemzDemCFWTsl562d66yDseYmC0Jo1sXIXZZv ALcw== 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 a39-v6si8149647pla.510.2018.06.22.08.41.34; Fri, 22 Jun 2018 08:41:49 -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; 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 S934208AbeFVPkB (ORCPT + 99 others); Fri, 22 Jun 2018 11:40:01 -0400 Received: from Galois.linutronix.de ([146.0.238.70]:42049 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933674AbeFVPj7 (ORCPT ); Fri, 22 Jun 2018 11:39:59 -0400 Received: from hsi-kbw-5-158-153-52.hsi19.kabel-badenwuerttemberg.de ([5.158.153.52] helo=nanos.tec.linutronix.de) by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1fWOA1-0007oK-Ei; Fri, 22 Jun 2018 17:39:41 +0200 Date: Fri, 22 Jun 2018 17:39:41 +0200 (CEST) From: Thomas Gleixner To: Andy Lutomirski cc: "Bae, Chang Seok" , "H. Peter Anvin" , Ingo Molnar , Andi Kleen , Dave Hansen , "Metzger, Markus T" , "Ravi V. Shankar" , LKML Subject: Re: [PATCH v4 1/7] x86/fsgsbase/64: Introduce FS/GS base helper functions In-Reply-To: Message-ID: References: <1529536506-26237-1-git-send-email-chang.seok.bae@intel.com> <1529536506-26237-2-git-send-email-chang.seok.bae@intel.com> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 22 Jun 2018, Andy Lutomirski wrote: > On Fri, Jun 22, 2018 at 7:28 AM Thomas Gleixner wrote: > > > +unsigned long read_task_fsbase(struct task_struct *task) > > > +{ > > > + unsigned long fsbase; > > > + > > > + if (task == current) { > > > + fsbase = read_fsbase(); > > > + } else { > > > + /* > > > + * XXX: This will not behave as expected if called > > > + * if fsindex != 0. This preserves an existing bug > > > + * that will be fixed. > > > > I'm late to this party, but let me ask the obvious question: > > > > Why is the existing bug not fixed as the first patch in the series? > > 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. 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. 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 preserving bugs. Thanks, tglx