From patchwork Fri May 17 19:00:00 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Leroy X-Patchwork-Id: 13667314 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 A0E88C04FFE for ; Fri, 17 May 2024 19:00:35 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 394816B009A; Fri, 17 May 2024 15:00:35 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 31E576B009B; Fri, 17 May 2024 15:00:35 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 1E6F76B009C; Fri, 17 May 2024 15:00:35 -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 028E16B009A for ; Fri, 17 May 2024 15:00:34 -0400 (EDT) Received: from smtpin28.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 7A05016049A for ; Fri, 17 May 2024 19:00:34 +0000 (UTC) X-FDA: 82128803988.28.F8CFA48 Received: from pegase1.c-s.fr (pegase1.c-s.fr [93.17.236.30]) by imf19.hostedemail.com (Postfix) with ESMTP id 75CD61A0004 for ; Fri, 17 May 2024 19:00:32 +0000 (UTC) Authentication-Results: imf19.hostedemail.com; dkim=none; spf=pass (imf19.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=1715972432; 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=THJenixcLCEKPbWQL/7wBEtGEkZb/a1kheQ1FVFnpSg=; b=UDTm/uHF2Ge6ZcRqqAOJCgzKww9Xii+kgiTsDmIbLyuc83G4BA2ip3b3kaDw8SStN3CflF CbebFVDEIIgHvo3kUybCiNYeZArhVkSMXg3EHa/7dMN1miwHyawbLj8A7j98rLDhy/Hm/t VC7r3/2u0rvhh6XpRkry6dZRlzCAsko= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1715972432; a=rsa-sha256; cv=none; b=ALkuXSKLoe0IZdFO1AHvFL4pdQFrxQ04THDj6swWMrPCCuiEffvZgq2u/nvWn9ESyArY5i 5essp5DZ1nE/gFjgWHd+/nW4wuocZszqnLTEI9PYJcB504lGxZ5yGWbndv7OC1p+xK1Co/ Lb7ShXI8DfXh713Pp5EppdjqANWKik0= ARC-Authentication-Results: i=1; imf19.hostedemail.com; dkim=none; spf=pass (imf19.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 4Vgx9Q3vS0z9t1J; Fri, 17 May 2024 21:00:10 +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 wn4ZCLJ6Jmpw; Fri, 17 May 2024 21:00:10 +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 4Vgx9L4MS7z9sv8; Fri, 17 May 2024 21:00:06 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 9167C8B775; Fri, 17 May 2024 21:00:06 +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 GDVjEHegVUU1; Fri, 17 May 2024 21:00:06 +0200 (CEST) Received: from PO20335.idsi0.si.c-s.fr (unknown [192.168.232.121]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 0D7EC8B766; Fri, 17 May 2024 21:00:06 +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: [RFC PATCH v2 06/20] powerpc/8xx: Fix size given to set_huge_pte_at() Date: Fri, 17 May 2024 21:00:00 +0200 Message-ID: <04f4e737608ea0b177b88057db138fbf0d6ab138.1715971869.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=1715972396; l=902; i=christophe.leroy@csgroup.eu; s=20211009; h=from:subject:message-id; bh=1GF1AP8tajvOLO+5SI7vVcCcLKzzL1YzSZ6WjpVPsw8=; b=IoskHevYmLAROXWm3Bla0EeNdkO8Ms0H48szoFx+ijylMn/U7znhO/J36x3c1ZmqLZveNFdLf 4Wdtrm4IX4aCKC2WiUHsJ1pg9pKyKmjBwmsEssdpkJRnTzyOgJQlVQS X-Developer-Key: i=christophe.leroy@csgroup.eu; a=ed25519; pk=HIzTzUj91asvincQGOFx6+ZF5AoUuP9GdOtQChs7Mm0= X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: 75CD61A0004 X-Rspam-User: X-Stat-Signature: dh7degcs6chzjygputpein7jtwiun5hm X-HE-Tag: 1715972432-654991 X-HE-Meta: U2FsdG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K4pW3hhV9w5/otc73pggil50c/ECrvkZMoH/QFZd06ZZpqV/RHz9/u8DC+dvYE0RsxmDUmhwVWHM= 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 real page size, 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; }