From patchwork Sat Nov 27 02:04:48 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Oltean X-Patchwork-Id: 1560648 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=nxp.com header.i=@nxp.com header.a=rsa-sha256 header.s=selector2 header.b=Zv8sQ5VE; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ozlabs.org (client-ip=112.213.38.117; helo=lists.ozlabs.org; envelope-from=linuxppc-dev-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org; receiver=) Received: from lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4J1FMH6kCdz9sS8 for ; Sat, 27 Nov 2021 13:05:47 +1100 (AEDT) Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4J1FMH1v13z3cR1 for ; Sat, 27 Nov 2021 13:05:47 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=nxp.com header.i=@nxp.com header.a=rsa-sha256 header.s=selector2 header.b=Zv8sQ5VE; dkim-atps=neutral X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=permerror (SPF Permanent Error: Void lookup limit of 2 exceeded) smtp.mailfrom=nxp.com (client-ip=2a01:111:f400:7e1b::62f; helo=eur05-am6-obe.outbound.protection.outlook.com; envelope-from=vladimir.oltean@nxp.com; receiver=) Authentication-Results: lists.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=nxp.com header.i=@nxp.com header.a=rsa-sha256 header.s=selector2 header.b=Zv8sQ5VE; dkim-atps=neutral Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2062f.outbound.protection.outlook.com [IPv6:2a01:111:f400:7e1b::62f]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4J1FLx08KSz2yQ9 for ; Sat, 27 Nov 2021 13:05:26 +1100 (AEDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NJgczmkctn0K9Oz4pXrIZAq3/MhvJCZpkpJubyLtEte5QEVLvuo2DyL8mX8cZaZ2KYd4zUrpb0W+bFCBS1GZGRmix4mk/vJCpJmK1LA+D41vAnWbCqCg4Td42fnodKsvNgqjK6fFCtQuAam2Sni9aK6G8zX8dvq3XkBZalsyh6Ph4rlIKdMwbAJNGhFYHyTEUs/RWXCjMu0gEPQimnixZEtmdkLhGKzwSdRhYxD4Hcwc9whr+0rSQENq5S5/8yQGkIFdqv1X50+nmoDfOHrmRDDIqHbe15FukEqAnDmP8P7xwTqAUxXVB1yiJpJsQPdgqBEy/i/F5embNd9tvgzZaw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=FXqeVDCPnI81WwSNwzROAqeb5GxOFiLWrntAmK+Vi3c=; b=GDNHXkQtymJykf/YxJ4BRtPymNRjowVGiGI9f2qZh+RufnpN9uAyBBGUVWABV4Gkn1FzlcRytw0AEu90xBzslHqZSqJhbYAKjsfei2xdKrw94a4VZoIiZstE7jx3Ymr95R5HGCVmUB5MSDS70RLjnvbm4SbtHcDr1oJgNDV8QZESwRSzs3efp8PcIjpiej2ffsF8Ql0zROfFIYJ3Bqi/t71L+EHM5SYoEVLeT77dNDA6//VWvB0JqoGXBzAvMKGww/4/XBpCzOWsKsAueyzUkTEBIa/lnvcW6f3nvBbJOiU1xkJib6/RlM0jimYRxlPxf56EVeTEdvQisdPspo79wQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=FXqeVDCPnI81WwSNwzROAqeb5GxOFiLWrntAmK+Vi3c=; b=Zv8sQ5VEXrgfjYk00AhwLGfh4rz88HsMTxhzqsd7XPjygDgW5Eel8eOg43oJAueWLRY6tAR+aXDYNJVBUePCmzBOT6q1+odlmpZmBvcKGkwHIxWGXzNfOLiFpwmYqiEaAahiD1ehFlRiDjqZ2YUGQFvtzFzdOJWdP9UuuxX7m5Q= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from VI1PR04MB5136.eurprd04.prod.outlook.com (2603:10a6:803:55::19) by VI1PR0402MB3837.eurprd04.prod.outlook.com (2603:10a6:803:25::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4734.23; Sat, 27 Nov 2021 02:05:06 +0000 Received: from VI1PR04MB5136.eurprd04.prod.outlook.com ([fe80::e4ed:b009:ae4:83c5]) by VI1PR04MB5136.eurprd04.prod.outlook.com ([fe80::e4ed:b009:ae4:83c5%7]) with mapi id 15.20.4734.023; Sat, 27 Nov 2021 02:05:05 +0000 From: Vladimir Oltean To: Michael Ellerman , linuxppc-dev@lists.ozlabs.org Subject: [PATCH] powerpc/mm: fix early initialization failure for MMUs with no hash table Date: Sat, 27 Nov 2021 04:04:48 +0200 Message-Id: <20211127020448.4008507-1-vladimir.oltean@nxp.com> X-Mailer: git-send-email 2.25.1 X-ClientProxiedBy: AS8P189CA0024.EURP189.PROD.OUTLOOK.COM (2603:10a6:20b:31f::29) To VI1PR04MB5136.eurprd04.prod.outlook.com (2603:10a6:803:55::19) MIME-Version: 1.0 Received: from localhost.localdomain (188.25.173.50) by AS8P189CA0024.EURP189.PROD.OUTLOOK.COM (2603:10a6:20b:31f::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4713.20 via Frontend Transport; Sat, 27 Nov 2021 02:05:05 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 9fcac5f0-ab56-47f1-2125-08d9b14a54b1 X-MS-TrafficTypeDiagnostic: VI1PR0402MB3837: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:8273; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: J6gOQptM3hp+YmbWVDcUfguwmSYmS73pljeys2pVxqXur+KAcLaQRxHo3MzH4/nsnfcvOuuW7FmojdDOzfz8WBAEwcxjXbdt+iaLQv6Dd8wA4H/4cGNaFkwUK+3KbKxHe8I0P4ZQ9/vDg9QR+KMSR9TKwka3qYuMxrI5Co/JZ97i99K/pYScwbtOBcaWisheUDndHp1PVytsCZDvW95QXhieeNCOE/JL2jJupj3Oa/luB/cVjPgqKz+2xJhXGQaFjvwWGLvc7LmYcFo8wTpvmOQ5Lo2dTiPimDqs8HtDduQjODcSmcTbu7czlyi/OIDSzC2WGxRvJotFJITmM9STqYxc/7g8a57gfgzW93F0uMh9H4VCpMrrinIdYEZTxk+/GRzjo7q54cMKs5FCv1OxEkFZz5Tpxzf7b0smWHmLMl53vOcQwiPC8BbLQ/mVZ2obptrqBNs9GeElzNkBey4+sCMIaU4YmDahnWo+veoON/cm5Lu4X9133cSyAsB6by16HCDpoO1seRJxZkguz48Wl68oDEPuvU76uJ3V3wR2R92BHquykHDcqo5Ibk20RWcif0VGyhYr1Q0+4IcDqU87jDnILzdVFObsdmQ8WIBWV2lNNVDxAVLIvzGG29EaLizsE+haztQFSQQjcgaqm6uI7FaLUik76pvXkxbM5JQrbb5siQjRbcljDpVqn6TTHk5q6U3Rdjo08KB8ArNAUp3xDg== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:VI1PR04MB5136.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(36756003)(508600001)(44832011)(8936002)(86362001)(38100700002)(2906002)(6666004)(38350700002)(54906003)(26005)(8676002)(5660300002)(83380400001)(6512007)(956004)(4326008)(316002)(52116002)(186003)(2616005)(66556008)(66476007)(66946007)(6506007)(1076003)(6486002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: WvwTsNWPZOcXKO3EBF5CPu3knaStr7cYJHoVYsVCS1p6hF7NjUAWASTQ8J24brnH46xKwj1gVFlM2zpPzXDJZI7DyK2GFR8XKt0uQqKOjSd5TYky+Cav6J4WfvlMu7eWCSsd8TbM/uIVwwlmDlf0QrKVOv9KbMe6Lhn37ot1X/9wCRVVQfMGadh+djYB+7BmgwnirdfQGB/qdmLL5Bi7q4+1cYD0nNveq4w+skcoHBYWkXD7GEdj5uMUA41r9YPXVAsgBdIvNsoBY8W/UtI4yPtqsoV7BhaA1wP8Qg6KQtUmtoytpSFI3jQY4rumjsWPjpEGcoJyzVUon0YauMSmpXjMuHuq3T1GxtYXtIJnk7NcI44tRcU1BOFFdfdWPrTWmSRhnjJRyoCHeklCzAq6agb1fzCu4007bJ9CdeNORPgt5fsy0D7KgJuEfqh5oIT5fcAvcVtfU7bON+F8RUOCgZZopLZinP3JE/rFU/VkdDtl5q8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Rr55BwK2IXc788BcGOrsKzT1B1BAkP30NpGy/EBZ441W5RIjzos4Au3mL4Tpw8QhnKPylZ6JTRQYvM= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9fcac5f0-ab56-47f1-2125-08d9b14a54b1 X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB5136.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Nov 2021 02:05:05.7955 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: ZXBnaSSwfLsvxtrDJO81avrw4tyabe77EmRVmz9HkIMOM3tcdFRBm7Ucsgr05FNt+2xVgTF5aJ8d3o9KchdF4A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0402MB3837 X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: stable@vger.kernel.org, Paul Mackerras , linux-kernel@vger.kernel.org Errors-To: linuxppc-dev-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" The blamed patch attempted to do a trivial conversion of map_mem_in_cams() by adding an extra "bool init" argument, but by mistake, changed the way in which two call sites pass the other boolean argument, "bool dry_run". As a result, early_init_this_mmu() now calls map_mem_in_cams() with dry_run=true, and setup_initial_memory_limit() calls with dry_run=false, both of which are unintended changes. This makes the kernel boot process hang here: [ 0.045211] e500 family performance monitor hardware support registered [ 0.051891] rcu: Hierarchical SRCU implementation. [ 0.057791] smp: Bringing up secondary CPUs ... Issue noticed on a Freescale T1040. Fixes: 52bda69ae8b5 ("powerpc/fsl_booke: Tell map_mem_in_cams() if init is done") Cc: stable@vger.kernel.org Signed-off-by: Vladimir Oltean --- arch/powerpc/mm/nohash/tlb.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/mm/nohash/tlb.c b/arch/powerpc/mm/nohash/tlb.c index 89353d4f5604..647bf454a0fa 100644 --- a/arch/powerpc/mm/nohash/tlb.c +++ b/arch/powerpc/mm/nohash/tlb.c @@ -645,7 +645,7 @@ static void early_init_this_mmu(void) if (map) linear_map_top = map_mem_in_cams(linear_map_top, - num_cams, true, true); + num_cams, false, true); } #endif @@ -766,7 +766,7 @@ void setup_initial_memory_limit(phys_addr_t first_memblock_base, num_cams = (mfspr(SPRN_TLB1CFG) & TLBnCFG_N_ENTRY) / 4; linear_sz = map_mem_in_cams(first_memblock_size, num_cams, - false, true); + true, true); ppc64_rma_size = min_t(u64, linear_sz, 0x40000000); } else