Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp5378653pxu; Tue, 22 Dec 2020 15:54:18 -0800 (PST) X-Google-Smtp-Source: ABdhPJy9mdoNEeSniqvIkRaGtY5/poAKDVimQ27V38vNfU4g7Pfz6Z3guc9dOvYU/qE/nq1D3vpI X-Received: by 2002:a17:906:7c49:: with SMTP id g9mr22075742ejp.185.1608681258132; Tue, 22 Dec 2020 15:54:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608681258; cv=none; d=google.com; s=arc-20160816; b=dHbLOdGbtnh7Bdt7iZHeCE5+sdj7Q9j43yOlrtIDRBQhephyJxUMOnXZS3LLjVKD/6 7EsekDkOf+nOSzbGdXNfm5SotconA52+/IJG/kVH6de0SvRq5e1ohwitsiecjnRf4BD7 wSfZb6D5YI0Y1v3b4DwWkVjARgwCtEe2/BYyiQpSO8Jbv+JYANhfZ7yXeUVFJD7xK95X HPSxmwsGPVn6spX37dPMRzK+RdYzsGhXTV++jeqvKSxiFNNpot/2ipCzf2UNx/vg/c/i yNj8Q0ULzLr8RAQ5vSGxHQEHw0WFfb3h8suR5g+yKcgIIAEhj5TbYJfda8sUWUAEV5hy l13A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:references :in-reply-to:subject:cc:to:dkim-signature:dkim-signature:from; bh=JBg6u3ycvJLYb+a8Gwh+4UKSChn8eINhzdFNu5z9WyE=; b=bPFZawbYH3WRVF/csFzjbEMFWWZVOsEYfQKgL+NLsgHRiS+YW1bX9nuTwatG3YxmYR VLax519lx4EmrZhDKDFhMpTWkLkmKoWasX/YDId1Ic9UXRRSqLx7pQRHyZYRvb+cC/nG uVLlTUdNNTQoL1MjTaU+yVobTfXZE/nP1wLcsBiFhCosAlPAXw/cPiP9zYdCGZ/uMZHM 94FF0o0wieQRfee/JXP0gUW56L9rUb/xUsy6x7DObXgHnmUqIhDCub1lSgz2nY8bY5Oj skApK90btHPI+ViLO7iV8rfFCyadWGhG1vzhV4L2R0p1SNHlkZuFrEZIQ9zx9IRBqKZr WUAQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=K1OSJMhc; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a17si13048971edb.389.2020.12.22.15.53.55; Tue, 22 Dec 2020 15:54:18 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=K1OSJMhc; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726290AbgLVXxL (ORCPT + 99 others); Tue, 22 Dec 2020 18:53:11 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41626 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725897AbgLVXxL (ORCPT ); Tue, 22 Dec 2020 18:53:11 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3DBCFC0613D3; Tue, 22 Dec 2020 15:52:31 -0800 (PST) From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1608681148; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=JBg6u3ycvJLYb+a8Gwh+4UKSChn8eINhzdFNu5z9WyE=; b=K1OSJMhctJgGqMijS/Dc/dfEJdTW+iWwbbbjAvUc//I3mzeptfqjfQOXVdZEw/VxmlXZbM 2USlNBwyrFUILUuc+ZHzWwZ9ut/UeuR8s5TMCQs8iFyVsQxaE0LAmdOOnCz5FKssZ19+nQ WFhrEQU9pdlgA8k0fa5kn6y5Xcw/c7aOJeo9w8zkbE743F1tviXktld2kIXl5T7dphJFTG 2szLcKVExLAWUH6aJqWmDZg6G86NSUJKqTLa6Yyz959ZSBW32HRuTl0NUQNLp6UwkTlUXl PkTEzM0pF0P/56BHou13K8VMDy44Q0BWceQ40CP4oopHqni2U13zAoU3hSdGUQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1608681148; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=JBg6u3ycvJLYb+a8Gwh+4UKSChn8eINhzdFNu5z9WyE=; b=tQt53sLP8hlrZ3beATYIm1t4bWQWfbwTznxZokdW4DuOeaSX2ea6B3Hw3vneVfdSi4Yc+/ KNKio+NiAah6rABw== To: Andreas Larsson , sparclinux , linux-mm@kvack.org Cc: "David S. Miller" , Arnd Bergmann , "linux-kernel\@vger.kernel.org" , Sam Ravnborg Subject: Re: sparc32: Init process fails to load with generic kmap atomic In-Reply-To: References: Date: Wed, 23 Dec 2020 00:52:28 +0100 Message-ID: <87v9ctcsar.fsf@nanos.tec.linutronix.de> MIME-Version: 1.0 Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Dec 22 2020 at 18:58, Andreas Larsson wrote: > 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: The kaddr might be misleading you here. If the code flow is: kaddr1 = kmap_atomic(page1); ... kunmap_atomic(kaddr1); kaddr2 = kmap_atomic(page2); Then kaddr1 == kaddr2, but first it maps page1 and then page2, but that was the same in the original code. > 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. I can't spot it either. I'll send you a debug patch after the holidays. Thanks, tglx