Received: by 2002:ab2:3141:0:b0:1ed:23cc:44d1 with SMTP id i1csp605039lqg; Fri, 1 Mar 2024 15:23:50 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWUJ4PDeMvaBFampvypqTGLyapjvcT1+ALJSENMtVJdmfuKhbBwLcfmH5HL2uQWDrk/ReCGowUdDl8lb38B9IcZxr1rLEdGTOKA8Tsf1g== X-Google-Smtp-Source: AGHT+IHWSb7riSCNPeEbOZA971uuaHBOS7eZAYdvkCjzsmd+9wvRCMyRPBzqNh5GXQMTpm6yqMDD X-Received: by 2002:a17:902:a585:b0:1db:a94f:903d with SMTP id az5-20020a170902a58500b001dba94f903dmr2743694plb.36.1709335430140; Fri, 01 Mar 2024 15:23:50 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709335430; cv=pass; d=google.com; s=arc-20160816; b=DsofXcUCA+AikMjCJ1QhTjEoxgks2t7YZ/FpzxZt9875p/LSgz73suo+yc1pv5dEOO ZuIMUE/S/kXWA0WvqU/1tiTC3X8fz3k6JbGrbw6Yfe+ex9CkCgGtLkViJKGM7NEBxICl z9iHPeROwrQNpx6iOJhOlKuwGQ3x1MpRq6525xxrN2pvSk5znelIFywS83DiY7m3YYCF jBZy7L/R/XckgzYjFxsjxj0I8nz3M1vl9JURzj7gQxAjoHXc4cx5V2+14DbssLzndHyc 5x99QEFwXFnUXY5+b6hsk9rZFtTt2+963pv0IDT2jyYdy+hY5czDsjMCmlSpEQ9jGiLn Tpdg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :message-id:date:references:in-reply-to:subject:cc:to:from :dkim-signature; bh=4kEIwFfqRv6oPsKGANVnLORvXnAWA3F6DnLBJl/uvnI=; fh=pS4ySK6OCP2REOk3nmqYFKQHZvu9CgmFKY8rl1h0AJc=; b=v7W6cCKrlZ7TGXloh8AYX0jamZBYL1Ij/tdLuIGxJk6iMqKITbmoH8b5daD1p87vtY 2y9uhnnoaCHnIvU+h2d/5x3Efd+PL9clgA98USEiSash2S7ex+gw7E8W2JFZcJ4L2rWu /+pcbHpaXLcQbadlFUo431iPOzZs3Ve00vzcmb4vvOVoCBUIZ9vSiBWv3SxsduNGzI4i 7K2ZzgpfNTp1hYPiHvjZk8WG9grpQ2GP6SP7oaOzY3HwbsF95MIwh1SoILFLoVwBxLEU sQrghhOKGsPns7lwBm1v30Ji0U6FNx2XvDt8sYk0I9i5QMhXAS7Dsup6f2Q+hsSI8fQW SJmg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ellerman.id.au header.s=201909 header.b=LNakTF1E; arc=pass (i=1 spf=pass spfdomain=ellerman.id.au dkim=pass dkdomain=ellerman.id.au); spf=pass (google.com: domain of linux-kernel+bounces-89224-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-89224-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id x9-20020a170902b40900b001dc56a95e98si4127044plr.393.2024.03.01.15.23.49 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Mar 2024 15:23:50 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-89224-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@ellerman.id.au header.s=201909 header.b=LNakTF1E; arc=pass (i=1 spf=pass spfdomain=ellerman.id.au dkim=pass dkdomain=ellerman.id.au); spf=pass (google.com: domain of linux-kernel+bounces-89224-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-89224-linux.lists.archive=gmail.com@vger.kernel.org" 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 sv.mirrors.kernel.org (Postfix) with ESMTPS id CB6EE2854F4 for ; Fri, 1 Mar 2024 23:23:49 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 198AB5EE89; Fri, 1 Mar 2024 23:23:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ellerman.id.au header.i=@ellerman.id.au header.b="LNakTF1E" Received: from gandalf.ozlabs.org (gandalf.ozlabs.org [150.107.74.76]) (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 9D5845915C for ; Fri, 1 Mar 2024 23:23:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=150.107.74.76 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709335423; cv=none; b=FAivZdn3R5wj1v2KJTTA49NQfX7wOZr5eMtX7HPkfQJJ8oRfGeveCCPZq8EtRMBuAbWMrpMezZiRmkus4teM7gcCHrLa0klin1Fm7Wi7epsvNkJhnxbH9PAULjORhQd8ci379mhS5nYYl1jdI4pjdasxRsY92IkMRMKJ60uJuKQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709335423; c=relaxed/simple; bh=cLGuWTKqwwVl7Rmyebg7Ib4FHjwqx0p34yyX471brkw=; h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=m2GVhMFTPwB8mql+ADX9nRaWskujdCxZuJ/2iDrMlpKzGI8xpJPU2hRKWdJxKa6aFEuP9ni4Y6WGeXo+mfxQcCQfZsENw0c1a0OK9zDDhSzgZbBDKTBNUr5xS14UbdB1JhPrrvT1lVueGsNY1shwrJ/0M7Te9p7NR+OntMaNkGA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ellerman.id.au; spf=pass smtp.mailfrom=ellerman.id.au; dkim=pass (2048-bit key) header.d=ellerman.id.au header.i=@ellerman.id.au header.b=LNakTF1E; arc=none smtp.client-ip=150.107.74.76 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ellerman.id.au Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ellerman.id.au DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ellerman.id.au; s=201909; t=1709335418; bh=4kEIwFfqRv6oPsKGANVnLORvXnAWA3F6DnLBJl/uvnI=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=LNakTF1Eajw7GrUdX4fOw/P+RRygl2XCgx3FWFdOrXuWkqdMoN3xtshaJDlmRXf1A k4grncFThmejyovuYOleZ7mtKQnxO8CzsuOe5P3PYzuiafU0TOJ5hcWcbGNl4BHeBd Mf4x5pJGt9oBPoZ7pmDJyMzuglL77dkK9GOrN9CjL4VDbqcf1DVgYIH9aGmjI0MdpK j1GkC9KM/TmPox6aPHiNq+tMkkpMm/RChEpVmLr6rm0ZrFWh3ZnyxDtne4yQ/ETdsO LyLllN0azhGnubCa6Wa1o5jwub/rtqmzj1gPWkxAYVjIvLTyDuL4wsvkjVm9VHSWOH Wc2K6CRdjS6rg== Received: from authenticated.ozlabs.org (localhost [127.0.0.1]) (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 mail.ozlabs.org (Postfix) with ESMTPSA id 4Tmkfx0Xjfz4wc4; Sat, 2 Mar 2024 10:23:37 +1100 (AEDT) From: Michael Ellerman To: Joel Savitz , linux-kernel@vger.kernel.org Cc: Joel Savitz , Nicholas Piggin , Christophe Leroy , "Aneesh Kumar K.V" , "Naveen N. Rao" , Benjamin Gray , Paul Mackerras , linuxppc-dev@lists.ozlabs.org, Gonzalo Siero Subject: Re: [PATCH] powerpc: align memory_limit to 16MB in early_parse_mem In-Reply-To: <20240301203023.2197451-1-jsavitz@redhat.com> References: <20240301203023.2197451-1-jsavitz@redhat.com> Date: Sat, 02 Mar 2024 10:23:36 +1100 Message-ID: <87cysdfsef.fsf@mail.lhotse> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain Hi Joel, Joel Savitz writes: > On 64-bit powerpc, usage of a non-16MB-aligned value for the mem= kernel > cmdline parameter results in a system hang at boot. Can you give us any more details on that? It might be a bug we can fix. > For example, using 'mem=4198400K' will always reproduce this issue. > > This patch fixes the problem by aligning any argument to mem= to 16MB > corresponding with the large page size on powerpc. The large page size depends on the MMU, with Radix it's 2MB or 1GB. So depending on what's happening 16MB may not be enough. What system are you testing on? cheers > Fixes: 2babf5c2ec2f ("[PATCH] powerpc: Unify mem= handling") > Co-developed-by: Gonzalo Siero > Signed-off-by: Gonzalo Siero > Signed-off-by: Joel Savitz > --- > arch/powerpc/kernel/prom.c | 6 +++++- > 1 file changed, 5 insertions(+), 1 deletion(-) > > diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c > index 0b5878c3125b..8cd3e2445d8a 100644 > --- a/arch/powerpc/kernel/prom.c > +++ b/arch/powerpc/kernel/prom.c > @@ -82,8 +82,12 @@ static int __init early_parse_mem(char *p) > { > if (!p) > return 1; > - > +#ifdef CONFIG_PPC64 > + /* Align to 16 MB == size of ppc64 large page */ > + memory_limit = ALIGN(memparse(p, &p), 0x1000000); > +#else > memory_limit = PAGE_ALIGN(memparse(p, &p)); > +#endif > DBG("memory limit = 0x%llx\n", memory_limit); > > return 0; > -- > 2.43.0