From patchwork Thu Feb 13 14:28:00 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Larry Finger X-Patchwork-Id: 1237724 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 48JT2S0mlSz9sP7 for ; Fri, 14 Feb 2020 07:41:52 +1100 (AEDT) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=lwfinger.net Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=riU4//CY; 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 48JT2R69MPzDqdk for ; Fri, 14 Feb 2020 07:41:51 +1100 (AEDT) X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Received: from ozlabs.org (bilbo.ozlabs.org [IPv6:2401:3900:2:1::2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 48JJlS5zwqzDqTD for ; Fri, 14 Feb 2020 01:28:20 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=lwfinger.net Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=riU4//CY; dkim-atps=neutral Received: from ozlabs.org (bilbo.ozlabs.org [IPv6:2401:3900:2:1::2]) by bilbo.ozlabs.org (Postfix) with ESMTP id 48JJlQ722zz8t2l for ; Fri, 14 Feb 2020 01:28:18 +1100 (AEDT) Received: by ozlabs.org (Postfix) id 48JJlP71V8z9sNg; Fri, 14 Feb 2020 01:28:17 +1100 (AEDT) Delivered-To: linuxppc-dev@ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gmail.com (client-ip=2607:f8b0:4864:20::341; helo=mail-ot1-x341.google.com; envelope-from=larry.finger@gmail.com; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=lwfinger.net Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=riU4//CY; dkim-atps=neutral Received: from mail-ot1-x341.google.com (mail-ot1-x341.google.com [IPv6:2607:f8b0:4864:20::341]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 48JJlJ4Nzxz9s3x for ; Fri, 14 Feb 2020 01:28:12 +1100 (AEDT) Received: by mail-ot1-x341.google.com with SMTP id b18so5752628otp.0 for ; Thu, 13 Feb 2020 06:28:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:subject:to:cc:references:message-id:date:user-agent :mime-version:in-reply-to:content-language; bh=iyhwqqvui+o1cnNqtGpbpVkpHXIfpEHL/iUT4RydlqM=; b=riU4//CYJeOd/3JB5b50Ftxz9N5B0ZSCiAajUldm4ATmevQx56a983PoNUompqzHLz qyW+09l8v9aDQ3+IZ2u9qfLmB09GZIDm4pJv8M11gNP3bNLP41zYNWrFJBBX5ycAbcej cY+uaOYGKujFyYERob0wc38Dz6Ss3Oikyebogg37e58c2ccsUk5r5aqSD2rO4FNpOqAN xz9tAmavYQx1tFmwl/oCp+br4aJOfbGY+aLJM5rZRrr0R6YjJcMq+gyi8fWtdkx6vjne l/Xs0lW68MoEAehewB58jXpLZRWAw3vHhp2u87tIfDftopwaHTZTZ2gCeAW7HhymyPaX GoyQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:subject:to:cc:references:message-id :date:user-agent:mime-version:in-reply-to:content-language; bh=iyhwqqvui+o1cnNqtGpbpVkpHXIfpEHL/iUT4RydlqM=; b=n0TTWMT+PpXXDpm2mSq2woKk4N7FY7G269ZrJc9qvgTXW4HIvnqx0wLxlvEqLCKbad KJKHw9PFMSbgu2i76Ix4lavZvr6YWCupkVc4rMF69JqxA7EnCqgT3+wgwHezAoG5/87E 4+9gz0ubxIIr3GtlJjcrh27amI0/tQXVtgVBnIOYpRROweo++HlID8tw10V6blGX1an4 fHA6JtSUhhzayTIY/1Sh7Qp6c4ZeFnHaIO08dLTBKEFdokBjLzTAuEfugCvBET85rUuU 3wPZc33QDXpRBnH3jnF/LnzLVWerlgZMfwKkY+Xl/wm+oXF8jpnMYJEb8cI6yc6Gb9sP E7lg== X-Gm-Message-State: APjAAAVBPGrZVVcUQopulGRMz9sU1X+MMLrdbEnECWQQJlfq5qP9ze6i 4z2mb3cXvIxVIeDg5kmrm5D/di0e X-Google-Smtp-Source: APXvYqwIKU1uG8ojHTh1jJ8o44rH+OiSZzYthfur3WMgiGrfCtwmvVdNW5fZt1HQ0fG04exluLLdNg== X-Received: by 2002:a9d:bb8:: with SMTP id 53mr12430006oth.150.1581604088279; Thu, 13 Feb 2020 06:28:08 -0800 (PST) Received: from [192.168.1.120] (cpe-24-31-245-230.kc.res.rr.com. [24.31.245.230]) by smtp.gmail.com with ESMTPSA id n22sm922948otj.36.2020.02.13.06.28.00 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 13 Feb 2020 06:28:07 -0800 (PST) From: Larry Finger Subject: RESEND: Re: Problem booting a PowerBook G4 Aluminum after commit cd08f109 with CONFIG_VMAP_STACK=y To: Christophe Leroy References: <159ed5d8-376b-1642-fb4b-01406d671cf1@c-s.fr> <6a1802b8-c6a7-d091-1036-689e089b786f@lwfinger.net> <608a1a18-a0ed-2059-bfbc-081c9ef1bfd8@lwfinger.net> Message-ID: <7f63e8a8-95c5-eeca-dc79-3c13f4d98d39@lwfinger.net> Date: Thu, 13 Feb 2020 08:28:00 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.4.2 MIME-Version: 1.0 In-Reply-To: Content-Language: en-US X-Mailman-Approved-At: Fri, 14 Feb 2020 07:39:29 +1100 X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "linuxppc-dev@ozlabs.org" Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" On 2/11/20 1:23 PM, Christophe Leroy wrote: > Can you send me a picture of that BUG Unable to handle kernel data access with > all the registers values etc..., together with the matching vmlinux ? > > First thing is to identify where we are when that happens. That mean see what is > at 0xc0013674. Can be done with 'ppc-linux-objdump -d vmlinux' (Or whatever your > PPC objdump is named) and get the function code. > > Then we need to understand how we reach that function and why it tries to access > a physical address. > > > Another thing I'm thinking about, not necessarily related to that problem: Some > buggy drivers do DMA from stack. This doesn't work anymore with > CONFIG_VMAP_STACK. Most of them can be detected with CONFIG_DEBUG_VIRTUAL so you > should activate it. Christophe, The previous send of this message failed because the attached vmlinux was too large. I have gone about as far as I can in debugging the problem. Setting CONFIG_DEBUG_VIRTUAL made no difference. Attached are the final screenshot, and the patches that I have applied. You already have the gzipped vmlinux. My kernel is built with commit cd08f1089 with patches applied as in the attached file. These include the change to arch/powerpc/kernel/entry_32.S, line 217. The next patch was to arch/powerpc/mm/mem.c where I added a call to btext_clearscreen() to stop the bootconsole from overwriting lines. If does not scroll, but jumps from the bottom to the top. The other change I made to the program was in kernel/printk/printk.c where I returned early from unregister_console() to keep logging going. As you noted, the console goes silent when the bootconsole is disabled. The rest of the changes were made to follow the flow of the program to see where if failed. The following change showed where the problem happens: index 8bf5f2f..c69d91d9 100644 The logged output shows that the problem happens in schedule(). At that point, we are back in assembler and out of my realm. Thanks for your help, and I will supply any additional info and testing that you need. Larry X-Account-Key: account11 X-UIDL: GmailId16b2c9a50ea3b90f X-Mozilla-Status: 0013 X-Mozilla-Status2: 00000000 X-Mozilla-Keys: Delivered-To: larry.finger@gmail.com Received: by 2002:a4a:b2cb:0:0:0:0:0 with SMTP id l11csp8290747ooo; Thu, 6 Jun 2019 04:43:59 -0700 (PDT) X-Google-Smtp-Source: APXvYqwCuWkmxNEorwoFA8dV9n0gnv2GBWEgptpWhjUpg7zmkwpEpAZ0OoddjKTZH+rGzLk5PqDb X-Received: by 2002:a0d:f7c1:: with SMTP id h184mr23332511ywf.461.1559821439502; Thu, 06 Jun 2019 04:43:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559821439; cv=none; d=google.com; s=arc-20160816; b=cwyAMW7kgYORTfk9s11BVuRyOK1aZ/y91JWwr6KOKPjipJrjl4Z4hU3kdcWdy4XKFx gYTTnCmpLQjMriyYBUCnK6H+TIupoTDV4xc2Zbd0o3MYzlJDnRLoxhQ0tGLa9faooOCk HVI7sohOmcS2usEzXxiIFXmHZeya5uHoc8dqbhVGERSvmUYr7eJay3A3XxiVCfsgUo2x Wdp3LeIQ8WTPcLfY7YXjggvhCrALhNjfjR+cuKRupwAc5ExKfZ6KTUikPOVqAZeDyEk6 FsO52PBlpxzCc+eWSTyrnhUxm1yaluTml84QKHyu4mihylKmeQH4KtH+12GJ2+ZfhDHc Zyww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=user-agent:in-reply-to:content-disposition:mime-version:references :message-id:subject:cc:to:from:date:delivered-to; bh=kt7o1+XVy+lXH5WOMXil8IA2OM6q4I/uYbcFkZqbRc8=; b=yphupkT6Zz+pYJvawZCl4bXGIugoNj5iCMqRlPqyqbEf4RN+3aY22jD5xpiDlw0jjS 4h5S9kSgQJn14JjtpTfGee/fKwo5JiazPvYu68XodDh2maHWANND00ToKt9H10yeHUUm 09L9jV51XLMRIGvJyTsw+qYDq52Rms2nuS93spZQ+gFrEmpaVPcnua1Mk7kgT+J5hgGa X5Ps+iqFFYXg7SeMwWvx0juniqkBIEUvbVyyb3SKd8FW24HyYx7b/q31/0euFLwj6W8A 8UlSDrDJ4008OUhrjFeibePvH2exlHbj/RPDpDYY4XNIsqQmb+BZulXC09QlzV0aKdLC D/AQ== ARC-Authentication-Results: i=1; mx.google.com; spf=neutral (google.com: 209.17.115.53 is neither permitted nor denied by best guess record for domain of hch@lst.de) smtp.mailfrom=hch@lst.de Return-Path: Received: from atl4mhob15.registeredsite.com (atl4mhob15.registeredsite.com. [209.17.115.53]) by mx.google.com with ESMTP id u187si831499ybb.479.2019.06.06.04.43.59 for ; Thu, 06 Jun 2019 04:43:59 -0700 (PDT) Received-SPF: neutral (google.com: 209.17.115.53 is neither permitted nor denied by best guess record for domain of hch@lst.de) client-ip=209.17.115.53; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.17.115.53 is neither permitted nor denied by best guess record for domain of hch@lst.de) smtp.mailfrom=hch@lst.de Received: from mail.hostingplatform.com (atl4qibmail17pod0.registeredsite.com [10.30.71.59]) by atl4mhob15.registeredsite.com (8.14.4/8.14.4) with ESMTP id x56Bhxx8019893 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Thu, 6 Jun 2019 07:43:59 -0400 Received: (qmail 10870 invoked by uid 78); 6 Jun 2019 11:43:58 -0000 Delivered-To: lwfinger.net-Larry.Finger@lwfinger.net Received: (qmail 10858 invoked by uid 0); 6 Jun 2019 11:43:58 -0000 Received: from unknown (HELO atl4mhib12.myregisteredsite.com) (209.17.115.147) by 0 with ESMTPS (DHE-RSA-AES256-GCM-SHA384 encrypted); 6 Jun 2019 11:43:58 -0000 Received: from newverein.lst.de (verein.lst.de [213.95.11.211]) by atl4mhib12.myregisteredsite.com (8.14.4/8.14.4) with ESMTP id x56BhuC5008752 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Thu, 6 Jun 2019 07:43:57 -0400 Received: by newverein.lst.de (Postfix, from userid 2407) id C2C8268B20; Thu, 6 Jun 2019 13:43:26 +0200 (CEST) Date: Thu, 6 Jun 2019 13:43:25 +0200 From: Christoph Hellwig To: Benjamin Herrenschmidt Cc: Aaro Koskinen , Christoph Hellwig , Christian Zigotzky , Michael Ellerman , Larry Finger , linuxppc-dev@lists.ozlabs.org, linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [BISECTED REGRESSION] b43legacy broken on G4 PowerBook Message-ID: <20190606114325.GA7497@lst.de> References: <20190605225059.GA9953@darkstar.musicnaut.iki.fi> <20190606093149.GA11598@darkstar.musicnaut.iki.fi> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.17 (2007-11-01) X-SpamScore: 4 X-MailHub-Apparently-To: Larry.Finger@lwfinger.net X-MailHub-Forwarded: Yes On Thu, Jun 06, 2019 at 08:57:49PM +1000, Benjamin Herrenschmidt wrote: > > Wow... that's an odd amount. One thing we could possibly do is add code > > to limit the amount of RAM when we detect that device.... > > Sent too quickly... I mean that *or* force swiotlb at 30-bits on those systems based > on detecting the presence of that device in the device-tree. swiotlb doesn't really help you, as these days swiotlb on matters for the dma_map* case. What would help is a ZONE_DMA that covers these devices. No need to do the 24-bit x86 does, but 30-bit would do it. WIP patch for testing below: diff --git a/arch/powerpc/include/asm/page.h b/arch/powerpc/include/asm/page.h index b8286a2013b4..7a367ce87c41 100644 --- a/arch/powerpc/include/asm/page.h +++ b/arch/powerpc/include/asm/page.h @@ -319,6 +319,10 @@ struct vm_area_struct; #endif /* __ASSEMBLY__ */ #include +#if 1 /* XXX: pmac? dynamic discovery? */ +#define ARCH_ZONE_DMA_BITS 30 +#else #define ARCH_ZONE_DMA_BITS 31 +#endif #endif /* _ASM_POWERPC_PAGE_H */ diff --git a/arch/powerpc/mm/mem.c b/arch/powerpc/mm/mem.c index cba29131bccc..2540d3b2588c 100644 --- a/arch/powerpc/mm/mem.c +++ b/arch/powerpc/mm/mem.c @@ -248,7 +248,8 @@ void __init paging_init(void) (long int)((top_of_ram - total_ram) >> 20)); #ifdef CONFIG_ZONE_DMA - max_zone_pfns[ZONE_DMA] = min(max_low_pfn, 0x7fffffffUL >> PAGE_SHIFT); + max_zone_pfns[ZONE_DMA] = min(max_low_pfn, + ((1UL << ARCH_ZONE_DMA_BITS) - 1) >> PAGE_SHIFT); #endif max_zone_pfns[ZONE_NORMAL] = max_low_pfn; #ifdef CONFIG_HIGHMEM