Received: by 2002:a05:7412:3b8b:b0:fc:a2b0:25d7 with SMTP id nd11csp1270881rdb; Fri, 9 Feb 2024 16:32:41 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUIK8+l9+TdX2CkLnp6eL7tyGqKUaVXExk+CuIB8lIJQPiXJxt8a9Bdyut9YCM60FrVEyoqRrfTIKWdkSOanlw810Qza+CzGItbYjsPxg== X-Google-Smtp-Source: AGHT+IEMYTxl5OhtnKy8yIQJmQwKe0c88Te1b4GDmPKma2p8ASBBO3D3qEel5nhkssnG0ozZ+CgG X-Received: by 2002:a05:6358:910c:b0:176:8f0a:be with SMTP id q12-20020a056358910c00b001768f0a00bemr1495673rwq.13.1707525161505; Fri, 09 Feb 2024 16:32:41 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707525161; cv=pass; d=google.com; s=arc-20160816; b=mk/oJj4dYWehiZj4vepkb53H39IaFqSD5PSnrJBoGevhFdGd2Vg+E8wx853CUTNb3X Ouezh9rbQ2jm4i7FBxvVtAEXH68N886pDn9gwK8JtRRP/xBzHw+Lnd+w6BioqaBwV7UP JLEgNWmehTsh8v//nIlzMX2DAH9wP0fQIUMtJpyyXEL92DcSyEXiQiJyqZI5VJ54ehQA AGjjC2gmKKx4tT2c15pPnujVI/XF0C+i3dQZ71Th6ehqyFtRKSNF4lV0nmbjGcihWTBQ ptpDIOsMt7o7uXRp4SxhK6cAFu3mET/hy5EyMCroVxpeCpTDjE+jMTPExR1CzcQjm50K n4NQ== 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:subject:cc:to:from:dkim-signature; bh=Y+AILw3pX1T29zesxJoDs7erTQv/gDbeD35hCxK6nqc=; fh=Tvyt1BlzS7ybCCCujKdXIQWSEbx65HcRH7etfo7WSng=; b=XEdq+6ZQ6PeOkArDTt7GUyNdS+rdv53FP84eJ7FCCkwQaaV8yPYp0gmvuOXjC+ec68 8abHvcVsgN32MtBmfIuE7zrv68HkSnwWvdcc75UD4uo/6Kd1pQqNG3h50PMWxaogY7Hc hbIfkWPzvS2RVchgkND6Cy3YckiKW9kvqr7n1wsc5jlKSP/9LVVsWtHnuRkIkjlBBqTi mptIXtY3ywIvLhxsYrR55PbdPluMqwXz8vhFjtpa+UTD2F3kC00Du0w5I5UJxVRMuu6D QET2Ki2rZvbjCk0Ursxlxce9xPhK7w34QfT+gVdY6JWfBDs3CBUpf6EloSjGSHIuSCt8 nf8A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=BI11iwot; 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-60189-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-60189-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com X-Forwarded-Encrypted: i=2; AJvYcCVwj/7m0eIVvU3gYbU3uGhP7CwIX26AUPWwmwJxjV/FkoOVTm9ykAfwOH5qJKeuwyB1pWP1mKLdCZQzzfBQuBZ1kdP6QSDw9hsukFvR/A== Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id j193-20020a638bca000000b005d760d1af1csi2581383pge.460.2024.02.09.16.32.41 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Feb 2024 16:32:41 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-60189-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=BI11iwot; 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-60189-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-60189-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 23136283ACF for ; Sat, 10 Feb 2024 00:32:41 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E930128F7; Sat, 10 Feb 2024 00:32:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="BI11iwot" Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.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 B4E8A1FB3; Sat, 10 Feb 2024 00:32:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707525146; cv=none; b=bse8fGydcZUbNM4CHObZ6TIdCvjNvl4er2Y32nTQXXde5RIX/yE0HEdZHkBzqJXlH1uEZpXiIdRj5Q4lN5eJAQVoXScBE49GiACzm+PDf0ZZbiy6im7OhK8dBt15SRKX8XiG1fyq23cdh9gETXHj2lZyzktPNpsWehr7UrY2I58= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707525146; c=relaxed/simple; bh=86ofy+kM5/T8yxYifh+rhywEk+E0E7T2saCw5ZL4pS4=; h=From:To:CC:Subject:Date:Message-ID:MIME-Version:Content-Type; b=AGjeDFcB29lk0BZzEu114Tu+thmtHtGPzcckk5sAvGyWmnFcCCuT2DMzkig8WXcnPdjZ+GmnShQ/bwUZO3oOI/hJpK70eFG7F3GUxTl0/cD6p9FkB3Go7h/WVrcFFkBqKFAmKricZtcdiJ+eUYBCCOmsQeIsmSzDypWEhZ++uhQ= 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=BI11iwot; arc=none smtp.client-ip=205.220.168.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 (m0279862.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 419Nts6s031351; Sat, 10 Feb 2024 00:29:48 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= from:to:cc:subject:date:message-id:mime-version:content-type; s= qcppdkim1; bh=Y+AILw3pX1T29zesxJoDs7erTQv/gDbeD35hCxK6nqc=; b=BI 11iwotVsHW4+YaVnK6MfOXbxyVFhGjjb7xTNKbO6c+0r8/TTeZnKJPcIA/bZrZxh I1IfTPs5Gc9Vt7G8KjJGaGgL7UtHuBybizvQml1skqiDwNd2HF0xVuEio/6NdcuP mL2TeLoY0dzn+9pw9P7v3rv9cnnLIRzgKBtzujicQwVsfkpe4iNj97Vey7bS/A1r p/A+3uwcUjM2IMHGfyJXVrZiP/HmwTFSUTJ61djqQaXAK80AmnvYGBxUuOTh3dSF TdXTPy28w+kL0dm3+24tS6jxna/hb5tyO80GpgGGsCa3LRogzbhdx38B4+p7EpaG p25KzyVD5G73vZ+prKrg== Received: from nalasppmta02.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3w5u2k8c02-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sat, 10 Feb 2024 00:29:48 +0000 (GMT) Received: from nalasex01b.na.qualcomm.com (nalasex01b.na.qualcomm.com [10.47.209.197]) by NALASPPMTA02.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 41A0TlCw025917 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sat, 10 Feb 2024 00:29:47 GMT Received: from th-lint-014.qualcomm.com (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.1118.40; Fri, 9 Feb 2024 16:29:44 -0800 From: Oreoluwa Babatunde To: , , , , , , , , CC: , , , , , , Oreoluwa Babatunde Subject: [PATCH 0/3] Restructure init sequence to set aside reserved memory earlier Date: Fri, 9 Feb 2024 16:29:28 -0800 Message-ID: <1707524971-146908-1-git-send-email-quic_obabatun@quicinc.com> X-Mailer: git-send-email 2.7.4 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain 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-ORIG-GUID: _wH-3-rOkUcyW1AYOaxCUEVnFN9qy5ZW X-Proofpoint-GUID: _wH-3-rOkUcyW1AYOaxCUEVnFN9qy5ZW X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-02-09_20,2024-02-08_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 clxscore=1011 lowpriorityscore=0 suspectscore=0 mlxlogscore=510 bulkscore=0 impostorscore=0 malwarescore=0 mlxscore=0 priorityscore=1501 phishscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2401310000 definitions=main-2402100002 The loongarch, openric, and sh architectures allocate memory from memblock before it gets the chance to set aside reserved memory regions. This means that there is a possibility for memblock to allocate from memory regions that are supposed to be reserved. This series makes changes to the arch specific setup code to call the functions responsible for setting aside the reserved memory regions earlier in the init sequence. Hence, by the time memblock starts being used to allocate memory, the reserved memory regions should already be set aside, and it will no longer be possible for allocations to come from them. I am currnetly using an arm64 device, and so I will need assistance from the relevant arch maintainers to help check if this breaks anything from compilation to device bootup. Oreoluwa Babatunde (3): loongarch: Call arch_mem_init() before platform_init() in the init sequence openrisc: Call setup_memory() earlier in the init sequence sh: Call paging_init() earlier in the init sequence arch/loongarch/kernel/setup.c | 2 +- arch/openrisc/kernel/setup.c | 6 +++--- arch/sh/kernel/setup.c | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) --