From nobody Fri Oct 24 21:57:29 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1519022728211728.7495037812789; Sun, 18 Feb 2018 22:45:28 -0800 (PST) Received: from localhost ([::1]:47825 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1enfCV-0005lN-VY for importer@patchew.org; Mon, 19 Feb 2018 01:45:24 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42982) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1enfAU-0004jU-Hv for qemu-devel@nongnu.org; Mon, 19 Feb 2018 01:43:19 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1enfAR-0001df-Fp for qemu-devel@nongnu.org; Mon, 19 Feb 2018 01:43:18 -0500 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:49602 helo=mx0a-001b2d01.pphosted.com) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1enfAR-0001dX-Bc for qemu-devel@nongnu.org; Mon, 19 Feb 2018 01:43:15 -0500 Received: from pps.filterd (m0098417.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w1J6cubw033891 for ; Mon, 19 Feb 2018 01:43:13 -0500 Received: from e06smtp13.uk.ibm.com (e06smtp13.uk.ibm.com [195.75.94.109]) by mx0a-001b2d01.pphosted.com with ESMTP id 2g7s5hgtvs-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Mon, 19 Feb 2018 01:43:12 -0500 Received: from localhost by e06smtp13.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 19 Feb 2018 06:43:11 -0000 Received: from b06cxnps4076.portsmouth.uk.ibm.com (9.149.109.198) by e06smtp13.uk.ibm.com (192.168.101.143) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Mon, 19 Feb 2018 06:43:08 -0000 Received: from d06av21.portsmouth.uk.ibm.com (d06av21.portsmouth.uk.ibm.com [9.149.105.232]) by b06cxnps4076.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w1J6h8WN48431164; Mon, 19 Feb 2018 06:43:08 GMT Received: from d06av21.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 4697652041; Mon, 19 Feb 2018 05:35:04 +0000 (GMT) Received: from bharata.in.ibm.com (unknown [9.124.35.166]) by d06av21.portsmouth.uk.ibm.com (Postfix) with ESMTP id 1289352043; Mon, 19 Feb 2018 05:35:02 +0000 (GMT) From: Bharata B Rao To: qemu-devel@nongnu.org Date: Mon, 19 Feb 2018 12:12:53 +0530 X-Mailer: git-send-email 2.7.4 In-Reply-To: <1519022574-6817-1-git-send-email-bharata@linux.vnet.ibm.com> References: <1519022574-6817-1-git-send-email-bharata@linux.vnet.ibm.com> X-TM-AS-GCONF: 00 x-cbid: 18021906-0012-0000-0000-000005B214CA X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18021906-0013-0000-0000-0000192E1E90 Message-Id: <1519022574-6817-2-git-send-email-bharata@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2018-02-19_04:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=1 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1709140000 definitions=main-1802190084 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] [fuzzy] X-Received-From: 148.163.158.5 Subject: [Qemu-devel] [RFC PATCH v0 1/2] pc-dimm: Make pc_dimm_built_list() global X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: imammedo@redhat.com, mwb@linux.vnet.ibm.com, qemu-ppc@nongnu.org, Bharata B Rao , nfont@linux.vnet.ibm.com, david@gibson.dropbear.id.au Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Making pc_dimm_built_list() global allows other parts of QEMU code to build and walk through the DIMM list in address-sorted order. This is needed in the next patch for sPAPR code to create ibm,dynamic-memory-v2 device tree property that will have entries for populated DIMMs as well as available hotpluggable areas. CHECK: List of DIMMs is already available via qmp_pc_dimm_device_list(), but that doesn't provide a sorted list. Signed-off-by: Bharata B Rao --- hw/mem/pc-dimm.c | 2 +- include/hw/mem/pc-dimm.h | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/hw/mem/pc-dimm.c b/hw/mem/pc-dimm.c index 6e74b61..9bd61ca 100644 --- a/hw/mem/pc-dimm.c +++ b/hw/mem/pc-dimm.c @@ -261,7 +261,7 @@ static gint pc_dimm_addr_sort(gconstpointer a, gconstpo= inter b) return 0; } =20 -static int pc_dimm_built_list(Object *obj, void *opaque) +int pc_dimm_built_list(Object *obj, void *opaque) { GSList **list =3D opaque; =20 diff --git a/include/hw/mem/pc-dimm.h b/include/hw/mem/pc-dimm.h index d83b957..d880f5e 100644 --- a/include/hw/mem/pc-dimm.h +++ b/include/hw/mem/pc-dimm.h @@ -100,4 +100,5 @@ void pc_dimm_memory_plug(DeviceState *dev, MemoryHotplu= gState *hpms, MemoryRegion *mr, uint64_t align, Error **errp); void pc_dimm_memory_unplug(DeviceState *dev, MemoryHotplugState *hpms, MemoryRegion *mr); +int pc_dimm_built_list(Object *obj, void *opaque); #endif --=20 2.7.4