From nobody Mon Feb 9 02:14:23 2026 Delivered-To: importer@patchew.org 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; Authentication-Results: mx.zohomail.com; dkim=fail; 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=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1579783466; cv=none; d=zohomail.com; s=zohoarc; b=VN+i7p+c1EGYeImiz5/8Tsrxe3aDHTghUjlr2ZMbIMnSCRfhhV1W9XU8UGiNX6Y0lFc1oeIEJFRtU00N1ADHeuR0Z0yOkqUYdURBGPuUEznT7EwEMZZzCLwTaHMmRN+/afWreEMRuxBnTly7rTkkGfY0behp0QB7wyBaNVmZzXc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1579783466; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To; bh=1va1W52q5+Uykms32lfrSHbPymZraTHrCJAaXagx6WM=; b=mFBILDlyX6KlvyStTBUOhq2lsf11q4Y6pagQyDZSt5gFs0x1Iv44E49PXKKNKemi+aHG1XdulSovs9euyf5Xd7JmHAsFBahwrp65TPudPA8onrP9vmReR+rwm//V2/PbYZu8o2FmrZneGZan9KR4fD5nDamMfHpwVq2IDwEfzQ8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1579783466168749.2018174408829; Thu, 23 Jan 2020 04:44:26 -0800 (PST) Received: from localhost ([::1]:56436 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iubqS-0007TS-EA for importer@patchew.org; Thu, 23 Jan 2020 07:44:24 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:36662) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iuauD-0000el-BS for qemu-devel@nongnu.org; Thu, 23 Jan 2020 06:44:14 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iuauC-0005SZ-3Y for qemu-devel@nongnu.org; Thu, 23 Jan 2020 06:44:13 -0500 Received: from us-smtp-2.mimecast.com ([205.139.110.61]:55533 helo=us-smtp-delivery-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iuauB-0005SI-Vw for qemu-devel@nongnu.org; Thu, 23 Jan 2020 06:44:12 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-350-NEIGbUICNqi7dLS2T2z8DQ-1; Thu, 23 Jan 2020 06:43:48 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 33B5D800D41 for ; Thu, 23 Jan 2020 11:43:47 +0000 (UTC) Received: from dell-r430-03.lab.eng.brq.redhat.com (dell-r430-03.lab.eng.brq.redhat.com [10.37.153.18]) by smtp.corp.redhat.com (Postfix) with ESMTP id D10001001B2C; Thu, 23 Jan 2020 11:43:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1579779851; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=1va1W52q5+Uykms32lfrSHbPymZraTHrCJAaXagx6WM=; b=OqKQhLOd1/H3C7APRENlwW8lxvWx05S1kia7XIb8tWO5dsNxxvz+3V2/0TJyIpBOK/ljOC 1y9WX2gjCdNx0ail3kZqX3VUVamMTt/Gg1XSHAACQhYErTcX9Mjnyy3ISIFemC65KZdO9J X67b1UBB2uyp3Xlx6xDd3LxdO2R5zgI= From: Igor Mammedov To: qemu-devel@nongnu.org Subject: [PATCH REPOST v3 73/80] remove no longer used memory_region_allocate_system_memory() Date: Thu, 23 Jan 2020 12:38:38 +0100 Message-Id: <1579779525-20065-74-git-send-email-imammedo@redhat.com> In-Reply-To: <1579779525-20065-1-git-send-email-imammedo@redhat.com> References: <1579779525-20065-1-git-send-email-imammedo@redhat.com> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-MC-Unique: NEIGbUICNqi7dLS2T2z8DQ-1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 205.139.110.61 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: pbonzini@redhat.com, ehabkost@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" all boards were switched to using memdev backend for main RAM, so we can drop no longer used memory_region_allocate_system_memory() Signed-off-by: Igor Mammedov --- CC: ehabkost@redhat.com CC: pbonzini@redhat.com --- include/hw/boards.h | 32 -------------------------------- hw/core/numa.c | 34 ---------------------------------- 2 files changed, 66 deletions(-) diff --git a/include/hw/boards.h b/include/hw/boards.h index 351479d..f4b1b95 100644 --- a/include/hw/boards.h +++ b/include/hw/boards.h @@ -12,38 +12,6 @@ #include "qom/object.h" #include "hw/core/cpu.h" =20 -/** - * memory_region_allocate_system_memory - Allocate a board's main memory - * @mr: the #MemoryRegion to be initialized - * @owner: the object that tracks the region's reference count - * @name: name of the memory region - * @ram_size: size of the region in bytes - * - * This function allocates the main memory for a board model, and - * initializes @mr appropriately. It also arranges for the memory - * to be migrated (by calling vmstate_register_ram_global()). - * - * Memory allocated via this function will be backed with the memory - * backend the user provided using "-mem-path" or "-numa node,memdev=3D..." - * if appropriate; this is typically used to cause host huge pages to be - * used. This function should therefore be called by a board exactly once, - * for the primary or largest RAM area it implements. - * - * For boards where the major RAM is split into two parts in the memory - * map, you can deal with this by calling memory_region_allocate_system_me= mory() - * once to get a MemoryRegion with enough RAM for both parts, and then - * creating alias MemoryRegions via memory_region_init_alias() which - * alias into different parts of the RAM MemoryRegion and can be mapped - * into the memory map in the appropriate places. - * - * Smaller pieces of memory (display RAM, static RAMs, etc) don't need - * to be backed via the -mem-path memory backend and can simply - * be created via memory_region_init_ram(). - */ -void memory_region_allocate_system_memory(MemoryRegion *mr, Object *owner, - const char *name, - uint64_t ram_size); - #define TYPE_MACHINE_SUFFIX "-machine" =20 /* Machine class name that needs to be used for class-name-based machine diff --git a/hw/core/numa.c b/hw/core/numa.c index e6baf2c..316bc50 100644 --- a/hw/core/numa.c +++ b/hw/core/numa.c @@ -806,40 +806,6 @@ void numa_cpu_pre_plug(const CPUArchId *slot, DeviceSt= ate *dev, Error **errp) } } =20 -static void allocate_system_memory_nonnuma(MemoryRegion *mr, Object *owner, - const char *name, - uint64_t ram_size) -{ - if (mem_path) { -#ifdef __linux__ - memory_region_init_ram_from_file(mr, owner, name, ram_size, 0, 0, - mem_path, &error_fatal); -#else - fprintf(stderr, "-mem-path not supported on this host\n"); - exit(1); -#endif - } else { - memory_region_init_ram_nomigrate(mr, owner, name, ram_size, &error= _fatal); - } - vmstate_register_ram_global(mr); -} - -void memory_region_allocate_system_memory(MemoryRegion *mr, Object *owner, - const char *name, - uint64_t ram_size) -{ - MachineState *ms =3D MACHINE(qdev_get_machine()); - - if (ms->numa_state =3D=3D NULL || - ms->numa_state->num_nodes =3D=3D 0 || numa_uses_legacy_mem()) { - allocate_system_memory_nonnuma(mr, owner, name, ram_size); - return; - } - - memory_region_init(mr, owner, name, ram_size); - numa_init_memdev_container(ms, mr); -} - static void numa_stat_memory_devices(NumaNodeMem node_mem[]) { MemoryDeviceInfoList *info_list =3D qmp_memory_device_list(); --=20 2.7.4