Received: by 2002:ab2:1689:0:b0:1f7:5705:b850 with SMTP id d9csp1477621lqa; Mon, 29 Apr 2024 09:29:15 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXvLC9+EJLg2ZTxfx3WQdg01sFTLyuFoPWJy+FRnLQFSCP7+ZI5dM/KiEsqBzcKCqDbZ4we3aJw4FqvNWDKZlHfTlmzfHPJ3cqu7d4S6Q== X-Google-Smtp-Source: AGHT+IGbBQtrzzwfWDkJ9byJfbj1+mYA6BY81HcgJgCKhe3D4WwR9D/z0UfzOpQQ/2cVqNrakvhy X-Received: by 2002:a05:651c:20f:b0:2e0:5f2c:e0b5 with SMTP id y15-20020a05651c020f00b002e05f2ce0b5mr3113913ljn.36.1714408152033; Mon, 29 Apr 2024 09:29:12 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714408152; cv=pass; d=google.com; s=arc-20160816; b=uTlvl6kNBD/nkmRKSMlmemWp7MoXtW6p6itXmFy+BsCnj7MkCDt53XJAAptcGw8vFt lZsNWKev5Jb6kcAZ2M1+NFKZs5EFQjR0UFyOjnyXtZXXVwGB8ECfQY4L+dHqJs1NHK0o o3/ZlQkZ2e1mw5csSMCEGOa+LSwkBZuLXVhDCZX/JN0uBUcmOutyiWiFI8vGKjURX7VB iLdB1c6IcogZqDPKlilIjHLKYuMiTUTJB7VZazl/Z1B03iseN5tFOcRsSbpa+tB9Qky3 dDelqe2fZ25CjmYZ2AcA5c+Q0dIwxDndtPxGmmVCZA/6flgr1069DbLg2xgVV0G+6uNj 8+GA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=8aEzxpcfWPZRrq+K6Lw7TglFRUXWgUOU+zQ+AjNDdGU=; fh=d4Tw9T9+qn2moaPzKn28vbFJt1IZVjvn55Kn6yA7U2A=; b=0FcZ5jVkfNY5M0OLnvMG/XTTSgezX9nt12v4YJNsfngcJiiGK23UN1l2IMnqdwm6IU zT9DCkCVBHP2+jh0is01FnR8z9CTom8eWHTZxOFGDetmrba/vVgtFY1WFNVnf4exy7Cy zgFmu6ia4yesgN3KgA34G7ilJa5eKD0CPjru5T9FLXLCgv/wJW1HUwil3RxRjcOyS6oW KtwDf6VsbdEg/MZ/+oQWNc1Ax50wVAS/4uHjVLptFUTm21ICTGctAjbjuseXyzSrzbEt QK2NHLBXtzw+uh4m5gPViVzD6RTEd4jjMRgB5RbQSBUp0ff1Av5HYePPNvENP2wQOaPz Yi0A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=nFSL4xYs; arc=pass (i=1 spf=pass spfdomain=quicinc.com dkim=pass dkdomain=quicinc.com dmarc=pass fromdomain=quicinc.com); spf=pass (google.com: domain of linux-kernel+bounces-162686-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-162686-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id s1-20020a170906a18100b00a55adb22ba2si10770870ejy.805.2024.04.29.09.29.11 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Apr 2024 09:29:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-162686-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=nFSL4xYs; arc=pass (i=1 spf=pass spfdomain=quicinc.com dkim=pass dkdomain=quicinc.com dmarc=pass fromdomain=quicinc.com); spf=pass (google.com: domain of linux-kernel+bounces-162686-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-162686-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com 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 BA5E61F249D7 for ; Mon, 29 Apr 2024 16:29:11 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DE75E84D35; Mon, 29 Apr 2024 16:29:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="nFSL4xYs" Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) (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 95038824AA; Mon, 29 Apr 2024 16:29:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.180.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714408144; cv=none; b=XRVwHRKvak+HrWqJdSu9IU1r07lLRZWyzqGn9dd9/gmrCtB1CK43eDrCaEpn9MDbK/TAQFgcEbwcOuOdm3IJ7mcohV8x1mmSws6moHXsc+5fKJWHvYOgxePyhAmtRHYz4fNRCJ6xtNp/AgR4/KZl0ZM3xW0S0skIXxTnL3Z0daQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714408144; c=relaxed/simple; bh=/rhfbBArK1vuX55gWRri0xcPJM+jiH9RSzxzjjGEBaI=; h=Message-ID:Date:MIME-Version:Subject:To:CC:References:From: In-Reply-To:Content-Type; b=a5wrtBzAh/uCSZF2L4sXAVsDCbD6RLW5OFigaqOFd+NG8dS3r6ajx0UEx4kB7spcgA7XjCRculoJbEL4kCSjyrMrkr+kSr0oX1RuNJTUjsYIMqRI7dq8TJ3BdO/Vv6MGk+P2rN/XZ7XKTeBbydPYBlT//wxvIC4GoSdqdYnZPxQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com; spf=pass smtp.mailfrom=quicinc.com; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b=nFSL4xYs; arc=none smtp.client-ip=205.220.180.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=quicinc.com Received: from pps.filterd (m0279869.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 43TFucHQ003792; Mon, 29 Apr 2024 16:28:42 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= message-id:date:mime-version:subject:to:cc:references:from :in-reply-to:content-type:content-transfer-encoding; s= qcppdkim1; bh=8aEzxpcfWPZRrq+K6Lw7TglFRUXWgUOU+zQ+AjNDdGU=; b=nF SL4xYszEGgM11oxNQYEyCYje9JaFMVDVHQjObtRqOCQwd4k+77F4qtHJbBI0BBzn 7mokjnptD/9umDH7shc3IR3VUr3RmUaLfa+Z6IKwu74NIonvJbBMU01/M63hYIGv MLw0IyQX9ye+6gf3SIN5u920gyVeZ/sKwSdmOznKzSu+bM6HRAkKLea/2CLva45p vMwubcG9su7IRNg760s5cBtTz2X02HtTlPWj6p2HPoifTtjNRstVseItKPLkkTfP XY7BacktNb9ErvhI1DOkongOaw7H9GEcGH6M+Y+V1EuwG6yqEJ8SchzEEmvt6AtP yTuLcZNdotmb0+4MQQUg== Received: from nalasppmta05.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3xtd8kgqyh-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 29 Apr 2024 16:28:41 +0000 (GMT) Received: from nalasex01b.na.qualcomm.com (nalasex01b.na.qualcomm.com [10.47.209.197]) by NALASPPMTA05.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 43TGSexC028096 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 29 Apr 2024 16:28:40 GMT Received: from [10.71.110.192] (10.80.80.8) by nalasex01b.na.qualcomm.com (10.47.209.197) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.9; Mon, 29 Apr 2024 09:28:37 -0700 Message-ID: Date: Mon, 29 Apr 2024 09:28:30 -0700 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2] sh: Call paging_init() earlier in the init sequence To: John Paul Adrian Glaubitz , , CC: , , , , , Rob Herring References: <20240423233150.74302-1-quic_obabatun@quicinc.com> <6ba5b226dfcbae3d9c789bb6943089621b315d65.camel@physik.fu-berlin.de> Content-Language: en-US From: Oreoluwa Babatunde In-Reply-To: <6ba5b226dfcbae3d9c789bb6943089621b315d65.camel@physik.fu-berlin.de> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To nalasex01b.na.qualcomm.com (10.47.209.197) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: LA1Li0h98ffn-aMf74TbmVylhmK6Oive X-Proofpoint-ORIG-GUID: LA1Li0h98ffn-aMf74TbmVylhmK6Oive X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1011,Hydra:6.0.650,FMLib:17.11.176.26 definitions=2024-04-29_14,2024-04-29_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 bulkscore=0 adultscore=0 spamscore=0 mlxscore=0 phishscore=0 suspectscore=0 priorityscore=1501 impostorscore=0 lowpriorityscore=0 clxscore=1015 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2404010003 definitions=main-2404290105 On 4/29/2024 2:03 AM, John Paul Adrian Glaubitz wrote: > Hi Oreoluwa, > > On Tue, 2024-04-23 at 16:31 -0700, Oreoluwa Babatunde wrote: >> The unflatten_device_tree() function contains a call to >> memblock_alloc(). This is a problem because this allocation is done >> before any of the reserved memory is set aside in paging_init(). >> This means that there is a possibility for memblock to allocate from >> any of the memory regions that are supposed to be set aside as reserved. >> >> Hence, move the call to paging_init() to be earlier in the init >> sequence so that the reserved memory regions are set aside before any >> allocations are done using memblock. >> >> Reviewed-by: Rob Herring >> Signed-off-by: Oreoluwa Babatunde >> --- >> v2: >> - Added Rob Herrings Reviewed-by. >> - cc Andrew Morton to assist with merging this for sh architecture. >> Similar change made for loongarch and openrisc in v1 have already >> been merged. > Could you link the changes for references so I can have a look? Hi John, Here are links to the corresponding changes on Loongarch and Openrisc. - Loongarch: https://lore.kernel.org/all/20240218151403.2206980-1-chenhuacai@loongson.cn/ - Openrisc: https://lore.kernel.org/all/1707524971-146908-3-git-send-email-quic_obabatun@quicinc.com/ Thank you! Oreoluwa > >> v1: >> https://lore.kernel.org/all/1707524971-146908-4-git-send-email-quic_obabatun@quicinc.com/ >> >> arch/sh/kernel/setup.c | 4 ++-- >> 1 file changed, 2 insertions(+), 2 deletions(-) >> >> diff --git a/arch/sh/kernel/setup.c b/arch/sh/kernel/setup.c >> index 620e5cf8ae1e..98c8473e130d 100644 >> --- a/arch/sh/kernel/setup.c >> +++ b/arch/sh/kernel/setup.c >> @@ -322,6 +322,8 @@ void __init setup_arch(char **cmdline_p) >> /* Let earlyprintk output early console messages */ >> sh_early_platform_driver_probe("earlyprintk", 1, 1); >> >> + paging_init(); >> + >> #ifdef CONFIG_OF_EARLY_FLATTREE >> #ifdef CONFIG_USE_BUILTIN_DTB >> unflatten_and_copy_device_tree(); >> @@ -330,8 +332,6 @@ void __init setup_arch(char **cmdline_p) >> #endif >> #endif >> >> - paging_init(); >> - >> /* Perform the machine specific initialisation */ >> if (likely(sh_mv.mv_setup)) >> sh_mv.mv_setup(cmdline_p); > Reviewed-by: John Paul Adrian Glaubitz > > Adrian >