Message ID | 20240404133642.971583-1-chenhuacai@loongson.cn (mailing list archive) |
---|---|
Headers | show
Return-Path: <owner-linux-mm@kvack.org> X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id ABD8ECD1292 for <linux-mm@archiver.kernel.org>; Thu, 4 Apr 2024 13:37:10 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C88336B0082; Thu, 4 Apr 2024 09:37:09 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id C37EF6B0083; Thu, 4 Apr 2024 09:37:09 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B26976B0087; Thu, 4 Apr 2024 09:37:09 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 94A726B0082 for <linux-mm@kvack.org>; Thu, 4 Apr 2024 09:37:09 -0400 (EDT) Received: from smtpin17.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 2A3ED40DBC for <linux-mm@kvack.org>; Thu, 4 Apr 2024 13:37:09 +0000 (UTC) X-FDA: 81971950578.17.FE9494B Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by imf10.hostedemail.com (Postfix) with ESMTP id AE29AC0022 for <linux-mm@kvack.org>; Thu, 4 Apr 2024 13:37:05 +0000 (UTC) Authentication-Results: imf10.hostedemail.com; dkim=none; spf=pass (imf10.hostedemail.com: domain of "SRS0=Mf8M=LJ=loongson.cn=chenhuacai@kernel.org" designates 145.40.73.55 as permitted sender) smtp.mailfrom="SRS0=Mf8M=LJ=loongson.cn=chenhuacai@kernel.org"; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1712237826; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:in-reply-to: references; bh=LeWkZxViBnRKKdJo7vFPZSjXukA4Vl9Mr5i9eC/8m44=; b=UaqGcJNoAqV73EImChL3sMrbO3KzkNFzdjnkqF1WtwqCLQviJAHyZ8F+DbP8fEjDHGbpjs Wcg9eUAQtKdOQBFmlMZL14YrmWpzmiA2tBDH9DIVdcGK8WHndFrDs1CZVf8FGVrRIQvZBD bU5VwdgwFibFtGMaIrjKkoz+nmFkBfE= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1712237826; a=rsa-sha256; cv=none; b=Vrd7wZUsLbMMvdQMuPDAdTg5yHD5g25dSu9sk/FvpSn3Fr7gT3u4nWbPWLYRW51Ro8RaWX eSEFuBAKMrbGYuFFSNVML364n3UL8BXkHICW1+zx6ByDJwH/Fbn8Sx40ObFyYZlZyJCmf2 YBFDweIZo75TrEKYCnPykl69MIzCcMw= ARC-Authentication-Results: i=1; imf10.hostedemail.com; dkim=none; spf=pass (imf10.hostedemail.com: domain of "SRS0=Mf8M=LJ=loongson.cn=chenhuacai@kernel.org" designates 145.40.73.55 as permitted sender) smtp.mailfrom="SRS0=Mf8M=LJ=loongson.cn=chenhuacai@kernel.org"; dmarc=none Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sin.source.kernel.org (Postfix) with ESMTP id CA7F3CE2B37; Thu, 4 Apr 2024 13:37:02 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6476FC433F1; Thu, 4 Apr 2024 13:36:59 +0000 (UTC) From: Huacai Chen <chenhuacai@loongson.cn> To: Andrew Morton <akpm@linux-foundation.org>, Huacai Chen <chenhuacai@kernel.org> Cc: loongarch@lists.linux.dev, linux-mm@kvack.org, Xuefeng Li <lixuefeng@loongson.cn>, Guo Ren <guoren@kernel.org>, Xuerui Wang <kernel@xen0n.name>, Jiaxun Yang <jiaxun.yang@flygoat.com>, linux-kernel@vger.kernel.org, loongson-kernel@lists.loongnix.cn, Huacai Chen <chenhuacai@loongson.cn> Subject: [PATCH 0/3] Make {virt, phys, page, pfn} translation work with KFENCE for LoongArch Date: Thu, 4 Apr 2024 21:36:33 +0800 Message-ID: <20240404133642.971583-1-chenhuacai@loongson.cn> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: AE29AC0022 X-Rspam-User: X-Stat-Signature: nbteimifqiwjjp8iexnpqs4a6ar6gtx6 X-Rspamd-Server: rspam03 X-HE-Tag: 1712237825-725592 X-HE-Meta: U2FsdGVkX18Hx/qzCLzTi+YqE3uALkZQujU47Zq5FebL9ukUzUsj3IWrY8GheAnJZXOWJ5ExhyGGw3eGyqcSihu1Q+ogmsXCBvYYG5b4svkqVOcY/79cks9PZALieXTMz8djMo3NHdkzopDPzTK71FgCLbKYN5/mVm+q1CBHXZMq7mA2HLLJ5qKQO7ug0Q1uRNfeIhYmXNgWIIeIQ0yWGZboOBAzkO2itNGf9ybFH9BUwhBKHvYrcFbSTpcPNtA7xlvcoKbQjC8xurPW6+BAWiKBI3rjf6b9easuAle1Sqdg3J9QIMNgAceSC8ZbhVTYpVd7wE2UPoGw0sQpZSn4l5UO8U5JEw9p1XszWnG9KLeM1dxexS3RofvMrUmktkxLPkkFD+gJOos9lK3Il3b2XkDQcdf+jdCMfEXER7tdyOPGkPp1RLlq+e6+iPkXdRP1rCFN2ohSbJkRQ5WTLLEINGya2Cb+prj71dTWYvMsLl05tHCvLHWdw6tCMNN5Ro81I3B0cjKkkvNFjXbPovIzaYeBsv8ZkYP1qyZ/Ohy7ycBvZVFwJrTxw8RjE3SBm/acCwACpK+z7ZKz0ZEDZKcsddDyZJwTsHxYx5ikZDL927aZdiGo4Y0NHOyYN46INqdXOkTHNOaOI3TNpxdjWYUTZ+duvQHr72vrvEMUljciRmpUvtnkL8/cZSOWr5nu5zFS/6/XsvMW5vZahgocW9oc9e9uN6lbxfFxors5EaHRL3uT6JVTNsOL9T73msGUXXiWI4vTevXFxTzOR3yZPSqac6Nq9PzIBkVrguBfoO78jLC8we+0AY/MriXk5eotSW5pIyCXhVOzIZd5jNKgsGd+Q4p4Pv/UfZqr0wwc4nDIWfcJxM8v4ufbYYr2X5r+2ML/R6FWbgJk06V1ug4c8pFCN38jw9rQx8ZBEK+kaF7oBkrISllIRH02oeSG1PSyhRs6ZxDmCKYFvYxhseNEPAE YBIs4EKl plK8P1RNaAN1G4UX5DqhxOTMli7oXdIEi2PebsPSsn7Unbt3BCrXbmatUUpOqtoGZTBdhn5+FQxh1zDp5awB+KZl+poZeWcySSmptf9EDChR7f01FzpNipBAL4kXZR8gkN1TCjvIs0NYzBUiBMgmccWlssop+/rEt3AE1uDaVl7MrZqVZ5d6dcoEVSvf5Hwyl6CwXSbw+J+69nSD0xtS4dT/Xa01LmG22vOcnVl1ypvTYlSWsNCu3NQQGSb1+zpTumLZ2VjHIXpKVkVZRBQOvNWS11q1Ybf61CESKTbeIqnjgsEJDQtnmL4p1ckXsOQG27/V4QhBbI+SeuF3cROOc20PPi0UGZrFnZe7M 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: <linux-mm.kvack.org> List-Subscribe: <mailto:majordomo@kvack.org> List-Unsubscribe: <mailto:majordomo@kvack.org> |
Series |
Make {virt, phys, page, pfn} translation work with KFENCE for LoongArch
|
expand
|
On LoongArch kmalloc() range is DMW-mapped rather than TLB-mapped, so KFENCE remap __kfence_pool to the TLB-mappd range. To make all drivers work, {virt, phys, page, pfn} translation functions are overriden (part of them already done, others done in this series): 1, virt_to_pfn()/pfn_to_virt(); 2, virt_to_page()/page_to_virt(); 3, virt_to_phys()/phys_to_virt(). Since LoongArch overrides page_to_virt() which use page_address() in the KFENCE case (by defining WANT_PAGE_VIRTUAL/HASHED_PAGE_VIRTUAL). So move lowmem_page_address() a little later to avoid such build errors: error: implicit declaration of function ‘page_address’. Huacai Chen(3): mm: Move lowmem_page_address() a little later. LoongArch: Make {virt, phys, page, pfn} translation work with KFENCE LoongArch: Make virt_addr_valid()/__virt_addr_valid() work with KFENCE Signed-off-by: Huacai Chen <chenhuacai@loongson.cn> --- 2.27.0