From patchwork Wed Jun 5 11:40:48 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?QmrDtnJuIFTDtnBlbA==?= X-Patchwork-Id: 13686704 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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 07433C25B76 for ; Wed, 5 Jun 2024 11:41:45 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 8D6E46B009B; Wed, 5 Jun 2024 07:41:44 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 884926B009C; Wed, 5 Jun 2024 07:41:44 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6FEC96B009D; Wed, 5 Jun 2024 07:41:44 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 467146B009B for ; Wed, 5 Jun 2024 07:41:44 -0400 (EDT) Received: from smtpin24.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 02BC01A115C for ; Wed, 5 Jun 2024 11:41:43 +0000 (UTC) X-FDA: 82196645328.24.FFB6994 Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by imf06.hostedemail.com (Postfix) with ESMTP id E0FA2180009 for ; Wed, 5 Jun 2024 11:41:41 +0000 (UTC) Authentication-Results: imf06.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=Yo0tPcOU; spf=pass (imf06.hostedemail.com: domain of bjorn@kernel.org designates 145.40.73.55 as permitted sender) smtp.mailfrom=bjorn@kernel.org; dmarc=pass (policy=none) header.from=kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1717587702; 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:in-reply-to:references:references:dkim-signature; bh=4LAefMcejtvNP+3dK8XGpbnqvuZv17HOK6IUzDUtqns=; b=MOCmH5HHjvVLY2PB75/GN9TzCtdv6Nh8CtVZDdlcsQor9gl234ubDfMu1E7/8+TIbDFcfi Jj6gGur+GnT1Y6eqD8XQgrosim3Nj6SEz/3+W+EiBnWZ41Ks7UhokPgg+bal57gxYLnH4P XzvkfDdwCY6aakLOTM5eENpTXRJK6LI= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1717587702; a=rsa-sha256; cv=none; b=Jt8FN4GpQU3NGzW5lyfbLcbZqLNXIXABGxFnaiqi07vEXkzJKhLb2NVE+qQ21+AJWinN1W /ZFltNKEBW+ypkeEOPS2OyluqVG7fmdf+LpFwLsUpDgWjeOxFM/q7ypsFHisp5Vo6Ohxah ggn4NyC9dduqw2mq73NvHLxDD7Ns3y0= ARC-Authentication-Results: i=1; imf06.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=Yo0tPcOU; spf=pass (imf06.hostedemail.com: domain of bjorn@kernel.org designates 145.40.73.55 as permitted sender) smtp.mailfrom=bjorn@kernel.org; dmarc=pass (policy=none) header.from=kernel.org Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sin.source.kernel.org (Postfix) with ESMTP id 48605CE1774; Wed, 5 Jun 2024 11:41:39 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 56EA3C3277B; Wed, 5 Jun 2024 11:41:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1717587698; bh=JhdeFloFX/xxhqkxVxMkwy3o8a+I7NU1Jr3K3J+2XHI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Yo0tPcOUDWbZKgAZCcnplN/Tpng+rYhahCirtGosu22vfbqUpPcHwDQA6k6SFhOAV ZJqZbW2Hub+7wW8blIcchz+3RvICwE2f/9Ybv7CyKA+D07H53Ebb5i0DPEtvRVmP7+ +UJZgr4Sp39itexUAPNROpGAAJDUgk4oCvOQX909f0SpiDFFPHsojDG2bl1yDM6WIT 1SeA46LAIXR14O9bfozUPdydSqNyrw8nINXW38klf+p8XKmw4BCQ/CsmeOD9GOvQFi hvRgm5Ntqz+0/jK4n1J/g/BIAKDgmEOtQ2+tEApA0MTtkbTxYZ4HxLyqMrMU4Yz12A PHsFFb2fJFJpQ== From: =?utf-8?b?QmrDtnJuIFTDtnBlbA==?= To: Alexandre Ghiti , Albert Ou , David Hildenbrand , Palmer Dabbelt , Paul Walmsley , linux-riscv@lists.infradead.org, Oscar Salvador Cc: =?utf-8?b?QmrDtnJuIFTDtnBlbA==?= , Andrew Bresticker , Chethan Seshadri , Lorenzo Stoakes , Santosh Mamila , Sivakumar Munnangi , Sunil V L , linux-kernel@vger.kernel.org, linux-mm@kvack.org, virtualization@lists.linux-foundation.org Subject: [PATCH v4 05/11] riscv: mm: Add pfn_to_kaddr() implementation Date: Wed, 5 Jun 2024 13:40:48 +0200 Message-ID: <20240605114100.315918-6-bjorn@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240605114100.315918-1-bjorn@kernel.org> References: <20240605114100.315918-1-bjorn@kernel.org> MIME-Version: 1.0 X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: E0FA2180009 X-Rspam-User: X-Stat-Signature: 8uxt3zp8cbfrxz3a6dy9p3uhfkko4rf3 X-HE-Tag: 1717587701-889492 X-HE-Meta: U2FsdGVkX1+7CFhT8mq0gCqCOlPev0JNYQmQF/zoZU6NH5Skn24K+uPonAMylUrkVASOExPchBONsbT2dA7lRUKBjqrG1m21O6iPs+RDs11VFXJ7GpTHaYXtxix04KLLq7BfjnyLQEfRswoAembet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xl7NrJlxV3YsEiI/dEWbETkbSIrKhHVQ9HJ8TxUIxihDJrP6Yj85DTVhH/Zg1fomX5zEaaTsTNspHv3fiVdlS/Yzw75KRfhELqEUib5Gari4TLiuLaMn0nYOhxZjvHh4Wryt8CQEL/nBKbPpeGt+DkDxgUHvjw= 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: List-Subscribe: List-Unsubscribe: From: Björn Töpel The pfn_to_kaddr() function is used by KASAN's memory hotplugging path. Add the missing function to the RISC-V port, so that it can be built with MHP and CONFIG_KASAN. Signed-off-by: Björn Töpel Reviewed-by: Alexandre Ghiti Reviewed-by: Alexandre Ghiti --- arch/riscv/include/asm/page.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/arch/riscv/include/asm/page.h b/arch/riscv/include/asm/page.h index 115ac98b8d72..235fd45d998d 100644 --- a/arch/riscv/include/asm/page.h +++ b/arch/riscv/include/asm/page.h @@ -188,6 +188,11 @@ extern phys_addr_t __phys_addr_symbol(unsigned long x); unsigned long kaslr_offset(void); +static __always_inline void *pfn_to_kaddr(unsigned long pfn) +{ + return __va(pfn << PAGE_SHIFT); +} + #endif /* __ASSEMBLY__ */ #define virt_addr_valid(vaddr) ({ \