From patchwork Sun May 26 09:22:27 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Leroy X-Patchwork-Id: 13674218 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 6805BC25B75 for ; Sun, 26 May 2024 09:23:06 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 004C66B009D; Sun, 26 May 2024 05:23:06 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id EF81F6B009E; Sun, 26 May 2024 05:23:05 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id DBED76B009F; Sun, 26 May 2024 05:23:05 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id C56C26B009D for ; Sun, 26 May 2024 05:23:05 -0400 (EDT) Received: from smtpin18.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 41872C02D8 for ; Sun, 26 May 2024 09:23:05 +0000 (UTC) X-FDA: 82160007930.18.B8182E4 Received: from pegase1.c-s.fr (pegase1.c-s.fr [93.17.236.30]) by imf20.hostedemail.com (Postfix) with ESMTP id 3D5EE1C000B for ; Sun, 26 May 2024 09:23:03 +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-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1716715383; a=rsa-sha256; cv=none; b=kfWwxOt2F+unPLOe1eJt8JIHFfNhErmFo5SQ3nlzSH2p2q0B6Uoai4OtxZXs1lUQ5+Say3 eI7V7D7m9MSGCMqV0fU8DYnj6j94MvjDLUtZRkG1t96YKKvub0Coh9zpISL5YQjDZE/4hV sie0dIXFX3pPpvFcx2ewZDeCmrhHts8= 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 ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1716715383; 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=v2R/ykHk5ZeJinlv4+aQSJVNURRNOgy9IzDnetzgcVU=; b=uTLwptbCmoyN3lJ/xVAJVLZENC+Ya33+sc0i32gOBRQQLhn50aMR35wrdQppeDVxVAUDQq 3AdZvUYbdtDhZH6Kw7oJrocNl7xhv1I/GbzoREUSsinL/lGimsFD2FMyxO319eo0buNkqJ WJfyR4P4QKYgPNv8O1C9xDhyKNMArAo= Received: from localhost (mailhub3.si.c-s.fr [192.168.12.233]) by localhost (Postfix) with ESMTP id 4VnCwp15LKz9tHZ; Sun, 26 May 2024 11:22:34 +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 5IAzddTqHSYF; Sun, 26 May 2024 11:22:34 +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 4VnCwl4wkhz9tBX; Sun, 26 May 2024 11:22:31 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id A4FBA8B773; Sun, 26 May 2024 11:22: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 dWG07mPUpMKP; Sun, 26 May 2024 11:22:31 +0200 (CEST) Received: from PO20335.idsi0.si.c-s.fr (unknown [192.168.233.45]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 1ED728B764; Sun, 26 May 2024 11:22:31 +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 v3 07/16] powerpc/8xx: Fix size given to set_huge_pte_at() Date: Sun, 26 May 2024 11:22:27 +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=1716715343; l=918; i=christophe.leroy@csgroup.eu; s=20211009; h=from:subject:message-id; bh=14PrrCB4a2+6ypzEPLZ322xfrxYIQM2wn25R6xSXiBc=; b=kh3InX9YmF8QGKkVD+/iQqWsCuqq++5G9Oj7yTov8O3ch02WakowGYR43f60T/f6D84b5MmL9 Tx7lAM8OA6JDl3NxC3B56kpleXsSPn+lLcBmy5cbjgpxZ/bF/s/qa11 X-Developer-Key: i=christophe.leroy@csgroup.eu; a=ed25519; pk=HIzTzUj91asvincQGOFx6+ZF5AoUuP9GdOtQChs7Mm0= X-Rspamd-Queue-Id: 3D5EE1C000B X-Rspam-User: X-Rspamd-Server: rspam12 X-Stat-Signature: ez8ahw5tb3f5xkqncm1z95cnhpcfa6nn X-HE-Tag: 1716715383-996088 X-HE-Meta: U2FsdGVkX18GJRoKjeDdyGiBYW4tSL7lWvm3dDokQQTtYM5J3FM3hkVJs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CMpGpk679/LLEFLtUlD8l+k92LNfzstJTK3xMgRlYl6sBsGKoipij4Uew== 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; }