From nobody Sat Nov 15 00:05:06 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=reject dis=none) header.from=linux.ibm.com ARC-Seal: i=1; a=rsa-sha256; t=1759087779; cv=none; d=zohomail.com; s=zohoarc; b=CfP/rPnBBDIL2GpPu7ONr+Ptyd2nUi4jjgbTco4RmVsdVovSctZszJWmB8hTKiX4wsDY1GSTIfWf9y6iUnXlLcWUPFvfLX9I3PQM27fxLCnK3GKaLS7XwLu/+UTPEbofyp+LEwGaI0cXOTAmqlqk2OyN2DMGP9duYahkQA5RF9c= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1759087779; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=O6w2275zp6vCl7hRWdMteVvnMr1AljSQGuFkvAaUCvs=; b=MJ3EvzToq/g9FdoK5eaRGxHGdj7TeXDjeD2JY5ZRgyYPTqfZewIIOF+n6QJg2fyLvDckdM+/WDnH2aHu3FcNK3iiODvQLOq1vlpSbxa9eH9XjBi6HadsmRCjSIsWagRowPjzAD055obqpv79Cw1HacJjpL1hkaS+V44LmlgQ9nA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1759087779117197.94570566265702; Sun, 28 Sep 2025 12:29:39 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1v2x3b-00033i-Um; Sun, 28 Sep 2025 15:27:39 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1v2x3Y-00032C-Ob for qemu-devel@nongnu.org; Sun, 28 Sep 2025 15:27:36 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1v2x3I-00047G-9F for qemu-devel@nongnu.org; Sun, 28 Sep 2025 15:27:36 -0400 Received: from pps.filterd (m0360072.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 58SIlIOe032112 for ; Sun, 28 Sep 2025 19:27:11 GMT Received: from ppma23.wdc07v.mail.ibm.com (5d.69.3da9.ip4.static.sl-reverse.com [169.61.105.93]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 49e7jw6ev9-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Sun, 28 Sep 2025 19:27:11 +0000 (GMT) Received: from pps.filterd (ppma23.wdc07v.mail.ibm.com [127.0.0.1]) by ppma23.wdc07v.mail.ibm.com (8.18.1.2/8.18.1.2) with ESMTP id 58SIXE09007331 for ; Sun, 28 Sep 2025 19:27:11 GMT Received: from smtprelay07.fra02v.mail.ibm.com ([9.218.2.229]) by ppma23.wdc07v.mail.ibm.com (PPS) with ESMTPS id 49eurjjsbp-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Sun, 28 Sep 2025 19:27:11 +0000 Received: from smtpav06.fra02v.mail.ibm.com (smtpav06.fra02v.mail.ibm.com [10.20.54.105]) by smtprelay07.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 58SJR6Xm26018118 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 28 Sep 2025 19:27:06 GMT Received: from smtpav06.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id E9E0720049; Sun, 28 Sep 2025 19:27:05 +0000 (GMT) Received: from smtpav06.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id B329920040; Sun, 28 Sep 2025 19:27:04 +0000 (GMT) Received: from li-1901474c-32f3-11b2-a85c-fc5ff2c001f3.ibm.com.com (unknown [9.39.17.115]) by smtpav06.fra02v.mail.ibm.com (Postfix) with ESMTP; Sun, 28 Sep 2025 19:27:04 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=cc :content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=pp1; bh=O6w2275zp6vCl7hRW dMteVvnMr1AljSQGuFkvAaUCvs=; b=m8x3VJGfuULKVyYdrWRmfRmmRtqQKTnH/ Un3FG/R8iQqzd7KBU7GmQi6UWhmzIj+6dPgjOFPXjb9hmJA7cU2EhOnfopah58YK O6bZtoNWc5zaK5wm9NN2A6RdPmFIopiwAYnAHHN0HgprxwCrLTrcA/KHSyKJ31ks WombhxoDT+hcRmYrhln3qdS4UoAiAOqb3qiSZqyq406AboX4LTiCrys56Q8BjJBH j/AF+fQoT2qQxVI+28f/OrpDisSuGfCL5AtsrSNV7/5kk8khoN4K3ettxgFAyVyF 7MfRnB/WUvGK94Hu2uOS3xlY9cUIvOU0Eelcc7XaN7q6r+RKR/QMg== From: Harsh Prateek Bora To: qemu-devel@nongnu.org Cc: Gaurav Batra , David Christensen , Shivaprasad G Bhat Subject: [PULL 19/27] ppc/spapr: init lrdr-capapcity phys with ram size if maxmem not provided Date: Mon, 29 Sep 2025 00:56:21 +0530 Message-ID: <20250928192629.139822-20-harshpb@linux.ibm.com> X-Mailer: git-send-email 2.43.5 In-Reply-To: <20250928192629.139822-1-harshpb@linux.ibm.com> References: <20250928192629.139822-1-harshpb@linux.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-TM-AS-GCONF: 00 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUwOTI3MDAyNSBTYWx0ZWRfXw8JlCVHkbbTO QIgNwHFNOmtDMQbMgg9p7XMg1Z/dq81zQBdU6u29xlM5tFS5MUfqiQws3KJH9+EQ6mhe6hWZKKg Um/lnIJhj41FD+zkdrMCbjP/H9j4LquwCbTj5AgYLBKgOGqKVbruLBc5TPT+wczDNgZL7BM1cyn Ff+qEbSIF7JKPWbrlJ3t9ApMDa0eIPZkmWNo+n8bUyB4WvrWQ+Vy+XV55JUOn/304PTj35o3myS v2sBZ/VTf6Xy1b5I928VbJjQgSDOxPEMB73fwlChdFjKS8VMVEWBv6XHL/3+SDf0GCeKHiFnZTd C8vDlkvG8aEtoiWBLdkM6psoCYcTcjAZw8jnfygJzemtjKbbb1Fbd1L0NBGdVtMW7B0jONkg5GK bh7swKs9uVvry3FGMRlJhhOm2hpUXw== X-Proofpoint-ORIG-GUID: f9DqrlbqZcGEBsPPPAPEg6uN4K8bDQj8 X-Proofpoint-GUID: f9DqrlbqZcGEBsPPPAPEg6uN4K8bDQj8 X-Authority-Analysis: v=2.4 cv=GdUaXAXL c=1 sm=1 tr=0 ts=68d98c0f cx=c_pps a=3Bg1Hr4SwmMryq2xdFQyZA==:117 a=3Bg1Hr4SwmMryq2xdFQyZA==:17 a=yJojWOMRYYMA:10 a=f7IdgyKtn90A:10 a=VwQbUJbxAAAA:8 a=VnNF1IyMAAAA:8 a=lvduwxc082U5sw0zugYA:9 a=oH34dK2VZjykjzsv8OSz:22 a=pHzHmUro8NiASowvMSCR:22 a=n87TN5wuljxrRezIQYnT:22 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1117,Hydra:6.1.9,FMLib:17.12.80.40 definitions=2025-09-28_08,2025-09-26_01,2025-03-28_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 clxscore=1015 phishscore=0 adultscore=0 priorityscore=1501 malwarescore=0 spamscore=0 bulkscore=0 impostorscore=0 lowpriorityscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2509150000 definitions=main-2509270025 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=148.163.158.5; envelope-from=harshpb@linux.ibm.com; helo=mx0b-001b2d01.pphosted.com X-Spam_score_int: -19 X-Spam_score: -2.0 X-Spam_bar: -- X-Spam_report: (-2.0 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @ibm.com) X-ZM-MESSAGEID: 1759087780938116600 Content-Type: text/plain; charset="utf-8" lrdr-capacity contains phys field which communicates the maximum address in bytes and therefore, the most memory that can be allocated to this partition. This is usually populated when maxmem is provided alongwith memory size on qemu command line. However since maxmem is an optional param, this leads to bits being set to 0 in absence of maxmem param. Fix this by initializing the respective bits as per total mem size in such case. Reported-by: Gaurav Batra Tested-by: David Christensen Signed-off-by: Harsh Prateek Bora Reviewed-by: Shivaprasad G Bhat Link: https://lore.kernel.org/r/20250506042903.76250-1-harshpb@linux.ibm.com Message-ID: <20250506042903.76250-1-harshpb@linux.ibm.com> --- hw/ppc/spapr.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index eb22333404..82fb23beaa 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -907,6 +907,7 @@ static void spapr_dt_rtas(SpaprMachineState *spapr, voi= d *fdt) int rtas; GString *hypertas =3D g_string_sized_new(256); GString *qemu_hypertas =3D g_string_sized_new(256); + uint64_t max_device_addr =3D 0; uint32_t lrdr_capacity[] =3D { 0, 0, @@ -917,13 +918,15 @@ static void spapr_dt_rtas(SpaprMachineState *spapr, v= oid *fdt) =20 /* Do we have device memory? */ if (MACHINE(spapr)->device_memory) { - uint64_t max_device_addr =3D MACHINE(spapr)->device_memory->base + + max_device_addr =3D MACHINE(spapr)->device_memory->base + memory_region_size(&MACHINE(spapr)->device_memory->mr); - - lrdr_capacity[0] =3D cpu_to_be32(max_device_addr >> 32); - lrdr_capacity[1] =3D cpu_to_be32(max_device_addr & 0xffffffff); + } else if (ms->ram_size =3D=3D ms->maxram_size) { + max_device_addr =3D ms->ram_size; } =20 + lrdr_capacity[0] =3D cpu_to_be32(max_device_addr >> 32); + lrdr_capacity[1] =3D cpu_to_be32(max_device_addr & 0xffffffff); + _FDT(rtas =3D fdt_add_subnode(fdt, 0, "rtas")); =20 /* hypertas */ --=20 2.43.5