From patchwork Thu Apr 4 13:36:34 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Huacai Chen X-Patchwork-Id: 13617863 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 5DCABCD1292 for ; Thu, 4 Apr 2024 13:37:17 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C88076B0083; Thu, 4 Apr 2024 09:37:16 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id C38116B0087; Thu, 4 Apr 2024 09:37:16 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id AFF576B0088; Thu, 4 Apr 2024 09:37:16 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 949696B0083 for ; Thu, 4 Apr 2024 09:37:16 -0400 (EDT) Received: from smtpin08.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 227B9A0A9C for ; Thu, 4 Apr 2024 13:37:16 +0000 (UTC) X-FDA: 81971950872.08.30C01F5 Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by imf22.hostedemail.com (Postfix) with ESMTP id 0BBD6C0009 for ; Thu, 4 Apr 2024 13:37:13 +0000 (UTC) Authentication-Results: imf22.hostedemail.com; dkim=none; dmarc=none; spf=pass (imf22.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" ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1712237834; a=rsa-sha256; cv=none; b=3xFZtdusExNQErPe7EZUhYT6xhLzZ03TWEbnHjnZFa3EB+rizILgl++lA7xqZ1SSsaikq7 vqIVcci2nxJE4G9DfhlxBtF2yX6bqOLTuXuIQABz7e1b/G23AJrxm8iLWQXOv+s4uNey70 5aFZbAxaEvwPs/wD5y7VGs5fu5vke78= ARC-Authentication-Results: i=1; imf22.hostedemail.com; dkim=none; dmarc=none; spf=pass (imf22.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" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1712237834; 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; bh=2yJUX/E8rOc1QE9BIxZ13eU/GVBgHCKj0SBjtOIwJVY=; b=FvsTreoxTm0QzCbPQr5Ywr1HJHX7Ew+Td2LLlieFJQ+z1gc5buixOfRDBxYnqfQfF2qPhU szewvd482RnkowrviziPg1M1/XzdiJVuWx7DRJufpBsvg/QFzWsPZCi/9kQ8Xa5pKznp3Z lEU7D5LUScPZ4BDWtUjPduQgNPgistI= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sin.source.kernel.org (Postfix) with ESMTP id 091A8CE31BE; Thu, 4 Apr 2024 13:37:11 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A1A4AC433C7; Thu, 4 Apr 2024 13:37:07 +0000 (UTC) From: Huacai Chen To: Andrew Morton , Huacai Chen Cc: loongarch@lists.linux.dev, linux-mm@kvack.org, Xuefeng Li , Guo Ren , Xuerui Wang , Jiaxun Yang , linux-kernel@vger.kernel.org, loongson-kernel@lists.loongnix.cn, Huacai Chen Subject: [PATCH 1/3] mm: Move lowmem_page_address() a little later Date: Thu, 4 Apr 2024 21:36:34 +0800 Message-ID: <20240404133642.971583-2-chenhuacai@loongson.cn> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240404133642.971583-1-chenhuacai@loongson.cn> References: <20240404133642.971583-1-chenhuacai@loongson.cn> MIME-Version: 1.0 X-Rspamd-Server: rspam08 X-Rspamd-Queue-Id: 0BBD6C0009 X-Stat-Signature: qz1rqmmu7opbdwip1b9czy7h7x4e16qp X-Rspam-User: X-HE-Tag: 1712237833-260428 X-HE-Meta: U2FsdGVkX1+4GTQ9Lfj/t027blPFBScJ6/3NwcqcL3H/ut+e9dyfIip/KOHIbFVykUQV/8GyH/ffBJAyZrFyFWiyE5KpvFLmn+9W3JxuaIyBNH/N6reOv0/atFPDgO7Pa5tqI5PKDjxyZeNaTml3YAKf5uNFNilVMOPKS4Vt5mC0ZmIz1OEImcww3PdpB5HyYZrfdKTz8uBlRGEPjwGdZPobeTBVPn9kRAHaTdYIgBUCVyr/JzuDmwk6U18aDT+bWP0XOqs2VtuR7qA9A3bghytZ8IpJrm1hgauZHdl11GOw0JRPlwurEq8qR/2TNjjjcYVXhXmoFSJ8CX55/L7PC4zRKZPcB4QYjxu5+iPxvUJWbgAuF3t560p1XPIioNgEzKDmu3A3jkoU9/mf/74Gygl7aYTLsClaa4pq6eDDhSBPvTpJdllS0tQ/RpZRx+fvSULmADTxf433dq3K/W+3S6PpnUCXdoBd1PXgaBaAF5bKs5LAppx/httqJkF1SJvgOvrKozdAVZ4znqorzNxIfKqovCSs5EwPhEm9bptGW9m2t6cqyFiyEm2XDi30zVpryq8093FXroMCAP7dkMyO3IaYr+PbM15Tn92XkUd0t2tnWV0EE7dJBz23R9On27/hee+WFn4qh7spfZLGXDpC6NOgHdmUopW2eSS0GdHiyCSWJGgYM130PKPlU0dgWEgh87tzt+zkoJPlJwS/DMCyW4Or8PlHFAhyPRbVkFVZBZv2W5IgU/qUHpPvdkIjF8OG2r/+zhPRz+AfVnK5EtJuK88T6GdOHETfOPTWpAzjkX5YVAip1LNL2oOsTTWN20hixhPd+NssFtQ4k4MV5ffnAto98DfR1SmbMYZT2ZWcB133SfPpFV2JmfuQJHRGBn+uemiPlRtK4oBxbzAQrApyn1T/dBQMwS/xGiFm03evf1K6lei7Txr2dCIluU3vDGY4yvyo8di0AUC3KLjibAE WYYa01Gk F2+DkfxoH6pqYlpKsoipq1aGV+OXLUeub8eTBFcYII3+JWnuY1sw084lmhdgn8DkR5m7uo+btIq9FOt7nSl7s0O6mIyEkl8aPCWvpsMMGcozUMFxsDUe6yZa0VnTqNXQd6KI6CV9ZnahfQbcjWSjX722LcXvOHsEGS41VCI+Dhee6JwOlAnFPvpvcKeULUd2eNadxvXP757s9EoYMkPHUYghnLHg+tq1T+SfXomISmOxH7JJCPm/sncPenusawaDXnnkSuIxqPVv7Bp3C/RRM/XomZ1uDKyOqfrfAPsWEbDt9SjaQC8DLyfoRHjCVFpWu+WIsyaQVd0URuM1rBcO63vEa9Ea8ybmsaBa5 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: LoongArch will override 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'. Signed-off-by: Huacai Chen Acked-by: Andrew Morton --- include/linux/mm.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/include/linux/mm.h b/include/linux/mm.h index 0436b919f1c7..7b0ee64225de 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -2207,11 +2207,6 @@ static inline int arch_make_folio_accessible(struct folio *folio) */ #include -static __always_inline void *lowmem_page_address(const struct page *page) -{ - return page_to_virt(page); -} - #if defined(CONFIG_HIGHMEM) && !defined(WANT_PAGE_VIRTUAL) #define HASHED_PAGE_VIRTUAL #endif @@ -2234,6 +2229,11 @@ void set_page_address(struct page *page, void *virtual); void page_address_init(void); #endif +static __always_inline void *lowmem_page_address(const struct page *page) +{ + return page_to_virt(page); +} + #if !defined(HASHED_PAGE_VIRTUAL) && !defined(WANT_PAGE_VIRTUAL) #define page_address(page) lowmem_page_address(page) #define set_page_address(page, address) do { } while(0)