Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp2808112lqp; Mon, 25 Mar 2024 09:44:44 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXggWbOdtbq2WbFrguy/q8OZy9bYA2c/Yneb8AORtBdG2wMLya7aRmkLZ4KVdzZu+nqA2JTLtFLOsE4fp4jyboRh5NAxhq6JQ6ZNTyJTA== X-Google-Smtp-Source: AGHT+IHD9Jv2kn90NgBCVLCrqEP4dfXxFXa4ZgSWdcqFWUUzU63Kou68+nu2GFQ9xdsJL6jwFNno X-Received: by 2002:a17:907:bb94:b0:a46:8c10:c75a with SMTP id xo20-20020a170907bb9400b00a468c10c75amr4900834ejc.38.1711385083914; Mon, 25 Mar 2024 09:44:43 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711385083; cv=pass; d=google.com; s=arc-20160816; b=l9Y1M4299gv8ao09rzAZ2aZyqCPgKXN7zpL5AWdIrK1CeeA5baES0jgJZBpBwQBqbT 7CFininhxll/u1w8lGr1jzS2+FoKA7zoBDAiYugddVX2pgyk7me2QhuDJEyZXWr02q8Q S/nVQ1G33wLD+kCqUFT7vkEEbKyjkVgwJ6nt5QiEQRGB3kSri0jKB6U57q5PoecdnyQ+ HFUYH/BJjb6psEEfl9fwhhaeRM4giyofAFgV8svhailYXd+gl4SO1ZR+dFaAUETALu/R wJyDOft2v5mkCRpsRGC8WlDX9kOQ+c6dJJYrd2C7yVKQZaF/iaa5rQGRuK+FWDp4eEmA +fdw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from; bh=qZ5KCYPj4SMvT/HBTq5bq8L6nreeyk6uwD9/N46B+Gs=; fh=21vk3J0tHc4wgg3UxOCfvUnkixvoiEd7I94CvMLI7/8=; b=Eaz6lK8LsNVkGjqMY9xXzaJb7fygZyYnbaXI1wJ82IV403T21Bix036qsOvF/yisoN V69NlijROTj3l+V/HXe11XQ3S6gO2iY+56NiyFGzaSBtK9Nw8fiPcwSV8masvm8/OQ58 iOZADoxEJqdku/YxXnEZGfMBGlJn4thuzKr4drBJSn9IbHzKxSxJrjOEQ4z/HLj9DA9+ LpTI91DByZx8Hzp7U86R4BCpn03xjh9SKq8M5xjmr1wcvqhUeAzdoS0vCeMSkJ1Ib9NR /s9P4bcwHS/zuUNJDrPVDf91f3psjlSYwqzmxVjvneIieDJkxB1uragZXf/9phNDYH8K Mx/w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=csgroup.eu dmarc=pass fromdomain=csgroup.eu); spf=pass (google.com: domain of linux-kernel+bounces-117305-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-117305-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=csgroup.eu Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id k27-20020a17090632db00b00a4a346bd0b4si1014938ejk.279.2024.03.25.09.44.43 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Mar 2024 09:44:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-117305-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=csgroup.eu dmarc=pass fromdomain=csgroup.eu); spf=pass (google.com: domain of linux-kernel+bounces-117305-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-117305-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=csgroup.eu Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id EFF5F1F37FEE for ; Mon, 25 Mar 2024 16:44:13 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E7EBF1703A1; Mon, 25 Mar 2024 14:56:47 +0000 (UTC) Received: from pegase1.c-s.fr (pegase1.c-s.fr [93.17.236.30]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 976491703AD for ; Mon, 25 Mar 2024 14:56:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=93.17.236.30 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711378607; cv=none; b=plEtjGXGjiFOzHrecp1DU4cJlUSHxYeWfyt/QF3KqeVDrPYL3t3zlFAVpjVd27QUJXwp6EtyaJxa6eyN+43HVjreN6nfkwO0YiPf9gdadfjU7X9CoZj5YwyqN9253FfQSdTbLKQqGbVL8TPpscSixWmauOxubj0MACz3F6MOb98= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711378607; c=relaxed/simple; bh=Lt4RxvANgRMdtDBAVPsx//g2luBxg6RgUDKkYHSTyhY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=uBYGWfyhdKXhW6YY20vAu/mFYFaLK0N8STdM378U+7covZsgIwBcEa8Fu7wAp3dk6zxGaWD6rOnKGABcVsI3NdGGexz1Ap7sgbO+H+e+G0zZs89xj4YOyj2GMQM8K6v2MHnb0GgPsWZv3FvIdEmD2vbmSap1z+hKkep2Wvne+No= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=csgroup.eu; spf=pass smtp.mailfrom=csgroup.eu; arc=none smtp.client-ip=93.17.236.30 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=csgroup.eu Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=csgroup.eu Received: from localhost (mailhub3.si.c-s.fr [192.168.12.233]) by localhost (Postfix) with ESMTP id 4V3GGT3g45z9snj; Mon, 25 Mar 2024 15:56:17 +0100 (CET) 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 CGKskKphEDJv; Mon, 25 Mar 2024 15:56:17 +0100 (CET) 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 4V3GGK5rj0z9scH; Mon, 25 Mar 2024 15:56:09 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id C557B8B765; Mon, 25 Mar 2024 15:56:09 +0100 (CET) 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 sXq_S5qTELHS; Mon, 25 Mar 2024 15:56:09 +0100 (CET) Received: from PO20335.idsi0.si.c-s.fr (unknown [172.25.230.108]) by messagerie.si.c-s.fr (Postfix) with ESMTP id A4DC88B76E; Mon, 25 Mar 2024 15:56:09 +0100 (CET) From: Christophe Leroy To: Andrew Morton , Jason Gunthorpe , Peter Xu Cc: Christophe Leroy , linux-kernel@vger.kernel.org, linux-mm@kvack.org, linuxppc-dev@lists.ozlabs.org Subject: [RFC PATCH 6/8] powerpc/8xx: Fix size given to set_huge_pte_at() Date: Mon, 25 Mar 2024 15:55:59 +0100 Message-ID: X-Mailer: git-send-email 2.43.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1711378567; l=902; i=christophe.leroy@csgroup.eu; s=20211009; h=from:subject:message-id; bh=Lt4RxvANgRMdtDBAVPsx//g2luBxg6RgUDKkYHSTyhY=; b=c9gTmd1HGEGsfYiLHRnhana1OzLTL6trd8ka61OZyKCy5KH57OasGxcAO+/VSMoNQJJQ2bs+v xysdBK83WZFAJyRPxyzJLps05TlJdfoMccQzAAXNNuMiV2r8FUxHCkC X-Developer-Key: i=christophe.leroy@csgroup.eu; a=ed25519; pk=HIzTzUj91asvincQGOFx6+ZF5AoUuP9GdOtQChs7Mm0= Content-Transfer-Encoding: 8bit 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 --- 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 6be6421086ed..70b4d807fda5 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; } -- 2.43.0