From patchwork Tue Jul 2 13:51:24 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Leroy X-Patchwork-Id: 13719688 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 EB45CC3064D for ; Tue, 2 Jul 2024 13:52:23 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 7D9456B00C6; Tue, 2 Jul 2024 09:52:23 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 785E66B00C7; Tue, 2 Jul 2024 09:52:23 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 64ECB6B00C8; Tue, 2 Jul 2024 09:52:23 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 44A676B00C6 for ; Tue, 2 Jul 2024 09:52:23 -0400 (EDT) Received: from smtpin25.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 044991C0884 for ; Tue, 2 Jul 2024 13:52:22 +0000 (UTC) X-FDA: 82294952166.25.B042A77 Received: from pegase1.c-s.fr (pegase1.c-s.fr [93.17.236.30]) by imf08.hostedemail.com (Postfix) with ESMTP id EC395160021 for ; Tue, 2 Jul 2024 13:52:20 +0000 (UTC) Authentication-Results: imf08.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=csgroup.eu; spf=pass (imf08.hostedemail.com: domain of christophe.leroy@csgroup.eu designates 93.17.236.30 as permitted sender) smtp.mailfrom=christophe.leroy@csgroup.eu ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1719928322; a=rsa-sha256; cv=none; b=uc+GzKyq930J/aekCLYN6RFN5fW/V2hgVB2cKZoi6n1FxyaBRQ0Q0H78BnCREQgY9IF6xS 9rtWSMsLqsehpoogjLrH13n+B9A68CsDq5qbgqM0C4WIFgKWHTubW5ymtT0CDJnKGCW6w7 y0+yK564bIKRvyRqLD/amnNoXv9eLlw= ARC-Authentication-Results: i=1; imf08.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=csgroup.eu; spf=pass (imf08.hostedemail.com: domain of christophe.leroy@csgroup.eu designates 93.17.236.30 as permitted sender) smtp.mailfrom=christophe.leroy@csgroup.eu ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1719928322; 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=TKP93e3OZTYMdLtpSH58IC5vXzyDe7c7VteCnsdaT3D07gJt+bPW89NfdqUvdcoutXbtaj AqqpA5zt9PbGAhc3nvtIiJVTDzV8u+b2ECp7rF9PW6A5oO8/7iBMbVKfgpT9b+A2RZEyHc Zi2ygGtmhbEUaoCZS2H0MehErGcuhYo= Received: from localhost (mailhub3.si.c-s.fr [192.168.12.233]) by localhost (Postfix) with ESMTP id 4WD4890hHzz9v49; Tue, 2 Jul 2024 15:51:37 +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 6zAmKaaQ0jHm; Tue, 2 Jul 2024 15:51:37 +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 4WD4833KVRz9tZl; Tue, 2 Jul 2024 15:51:31 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 6CAF78B774; Tue, 2 Jul 2024 15:51:31 +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 zXEONt1F524O; Tue, 2 Jul 2024 15:51:31 +0200 (CEST) Received: from PO20335.idsi0.si.c-s.fr (unknown [192.168.233.12]) by messagerie.si.c-s.fr (Postfix) with ESMTP id E3F168B764; Tue, 2 Jul 2024 15:51:30 +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 v7 12/23] powerpc/8xx: Fix size given to set_huge_pte_at() Date: Tue, 2 Jul 2024 15:51:24 +0200 Message-ID: <97f2090011e25d99b6b0aae73e22e1b921c5d1fb.1719928057.git.christophe.leroy@csgroup.eu> 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=1719928275; l=967; i=christophe.leroy@csgroup.eu; s=20211009; h=from:subject:message-id; bh=D5c7rc2WApQ3tCbzTNEVQ0Gk3Td9OpyCeDWt3oeDJWA=; b=uQUtdIUq84SS96MK3Yyi7eFh/R82rncNurgunjBL3cKhAN7hd4/KdduSVyWl3x7FwJ20kvEBT AAWK0LcoeyYCOlx3G8nxXwuG1GtSCMyrGnv/4xWUvckGvRl6DFLaV/A X-Developer-Key: i=christophe.leroy@csgroup.eu; a=ed25519; pk=HIzTzUj91asvincQGOFx6+ZF5AoUuP9GdOtQChs7Mm0= X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: EC395160021 X-Stat-Signature: 36yexdiec8zmeti4pmmtfrnrb35cerea X-Rspam-User: X-HE-Tag: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fbBGlqRrPrd0zEox1iC6r2cX/twmwGHElnESaFpSBA+tQvwxxyxDKyHlRbo9qnDulaeJ3WfOneezkkTERo+a1JBTVQTQGTfC+BmS7JcsLOWjNk= 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; }