From patchwork Wed Apr 3 01:32:49 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Xu X-Patchwork-Id: 13614864 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 974C7CD11C2 for ; Wed, 3 Apr 2024 01:33:04 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 4D7BB6B0088; Tue, 2 Apr 2024 21:33:00 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 460EB6B0089; Tue, 2 Apr 2024 21:33:00 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2D9DD6B008A; Tue, 2 Apr 2024 21:33:00 -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 0472F6B0088 for ; Tue, 2 Apr 2024 21:32:59 -0400 (EDT) Received: from smtpin21.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id B06FDA1033 for ; Wed, 3 Apr 2024 01:32:59 +0000 (UTC) X-FDA: 81966496878.21.6B1D61A Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf29.hostedemail.com (Postfix) with ESMTP id 99352120017 for ; Wed, 3 Apr 2024 01:32:57 +0000 (UTC) Authentication-Results: imf29.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=FdxrEUo6; spf=pass (imf29.hostedemail.com: domain of peterx@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=peterx@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1712107977; 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=PR/NBCt+5qJ4X31foyrecLlAlU9UbBCiiBiwAD7jaH8=; b=EDukoSVwT9Zm87qt3sLG86372z0mOAN1bYk6vvDIIl75THchIfTap70bp+ZdJ/L7kgXt8S vxTgAQrIERJpeCxBf5Sh5ZjAEEmQMby+sm1vtrFlHWwWu6/pUfPVOM/vTeQyty0Hh2fUTn rutBGUTkjOVxebNOWpT/TmYe7y8I94E= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1712107977; a=rsa-sha256; cv=none; b=bMzBAqVIMJl/cLjbYE61c+tGrjcEdPQ/ZFx9M2TLALID+fBYNtsvIwUGNtAAxN3J3XmvtJ 3CUD+c69PFkwpTZv3uw+ogPLN0tJoRSMsR5xEM4syL73MPPJrWcwsCCFIKzFfmmjosOVo5 r9BZBBMukZhtXFF3MhHcS1wM5ogVH9o= ARC-Authentication-Results: i=1; imf29.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=FdxrEUo6; spf=pass (imf29.hostedemail.com: domain of peterx@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=peterx@redhat.com; dmarc=pass (policy=none) header.from=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1712107977; h=from:from: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=PR/NBCt+5qJ4X31foyrecLlAlU9UbBCiiBiwAD7jaH8=; b=FdxrEUo6wFSgOOFz7oF5QcO+6f5q47MHFDEAYapSATTxnembeBln8wXXAuxo85BrJY2kU5 ylmEUeGvGuCMmu2/tM6OxHQ+djz0/xE50pPskDl2hCM49Tm2+0oXTLN4TcCnyAzRcQZQA9 AmkBzrCTRxSUYpuR5u4By93PNHzlNcw= Received: from mail-qk1-f199.google.com (mail-qk1-f199.google.com [209.85.222.199]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-274-6w4bW0YGMwWaNa4oxPjaSQ-1; Tue, 02 Apr 2024 21:32:55 -0400 X-MC-Unique: 6w4bW0YGMwWaNa4oxPjaSQ-1 Received: by mail-qk1-f199.google.com with SMTP id af79cd13be357-78a547efbaeso48384685a.0 for ; Tue, 02 Apr 2024 18:32:55 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712107975; x=1712712775; 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=PR/NBCt+5qJ4X31foyrecLlAlU9UbBCiiBiwAD7jaH8=; b=NyB1Um+lIpiCF7bpfE3RN4lY9cnOFS7b4YypQ/ppFnxLdEueeASAYXOSeXVJDk02zp obNa9FhUJcdujvu//odB6H53jo7XKbBNnSftAmBHihKE/I8WQ1uw8x/41n2qomqNZ3CZ V5dLTZTurH7VlgVwOl9wkrFI/SLXNXWGy0ag+BERDvkQlnGf/XNPUL4WX1KpYYjbEWlB pXgSnd7MemqG3p6Bibh5yyaw9pzEQzHzIw5lszAbY18mmqzyun7DUMUWI9dAKl4FkC55 kjmvvsRJkbJpR1DovTsSJC4/jIaDNMZIBBdZGGCatZ0Rj4egpWLvJooF+XGxCKXtqgjX L8Vw== X-Gm-Message-State: AOJu0YwvAY3wRI6CYHx6LMMX1MNGemA5y4NG3PBOnv1CE/G2aXExVXE3 wW30LAK9OdnwOmhz9xEv+SqhssUDpHqorZi4SK3JGqqcavadoVleayIzpRTWNkLCBIJepx3vi27 PqG4bhdWAwymLLvKDcrdH1Aap6RUTruyuVAhPfgjJR0Q7gSPzJ0HHvFmdkMrKy0g2RBF4pxb2wI ai1ouQjHPSJIlaa0Fhbpff4WtKuQGboQ== X-Received: by 2002:ad4:46d3:0:b0:698:fc78:21ae with SMTP id pm19-20020ad446d3000000b00698fc7821aemr9828997qvb.6.1712107974990; Tue, 02 Apr 2024 18:32:54 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEDjHRAOIt7pAcFSSzP58lew6Exi/iOo8/2ozkB/HO9HAPtSJzX+RWcE9OqEaW9cSxSEbXVlA== X-Received: by 2002:ad4:46d3:0:b0:698:fc78:21ae with SMTP id pm19-20020ad446d3000000b00698fc7821aemr9828970qvb.6.1712107974456; Tue, 02 Apr 2024 18:32:54 -0700 (PDT) Received: from x1n.redhat.com ([99.254.121.117]) by smtp.gmail.com with ESMTPSA id qm18-20020a056214569200b0068ff8bda6c7sm6031687qvb.92.2024.04.02.18.32.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Apr 2024 18:32:54 -0700 (PDT) From: peterx@redhat.com To: linux-mm@kvack.org, linux-kernel@vger.kernel.org Cc: Huacai Chen , peterx@redhat.com, David Hildenbrand , Jason Gunthorpe , Nathan Chancellor , Andrew Morton , Matthew Wilcox , WANG Xuerui , Ryan Roberts , loongarch@lists.linux.dev Subject: [PATCH 3/3] fixup! mm/arch: provide pud_pfn() fallback Date: Tue, 2 Apr 2024 21:32:49 -0400 Message-ID: <20240403013249.1418299-4-peterx@redhat.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240403013249.1418299-1-peterx@redhat.com> References: <20240403013249.1418299-1-peterx@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Rspamd-Queue-Id: 99352120017 X-Rspam-User: X-Rspamd-Server: rspam11 X-Stat-Signature: nyxgfyghs3a4z6s95b6848frk1b7h6j3 X-HE-Tag: 1712107977-824637 X-HE-Meta: U2FsdGVkX18Ljfjj15fD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iSVpa8GUV2mh2nkYZN3SCL2IYfwmeNfhxxyUnZIunR2gxVaZYIUsn7xN3FE6lHWCSFGZTSW5TJ00cbbQJJZzYHKC452Wfi1Y0jqV65SFIqWtR/ML5y6lM67RRPaJn0Sn59XnH9ObBwslKv84NFkuvqJTf4sqBvWdzFUvvtDnhDvH3mnd/yJrPCS9S7/5pO7POH1Tv3mi+R+tJvj/5cLY5N2OTpbBI78NFKsATH5KWWlDScmMAB5qrgy4Z2JbG07FsoNaDFUiNiknrumAXPgm7jk0tJKWuK48dWUbJq50J8CPvm+bB/vUUvKgGDY31QAjrgNtFsFJNJtcTKAqlc7FMcTxqR1eXWjgjXVDGOR9/BG 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: Peter Xu Signed-off-by: Peter Xu --- include/linux/pgtable.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/include/linux/pgtable.h b/include/linux/pgtable.h index fa8f92f6e2d7..0f4b2faa1d71 100644 --- a/include/linux/pgtable.h +++ b/include/linux/pgtable.h @@ -1882,9 +1882,13 @@ typedef unsigned int pgtbl_mod_mask; * code. Now it happens too for pud_pfn (and can happen for larger * mappings too in the future; we're not there yet). Instead of defining * it for all archs (like pmd_pfn), provide a fallback. + * + * Note that returning 0 here means any arch that didn't define this can + * get severely wrong when it hits a real pud leaf. It's arch's + * responsibility to properly define it when a huge pud is possible. */ #ifndef pud_pfn -#define pud_pfn(x) ({ BUILD_BUG(); 0; }) +#define pud_pfn(x) 0 #endif /*