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 C797AC433F5 for ; Tue, 16 Nov 2021 22:14:10 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 51EA260EB4 for ; Tue, 16 Nov 2021 22:14:10 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 51EA260EB4 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 D62686B0072; Tue, 16 Nov 2021 17:13:59 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id D12CD6B0074; Tue, 16 Nov 2021 17:13:59 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id BDA706B007D; Tue, 16 Nov 2021 17:13:59 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0199.hostedemail.com [216.40.44.199]) by kanga.kvack.org (Postfix) with ESMTP id AF12C6B0072 for ; Tue, 16 Nov 2021 17:13:59 -0500 (EST) Received: from smtpin19.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 71B3C1803816D for ; Tue, 16 Nov 2021 22:13:49 +0000 (UTC) X-FDA: 78816196368.19.A1D31B4 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf22.hostedemail.com (Postfix) with ESMTP id DCB4F1908 for ; Tue, 16 Nov 2021 22:13:47 +0000 (UTC) Received: by mail.kernel.org (Postfix) with ESMTPSA id 0A3A061881 for ; Tue, 16 Nov 2021 22:13:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1637100828; bh=RODKsIvjtpmvomcnrd1G098r6QHDqBPZze1YiTv3C1M=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=IAZ7psX3cd6eaTlSvndZnjLEb9yg/maqbAsSmY3xiBB8FObPeFwvDW1RPjeFIVX9Y X3XQuta54hmEbnms0s5o7rvw3P8n4h7KxwglcZZyozy253QQww9/WBSHJUXZy6gOhK Ha99Ao6PM4Cyiuuz356IC9KKapmIsVNqRVefA8pm/L9p8t7l5h5OH+wcY/w+wMcoBg I2n0LOPhqe9ni611AWSZ6LtgnqB2TZmitofr3fMNaoMRmSRBqEl0OBL0nqKRCI2Aon IL4SrdNdPyZ3bIP1JkSsEyx1ey+uNIO+Yi7f+I5uZ+nZtz+Ml7oT1XlZuhihYejMho 9dsDtg6N7S4ZQ== Received: by mail-oi1-f173.google.com with SMTP id u74so1680301oie.8 for ; Tue, 16 Nov 2021 14:13:48 -0800 (PST) X-Gm-Message-State: AOAM533I+YFTotirVN8F9lt2q8zqiGD/ZqMK7IxxpTDFTqBoeS/qHkRn 0iPF6zDSnqAEsMGep/O2Zld6jSTRAp/+DaVvINw= X-Google-Smtp-Source: ABdhPJyNtSexZSWeukGH9yX6hVdvzsPgPvGyseDlkJHFniQ/81YFPPqGHOrNqe/hT6Txg2vGznTxSVdtUvhtbK5U5l0= X-Received: by 2002:aca:ad95:: with SMTP id w143mr54314991oie.47.1637100827309; Tue, 16 Nov 2021 14:13:47 -0800 (PST) MIME-Version: 1.0 References: <20211116094737.7391-1-ardb@kernel.org> <20211116141222.43a1aea5bee1f9b16ed7ba75@linux-foundation.org> In-Reply-To: <20211116141222.43a1aea5bee1f9b16ed7ba75@linux-foundation.org> From: Ard Biesheuvel Date: Tue, 16 Nov 2021 23:13:35 +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-Rspamd-Queue-Id: DCB4F1908 X-Stat-Signature: yqhdfumjr1s47cphaqnycfteps1tr4qo Authentication-Results: imf22.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=IAZ7psX3; spf=pass (imf22.hostedemail.com: domain of ardb@kernel.org designates 198.145.29.99 as permitted sender) smtp.mailfrom=ardb@kernel.org; dmarc=pass (policy=none) header.from=kernel.org X-Rspamd-Server: rspam02 X-HE-Tag: 1637100827-160817 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: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") Cc: