From patchwork Mon Jun 10 05:54:52 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Leroy X-Patchwork-Id: 13691509 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 73FE4C27C5E for ; Mon, 10 Jun 2024 05:55:33 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 07CEB6B00A3; Mon, 10 Jun 2024 01:55:33 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id EFA296B00A4; Mon, 10 Jun 2024 01:55:32 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D74756B00A5; Mon, 10 Jun 2024 01:55:32 -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 B97FE6B00A3 for ; Mon, 10 Jun 2024 01:55:32 -0400 (EDT) Received: from smtpin12.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 742E51C115D for ; Mon, 10 Jun 2024 05:55:32 +0000 (UTC) X-FDA: 82213916904.12.BECF755 Received: from pegase1.c-s.fr (pegase1.c-s.fr [93.17.236.30]) by imf20.hostedemail.com (Postfix) with ESMTP id 629F41C0007 for ; Mon, 10 Jun 2024 05:55:30 +0000 (UTC) Authentication-Results: imf20.hostedemail.com; dkim=none; spf=pass (imf20.hostedemail.com: domain of christophe.leroy@csgroup.eu designates 93.17.236.30 as permitted sender) smtp.mailfrom=christophe.leroy@csgroup.eu; dmarc=pass (policy=quarantine) header.from=csgroup.eu ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1717998930; 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-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=FK7xq7vg1hFjlKdNBvhx1wOeVtV+MZPtFyG/AWrqhmI=; b=LB4Rg1I+xJndkn2Gv8W1G3t0s0YaGl/BzowuF8NBvA4NZcdPO/rFv0HPMKhfBmpEKrRKxw tg+sqMFolAyWgVfsB2Imdq+azW/J4O/rSDGKfpt/YQnJgDQs+B+/U6kR/0nCVlp+RLLC+o ynShn4s0b7c+d0u/IwONnYGvISICciE= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1717998930; a=rsa-sha256; cv=none; b=5z9rcepDvoFNLHTSFvEMyBgb9SmI/dX8BcF9cz6ezNw9zDn95aN/DvB1B7zj1LJyDIPwR4 lebRw3jUQ8uVwdfUc6R+n6/gW75736Ivgp6jTtS7mVAraSNnRi/x75wazLSI6eOtSsb1lC brSPqG8kqbnS1py/BM+r7ztVD5Zbtt8= ARC-Authentication-Results: i=1; imf20.hostedemail.com; dkim=none; spf=pass (imf20.hostedemail.com: domain of christophe.leroy@csgroup.eu designates 93.17.236.30 as permitted sender) smtp.mailfrom=christophe.leroy@csgroup.eu; dmarc=pass (policy=quarantine) header.from=csgroup.eu Received: from localhost (mailhub3.si.c-s.fr [192.168.12.233]) by localhost (Postfix) with ESMTP id 4VyLcS1L81z9v53; Mon, 10 Jun 2024 07:55:04 +0200 (CEST) X-Virus-Scanned: amavisd-new at c-s.fr Received: from pegase1.c-s.fr ([192.168.12.234]) by localhost (pegase1.c-s.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id HMKBJr73Khg4; Mon, 10 Jun 2024 07:55:04 +0200 (CEST) Received: from messagerie.si.c-s.fr (messagerie.si.c-s.fr [192.168.25.192]) by pegase1.c-s.fr (Postfix) with ESMTP id 4VyLcL1pkDz9tpr; Mon, 10 Jun 2024 07:54:58 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 39AD58B764; Mon, 10 Jun 2024 07:54:58 +0200 (CEST) X-Virus-Scanned: amavisd-new at c-s.fr Received: from messagerie.si.c-s.fr ([127.0.0.1]) by localhost (messagerie.si.c-s.fr [127.0.0.1]) (amavisd-new, port 10023) with ESMTP id iN67h1_nWE2V; Mon, 10 Jun 2024 07:54:58 +0200 (CEST) Received: from PO20335.idsi0.si.c-s.fr (unknown [172.25.230.108]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 14E1E8B76E; Mon, 10 Jun 2024 07:54:58 +0200 (CEST) From: Christophe Leroy To: Andrew Morton , Jason Gunthorpe , Peter Xu , Oscar Salvador , Michael Ellerman , Nicholas Piggin Cc: Christophe Leroy , linux-kernel@vger.kernel.org, linux-mm@kvack.org, linuxppc-dev@lists.ozlabs.org Subject: [PATCH v5 07/18] powerpc/8xx: Fix size given to set_huge_pte_at() Date: Mon, 10 Jun 2024 07:54:52 +0200 Message-ID: X-Mailer: git-send-email 2.44.0 In-Reply-To: References: MIME-Version: 1.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1717998887; l=967; i=christophe.leroy@csgroup.eu; s=20211009; h=from:subject:message-id; bh=D5c7rc2WApQ3tCbzTNEVQ0Gk3Td9OpyCeDWt3oeDJWA=; b=dJoHG7aIvfUPrzPRx3YSvgp1SwHrQYbbiNyYety7x+77bjdeSwjb6oVPZkKxQNXopGxxXdAV9 PBe4k7lGHjrBdmk+Ggfy9UFF+7vCxTe1HbAmTB6X0OXBv8tzX6kEeUx X-Developer-Key: i=christophe.leroy@csgroup.eu; a=ed25519; pk=HIzTzUj91asvincQGOFx6+ZF5AoUuP9GdOtQChs7Mm0= X-Rspam-User: X-Stat-Signature: 9kep7athoez98apeeqhs85x6zi4sdaxt X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: 629F41C0007 X-HE-Tag: 1717998930-68136 X-HE-Meta: U2FsdGVkX1+fMqFF+9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FHnnFhPULH409jhCG7N0nX2Mh2qjGpJWDPqPdJzur9JZdDqxNpOUp1A384nn6u/0t/j+I= 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: set_huge_pte_at() expects the size of the hugepage as an int, not the psize which is the index of the page definition in table mmu_psize_defs[] Fixes: 935d4f0c6dc8 ("mm: hugetlb: add huge page size param to set_huge_pte_at()") Signed-off-by: Christophe Leroy Reviewed-by: Oscar Salvador --- arch/powerpc/mm/nohash/8xx.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/powerpc/mm/nohash/8xx.c b/arch/powerpc/mm/nohash/8xx.c index 43d4842bb1c7..d93433e26ded 100644 --- a/arch/powerpc/mm/nohash/8xx.c +++ b/arch/powerpc/mm/nohash/8xx.c @@ -94,7 +94,8 @@ static int __ref __early_map_kernel_hugepage(unsigned long va, phys_addr_t pa, return -EINVAL; set_huge_pte_at(&init_mm, va, ptep, - pte_mkhuge(pfn_pte(pa >> PAGE_SHIFT, prot)), psize); + pte_mkhuge(pfn_pte(pa >> PAGE_SHIFT, prot)), + 1UL << mmu_psize_to_shift(psize)); return 0; }