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 532F4C433EF for ; Tue, 16 Nov 2021 19:28:44 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id B090263231 for ; Tue, 16 Nov 2021 19:28:43 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org B090263231 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=armlinux.org.uk Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id E1DB96B006C; Tue, 16 Nov 2021 14:28:42 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id DCC406B0073; Tue, 16 Nov 2021 14:28:42 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id CBAC66B007B; Tue, 16 Nov 2021 14:28:42 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0086.hostedemail.com [216.40.44.86]) by kanga.kvack.org (Postfix) with ESMTP id BFC216B006C for ; Tue, 16 Nov 2021 14:28:42 -0500 (EST) Received: from smtpin08.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 843AE1816C8DD for ; Tue, 16 Nov 2021 19:28:42 +0000 (UTC) X-FDA: 78815780484.08.0B6ECD6 Received: from pandora.armlinux.org.uk (pandora.armlinux.org.uk [78.32.30.218]) by imf02.hostedemail.com (Postfix) with ESMTP id E74FB7010E29 for ; Tue, 16 Nov 2021 18:56:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=kKydUPTdgoDWZC5QNkdRo0Ma5DLXTFuue5c4I+JfHkU=; b=RUX7Apzr49imlduRoCjCNjI2GI 2halcwuIav9Fg7UxW4w2cbbVOlFPB1YA45XKsQUb3nEld61131EAliwmEBR4zOzLs/a5sCss3J87t a8tmKVssEeVIRx2z83NH+DkKHYMnn8hAjDiISHlu8l66mR2mHr7fg81pIVSG9YRqY5iOL30+9Co+s zNIIE2BIG2vqwC3aR7J6k/yF8piqoDLy79rFA0ii/Ou4s6tyzSWx+L1Vt3solUfi2QB/UT4fwWXML F8MiW+OQ6tzq2ncpE/gRRjKE/TkpxeWFZ6hDO+LF1s7MY+GLrRRiqNpcYWPouZ/3faNCv7zDjMPx6 xubwRRxw==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:55660) by pandora.armlinux.org.uk with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1mmxCa-0000WF-Ag; Tue, 16 Nov 2021 12:04:40 +0000 Received: from linux by shell.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1mmxCT-0001yu-F7; Tue, 16 Nov 2021 12:04:33 +0000 Date: Tue, 16 Nov 2021 12:04:33 +0000 From: "Russell King (Oracle)" To: Ard Biesheuvel Cc: linux-mm@kvack.org, Quanyang Wang , Linus Walleij , Thomas Gleixner , Andrew Morton Subject: Re: [PATCH resend] kmap_local: don't assume kmap PTEs are linear arrays in memory Message-ID: References: <20211116094737.7391-1-ardb@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20211116094737.7391-1-ardb@kernel.org> X-Rspamd-Queue-Id: E74FB7010E29 X-Stat-Signature: h9h7m78t7zqics7pbmqtaxo19b36j8z8 Authentication-Results: imf02.hostedemail.com; dkim=pass header.d=armlinux.org.uk header.s=pandora-2019 header.b=RUX7Apzr; spf=none (imf02.hostedemail.com: domain of "linux+linux-mm=kvack.org@armlinux.org.uk" has no SPF policy when checking 78.32.30.218) smtp.mailfrom="linux+linux-mm=kvack.org@armlinux.org.uk"; dmarc=pass (policy=none) header.from=armlinux.org.uk X-Rspamd-Server: rspam02 X-HE-Tag: 1637088983-43119 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, Nov 16, 2021 at 10:47:37AM +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. > > Link: https://lore.kernel.org/linux-arm-kernel/20211026131249.3731275-1-ardb@kernel.org/ > Reported-by: Quanyang Wang > Reviewed-by: Linus Walleij > Cc: Thomas Gleixner > Cc: Russell King Acked-by: Russell King (Oracle) Thanks. -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!