From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.2 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6427FC433DB for ; Tue, 22 Dec 2020 17:59:13 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 39CF422482 for ; Tue, 22 Dec 2020 17:59:11 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 39CF422482 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=gaisler.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 433308D001C; Tue, 22 Dec 2020 12:59:11 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 3BC388D0016; Tue, 22 Dec 2020 12:59:11 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 284E68D001C; Tue, 22 Dec 2020 12:59:11 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0069.hostedemail.com [216.40.44.69]) by kanga.kvack.org (Postfix) with ESMTP id 076368D0016 for ; Tue, 22 Dec 2020 12:59:11 -0500 (EST) Received: from smtpin24.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id B912F180ACF75 for ; Tue, 22 Dec 2020 17:59:10 +0000 (UTC) X-FDA: 77621679660.24.house44_4211e0927461 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin24.hostedemail.com (Postfix) with ESMTP id 9735D1A4A0 for ; Tue, 22 Dec 2020 17:59:10 +0000 (UTC) X-HE-Tag: house44_4211e0927461 X-Filterd-Recvd-Size: 3899 Received: from vsp-unauthed02.binero.net (vsp-unauthed02.binero.net [195.74.38.227]) by imf28.hostedemail.com (Postfix) with ESMTP for ; Tue, 22 Dec 2020 17:59:09 +0000 (UTC) X-Halon-ID: 5e35e258-447f-11eb-b73f-0050569116f7 Authorized-sender: andreas@gaisler.com Received: from andreas.got.gaisler.com (h-98-128-223-123.na.cust.bahnhof.se [98.128.223.123]) by bin-vsp-out-03.atm.binero.net (Halon) with ESMTPA id 5e35e258-447f-11eb-b73f-0050569116f7; Tue, 22 Dec 2020 18:59:04 +0100 (CET) To: Thomas Gleixner , sparclinux , linux-mm@kvack.org Cc: "David S. Miller" , Arnd Bergmann , "linux-kernel@vger.kernel.org" , Sam Ravnborg From: Andreas Larsson Subject: sparc32: Init process fails to load with generic kmap atomic Message-ID: Date: Tue, 22 Dec 2020 18:58:59 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Unfortunately I did not see this problem before I encountered it in master. Commit 3293efa9780712ad8504689e0c296d2bd33827d5 sparc/mm/highmem: Switch to generic kmap atomic No reason having the same code in every architecture Signed-off-by: Thomas Gleixner Cc: "David S. Miller" Cc: Arnd Bergmann Link: https://lore.kernel.org/r/20201103095858.197568209@linutronix.de prevents the init process to be started for me on a sparc32 LEON. On the commit before this it works. Details below from that commit but I get the same behavior on current master. From as far as I have gotten into hunting down the problem, I get a failure from load_elf_binary here: /* First of all, some simple consistency checks */ if (memcmp(elf_ex->e_ident, ELFMAG, SELFMAG) != 0) goto out; at least seemingly due to the kaddr from copy_page_to_iter in lib/iov_iter.c if (i->type & (ITER_BVEC|ITER_KVEC)) { void *kaddr = kmap_atomic(page); size_t wanted = copy_to_iter(kaddr + offset, bytes, i); where kaddr points to memory with all zeroes (from an earlier bzero) in this context: #0 _copy_to_iter (addr=0xfcffe000, bytes=0x100, i=0xf201fd78) at lib/iov_iter.c:635 #1 copy_to_iter (i=0xf201fd78, bytes=0x1ce, addr=0xfcffe000) at include/linux/uio.h:137 #2 copy_page_to_iter (page=0xf137ede0, offset=0x0, bytes=0x1ce, i=0xf201fd78) at lib/iov_iter.c:920 #3 shmem_file_read_iter (iocb=0xf201fd90, to=0xf201fd78) at mm/shmem.c:2661 #4 __kernel_read (file=0xf2103900, buf=0xf241365c, count=0x100, pos=0xf201fe80) at fs/read_write.c:454 #5 kernel_read (file=0xf2103900, buf=0xf241365c, count=0x100, pos=0xf201fe80) at fs/read_write.c:472 #6 prepare_binprm (bprm=0xf2413600) at fs/exec.c:1633 #7 search_binary_handler (bprm=0xf2413600) at fs/exec.c:1687 #8 exec_binprm (bprm=0xf2413600) at fs/exec.c:1744 #9 bprm_execve (bprm=0xf2413600, fd=, filename=, flags=) at fs/exec.c:1820 #10 kernel_execve (kernel_filename=, argv=0xf050d4f0 , envp=0xf050d468 ) at fs/exec.c:1969 #11 kernel_init (unused=0x0) at init/main.c:1427 I will have to continue to dig deeper into this in January. If anyone has any ideas how this could stem from this kmap patch, I am all ears. -- Andreas Larsson Software Engineer Cobham Gaisler