From patchwork Sat Jun 24 17:29:23 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Larry Finger X-Patchwork-Id: 780366 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [103.22.144.68]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3ww2S54pcWz9s0Z for ; Sun, 25 Jun 2017 03:31:49 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="t9k8V4V5"; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 3ww2S53gjvzDr1y for ; Sun, 25 Jun 2017 03:31:49 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="t9k8V4V5"; dkim-atps=neutral X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Received: from mail-ot0-x243.google.com (mail-ot0-x243.google.com [IPv6:2607:f8b0:4003:c0f::243]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 3ww2PM3DdCzDr1L for ; Sun, 25 Jun 2017 03:29:27 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="t9k8V4V5"; dkim-atps=neutral Received: by mail-ot0-x243.google.com with SMTP id p48so7848062otc.1 for ; Sat, 24 Jun 2017 10:29:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=2ZYzsCMIwiCwymPeLpdRhQ939DGOQJYbeeb9mVFKvpk=; b=t9k8V4V5QFh6hdbYBJYjvIAu/37zrW+3CyNTg7HcJm0gJuPayYDEKIwtqUgdNFg4Fp ML1auswaUV+Qa7leZsXiPxVObNE8DzdlHe25buLox5S4xq62h7Z7Nty1d1FG4ELu8UHb u+3w/MX5w4KQO3HsgxBEgELO59F7qUsATLjU8z7gGqHFEsTcHQ3RZAE4X8qcNA/z/MrQ K6GmfnKlGeYkf16+lQDMN/9I5zEphDxlfDH0I+JzYATm5qwtoGpvBQ0ZB45yhPSvgRU5 cKklp8juTLpCxAdAbKwEecyzwdV7nVxNo4WNcWfCv1SOm9oZyeDj+32rgWjlA8VJbfhQ 7k8A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:to:cc:references:from:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=2ZYzsCMIwiCwymPeLpdRhQ939DGOQJYbeeb9mVFKvpk=; b=mfMZr0FfsJuFm1Zvz2E5Vae1JSnSmIUKGRWqzCEDa5xQUgyFlAbX5EhS93l+LbJ+VG Ra6vJxAeVZU71NagUKyrMRHlVYUXMP6xBPeu65fB6lwZvQAXfLaxv43J+xxqYkMcr2JX llnwMCZU4lyQRT5cGGx0Fw7QxWhdsOF1wc8cncKAZAs+Tt3ujMO7rZEs9qZ9Ey7ilcuU xNktbW9LBKEHL/skIL/Oi20SgarMbAPrKJx4Oi4H0vC0RPTlQo09aRqU8m9gvolAGDsv RRiOVY81vy9RnI4FU/W8Q+jH5Afux96xmBXEXbpV7DoT/lfAXjAHZKBN0wREOmMTqAN8 NpJw== X-Gm-Message-State: AKS2vOwsOf9P6aRh55DMXEjUyXDUSjGaghIF9TGVCvOvSyenTAutmi5A /8MccUoH8DStSsAQ X-Received: by 10.157.45.109 with SMTP id v100mr6845792ota.159.1498325365047; Sat, 24 Jun 2017 10:29:25 -0700 (PDT) Received: from linux-4v1g.suse (cpe-24-31-249-175.kc.res.rr.com. [24.31.249.175]) by smtp.gmail.com with ESMTPSA id f200sm3777298oih.5.2017.06.24.10.29.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 24 Jun 2017 10:29:24 -0700 (PDT) Subject: Re: Regression in kernel 4.12-rc1 for Powerpc 32 - bisected to commit 3448890c32c3 To: Al Viro References: <69187aa4-611f-b08a-8d14-b8fa47b4c464@lwfinger.net> <1588557c-2706-0c0e-3387-4ae65d0b5790@lwfinger.net> <20170621212257.GN10672@ZenIV.linux.org.uk> <5f4b9fa4-262a-31b1-32ba-a2f6e789b3d6@lwfinger.net> <20170621213415.GO10672@ZenIV.linux.org.uk> <655d304e-e455-6e0c-56e1-f127653ea13c@lwfinger.net> <20170622141203.GP10672@ZenIV.linux.org.uk> <7bbd4c87-e8ff-5f83-8c4c-e205872083bf@lwfinger.net> <20170622192515.GQ10672@ZenIV.linux.org.uk> <2346c306-8e26-94cb-3c63-b866a7f4625d@lwfinger.net> <20170623202943.GS10672@ZenIV.linux.org.uk> From: Larry Finger Message-ID: <3e093314-5148-2e14-33a9-e5d67bd2e7cf@lwfinger.net> Date: Sat, 24 Jun 2017 12:29:23 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.0 MIME-Version: 1.0 In-Reply-To: <20170623202943.GS10672@ZenIV.linux.org.uk> Content-Language: en-US X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Thorsten Leemhuis , linuxppc-dev@lists.ozlabs.org, LKML Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" On 06/23/2017 03:29 PM, Al Viro wrote: > On Fri, Jun 23, 2017 at 01:49:16PM -0500, Larry Finger wrote: > >>> BTW, could you try to check what happens if you kill the >>> if (__builtin_constant_p(n) && (n <= 8)) >>> bits in raw_copy_{to,from}_user()? The usefulness of those (in __copy_from_user() >>> originally) had always been dubious and the things are simpler without them. >>> If _that_ turns out to cure breakage, I would be very surprised, though. >>> >> Sorry I was gone so long. Installing jessie on this box resulted in a crash >> on boot. Lubuntu 14.04 yielded a desktop with a functioning cursor, but >> nothing else. Finally, Ubuntu 12.04 resulted in a working system. I hate >> Unity, but I guess I'm stuck for now. > > Ho-hum... Jessie is 3.16, so whatever is crashing there, it's something > different... Ubuntu 12.04 is what, 3.2? > >> I know how easy it is to screw up a long bisection by booting the wrong >> kernel. To help that problem and to work around the yaconf/yboot nonsense on >> the MAC, my /etc/yaconf has always had generic kernel stanzas with only >> default, old, and original kernels mentioned. From there I use a local >> script to finish a kernel installation by moving the default links to the >> old ones and creating the new default links pointing to the current kernel. >> With those long-tested scripts, I'm sure that I am booting the one I want. >> >> With the new installation, kernel 4.12-rc6 failed, as did 3448890c with the >> backported 46f401c4 added. >> >> Replacing "if (__builtin_constant_p(n) && (n <= 8))" with "if (0)" had no effect. > > OK, that simplifies things a bit. Just to make sure we are on the same page: > > * f2ed8bebee69 + cherry-pick of 46f401c4 boots (Ubuntu 12.04 userland) > * 3448890c32c3 + cherry-pick of 46f401c4 fails (Ubuntu 12.04 userland), ditto > with removal of constant-size bits in raw_copy_..._user(). Failure appears > to be on udev getting EFAULT on some syscalls. > * straight Ubuntu 12.04 works > * jessie crashes on boot. I made a break through. If I turn off inline copy to/from users for 32-bit ppc with the following patch, then the system boots: raw_copy_in_user(void __user *to, const void __user *from, unsigned long n) It seems whatever problem I am seeing is in the inline version of _copy_to_user() and _copy_from_user() on the 32-bit ppc. The only other difference between the two versions is the placement of the __user macro, which looks to be wrong in the non-inlined version of _copy_to_user() in lib/usercopy.c, but that is the one that works. To me, this looks like a compiler error. On the PowerBook, 'gcc --version' reports "gcc (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3". I will prepare a proper patch that I will send to you privately. If you agree with it, it can be send through normal channels in time for the release of 4.12. Larry diff --git a/arch/powerpc/include/asm/uaccess.h b/arch/powerpc/include/asm/uaccess.h index 5c0d8a8cdae5..1e6a8723f497 100644 --- a/arch/powerpc/include/asm/uaccess.h +++ b/arch/powerpc/include/asm/uaccess.h @@ -267,12 +267,7 @@ do { \ extern unsigned long __copy_tofrom_user(void __user *to, const void __user *from, unsigned long size); -#ifndef __powerpc64__ - -#define INLINE_COPY_FROM_USER -#define INLINE_COPY_TO_USE - -#else /* __powerpc64__ */ +#ifdef __powerpc64__ static inline unsigned long