Received: by 2002:ab2:6d45:0:b0:1fb:d597:ff75 with SMTP id d5csp234432lqr; Wed, 5 Jun 2024 04:45:00 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCV/NaFToHxaScud+jU2Go+qNmwUEdG5IgzW/LUnkc/APTaPjwNgu5WUj4cDLE/SwSMuVc1Yfg3U4BU0bwOXRdeQOJlPzad4F7bE7C3D0Q== X-Google-Smtp-Source: AGHT+IHQsSJ+Cgj5mElwpfv++uWQqaFbXObfeQXcs7TImjLTdeBnc1dVxJj5BQeYEUa8uXH8ju+I X-Received: by 2002:a17:902:e851:b0:1f6:3fca:1ca4 with SMTP id d9443c01a7336-1f6a5a12fd5mr26141555ad.35.1717587900524; Wed, 05 Jun 2024 04:45:00 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717587900; cv=pass; d=google.com; s=arc-20160816; b=a8zN3pQBiTPWaYjmlXfc476VGz8KmZEmF7jcMEPxvc9HvfsQdXTsP8uihADECtGnzu +EFoVu9skGEZ+FXfhbYvR6mSw8tEq95UhI2fB2vjhSSgu/MElZTUngZvWmpj5Cz91XPR dPT3d43E++TtuE2CUcBk4Hst5Ian7dW8IVpgIS8NmDSazwDDp/vd04yKUGzFtvnqhMnS uAO41Od/iJubbjvDWpaAb9NpkvlmqoLJB5VDsTGIbY26aKbANFnonSMrDZzzLdw6H38G ZPcH+/z7sVJA5e7LSul5d1m2t7mnKq4mtUpE+vn7uNcA1WXY1innFT4fKpkJS7ju28V6 6erQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=4LAefMcejtvNP+3dK8XGpbnqvuZv17HOK6IUzDUtqns=; fh=/tocBNknTX0CBdcxdKGUdCq+MQUhEmbYJSr49AVQ1Gk=; b=kZxIBsS7WCIwdN2sQricbjE3XyMwb2LXbJnjdeNQ2scEqGc7GN+oSQNAodgp9NNKcj StHnGcO4x0i8Hyy2xth9yRw4R5NEh3JZTydnYrd8CXFO0SlVYm7TXTA09rk3n3bG5MiO hQfe5lAE2Z5x8vgwoYSwmENLCS7F4KSUI6aXHpMTpUYQGNDAa2hurtBp2GfGAbJDwpKm Ztkjfrn/ByzJTQ3kJlh1GhmchK3UVNjNCqyPDjQX1pgFyKbDatL95WPu0C8hiW4+fDtL ypOVs37/YZ/7yui4EHnfOudFhNxVLUyfJ9CyCt5GMSxZWG0Ul6O1bBCOl5MoWaaDanOr ZoLQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Yo0tPcOU; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-202279-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-202279-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id d9443c01a7336-1f6676de17dsi29995765ad.584.2024.06.05.04.44.59 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Jun 2024 04:45:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-202279-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Yo0tPcOU; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-202279-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-202279-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 369FCB23919 for ; Wed, 5 Jun 2024 11:42:38 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B81A6194A46; Wed, 5 Jun 2024 11:41:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Yo0tPcOU" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E3D6319307C for ; Wed, 5 Jun 2024 11:41:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717587699; cv=none; b=TUFASt/vQFb/ClwqwWGlZK3ywV07NjeaWVqnMJtG5WR3/eH49nhsQ0xVrURMDsKVLF8YEx/NgxTeDTfTlqrgvNePdCfeEnvTA8kFDLAGtlPAgGKat1i4nMdOvp0yM8KFZs/2V4NDcxd6eVi5WJpVCPhQsqY7F3+OrLz9zBjiLK4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717587699; c=relaxed/simple; bh=JhdeFloFX/xxhqkxVxMkwy3o8a+I7NU1Jr3K3J+2XHI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=m3ZcO//gtwZ3OF5zyK46ilN36j7mzj6Cde6KRCeKUCl58GS6F4U9VupeyLR3lbD6eXMlBDB8YsHsNDlCsYEj1+K6BKHV3SzZc6421TsXKl/0HKpBkf+SAHMSjdXPpbbEYMzF+F5jQnjokymLYztTfX8AAevc86ihIhUI0fRCGdE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Yo0tPcOU; arc=none smtp.client-ip=10.30.226.201 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?q?Bj=C3=B6rn=20T=C3=B6pel?= To: Alexandre Ghiti , Albert Ou , David Hildenbrand , Palmer Dabbelt , Paul Walmsley , linux-riscv@lists.infradead.org, Oscar Salvador Cc: =?UTF-8?q?Bj=C3=B6rn=20T=C3=B6pel?= , 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> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- 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) ({ \ -- 2.43.0