From patchwork Sat Aug 3 00:48:38 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Russell King - ARM Linux X-Patchwork-Id: 2838233 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id A85F8BF535 for ; Sat, 3 Aug 2013 00:49:17 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A7EFB202F6 for ; Sat, 3 Aug 2013 00:49:16 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 9331E20303 for ; Sat, 3 Aug 2013 00:49:15 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1V5Q1x-0008Qg-6z; Sat, 03 Aug 2013 00:49:13 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1V5Q1u-00021g-RG; Sat, 03 Aug 2013 00:49:10 +0000 Received: from caramon.arm.linux.org.uk ([78.32.30.218]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1V5Q1s-00020s-Ld for linux-arm-kernel@lists.infradead.org; Sat, 03 Aug 2013 00:49:09 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=arm.linux.org.uk; s=caramon; h=Sender:In-Reply-To:Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date; bh=EY+RrhSD7GSZK7nQD6Kjg0nm4E3vNc/hrpXaABCDlII=; b=he4725f2Lu7ZoQyykv5QQxqvQnvB3txLFN0YkrAqgHONILsiXcP6StXx+8FjybBGn2W8+ehMmNWzFWJlBDlg6CHXOu625plf5oZiy54O+eou9XlwzDT8T2s/v5hBzfAZHdryac6mCNno6aCFhBL8/J+fVnxeWuTVaS4gSImeuRg=; Received: from n2100.arm.linux.org.uk ([2002:4e20:1eda:1:214:fdff:fe10:4f86]:34089) by caramon.arm.linux.org.uk with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.76) (envelope-from ) id 1V5Q1Q-0007tR-DN; Sat, 03 Aug 2013 01:48:40 +0100 Received: from linux by n2100.arm.linux.org.uk with local (Exim 4.76) (envelope-from ) id 1V5Q1P-00078Y-7w; Sat, 03 Aug 2013 01:48:39 +0100 Date: Sat, 3 Aug 2013 01:48:38 +0100 From: Russell King - ARM Linux To: Olof Johansson Subject: Re: Build breakage due to latest ARM fixes Message-ID: <20130803004838.GU23006@n2100.arm.linux.org.uk> References: <20130803000731.GS23006@n2100.arm.linux.org.uk> <20130803004111.GT23006@n2100.arm.linux.org.uk> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20130803004111.GT23006@n2100.arm.linux.org.uk> User-Agent: Mutt/1.5.19 (2009-01-05) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130802_204909_106270_13F19579 X-CRM114-Status: GOOD ( 35.57 ) X-Spam-Score: -5.8 (-----) Cc: "linux-kernel@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-5.5 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On Sat, Aug 03, 2013 at 01:41:11AM +0100, Russell King - ARM Linux wrote: > On Fri, Aug 02, 2013 at 05:24:21PM -0700, Olof Johansson wrote: > > On Fri, Aug 2, 2013 at 5:07 PM, Russell King - ARM Linux > > wrote: > > > On Fri, Aug 02, 2013 at 04:41:11PM -0700, Olof Johansson wrote: > > >> Russell, > > >> > > >> Looks like you sent up some fixes to Linus that broke one of the atmel > > >> configs (CONFIG_MMU=n): > > >> > > >> commit 48be69a026b2c1 ARM: move signal handlers into a vdso-like page > > >> > > >> seems to have caused it: > > >> > > >> arch/arm/kernel/signal.c: In function 'setup_return': > > >> arch/arm/kernel/signal.c:413:25: error: 'mm_context_t' has no member > > >> named 'sigpage' > > >> > > >> I see it with at91x40_defconfig. > > > > > > I'll look into that. Obviously, I never build nommu because it isn't > > > part of the build system and the nommu platform I do have - OKI67001 - > > > doesn't have mainline kernel support. (And if it did, it would not be > > > DT, so I doubt it's submittable.) > > > > I just noticed a whole bunch of boot/runtime failures too across the board too. > > > > tegra2 seaboard, exynos arndale, ux500 snowball all panicked. Panda, > > cubox and sama5 were the only systems that stayed up. Note that I > > don't do much with them per boot though, so with more runtime they > > might have hit something too. > > > > Some of the oopses below, they're probably not very useful though. Let > > me know if I can help collect data in any way. > > Gah, it looks like I didn't commit an update to these patches. Okay, this should fix it - *untested* though because of the fscking time it is here again. The problem is that install_special_mapping() assumes that the pointer to the pages will be persistent, and it wasn't. I found that during testing and thought I'd merged the patches in, but I seem to have totally destroyed the original fixes for this. arch/arm/kernel/process.c | 9 +++++---- arch/arm/kernel/signal.c | 41 +++++++++++++++++++---------------------- 2 files changed, 24 insertions(+), 26 deletions(-) Tested-by: Olof Johansson diff --git a/arch/arm/kernel/process.c b/arch/arm/kernel/process.c index 16ed3f7..536c85f 100644 --- a/arch/arm/kernel/process.c +++ b/arch/arm/kernel/process.c @@ -474,17 +474,18 @@ const char *arch_vma_name(struct vm_area_struct *vma) "[sigpage]" : NULL; } +static struct page *signal_page; extern struct page *get_signal_page(void); int arch_setup_additional_pages(struct linux_binprm *bprm, int uses_interp) { struct mm_struct *mm = current->mm; - struct page *page; unsigned long addr; int ret; - page = get_signal_page(); - if (!page) + if (!signal_page) + signal_page = get_signal_page(); + if (!signal_page) return -ENOMEM; down_write(&mm->mmap_sem); @@ -496,7 +497,7 @@ int arch_setup_additional_pages(struct linux_binprm *bprm, int uses_interp) ret = install_special_mapping(mm, addr, PAGE_SIZE, VM_READ | VM_EXEC | VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC, - &page); + &signal_page); if (ret == 0) mm->context.sigpage = addr; diff --git a/arch/arm/kernel/signal.c b/arch/arm/kernel/signal.c index 0f17e06..39e7105 100644 --- a/arch/arm/kernel/signal.c +++ b/arch/arm/kernel/signal.c @@ -614,35 +614,32 @@ do_work_pending(struct pt_regs *regs, unsigned int thread_flags, int syscall) return 0; } -static struct page *signal_page; - struct page *get_signal_page(void) { - if (!signal_page) { - unsigned long ptr; - unsigned offset; - void *addr; + unsigned long ptr; + unsigned offset; + struct page *page; + void *addr; - signal_page = alloc_pages(GFP_KERNEL, 0); + page = alloc_pages(GFP_KERNEL, 0); - if (!signal_page) - return NULL; + if (!page) + return NULL; - addr = page_address(signal_page); + addr = page_address(page); - /* Give the signal return code some randomness */ - offset = 0x200 + (get_random_int() & 0x7fc); - signal_return_offset = offset; + /* Give the signal return code some randomness */ + offset = 0x200 + (get_random_int() & 0x7fc); + signal_return_offset = offset; - /* - * Copy signal return handlers into the vector page, and - * set sigreturn to be a pointer to these. - */ - memcpy(addr + offset, sigreturn_codes, sizeof(sigreturn_codes)); + /* + * Copy signal return handlers into the vector page, and + * set sigreturn to be a pointer to these. + */ + memcpy(addr + offset, sigreturn_codes, sizeof(sigreturn_codes)); - ptr = (unsigned long)addr + offset; - flush_icache_range(ptr, ptr + sizeof(sigreturn_codes)); - } + ptr = (unsigned long)addr + offset; + flush_icache_range(ptr, ptr + sizeof(sigreturn_codes)); - return signal_page; + return page; }