From patchwork Wed Dec 18 14:53:49 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Qi Zheng X-Patchwork-Id: 13913819 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 51EF1E77187 for ; Wed, 18 Dec 2024 14:54:14 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C0F896B0095; Wed, 18 Dec 2024 09:54:13 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id BBF646B0096; Wed, 18 Dec 2024 09:54:13 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A87126B0098; Wed, 18 Dec 2024 09:54:13 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 89B5B6B0095 for ; Wed, 18 Dec 2024 09:54:13 -0500 (EST) Received: from smtpin25.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 0C76EA0F2B for ; Wed, 18 Dec 2024 14:54:13 +0000 (UTC) X-FDA: 82908373926.25.DB71B55 Received: from mail-pf1-f173.google.com (mail-pf1-f173.google.com [209.85.210.173]) by imf05.hostedemail.com (Postfix) with ESMTP id 67E62100011 for ; Wed, 18 Dec 2024 14:53:09 +0000 (UTC) Authentication-Results: imf05.hostedemail.com; dkim=pass header.d=bytedance.com header.s=google header.b=Qk+SS0o3; spf=pass (imf05.hostedemail.com: domain of zhengqi.arch@bytedance.com designates 209.85.210.173 as permitted sender) smtp.mailfrom=zhengqi.arch@bytedance.com; dmarc=pass (policy=quarantine) header.from=bytedance.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1734533617; 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=6TUhNjBa4fVG8Yt6uM+e86xq9oKyC2RcGzSRFYrqHQk=; b=KqxwS2AIfwQkY2oENcD5MhAz2Ix9PyJWohMLBMblZRjD7glzjIOi5tXaPRpI/9luWxVHrX HcJVtsWHcurTN5Gq1KVaLEs2gCYsUuzbKll+M+utDqRhopW+k9OxGe1Rt6JVeG8cH1+aqJ WvR5rv1kho9UibSVxUnEgVj8Sj8x8j4= ARC-Authentication-Results: i=1; imf05.hostedemail.com; dkim=pass header.d=bytedance.com header.s=google header.b=Qk+SS0o3; spf=pass (imf05.hostedemail.com: domain of zhengqi.arch@bytedance.com designates 209.85.210.173 as permitted sender) smtp.mailfrom=zhengqi.arch@bytedance.com; dmarc=pass (policy=quarantine) header.from=bytedance.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1734533617; a=rsa-sha256; cv=none; b=WrWt5xVP5jtXOPoqlaYqqaky4A+l/RibWes43Q3a2RPzA6M8/JLnVUj9kBJIpae6Gi2wHw FHoriH1aixSjPrlEnw4h/6vQkbA5/cXZvg0lXHgFkVw8sn6CGWVz6Mey0JHkJ/hvlnZVxO 4yOB1s0Ylk/PFShEEW6GyFGcE+nbepc= Received: by mail-pf1-f173.google.com with SMTP id d2e1a72fcca58-725ea1e19f0so5805998b3a.3 for ; Wed, 18 Dec 2024 06:54:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance.com; s=google; t=1734533649; x=1735138449; darn=kvack.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=6TUhNjBa4fVG8Yt6uM+e86xq9oKyC2RcGzSRFYrqHQk=; b=Qk+SS0o3GlImIz7hsDeyF2RTzzFDdRPln2irbMVIDjiJCcUzC49VvY8J0YD7pygne3 apLO+xmZSEEgWBjS1ZB8k85oLJPjC3qvBP6GQ+5H2YtwrZaNL9cbXFKbYgcvAlCL6W1w xX46U3Ccv8NjMfvrcJpZRpZR437xEkyzdSf3gDplmRVklVvV83yudjbB8+hyoIl7GWrZ GdLqi394LGGA5g/7NFeEc+tGKlBnIOlzgIsMhs//fA9q635k5EfraY3O0klQKQpgUZQn 5RsCC+Hdg9sdQtjQziuWHkrNRlCSF1a7+aeGez2YHN0F81OY/RmEPoI4+IjzqjZH4PIf tZ7g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734533649; x=1735138449; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=6TUhNjBa4fVG8Yt6uM+e86xq9oKyC2RcGzSRFYrqHQk=; b=hAvf2TkmNiDMT5AGrmxD/0KfPXau1VlxjC7sC7eN/fkKOK4osbstIYDXDsKBEhVDmk +pqM/VBMtgOJXaKYQ+wBpo7WHHMnvOypcACAoFAzNLThoavlgSeTUSxa1ChWHmqtTac8 T2+qP1Amj93D4V/cX8eDE3pbeidn80WlD/yOMrEirHT+ud79/aI023EyJ7AVIbfJHGJU r1tXNQfzPqstCV8fsa/A69zPfGcr67aV42/1oTW5fWQ3m6vVo+K6jECrRFTtuYL0jUn5 HsFYDskdQGsyISP+mv/KeuEbJevJ+h4wiDYp/KbVBC7t6IRW7aJKV23pc0cu3JfeCf4X SbDQ== X-Gm-Message-State: AOJu0YwpzPHEWxuTkcr4YuqyAtA09QIl2zPGk8yD3WkTVyW1PJCbFBEx 4mGEfg0zrTn3jWsKpqLLulzYmbrha4CBkLBAH3q9vGEdoAwbsTKAVDX0lHEj4Eg= X-Gm-Gg: ASbGncuE+bHCC2r6ell5wz5VHrBZ87PUbqKcODYDcUVguSeHMHhbeZH6Ouv3ZRCeZdY 1y/zQHIYf/eIf0aTNevXL9o1k3eVXp7k5ThZr9gQMeMA0K+7Os5SlEyZg8HN/l0xdVD3+FUqSR5 7vnXZD8UpLNF2yzpWLIzi3UHShVV58GdwmS95Z7mSKWv6Vxl1O3pqWlpWn+zS9/rjDVmNXqD7r6 EOL9MZkMkG82sVJK8hMGCafWQ56hBBu+3NXjcV7PfrsPjBTaAID/R21Ew7nsmVgsx/xwgbI8eOs SQ3f1RMiaAv8YNaO/3pnN4eqXZX5 X-Google-Smtp-Source: AGHT+IGAv5ebUTcmFj1+CQHWcTyO3FMZbJhgBBLwAa5KNiAkWvuab0Vl1frY4xAv6WdOkoqOhQZfjw== X-Received: by 2002:a05:6a00:2189:b0:71e:e4f:3e58 with SMTP id d2e1a72fcca58-72a8d2a5c0bmr5568200b3a.17.1734533648641; Wed, 18 Dec 2024 06:54:08 -0800 (PST) Received: from C02DW0BEMD6R.bytedance.net ([2409:8a28:f4f:a9a4:df6:1df4:e2c5:1e97]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-72918ad5670sm8616375b3a.70.2024.12.18.06.54.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Dec 2024 06:54:08 -0800 (PST) From: Qi Zheng To: peterz@infradead.org, tglx@linutronix.de, david@redhat.com, jannh@google.com, hughd@google.com, yuzhao@google.com, willy@infradead.org, muchun.song@linux.dev, vbabka@kernel.org, lorenzo.stoakes@oracle.com, akpm@linux-foundation.org, rientjes@google.com, vishal.moola@gmail.com, klarasmodin@gmail.com Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, Qi Zheng Subject: [PATCH v2 02/15 fix] fix: mm: pgtable: introduce generic p4d_alloc_one() and p4d_free() Date: Wed, 18 Dec 2024 22:53:49 +0800 Message-Id: <20241218145349.96025-1-zhengqi.arch@bytedance.com> X-Mailer: git-send-email 2.24.3 (Apple Git-128) In-Reply-To: References: MIME-Version: 1.0 X-Rspamd-Server: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mMRn8MAp pHAlVi7L +iXgwoOzjPRSuX/omVUcWgkZ0kifgsgsYEy/KWa9jTjiHqE7OU27r/KYMbKrsGTg8QK6kLI9+9BWG888QA5nlsKGTdLA2c0/l7Jdg4hFt92xRc717cSfEfMa+/rLpu53j80BmflR53dHudBNnj5Wahl75hOUM5PkC4vS0JmFWPf1OzLswwxSNIDaTPxAJQ/Yf7bkY9fIkqTVQg31Sus3Ew8/a021GRIKkssMvxO4Eycv6qsE3c0Y5Tay2dBfOwjUWcaxWw12zPF+UqI4hquXr8qyeN0M4gKUqzfbq7n8OCtItGHwpYH+JRFGbYqvLBthLyuNV8Ws7yCLsxVd4IztNUBt560jhWXW+reIjnsgTzcuIRzUSNpzjNtp4suIsUaVGi/RaJZ5UyBMhr9dZACVrcSMoxp+ZcegtXvtJoebPqNKKzTav6gUyHP89V+0bGsN3StONtiUxvJXRIssiRnaudjHiyLDjb4KDrQaL9Ogoow/Iw4xBxIDDbABiOg== X-Bogosity: Ham, tests=bogofilter, spamicity=0.028252, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: Klara Modin reported the following build error: In file included from /home/klara/git/linux/arch/riscv/include/asm/kfence.h:8, from /home/klara/git/linux/mm/kfence/core.c:34: /home/klara/git/linux/include/asm-generic/pgalloc.h: In function ‘p4d_free’: /home/klara/git/linux/include/asm-generic/pgalloc.h:252:24: error: passing argument 2 of ‘__p4d_free’ from incompatible pointer type [-Wincompatible-pointer-types] 252 | __p4d_free(mm, p4d); | ^~~ | | | pud_t * /home/klara/git/linux/include/asm-generic/pgalloc.h:244:60: note: expected ‘p4d_t *’ but argument is of type ‘pud_t *’ 244 | static inline void __p4d_free(struct mm_struct *mm, p4d_t *p4d) | ~~~~~~~^~~ In file included from /home/klara/git/linux/arch/riscv/include/asm/kfence.h:8, from /home/klara/git/linux/mm/kfence/report.c:22: /home/klara/git/linux/include/asm-generic/pgalloc.h: In function ‘p4d_free’: /home/klara/git/linux/include/asm-generic/pgalloc.h:252:24: error: passing argument 2 of ‘__p4d_free’ from incompatible pointer type [-Wincompatible-pointer-types] 252 | __p4d_free(mm, p4d); | ^~~ | | | pud_t * /home/klara/git/linux/include/asm-generic/pgalloc.h:244:60: note: expected ‘p4d_t *’ but argument is of type ‘pud_t *’ 244 | static inline void __p4d_free(struct mm_struct *mm, p4d_t *p4d) | Just fix it. Reported-by: Klara Modin Signed-off-by: Qi Zheng --- include/asm-generic/pgalloc.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/asm-generic/pgalloc.h b/include/asm-generic/pgalloc.h index 370f5b579ff88..e73416b2b53a8 100644 --- a/include/asm-generic/pgalloc.h +++ b/include/asm-generic/pgalloc.h @@ -247,7 +247,7 @@ static inline void __p4d_free(struct mm_struct *mm, p4d_t *p4d) } #ifndef __HAVE_ARCH_P4D_FREE -static inline void p4d_free(struct mm_struct *mm, pud_t *p4d) +static inline void p4d_free(struct mm_struct *mm, p4d_t *p4d) { __p4d_free(mm, p4d); }