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 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 526EEC433EF for ; Tue, 16 Nov 2021 22:16:08 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id EADFC619E1 for ; Tue, 16 Nov 2021 22:16:07 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org EADFC619E1 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 8318C6B0071; Tue, 16 Nov 2021 17:15:57 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 7DF256B0072; Tue, 16 Nov 2021 17:15:57 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6A7BD6B0074; Tue, 16 Nov 2021 17:15:57 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0141.hostedemail.com [216.40.44.141]) by kanga.kvack.org (Postfix) with ESMTP id 5C62F6B0071 for ; Tue, 16 Nov 2021 17:15:57 -0500 (EST) Received: from smtpin28.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 2DEC1876F2 for ; Tue, 16 Nov 2021 22:15:47 +0000 (UTC) X-FDA: 78816201534.28.7E37E59 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf25.hostedemail.com (Postfix) with ESMTP id 431E9B0001AB for ; Tue, 16 Nov 2021 22:15:33 +0000 (UTC) Received: by mail.kernel.org (Postfix) with ESMTPSA id 14AA1619FA for ; Tue, 16 Nov 2021 22:15:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1637100946; bh=dehfsVFNIKOgkApz0QVMyLqzUjqdXVa8pOQJ9N82hRI=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=lX7M3BSa1hKNWKbpsWWmpAdd20WrnU9tGc/KNUYPKAXfKg9LQUyxss9/4Y4WE7O7C ncAfUKwmyMvBYxE/DElQfu5wKxfkmxCkE1f2e/nwvP1eOuZVYJBEMR4gpRsImMxpkV 3H8CMvvlghYhbkIYQoURJob4lvCnj0hdbFa0R+eYFt6eBjmbXcmfIacBoUEBI0Iss4 9sqUSNg/JC06SDn2Mphv+a+mK6sUynCyL1ky8a65Kf0fLILYoYwi9CytXDBomS0r5h OIK1mw6cT39My5oeT+bZqFx/IORuVZFtHQjKcaqMdqLFA/4XVjwFZcWtk88Aaw7F+j J3VvC6fpYDT4Q== Received: by mail-ot1-f49.google.com with SMTP id r10-20020a056830080a00b0055c8fd2cebdso956663ots.6 for ; Tue, 16 Nov 2021 14:15:46 -0800 (PST) X-Gm-Message-State: AOAM531Hh0uTOoofyJ+9hJKwOvRnyK9JDAy5BIkfvZAIf+C4CLEecQSz tNMY84XdweBepk/ELGYSsYfcu3NaT9w5O5qlJks= X-Google-Smtp-Source: ABdhPJwGtZUlAGFSUCfFJm2YfkCw0yff/BPHLEtm78o4DkLqdW7zQpgzQxhBZ7LWJvNJUnAQedYM+XFTdKFTNTck9MU= X-Received: by 2002:a05:6830:1514:: with SMTP id k20mr8911160otp.147.1637100945377; Tue, 16 Nov 2021 14:15:45 -0800 (PST) MIME-Version: 1.0 References: <20211116094737.7391-1-ardb@kernel.org> <20211116141222.43a1aea5bee1f9b16ed7ba75@linux-foundation.org> In-Reply-To: From: Ard Biesheuvel Date: Tue, 16 Nov 2021 23:15:33 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH resend] kmap_local: don't assume kmap PTEs are linear arrays in memory To: Andrew Morton Cc: Linux Memory Management List , Quanyang Wang , Linus Walleij , Thomas Gleixner , Russell King Content-Type: text/plain; charset="UTF-8" X-Stat-Signature: o544ia8w7kfuy9xui4u5ipszp1bjjtme Authentication-Results: imf25.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=lX7M3BSa; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf25.hostedemail.com: domain of ardb@kernel.org designates 198.145.29.99 as permitted sender) smtp.mailfrom=ardb@kernel.org X-Rspamd-Server: rspam11 X-Rspamd-Queue-Id: 431E9B0001AB X-HE-Tag: 1637100933-905393 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: On Tue, 16 Nov 2021 at 23:13, Ard Biesheuvel wrote: > > On Tue, 16 Nov 2021 at 23:12, Andrew Morton wrote: > > > > On Tue, 16 Nov 2021 10:47:37 +0100 Ard Biesheuvel wrote: > > > > > The kmap_local conversion broke the ARM architecture, because the new > > > code assumes that all PTEs used for creating kmaps form a linear array > > > in memory, and uses array indexing to look up the kmap PTE belonging to > > > a certain kmap index. > > > > > > On ARM, this cannot work, not only because the PTE pages may be > > > non-adjacent in memory, but also because ARM/!LPAE interleaves hardware > > > entries and extended entries (carrying software-only bits) in a way that > > > is not compatible with array indexing. > > > > > > Fortunately, this only seems to affect configurations with more than 8 > > > CPUs, due to the way the per-CPU kmap slots are organized in memory. > > > > > > Work around this by permitting an architecture to set a Kconfig symbol > > > that signifies that the kmap PTEs do not form a lineary array in memory, > > > and so the only way to locate the appropriate one is to walk the page > > > tables. > > > > A Fixes: link would be helpful. > > > > kmap_local() was a year ago, so is a -stable backport desired here? > > Fixes: 1834eb1a6027 ("kmap_local: don't assume kmap PTEs are linear > arrays in memory") Oops that should be Fixes: 2a15ba82fa6c ("ARM: highmem: Switch to generic kmap atomic") > Cc: