From patchwork Sun Oct 20 22:56:30 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 1180089 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.b="gUw4eJLu"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46xFZD3Pw3z9sCJ for ; Mon, 21 Oct 2019 09:59:00 +1100 (AEDT) Received: from localhost ([::1]:50880 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iMKA5-00073e-Cc for incoming@patchwork.ozlabs.org; Sun, 20 Oct 2019 18:58:57 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34368) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iMK93-00071x-Jr for qemu-devel@nongnu.org; Sun, 20 Oct 2019 18:57:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iMK91-0000UN-Ka for qemu-devel@nongnu.org; Sun, 20 Oct 2019 18:57:53 -0400 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:50846 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iMK8z-0000Ss-NE for qemu-devel@nongnu.org; Sun, 20 Oct 2019 18:57:51 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1571612268; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ZiO2C5es1NYJxD/UQgZc/eWnlcXJHpGVMpR68/XdhKU=; b=gUw4eJLurWPl6MEnxBDI+CGrPbnpqrXwXE0JV4KQJktsaXuS/hgyEStmEB6q8aMtDYsVjo t2w/41hJD5gqDOGmAcfmi8MvpQXM8P5v1TNc+OY6EyQXW9Qm1+2PBSej+Xkmu0IBKnAivv WCPCqMdBfgnQlxR+zy/nl7I94luR+Hs= 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-237-uy8zh8NwOQ2uo6L-XeNDjw-1; Sun, 20 Oct 2019 18:57:44 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id BCF285EC; Sun, 20 Oct 2019 22:57:34 +0000 (UTC) Received: from x1w.redhat.com (ovpn-204-40.brq.redhat.com [10.40.204.40]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 7FFF360F88; Sun, 20 Oct 2019 22:57:15 +0000 (UTC) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: Paolo Bonzini , Igor Mammedov , qemu-devel@nongnu.org, Markus Armbruster , Eduardo Habkost Subject: [PATCH 01/21] hw/arm/xilinx_zynq: Use the IEC binary prefix definitions Date: Mon, 21 Oct 2019 00:56:30 +0200 Message-Id: <20191020225650.3671-2-philmd@redhat.com> In-Reply-To: <20191020225650.3671-1-philmd@redhat.com> References: <20191020225650.3671-1-philmd@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-MC-Unique: uy8zh8NwOQ2uo6L-XeNDjw-1 X-Mimecast-Spam-Score: 0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 207.211.31.120 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: Paul Burton , Peter Maydell , "Michael S. Tsirkin" , Leif Lindholm , Mark Cave-Ayland , KONRAD Frederic , "Edgar E. Iglesias" , Rob Herring , Andrey Smirnov , Helge Deller , =?utf-8?q?Herv=C3=A9_Poussineau?= , Joel Stanley , Aleksandar Rikalo , Richard Henderson , Artyom Tarasenko , Antony Pavlov , Alistair Francis , Fabien Chouteau , Beniamino Galvani , qemu-arm@nongnu.org, Peter Chubb , =?utf-8?q?C=C3=A9dric_Le_Goat?= =?utf-8?q?er?= , David Gibson , Radoslaw Biernacki , Thomas Huth , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?b?w6k=?= , Andrew Baumann , Jean-Christophe Dubois , Andrew Jeffery , Michael Walle , qemu-ppc@nongnu.org, Aleksandar Markovic , Jan Kiszka , Aurelien Jarno Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" IEC binary prefixes ease code review: the unit is explicit. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Reviewed-by: Alistair Francis --- hw/arm/xilinx_zynq.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hw/arm/xilinx_zynq.c b/hw/arm/xilinx_zynq.c index c14774e542..3a0fa5b23f 100644 --- a/hw/arm/xilinx_zynq.c +++ b/hw/arm/xilinx_zynq.c @@ -16,6 +16,7 @@ */ #include "qemu/osdep.h" +#include "qemu/units.h" #include "qapi/error.h" #include "cpu.h" #include "hw/sysbus.h" @@ -194,7 +195,7 @@ static void zynq_init(MachineState *machine) memory_region_add_subregion(address_space_mem, 0, ext_ram); /* 256K of on-chip memory */ - memory_region_init_ram(ocm_ram, NULL, "zynq.ocm_ram", 256 << 10, + memory_region_init_ram(ocm_ram, NULL, "zynq.ocm_ram", 256 * KiB, &error_fatal); memory_region_add_subregion(address_space_mem, 0xFFFC0000, ocm_ram); From patchwork Sun Oct 20 22:56:31 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 1180094 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.b="Xu/BvkDr"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46xFgZ3b3Kz9sP4 for ; Mon, 21 Oct 2019 10:03:38 +1100 (AEDT) Received: from localhost ([::1]:51044 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iMKEa-0002up-2D for incoming@patchwork.ozlabs.org; Sun, 20 Oct 2019 19:03:36 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34429) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iMK9H-0007Am-KA for qemu-devel@nongnu.org; Sun, 20 Oct 2019 18:58:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iMK9F-0000b2-Cq for qemu-devel@nongnu.org; Sun, 20 Oct 2019 18:58:07 -0400 Received: from us-smtp-1.mimecast.com ([207.211.31.81]:58832 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 1iMK9D-0000Zj-UD for qemu-devel@nongnu.org; Sun, 20 Oct 2019 18:58:05 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1571612283; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=HKUywiLzAmwUUS3Ko1h1jc3EGAJrhz3L5AmjE57NQ9I=; b=Xu/BvkDr9no3sJSQs9u1+MqiSoIgBnf9a1a7hmqz6N/UPnya/5uQt/D4nXNrw7ElZusu5Q 6BTHlFh20vDLzl9goebBfbHc9Eb5i2u0dbpL1DSkeVBYlCl3rm5vLZXpuHn5R3j2YxoNKR vDbBawpbtZ1pzP1m/HeP5JBNVvIl+lU= 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-83-_FO5TgCTP4quFIedys1ZHg-1; Sun, 20 Oct 2019 18:57:59 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id AE4651800D9B; Sun, 20 Oct 2019 22:57:54 +0000 (UTC) Received: from x1w.redhat.com (ovpn-204-40.brq.redhat.com [10.40.204.40]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 45FF260C18; Sun, 20 Oct 2019 22:57:35 +0000 (UTC) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: Paolo Bonzini , Igor Mammedov , qemu-devel@nongnu.org, Markus Armbruster , Eduardo Habkost Subject: [PATCH 02/21] hw/arm/mps2: Use the IEC binary prefix definitions Date: Mon, 21 Oct 2019 00:56:31 +0200 Message-Id: <20191020225650.3671-3-philmd@redhat.com> In-Reply-To: <20191020225650.3671-1-philmd@redhat.com> References: <20191020225650.3671-1-philmd@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-MC-Unique: _FO5TgCTP4quFIedys1ZHg-1 X-Mimecast-Spam-Score: 0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 207.211.31.81 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: Paul Burton , Peter Maydell , "Michael S. Tsirkin" , Leif Lindholm , Mark Cave-Ayland , KONRAD Frederic , "Edgar E. Iglesias" , Rob Herring , Andrey Smirnov , Helge Deller , =?utf-8?q?Herv=C3=A9_Poussineau?= , Joel Stanley , Aleksandar Rikalo , Richard Henderson , Artyom Tarasenko , Antony Pavlov , Alistair Francis , Fabien Chouteau , Beniamino Galvani , qemu-arm@nongnu.org, Peter Chubb , =?utf-8?q?C=C3=A9dric_Le_Goat?= =?utf-8?q?er?= , David Gibson , Radoslaw Biernacki , Thomas Huth , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?b?w6k=?= , Andrew Baumann , Jean-Christophe Dubois , Andrew Jeffery , Michael Walle , qemu-ppc@nongnu.org, Aleksandar Markovic , Jan Kiszka , Aurelien Jarno Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" IEC binary prefixes ease code review: the unit is explicit. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Reviewed-by: Alistair Francis --- hw/arm/mps2-tz.c | 3 ++- hw/arm/mps2.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/hw/arm/mps2-tz.c b/hw/arm/mps2-tz.c index 6b24aaacde..f8b620bcc6 100644 --- a/hw/arm/mps2-tz.c +++ b/hw/arm/mps2-tz.c @@ -38,6 +38,7 @@ */ #include "qemu/osdep.h" +#include "qemu/units.h" #include "qapi/error.h" #include "qemu/error-report.h" #include "hw/arm/boot.h" @@ -458,7 +459,7 @@ static void mps2tz_common_init(MachineState *machine) * call the 16MB our "system memory", as it's the largest lump. */ memory_region_allocate_system_memory(&mms->psram, - NULL, "mps.ram", 0x01000000); + NULL, "mps.ram", 16 * MiB); memory_region_add_subregion(system_memory, 0x80000000, &mms->psram); /* The overflow IRQs for all UARTs are ORed together. diff --git a/hw/arm/mps2.c b/hw/arm/mps2.c index 10efff36b2..d002b126d3 100644 --- a/hw/arm/mps2.c +++ b/hw/arm/mps2.c @@ -23,6 +23,7 @@ */ #include "qemu/osdep.h" +#include "qemu/units.h" #include "qapi/error.h" #include "qemu/error-report.h" #include "hw/arm/boot.h" @@ -146,7 +147,7 @@ static void mps2_common_init(MachineState *machine) * zbt_boot_ctrl is always zero). */ memory_region_allocate_system_memory(&mms->psram, - NULL, "mps.ram", 0x1000000); + NULL, "mps.ram", 16 * MiB); memory_region_add_subregion(system_memory, 0x21000000, &mms->psram); switch (mmc->fpga_type) { From patchwork Sun Oct 20 22:56:32 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 1180090 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.b="DKEAqUYx"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46xFb11sMrz9sPf for ; Mon, 21 Oct 2019 09:59:41 +1100 (AEDT) Received: from localhost ([::1]:50920 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iMKAk-00088b-LM for incoming@patchwork.ozlabs.org; Sun, 20 Oct 2019 18:59:38 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34496) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iMK9Y-0007Tw-N1 for qemu-devel@nongnu.org; Sun, 20 Oct 2019 18:58:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iMK9X-0000hb-Et for qemu-devel@nongnu.org; Sun, 20 Oct 2019 18:58:24 -0400 Received: from us-smtp-1.mimecast.com ([205.139.110.61]:38769 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 1iMK9X-0000hD-BB for qemu-devel@nongnu.org; Sun, 20 Oct 2019 18:58:23 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1571612302; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Ct9GxQAra7Nz2QfsyFV24ARRUDhuyExjCbAMSK5fQ0A=; b=DKEAqUYxHBPcMLMFCZpupo930v35r/1Hqs0fkW64eFGUN34svAjaX9dArUwwJkAgv7KgF8 Ib/4AxNQzuMGmFVaj0r9VROqDLPIAXGytaDmX6AlGZJLD+GPao1vjZM/1Jg6GmUCk8GERz rj+9ZKsIQ01lDorNWiQGm7NEQkFcy6w= 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-102-saRSUd18PTCqyhOHWl-9jA-1; Sun, 20 Oct 2019 18:58:18 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 13F541800D9B; Sun, 20 Oct 2019 22:58:15 +0000 (UTC) Received: from x1w.redhat.com (ovpn-204-40.brq.redhat.com [10.40.204.40]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 5098960C18; Sun, 20 Oct 2019 22:57:55 +0000 (UTC) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: Paolo Bonzini , Igor Mammedov , qemu-devel@nongnu.org, Markus Armbruster , Eduardo Habkost Subject: [PATCH 03/21] hw/arm/collie: Create the RAM in the board Date: Mon, 21 Oct 2019 00:56:32 +0200 Message-Id: <20191020225650.3671-4-philmd@redhat.com> In-Reply-To: <20191020225650.3671-1-philmd@redhat.com> References: <20191020225650.3671-1-philmd@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-MC-Unique: saRSUd18PTCqyhOHWl-9jA-1 X-Mimecast-Spam-Score: 0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] 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: Paul Burton , Peter Maydell , "Michael S. Tsirkin" , Leif Lindholm , Mark Cave-Ayland , KONRAD Frederic , "Edgar E. Iglesias" , Rob Herring , Andrey Smirnov , Helge Deller , =?utf-8?q?Herv=C3=A9_Poussineau?= , Joel Stanley , Aleksandar Rikalo , Richard Henderson , Artyom Tarasenko , Antony Pavlov , Alistair Francis , Fabien Chouteau , Beniamino Galvani , qemu-arm@nongnu.org, Peter Chubb , =?utf-8?q?C=C3=A9dric_Le_Goat?= =?utf-8?q?er?= , David Gibson , Radoslaw Biernacki , Thomas Huth , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?b?w6k=?= , Andrew Baumann , Jean-Christophe Dubois , Andrew Jeffery , Michael Walle , qemu-ppc@nongnu.org, Aleksandar Markovic , Jan Kiszka , Aurelien Jarno Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" The SDRAM is incorrectly created in the SA1110 SoC. Move its creation in the board code, this will later allow the board to have the QOM ownership of the RAM. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Reviewed-by: Alistair Francis --- hw/arm/collie.c | 8 ++++++-- hw/arm/strongarm.c | 7 +------ hw/arm/strongarm.h | 4 +--- 3 files changed, 8 insertions(+), 11 deletions(-) diff --git a/hw/arm/collie.c b/hw/arm/collie.c index b1288ccea8..970a4405cc 100644 --- a/hw/arm/collie.c +++ b/hw/arm/collie.c @@ -27,9 +27,13 @@ static void collie_init(MachineState *machine) { StrongARMState *s; DriveInfo *dinfo; - MemoryRegion *sysmem = get_system_memory(); + MemoryRegion *sdram = g_new(MemoryRegion, 1); - s = sa1110_init(sysmem, collie_binfo.ram_size, machine->cpu_type); + s = sa1110_init(machine->cpu_type); + + memory_region_allocate_system_memory(sdram, NULL, "strongarm.sdram", + collie_binfo.ram_size); + memory_region_add_subregion(get_system_memory(), SA_SDCS0, sdram); dinfo = drive_get(IF_PFLASH, 0, 0); pflash_cfi01_register(SA_CS0, "collie.fl1", 0x02000000, diff --git a/hw/arm/strongarm.c b/hw/arm/strongarm.c index dc65d88a65..6bee034914 100644 --- a/hw/arm/strongarm.c +++ b/hw/arm/strongarm.c @@ -1586,8 +1586,7 @@ static const TypeInfo strongarm_ssp_info = { }; /* Main CPU functions */ -StrongARMState *sa1110_init(MemoryRegion *sysmem, - unsigned int sdram_size, const char *cpu_type) +StrongARMState *sa1110_init(const char *cpu_type) { StrongARMState *s; int i; @@ -1601,10 +1600,6 @@ StrongARMState *sa1110_init(MemoryRegion *sysmem, s->cpu = ARM_CPU(cpu_create(cpu_type)); - memory_region_allocate_system_memory(&s->sdram, NULL, "strongarm.sdram", - sdram_size); - memory_region_add_subregion(sysmem, SA_SDCS0, &s->sdram); - s->pic = sysbus_create_varargs("strongarm_pic", 0x90050000, qdev_get_gpio_in(DEVICE(s->cpu), ARM_CPU_IRQ), qdev_get_gpio_in(DEVICE(s->cpu), ARM_CPU_FIQ), diff --git a/hw/arm/strongarm.h b/hw/arm/strongarm.h index e98840b461..192821f6aa 100644 --- a/hw/arm/strongarm.h +++ b/hw/arm/strongarm.h @@ -55,7 +55,6 @@ enum { typedef struct { ARMCPU *cpu; - MemoryRegion sdram; DeviceState *pic; DeviceState *gpio; DeviceState *ppc; @@ -63,7 +62,6 @@ typedef struct { SSIBus *ssp_bus; } StrongARMState; -StrongARMState *sa1110_init(MemoryRegion *sysmem, - unsigned int sdram_size, const char *rev); +StrongARMState *sa1110_init(const char *cpu_type); #endif From patchwork Sun Oct 20 22:56:33 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 1180095 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.b="J+m8cIMQ"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46xFgr5m0Zz9sP6 for ; Mon, 21 Oct 2019 10:03:52 +1100 (AEDT) Received: from localhost ([::1]:51078 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iMKEn-0003MT-9t for incoming@patchwork.ozlabs.org; Sun, 20 Oct 2019 19:03:50 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34529) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iMK9n-0007rt-BU for qemu-devel@nongnu.org; Sun, 20 Oct 2019 18:58:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iMK9l-0000mf-Sy for qemu-devel@nongnu.org; Sun, 20 Oct 2019 18:58:39 -0400 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:53726 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iMK9l-0000mM-Ow for qemu-devel@nongnu.org; Sun, 20 Oct 2019 18:58:37 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1571612317; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=00y7jQpSxo9MyQHgBlj8zdJXUgyhGSSLykacNJ1ow64=; b=J+m8cIMQnuC4eRQrdUHOIis1Qpaqz/pgWtXkBVKgQ56mx1zZ1hMPY0ZgwXNj8MlWeCTuze wOvfSndkRGWUHVtaQ19IVjYLjdtoIoQN+NQxXRE2fWR9LNoHBfX/93agx4tDS7bEjTdJVF 11IyPTQ45xyHt+G3x9HDIjd7l0sgz9A= 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-17-v505K273OgOtL1nkGe2Q9Q-1; Sun, 20 Oct 2019 18:58:33 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 15AC91005509; Sun, 20 Oct 2019 22:58:30 +0000 (UTC) Received: from x1w.redhat.com (ovpn-204-40.brq.redhat.com [10.40.204.40]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 9A79D60C18; Sun, 20 Oct 2019 22:58:15 +0000 (UTC) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: Paolo Bonzini , Igor Mammedov , qemu-devel@nongnu.org, Markus Armbruster , Eduardo Habkost Subject: [PATCH 04/21] hw/arm/omap2: Create the RAM in the board Date: Mon, 21 Oct 2019 00:56:33 +0200 Message-Id: <20191020225650.3671-5-philmd@redhat.com> In-Reply-To: <20191020225650.3671-1-philmd@redhat.com> References: <20191020225650.3671-1-philmd@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-MC-Unique: v505K273OgOtL1nkGe2Q9Q-1 X-Mimecast-Spam-Score: 0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 207.211.31.120 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: Paul Burton , Peter Maydell , "Michael S. Tsirkin" , Leif Lindholm , Mark Cave-Ayland , KONRAD Frederic , "Edgar E. Iglesias" , Rob Herring , Andrey Smirnov , Helge Deller , =?utf-8?q?Herv=C3=A9_Poussineau?= , Joel Stanley , Aleksandar Rikalo , Richard Henderson , Artyom Tarasenko , Antony Pavlov , Alistair Francis , Fabien Chouteau , Beniamino Galvani , qemu-arm@nongnu.org, Peter Chubb , =?utf-8?q?C=C3=A9dric_Le_Goat?= =?utf-8?q?er?= , David Gibson , Radoslaw Biernacki , Thomas Huth , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?b?w6k=?= , Andrew Baumann , Jean-Christophe Dubois , Andrew Jeffery , Michael Walle , qemu-ppc@nongnu.org, Aleksandar Markovic , Jan Kiszka , Aurelien Jarno Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" The SDRAM is incorrectly created in the OMAP2420 SoC. Move its creation in the board code, this will later allow the board to have the QOM ownership of the RAM. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- hw/arm/nseries.c | 10 +++++++--- hw/arm/omap2.c | 13 +++++-------- include/hw/arm/omap.h | 4 +--- 3 files changed, 13 insertions(+), 14 deletions(-) diff --git a/hw/arm/nseries.c b/hw/arm/nseries.c index a36971d39a..11f2c193f3 100644 --- a/hw/arm/nseries.c +++ b/hw/arm/nseries.c @@ -1311,11 +1311,15 @@ static int n810_atag_setup(const struct arm_boot_info *info, void *p) static void n8x0_init(MachineState *machine, struct arm_boot_info *binfo, int model) { - MemoryRegion *sysmem = get_system_memory(); + MemoryRegion *sdram = g_new(MemoryRegion, 1); struct n800_s *s = (struct n800_s *) g_malloc0(sizeof(*s)); - int sdram_size = binfo->ram_size; + uint64_t sdram_size = binfo->ram_size; - s->mpu = omap2420_mpu_init(sysmem, sdram_size, machine->cpu_type); + memory_region_allocate_system_memory(sdram, NULL, "omap2.dram", + sdram_size); + memory_region_add_subregion(get_system_memory(), OMAP2_Q2_BASE, sdram); + + s->mpu = omap2420_mpu_init(sdram, machine->cpu_type); /* Setup peripherals * diff --git a/hw/arm/omap2.c b/hw/arm/omap2.c index bd7ddff983..457f152bac 100644 --- a/hw/arm/omap2.c +++ b/hw/arm/omap2.c @@ -22,6 +22,7 @@ #include "qemu/error-report.h" #include "qapi/error.h" #include "cpu.h" +#include "exec/address-spaces.h" #include "sysemu/blockdev.h" #include "sysemu/qtest.h" #include "sysemu/reset.h" @@ -2276,8 +2277,7 @@ static const struct dma_irq_map omap2_dma_irq_map[] = { { 0, OMAP_INT_24XX_SDMA_IRQ3 }, }; -struct omap_mpu_state_s *omap2420_mpu_init(MemoryRegion *sysmem, - unsigned long sdram_size, +struct omap_mpu_state_s *omap2420_mpu_init(MemoryRegion *sdram, const char *cpu_type) { struct omap_mpu_state_s *s = g_new0(struct omap_mpu_state_s, 1); @@ -2286,11 +2286,11 @@ struct omap_mpu_state_s *omap2420_mpu_init(MemoryRegion *sysmem, int i; SysBusDevice *busdev; struct omap_target_agent_s *ta; + MemoryRegion *sysmem = get_system_memory(); /* Core */ s->mpu_model = omap2420; s->cpu = ARM_CPU(cpu_create(cpu_type)); - s->sdram_size = sdram_size; s->sram_size = OMAP242X_SRAM_SIZE; s->wakeup = qemu_allocate_irq(omap_mpu_wakeup, s, 0); @@ -2299,9 +2299,6 @@ struct omap_mpu_state_s *omap2420_mpu_init(MemoryRegion *sysmem, omap_clk_init(s); /* Memory-mapped stuff */ - memory_region_allocate_system_memory(&s->sdram, NULL, "omap2.dram", - s->sdram_size); - memory_region_add_subregion(sysmem, OMAP2_Q2_BASE, &s->sdram); memory_region_init_ram(&s->sram, NULL, "omap2.sram", s->sram_size, &error_fatal); memory_region_add_subregion(sysmem, OMAP2_SRAM_BASE, &s->sram); @@ -2338,8 +2335,8 @@ struct omap_mpu_state_s *omap2420_mpu_init(MemoryRegion *sysmem, s->port->addr_valid = omap2_validate_addr; /* Register SDRAM and SRAM ports for fast DMA transfers. */ - soc_dma_port_add_mem(s->dma, memory_region_get_ram_ptr(&s->sdram), - OMAP2_Q2_BASE, s->sdram_size); + soc_dma_port_add_mem(s->dma, memory_region_get_ram_ptr(sdram), + OMAP2_Q2_BASE, memory_region_size(sdram)); soc_dma_port_add_mem(s->dma, memory_region_get_ram_ptr(&s->sram), OMAP2_SRAM_BASE, s->sram_size); diff --git a/include/hw/arm/omap.h b/include/hw/arm/omap.h index 2fda996648..763d8eab4f 100644 --- a/include/hw/arm/omap.h +++ b/include/hw/arm/omap.h @@ -824,7 +824,6 @@ struct omap_mpu_state_s { MemoryRegion tap_iomem; MemoryRegion imif_ram; MemoryRegion emiff_ram; - MemoryRegion sdram; MemoryRegion sram; struct omap_dma_port_if_s { @@ -938,8 +937,7 @@ struct omap_mpu_state_s *omap310_mpu_init(MemoryRegion *system_memory, const char *core); /* omap2.c */ -struct omap_mpu_state_s *omap2420_mpu_init(MemoryRegion *sysmem, - unsigned long sdram_size, +struct omap_mpu_state_s *omap2420_mpu_init(MemoryRegion *sdram, const char *core); uint32_t omap_badwidth_read8(void *opaque, hwaddr addr); From patchwork Sun Oct 20 22:56:34 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 1180096 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.b="UHEATkPC"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46xFhR3G3Xz9sP4 for ; Mon, 21 Oct 2019 10:04:23 +1100 (AEDT) Received: from localhost ([::1]:51100 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iMKFI-00041d-RL for incoming@patchwork.ozlabs.org; Sun, 20 Oct 2019 19:04:20 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34570) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iMKA8-0008OL-Ce for qemu-devel@nongnu.org; Sun, 20 Oct 2019 18:59:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iMKA7-0000vr-0k for qemu-devel@nongnu.org; Sun, 20 Oct 2019 18:59:00 -0400 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:57257 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iMKA6-0000vJ-Tl for qemu-devel@nongnu.org; Sun, 20 Oct 2019 18:58:58 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1571612338; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=P6Kh98FHafNlLZZo+92GpsnmCq+usB8Dn0FVmOfuI9k=; b=UHEATkPCW24OJa6AwfCyt9+IA1l2y2ifrK//uJ6rDh+YfH/ingmOFrN3/kaMd4XXxhVPm2 +pDOo0zRMdAgOG1y2MyDiyGZyZpDYI2dBBG3VK7c7dPjKd/t1TH0xmIoiswUb7W7QsY987 MhBanQ+kDZRk62u44fdMMl6+K/Irqw8= 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-49-1tlsh9YrNTOS-87o-fmvpw-1; Sun, 20 Oct 2019 18:58:54 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 010C780183E; Sun, 20 Oct 2019 22:58:51 +0000 (UTC) Received: from x1w.redhat.com (ovpn-204-40.brq.redhat.com [10.40.204.40]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A7C7B60C18; Sun, 20 Oct 2019 22:58:30 +0000 (UTC) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: Paolo Bonzini , Igor Mammedov , qemu-devel@nongnu.org, Markus Armbruster , Eduardo Habkost Subject: [PATCH 05/21] hw/arm/omap1: Create the RAM in the board Date: Mon, 21 Oct 2019 00:56:34 +0200 Message-Id: <20191020225650.3671-6-philmd@redhat.com> In-Reply-To: <20191020225650.3671-1-philmd@redhat.com> References: <20191020225650.3671-1-philmd@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-MC-Unique: 1tlsh9YrNTOS-87o-fmvpw-1 X-Mimecast-Spam-Score: 0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 207.211.31.120 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: Paul Burton , Peter Maydell , "Michael S. Tsirkin" , Leif Lindholm , Mark Cave-Ayland , KONRAD Frederic , "Edgar E. Iglesias" , Rob Herring , Andrey Smirnov , Helge Deller , =?utf-8?q?Herv=C3=A9_Poussineau?= , Joel Stanley , Aleksandar Rikalo , Richard Henderson , Artyom Tarasenko , Antony Pavlov , Alistair Francis , Fabien Chouteau , Beniamino Galvani , qemu-arm@nongnu.org, Peter Chubb , =?utf-8?q?C=C3=A9dric_Le_Goat?= =?utf-8?q?er?= , David Gibson , Radoslaw Biernacki , Thomas Huth , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?b?w6k=?= , Andrew Baumann , Jean-Christophe Dubois , Andrew Jeffery , Michael Walle , qemu-ppc@nongnu.org, Aleksandar Markovic , Jan Kiszka , Aurelien Jarno Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" The SDRAM is incorrectly created in the OMAP310 SoC. Move its creation in the board code, this will later allow the board to have the QOM ownership of the RAM. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- hw/arm/omap1.c | 12 +++++------- hw/arm/omap_sx1.c | 8 ++++++-- hw/arm/palm.c | 8 ++++++-- include/hw/arm/omap.h | 6 ++---- 4 files changed, 19 insertions(+), 15 deletions(-) diff --git a/hw/arm/omap1.c b/hw/arm/omap1.c index 0400593805..6ce038a453 100644 --- a/hw/arm/omap1.c +++ b/hw/arm/omap1.c @@ -23,6 +23,7 @@ #include "qapi/error.h" #include "qemu-common.h" #include "cpu.h" +#include "exec/address-spaces.h" #include "hw/boards.h" #include "hw/hw.h" #include "hw/irq.h" @@ -3858,8 +3859,7 @@ static int omap_validate_tipb_mpui_addr(struct omap_mpu_state_s *s, return range_covers_byte(0xe1010000, 0xe1020004 - 0xe1010000, addr); } -struct omap_mpu_state_s *omap310_mpu_init(MemoryRegion *system_memory, - unsigned long sdram_size, +struct omap_mpu_state_s *omap310_mpu_init(MemoryRegion *dram, const char *cpu_type) { int i; @@ -3867,11 +3867,12 @@ struct omap_mpu_state_s *omap310_mpu_init(MemoryRegion *system_memory, qemu_irq dma_irqs[6]; DriveInfo *dinfo; SysBusDevice *busdev; + MemoryRegion *system_memory = get_system_memory(); /* Core */ s->mpu_model = omap310; s->cpu = ARM_CPU(cpu_create(cpu_type)); - s->sdram_size = sdram_size; + s->sdram_size = memory_region_size(dram); s->sram_size = OMAP15XX_SRAM_SIZE; s->wakeup = qemu_allocate_irq(omap_mpu_wakeup, s, 0); @@ -3880,9 +3881,6 @@ struct omap_mpu_state_s *omap310_mpu_init(MemoryRegion *system_memory, omap_clk_init(s); /* Memory-mapped stuff */ - memory_region_allocate_system_memory(&s->emiff_ram, NULL, "omap1.dram", - s->sdram_size); - memory_region_add_subregion(system_memory, OMAP_EMIFF_BASE, &s->emiff_ram); memory_region_init_ram(&s->imif_ram, NULL, "omap1.sram", s->sram_size, &error_fatal); memory_region_add_subregion(system_memory, OMAP_IMIF_BASE, &s->imif_ram); @@ -3925,7 +3923,7 @@ struct omap_mpu_state_s *omap310_mpu_init(MemoryRegion *system_memory, s->port[tipb_mpui].addr_valid = omap_validate_tipb_mpui_addr; /* Register SDRAM and SRAM DMA ports for fast transfers. */ - soc_dma_port_add_mem(s->dma, memory_region_get_ram_ptr(&s->emiff_ram), + soc_dma_port_add_mem(s->dma, memory_region_get_ram_ptr(dram), OMAP_EMIFF_BASE, s->sdram_size); soc_dma_port_add_mem(s->dma, memory_region_get_ram_ptr(&s->imif_ram), OMAP_IMIF_BASE, s->sram_size); diff --git a/hw/arm/omap_sx1.c b/hw/arm/omap_sx1.c index c071197be7..be245714db 100644 --- a/hw/arm/omap_sx1.c +++ b/hw/arm/omap_sx1.c @@ -103,6 +103,7 @@ static void sx1_init(MachineState *machine, const int version) { struct omap_mpu_state_s *mpu; MemoryRegion *address_space = get_system_memory(); + MemoryRegion *dram = g_new(MemoryRegion, 1); MemoryRegion *flash = g_new(MemoryRegion, 1); MemoryRegion *cs = g_new(MemoryRegion, 4); static uint32_t cs0val = 0x00213090; @@ -118,8 +119,11 @@ static void sx1_init(MachineState *machine, const int version) flash_size = flash2_size; } - mpu = omap310_mpu_init(address_space, sx1_binfo.ram_size, - machine->cpu_type); + memory_region_allocate_system_memory(dram, NULL, "omap1.dram", + sx1_binfo.ram_size); + memory_region_add_subregion(address_space, OMAP_EMIFF_BASE, dram); + + mpu = omap310_mpu_init(dram, machine->cpu_type); /* External Flash (EMIFS) */ memory_region_init_ram(flash, NULL, "omap_sx1.flash0-0", flash_size, diff --git a/hw/arm/palm.c b/hw/arm/palm.c index 02a3a82b9b..72eca8cc55 100644 --- a/hw/arm/palm.c +++ b/hw/arm/palm.c @@ -190,16 +190,20 @@ static void palmte_init(MachineState *machine) MemoryRegion *address_space_mem = get_system_memory(); struct omap_mpu_state_s *mpu; int flash_size = 0x00800000; - int sdram_size = palmte_binfo.ram_size; static uint32_t cs0val = 0xffffffff; static uint32_t cs1val = 0x0000e1a0; static uint32_t cs2val = 0x0000e1a0; static uint32_t cs3val = 0xe1a0e1a0; int rom_size, rom_loaded = 0; + MemoryRegion *dram = g_new(MemoryRegion, 1); MemoryRegion *flash = g_new(MemoryRegion, 1); MemoryRegion *cs = g_new(MemoryRegion, 4); - mpu = omap310_mpu_init(address_space_mem, sdram_size, machine->cpu_type); + memory_region_allocate_system_memory(dram, NULL, "omap1.dram", + palmte_binfo.ram_size); + memory_region_add_subregion(address_space_mem, OMAP_EMIFF_BASE, dram); + + mpu = omap310_mpu_init(dram, machine->cpu_type); /* External Flash (EMIFS) */ memory_region_init_ram(flash, NULL, "palmte.flash", flash_size, diff --git a/include/hw/arm/omap.h b/include/hw/arm/omap.h index 763d8eab4f..f3aa670036 100644 --- a/include/hw/arm/omap.h +++ b/include/hw/arm/omap.h @@ -823,7 +823,6 @@ struct omap_mpu_state_s { MemoryRegion mpui_io_iomem; MemoryRegion tap_iomem; MemoryRegion imif_ram; - MemoryRegion emiff_ram; MemoryRegion sram; struct omap_dma_port_if_s { @@ -835,7 +834,7 @@ struct omap_mpu_state_s { hwaddr addr); } port[__omap_dma_port_last]; - unsigned long sdram_size; + uint64_t sdram_size; unsigned long sram_size; /* MPUI-TIPB peripherals */ @@ -932,8 +931,7 @@ struct omap_mpu_state_s { }; /* omap1.c */ -struct omap_mpu_state_s *omap310_mpu_init(MemoryRegion *system_memory, - unsigned long sdram_size, +struct omap_mpu_state_s *omap310_mpu_init(MemoryRegion *sdram, const char *core); /* omap2.c */ From patchwork Sun Oct 20 22:56:35 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 1180099 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.b="Nvy9BnOF"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46xFmN64RXz9sP6 for ; Mon, 21 Oct 2019 10:07:48 +1100 (AEDT) Received: from localhost ([::1]:51200 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iMKIa-0007FQ-7I for incoming@patchwork.ozlabs.org; Sun, 20 Oct 2019 19:07:44 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34649) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iMKAU-0000S6-8u for qemu-devel@nongnu.org; Sun, 20 Oct 2019 18:59:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iMKAT-00013X-5J for qemu-devel@nongnu.org; Sun, 20 Oct 2019 18:59:22 -0400 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:26708 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iMKAT-00013E-11 for qemu-devel@nongnu.org; Sun, 20 Oct 2019 18:59:21 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1571612360; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=9kM0ZnwOs54aW1Vd94/zbuy9tIm0oHWHTjl2ZmeUSXo=; b=Nvy9BnOF9t2nxqSc/d8xi3UdUqQlX2JXQQFkxHvLzTJEOViG6AUDAP0pFXigMgHVkEf71l LX3d9fJqgZwIeJdLTtYUk0KUT7AgAxdYgNrgK9iM10y4yxsK6zKkX/0NMILb4pPg6uNk92 tugVSpSyKBOY/+3NM2hwtyaRnSkkNcg= 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-283-gaImeOBIP5mikDC8J_QeaQ-1; Sun, 20 Oct 2019 18:59:17 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 76584107AD31; Sun, 20 Oct 2019 22:59:11 +0000 (UTC) Received: from x1w.redhat.com (ovpn-204-40.brq.redhat.com [10.40.204.40]) by smtp.corp.redhat.com (Postfix) with ESMTPS id BEFD760C18; Sun, 20 Oct 2019 22:58:51 +0000 (UTC) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: Paolo Bonzini , Igor Mammedov , qemu-devel@nongnu.org, Markus Armbruster , Eduardo Habkost Subject: [PATCH 06/21] hw/arm/digic4: Inline digic4_board_setup_ram() function Date: Mon, 21 Oct 2019 00:56:35 +0200 Message-Id: <20191020225650.3671-7-philmd@redhat.com> In-Reply-To: <20191020225650.3671-1-philmd@redhat.com> References: <20191020225650.3671-1-philmd@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-MC-Unique: gaImeOBIP5mikDC8J_QeaQ-1 X-Mimecast-Spam-Score: 0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 207.211.31.120 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: Paul Burton , Peter Maydell , "Michael S. Tsirkin" , Leif Lindholm , Mark Cave-Ayland , KONRAD Frederic , "Edgar E. Iglesias" , Rob Herring , Andrey Smirnov , Helge Deller , =?utf-8?q?Herv=C3=A9_Poussineau?= , Joel Stanley , Aleksandar Rikalo , Richard Henderson , Artyom Tarasenko , Antony Pavlov , Alistair Francis , Fabien Chouteau , Beniamino Galvani , qemu-arm@nongnu.org, Peter Chubb , =?utf-8?q?C=C3=A9dric_Le_Goat?= =?utf-8?q?er?= , David Gibson , Radoslaw Biernacki , Thomas Huth , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?b?w6k=?= , Andrew Baumann , Jean-Christophe Dubois , Andrew Jeffery , Michael Walle , qemu-ppc@nongnu.org, Aleksandar Markovic , Jan Kiszka , Aurelien Jarno Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Having the RAM creation code in a separate function is not very helpful. Move this code directly inside the board_init() function, this will later allow the board to have the QOM ownership of the RAM. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Reviewed-by: Alistair Francis --- hw/arm/digic_boards.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/hw/arm/digic_boards.c b/hw/arm/digic_boards.c index 304e4d1a29..ef3fc2b6a5 100644 --- a/hw/arm/digic_boards.c +++ b/hw/arm/digic_boards.c @@ -53,12 +53,6 @@ typedef struct DigicBoard { const char *rom1_def_filename; } DigicBoard; -static void digic4_board_setup_ram(DigicBoardState *s, hwaddr ram_size) -{ - memory_region_allocate_system_memory(&s->ram, NULL, "ram", ram_size); - memory_region_add_subregion(get_system_memory(), 0, &s->ram); -} - static void digic4_board_init(DigicBoard *board) { Error *err = NULL; @@ -72,7 +66,8 @@ static void digic4_board_init(DigicBoard *board) exit(1); } - digic4_board_setup_ram(s, board->ram_size); + memory_region_allocate_system_memory(&s->ram, NULL, "ram", board->ram_size); + memory_region_add_subregion(get_system_memory(), 0, &s->ram); if (board->add_rom0) { board->add_rom0(s, DIGIC4_ROM0_BASE, board->rom0_def_filename); From patchwork Sun Oct 20 22:56:36 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 1180101 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.b="L0BwBkbU"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46xFrF3n9Dz9sP6 for ; Mon, 21 Oct 2019 10:11:09 +1100 (AEDT) Received: from localhost ([::1]:51250 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iMKLr-0002Wv-4Z for incoming@patchwork.ozlabs.org; Sun, 20 Oct 2019 19:11:07 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34728) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iMKAi-0000mB-Ds for qemu-devel@nongnu.org; Sun, 20 Oct 2019 18:59:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iMKAh-00018t-3S for qemu-devel@nongnu.org; Sun, 20 Oct 2019 18:59:36 -0400 Received: from us-smtp-1.mimecast.com ([207.211.31.81]:41006 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 1iMKAh-00018j-01 for qemu-devel@nongnu.org; Sun, 20 Oct 2019 18:59:35 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1571612374; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=+7M1IUjrqcXlYCM8d7hykgPS4Gzumj9wbW6o3J1eHCc=; b=L0BwBkbUkyqGpRt4unziaHg6aEzuSZNcVm2uMkyrijaJqCK2sxFhps9wyfZg5XZwwxnRK8 0uNHxdA3IMvYJTR1EkXR9Xjz095zQ1X/YwCxAKdnxkBtl0A+xCY/HDjGPNtesKtBfmkUXV zwHANIZGAG6voEXPRylfB5z8KlZVBVE= 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-267-sHJr98qlNeWmDG17MSJU5w-1; Sun, 20 Oct 2019 18:59:32 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 478D5107AD31; Sun, 20 Oct 2019 22:59:29 +0000 (UTC) Received: from x1w.redhat.com (ovpn-204-40.brq.redhat.com [10.40.204.40]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 5BEDC60C18; Sun, 20 Oct 2019 22:59:11 +0000 (UTC) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: Paolo Bonzini , Igor Mammedov , qemu-devel@nongnu.org, Markus Armbruster , Eduardo Habkost Subject: [PATCH 07/21] hw: Drop QOM ownership on memory_region_allocate_system_memory() calls Date: Mon, 21 Oct 2019 00:56:36 +0200 Message-Id: <20191020225650.3671-8-philmd@redhat.com> In-Reply-To: <20191020225650.3671-1-philmd@redhat.com> References: <20191020225650.3671-1-philmd@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-MC-Unique: sHJr98qlNeWmDG17MSJU5w-1 X-Mimecast-Spam-Score: 0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 207.211.31.81 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: Paul Burton , Peter Maydell , "Michael S. Tsirkin" , Leif Lindholm , Mark Cave-Ayland , KONRAD Frederic , "Edgar E. Iglesias" , Rob Herring , Andrey Smirnov , Helge Deller , =?utf-8?q?Herv=C3=A9_Poussineau?= , Joel Stanley , Aleksandar Rikalo , Richard Henderson , Artyom Tarasenko , Antony Pavlov , Alistair Francis , Fabien Chouteau , Beniamino Galvani , qemu-arm@nongnu.org, Peter Chubb , =?utf-8?q?C=C3=A9dric_Le_Goat?= =?utf-8?q?er?= , David Gibson , Radoslaw Biernacki , Thomas Huth , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?b?w6k=?= , Andrew Baumann , Jean-Christophe Dubois , Andrew Jeffery , Michael Walle , qemu-ppc@nongnu.org, Aleksandar Markovic , Jan Kiszka , Aurelien Jarno Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" All the memory_region_allocate_system_memory() calls are in the board_init() code. From the 58 calls in the repository, only 4 set the 'owner' parameter. It is obvious we want the Machine to be the owner of the RAM, so we want to use OBJECT(machine) as owner. We can simplify a bit by passing MachineState to memory_region_allocate_system_memory(). In preparation of this refactor, first drop the 'owner' argument from these 4 uses. $ git grep memory_region_allocate_system_memory hw/ | wc -l 58 Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Alistair Francis Reviewed-by: Artyom Tarasenko --- hw/alpha/typhoon.c | 2 +- hw/arm/raspi.c | 2 +- hw/hppa/machine.c | 2 +- hw/sparc/sun4m.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/hw/alpha/typhoon.c b/hw/alpha/typhoon.c index 179e1f7658..8489ec335c 100644 --- a/hw/alpha/typhoon.c +++ b/hw/alpha/typhoon.c @@ -851,7 +851,7 @@ PCIBus *typhoon_init(ram_addr_t ram_size, ISABus **isa_bus, /* Main memory region, 0x00.0000.0000. Real hardware supports 32GB, but the address space hole reserved at this point is 8TB. */ - memory_region_allocate_system_memory(&s->ram_region, OBJECT(s), "ram", + memory_region_allocate_system_memory(&s->ram_region, NULL, "ram", ram_size); memory_region_add_subregion(addr_space, 0, &s->ram_region); diff --git a/hw/arm/raspi.c b/hw/arm/raspi.c index 615d755879..f76b6eaad3 100644 --- a/hw/arm/raspi.c +++ b/hw/arm/raspi.c @@ -182,7 +182,7 @@ static void raspi_init(MachineState *machine, int version) &error_abort, NULL); /* Allocate and map RAM */ - memory_region_allocate_system_memory(&s->ram, OBJECT(machine), "ram", + memory_region_allocate_system_memory(&s->ram, NULL, "ram", machine->ram_size); /* FIXME: Remove when we have custom CPU address space support */ memory_region_add_subregion_overlap(get_system_memory(), 0, &s->ram, 0); diff --git a/hw/hppa/machine.c b/hw/hppa/machine.c index 953d454f48..dbe1ff0fe5 100644 --- a/hw/hppa/machine.c +++ b/hw/hppa/machine.c @@ -96,7 +96,7 @@ static void machine_hppa_init(MachineState *machine) /* Main memory region. */ ram_region = g_new(MemoryRegion, 1); - memory_region_allocate_system_memory(ram_region, OBJECT(machine), + memory_region_allocate_system_memory(ram_region, NULL, "ram", ram_size); memory_region_add_subregion(addr_space, 0, ram_region); diff --git a/hw/sparc/sun4m.c b/hw/sparc/sun4m.c index 6c5a17a020..0bb7524655 100644 --- a/hw/sparc/sun4m.c +++ b/hw/sparc/sun4m.c @@ -788,7 +788,7 @@ static void ram_realize(DeviceState *dev, Error **errp) RamDevice *d = SUN4M_RAM(dev); SysBusDevice *sbd = SYS_BUS_DEVICE(dev); - memory_region_allocate_system_memory(&d->ram, OBJECT(d), "sun4m.ram", + memory_region_allocate_system_memory(&d->ram, NULL, "sun4m.ram", d->size); sysbus_init_mmio(sbd, &d->ram); } From patchwork Sun Oct 20 22:56:37 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 1180098 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.b="XtfDOisJ"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46xFmG0rfFz9sP6 for ; Mon, 21 Oct 2019 10:07:42 +1100 (AEDT) Received: from localhost ([::1]:51192 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iMKIV-00075S-Ac for incoming@patchwork.ozlabs.org; Sun, 20 Oct 2019 19:07:39 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34774) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iMKB2-0001Az-TM for qemu-devel@nongnu.org; Sun, 20 Oct 2019 18:59:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iMKB1-0001Gw-Bn for qemu-devel@nongnu.org; Sun, 20 Oct 2019 18:59:56 -0400 Received: from us-smtp-1.mimecast.com ([207.211.31.81]:34904 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 1iMKB1-0001Fw-87 for qemu-devel@nongnu.org; Sun, 20 Oct 2019 18:59:55 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1571612394; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=OSzxhfBjRtdS3tYnNag/BhLYbc88B8grh2N4vY+Fq+o=; b=XtfDOisJv3Uck5klKxCEXzxStcmyBzW02vsuVw3wpRh22h51hLveH0FAEXyfdbOlLBnbgH Jo2WRitLON9+Os398XYrThohg0Ov0lCSv9lJM8RIX+q0S7LOSbjJ4Yo5hOj0J6SgYhCWr2 aXVohYEWChUfX3VYuUx76R4WxW5dy4Q= 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-177-aywJjEjxOyyn1SNA9RuIhw-1; Sun, 20 Oct 2019 18:59:53 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 5A78A80183E; Sun, 20 Oct 2019 22:59:49 +0000 (UTC) Received: from x1w.redhat.com (ovpn-204-40.brq.redhat.com [10.40.204.40]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 0BB1360C18; Sun, 20 Oct 2019 22:59:29 +0000 (UTC) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: Paolo Bonzini , Igor Mammedov , qemu-devel@nongnu.org, Markus Armbruster , Eduardo Habkost Subject: [PATCH 08/21] hw/alpha/dp264: Create the RAM in the board Date: Mon, 21 Oct 2019 00:56:37 +0200 Message-Id: <20191020225650.3671-9-philmd@redhat.com> In-Reply-To: <20191020225650.3671-1-philmd@redhat.com> References: <20191020225650.3671-1-philmd@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-MC-Unique: aywJjEjxOyyn1SNA9RuIhw-1 X-Mimecast-Spam-Score: 0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 207.211.31.81 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: Paul Burton , Peter Maydell , "Michael S. Tsirkin" , Leif Lindholm , Mark Cave-Ayland , KONRAD Frederic , "Edgar E. Iglesias" , Rob Herring , Andrey Smirnov , Helge Deller , =?utf-8?q?Herv=C3=A9_Poussineau?= , Joel Stanley , Aleksandar Rikalo , Richard Henderson , Artyom Tarasenko , Antony Pavlov , Alistair Francis , Fabien Chouteau , Beniamino Galvani , qemu-arm@nongnu.org, Peter Chubb , =?utf-8?q?C=C3=A9dric_Le_Goat?= =?utf-8?q?er?= , David Gibson , Radoslaw Biernacki , Thomas Huth , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?b?w6k=?= , Andrew Baumann , Jean-Christophe Dubois , Andrew Jeffery , Michael Walle , qemu-ppc@nongnu.org, Aleksandar Markovic , Jan Kiszka , Aurelien Jarno Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" The SDRAM is incorrectly created in the Tyohoon northbridge ASIC. Move its creation in the board code, this will later allow the board to have the QOM ownership of the RAM. Signed-off-by: Philippe Mathieu-Daudé --- checkpatch complains: ERROR: spaces required around that '*' (ctx:WxV) #10: FILE: hw/alpha/alpha_sys.h:13: +PCIBus *typhoon_init(ISABus **, qemu_irq *, AlphaCPU *[4], ^ --- hw/alpha/alpha_sys.h | 2 +- hw/alpha/dp264.c | 11 ++++++++++- hw/alpha/typhoon.c | 9 +-------- 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/hw/alpha/alpha_sys.h b/hw/alpha/alpha_sys.h index 4e127a6de8..17f97e1bfe 100644 --- a/hw/alpha/alpha_sys.h +++ b/hw/alpha/alpha_sys.h @@ -10,7 +10,7 @@ #include "hw/i386/pc.h" -PCIBus *typhoon_init(ram_addr_t, ISABus **, qemu_irq *, AlphaCPU *[4], +PCIBus *typhoon_init(ISABus **, qemu_irq *, AlphaCPU *[4], pci_map_irq_fn); /* alpha_pci.c. */ diff --git a/hw/alpha/dp264.c b/hw/alpha/dp264.c index 51feee8558..ddc249261c 100644 --- a/hw/alpha/dp264.c +++ b/hw/alpha/dp264.c @@ -62,6 +62,7 @@ static void clipper_init(MachineState *machine) uint64_t palcode_entry, palcode_low, palcode_high; uint64_t kernel_entry, kernel_low, kernel_high; unsigned int smp_cpus = machine->smp.cpus; + MemoryRegion ram_region; /* Create up to 4 cpus. */ memset(cpus, 0, sizeof(cpus)); @@ -73,8 +74,16 @@ static void clipper_init(MachineState *machine) cpus[0]->env.trap_arg1 = 0; cpus[0]->env.trap_arg2 = smp_cpus; + /* + * Main memory region, 0x00.0000.0000. Real hardware supports 32GB, + * but the address space hole reserved at this point is 8TB. + */ + memory_region_allocate_system_memory(&ram_region, NULL, "ram", + ram_size); + memory_region_add_subregion(get_system_memory(), 0, &ram_region); + /* Init the chipset. */ - pci_bus = typhoon_init(ram_size, &isa_bus, &rtc_irq, cpus, + pci_bus = typhoon_init(&isa_bus, &rtc_irq, cpus, clipper_pci_map_irq); /* Since we have an SRM-compatible PALcode, use the SRM epoch. */ diff --git a/hw/alpha/typhoon.c b/hw/alpha/typhoon.c index 8489ec335c..12589ef331 100644 --- a/hw/alpha/typhoon.c +++ b/hw/alpha/typhoon.c @@ -58,7 +58,6 @@ typedef struct TyphoonState { TyphoonCchip cchip; TyphoonPchip pchip; MemoryRegion dchip_region; - MemoryRegion ram_region; } TyphoonState; /* Called when one of DRIR or DIM changes. */ @@ -817,7 +816,7 @@ static void typhoon_alarm_timer(void *opaque) cpu_interrupt(CPU(s->cchip.cpu[cpu]), CPU_INTERRUPT_TIMER); } -PCIBus *typhoon_init(ram_addr_t ram_size, ISABus **isa_bus, +PCIBus *typhoon_init(ISABus **isa_bus, qemu_irq *p_rtc_irq, AlphaCPU *cpus[4], pci_map_irq_fn sys_map_irq) { @@ -849,12 +848,6 @@ PCIBus *typhoon_init(ram_addr_t ram_size, ISABus **isa_bus, *p_rtc_irq = qemu_allocate_irq(typhoon_set_timer_irq, s, 0); - /* Main memory region, 0x00.0000.0000. Real hardware supports 32GB, - but the address space hole reserved at this point is 8TB. */ - memory_region_allocate_system_memory(&s->ram_region, NULL, "ram", - ram_size); - memory_region_add_subregion(addr_space, 0, &s->ram_region); - /* TIGbus, 0x801.0000.0000, 1GB. */ /* ??? The TIGbus is used for delivering interrupts, and access to the flash ROM. I'm not sure that we need to implement it at all. */ From patchwork Sun Oct 20 22:56:38 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 1180104 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.b="SCZJC8OZ"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46xFvx14Jvz9sP6 for ; Mon, 21 Oct 2019 10:14:20 +1100 (AEDT) Received: from localhost ([::1]:51292 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iMKOw-0005JB-4n for incoming@patchwork.ozlabs.org; Sun, 20 Oct 2019 19:14:18 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34854) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iMKBS-0001iT-RL for qemu-devel@nongnu.org; Sun, 20 Oct 2019 19:00:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iMKBR-0001XA-2l for qemu-devel@nongnu.org; Sun, 20 Oct 2019 19:00:22 -0400 Received: from us-smtp-1.mimecast.com ([205.139.110.61]:23252 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 1iMKBQ-0001Ws-T9 for qemu-devel@nongnu.org; Sun, 20 Oct 2019 19:00:20 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1571612420; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=LBfcXdZi7rmaayMUIJe621EviYh+sNbuG1duBKXRdNY=; b=SCZJC8OZ3ADs7OYyklSAdLQboARsYvBuWE2Lpmv/JX4xhiWwaDMLXcQnqz1zfqVzKoxkKm Mcth87pAzT/Wy9xZJndLuSNMEqTCsyEnzo31z1SAVbhZrM2COmA1EvCUBv6Ql9CZQS9u2p ve2LBvHrokzyM0fbMlEHxRgjOqoHpGY= 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-254-8yE4KQl8NF6B_y0XkBCCtQ-1; Sun, 20 Oct 2019 19:00:16 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 999DB800D41; Sun, 20 Oct 2019 23:00:12 +0000 (UTC) Received: from x1w.redhat.com (ovpn-204-40.brq.redhat.com [10.40.204.40]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 0BFD860C18; Sun, 20 Oct 2019 22:59:49 +0000 (UTC) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: Paolo Bonzini , Igor Mammedov , qemu-devel@nongnu.org, Markus Armbruster , Eduardo Habkost Subject: [PATCH 09/21] hw: Let memory_region_allocate_system_memory take MachineState argument Date: Mon, 21 Oct 2019 00:56:38 +0200 Message-Id: <20191020225650.3671-10-philmd@redhat.com> In-Reply-To: <20191020225650.3671-1-philmd@redhat.com> References: <20191020225650.3671-1-philmd@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-MC-Unique: 8yE4KQl8NF6B_y0XkBCCtQ-1 X-Mimecast-Spam-Score: 0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] 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: Paul Burton , Peter Maydell , "Michael S. Tsirkin" , Leif Lindholm , Mark Cave-Ayland , KONRAD Frederic , "Edgar E. Iglesias" , Rob Herring , Andrey Smirnov , Helge Deller , =?utf-8?q?Herv=C3=A9_Poussineau?= , Joel Stanley , Aleksandar Rikalo , Richard Henderson , Artyom Tarasenko , Antony Pavlov , Alistair Francis , Fabien Chouteau , Beniamino Galvani , qemu-arm@nongnu.org, Peter Chubb , =?utf-8?q?C=C3=A9dric_Le_Goat?= =?utf-8?q?er?= , David Gibson , Radoslaw Biernacki , Thomas Huth , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?b?w6k=?= , Andrew Baumann , Jean-Christophe Dubois , Andrew Jeffery , Michael Walle , qemu-ppc@nongnu.org, Aleksandar Markovic , Jan Kiszka , Aurelien Jarno Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" All the codebase calls memory_region_allocate_system_memory() with a NULL 'owner' from the board_init() function. Let pass a MachineState argument, and enforce the QOM ownership of the system memory. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Alistair Francis --- hw/core/numa.c | 11 +++++++---- include/hw/boards.h | 6 ++++-- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/hw/core/numa.c b/hw/core/numa.c index 038c96d4ab..2e29e4bfe0 100644 --- a/hw/core/numa.c +++ b/hw/core/numa.c @@ -520,21 +520,24 @@ static void allocate_system_memory_nonnuma(MemoryRegion *mr, Object *owner, vmstate_register_ram_global(mr); } -void memory_region_allocate_system_memory(MemoryRegion *mr, Object *owner, +void memory_region_allocate_system_memory(MemoryRegion *mr, MachineState *ms, const char *name, uint64_t ram_size) { uint64_t addr = 0; int i; - MachineState *ms = MACHINE(qdev_get_machine()); + + if (!ms) { + ms = MACHINE(qdev_get_machine()); + } if (ms->numa_state == NULL || ms->numa_state->num_nodes == 0 || !have_memdevs) { - allocate_system_memory_nonnuma(mr, owner, name, ram_size); + allocate_system_memory_nonnuma(mr, OBJECT(ms), name, ram_size); return; } - memory_region_init(mr, owner, name, ram_size); + memory_region_init(mr, OBJECT(ms), name, ram_size); for (i = 0; i < ms->numa_state->num_nodes; i++) { uint64_t size = ms->numa_state->nodes[i].node_mem; HostMemoryBackend *backend = ms->numa_state->nodes[i].node_memdev; diff --git a/include/hw/boards.h b/include/hw/boards.h index de45087f34..3b6cb82b6c 100644 --- a/include/hw/boards.h +++ b/include/hw/boards.h @@ -14,7 +14,7 @@ /** * 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 + * @ms: the #MachineState object that own the system memory * @name: name of the memory region * @ram_size: size of the region in bytes * @@ -38,8 +38,10 @@ * 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(). + * + * The #MachineState object will track the region's reference count. */ -void memory_region_allocate_system_memory(MemoryRegion *mr, Object *owner, +void memory_region_allocate_system_memory(MemoryRegion *mr, MachineState *ms, const char *name, uint64_t ram_size); From patchwork Sun Oct 20 22:56:39 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 1180097 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.b="aEyNJ++5"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46xFmC0cdJz9sP6 for ; Mon, 21 Oct 2019 10:07:39 +1100 (AEDT) Received: from localhost ([::1]:51196 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iMKIS-00075y-A6 for incoming@patchwork.ozlabs.org; Sun, 20 Oct 2019 19:07:36 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34937) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iMKBr-0001tv-Il for qemu-devel@nongnu.org; Sun, 20 Oct 2019 19:00:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iMKBl-0001gP-Mo for qemu-devel@nongnu.org; Sun, 20 Oct 2019 19:00:47 -0400 Received: from us-smtp-1.mimecast.com ([205.139.110.61]:34415 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 1iMKBl-0001ee-G6 for qemu-devel@nongnu.org; Sun, 20 Oct 2019 19:00:41 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1571612439; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ZRBJeBkO3O0fTTg2Wvp4cn/VQrb14msYc8Y6kPVTC14=; b=aEyNJ++5flaOQYY5WJ7U8MWnvn8fmYh9ob48ghGgXTQGx/5kk1gyvb1IIenj+k105OSTp5 G4qaKzK2EypHAmm+PHTrR3KPQXJrgBXKyec8sDiLpJq4LzydCKjCGGGdSxU/KZqMps0Rwg q3Zy8uq+oO/fZ2837WBWN1h1gmP4Rjk= 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-70-Zm89ON0bPtObZvoK7sixOA-1; Sun, 20 Oct 2019 19:00:35 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 238B480183E; Sun, 20 Oct 2019 23:00:31 +0000 (UTC) Received: from x1w.redhat.com (ovpn-204-40.brq.redhat.com [10.40.204.40]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 3DE7060C18; Sun, 20 Oct 2019 23:00:13 +0000 (UTC) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: Paolo Bonzini , Igor Mammedov , qemu-devel@nongnu.org, Markus Armbruster , Eduardo Habkost Subject: [PATCH 10/21] hw/core: Let the machine be the owner of the system memory Date: Mon, 21 Oct 2019 00:56:39 +0200 Message-Id: <20191020225650.3671-11-philmd@redhat.com> In-Reply-To: <20191020225650.3671-1-philmd@redhat.com> References: <20191020225650.3671-1-philmd@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-MC-Unique: Zm89ON0bPtObZvoK7sixOA-1 X-Mimecast-Spam-Score: 0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] 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: Paul Burton , Peter Maydell , "Michael S. Tsirkin" , Leif Lindholm , Mark Cave-Ayland , KONRAD Frederic , "Edgar E. Iglesias" , Rob Herring , Andrey Smirnov , Helge Deller , =?utf-8?q?Herv=C3=A9_Poussineau?= , Joel Stanley , Aleksandar Rikalo , Richard Henderson , Artyom Tarasenko , Antony Pavlov , Alistair Francis , Fabien Chouteau , Beniamino Galvani , qemu-arm@nongnu.org, Peter Chubb , =?utf-8?q?C=C3=A9dric_Le_Goat?= =?utf-8?q?er?= , David Gibson , Radoslaw Biernacki , Thomas Huth , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?b?w6k=?= , Andrew Baumann , Jean-Christophe Dubois , Andrew Jeffery , Michael Walle , qemu-ppc@nongnu.org, Aleksandar Markovic , Jan Kiszka , Aurelien Jarno Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Alistair Francis --- hw/core/null-machine.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/core/null-machine.c b/hw/core/null-machine.c index 1aa0a9a01a..16546c8140 100644 --- a/hw/core/null-machine.c +++ b/hw/core/null-machine.c @@ -35,7 +35,7 @@ static void machine_none_init(MachineState *mch) if (mch->ram_size) { MemoryRegion *ram = g_new(MemoryRegion, 1); - memory_region_allocate_system_memory(ram, NULL, "ram", mch->ram_size); + memory_region_allocate_system_memory(ram, mch, "ram", mch->ram_size); memory_region_add_subregion(get_system_memory(), 0, ram); } From patchwork Sun Oct 20 22:56:40 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 1180107 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.b="cveS1EZw"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46xFzS6NPJz9sP6 for ; Mon, 21 Oct 2019 10:17:24 +1100 (AEDT) Received: from localhost ([::1]:51350 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iMKRu-0000eh-JB for incoming@patchwork.ozlabs.org; Sun, 20 Oct 2019 19:17:22 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35021) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iMKC3-0001zI-Lq for qemu-devel@nongnu.org; Sun, 20 Oct 2019 19:01:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iMKC2-0001on-J4 for qemu-devel@nongnu.org; Sun, 20 Oct 2019 19:00:59 -0400 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:22856 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iMKC2-0001oL-Cu for qemu-devel@nongnu.org; Sun, 20 Oct 2019 19:00:58 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1571612458; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=V/98bWzvlzdStlbmzrzSO31ZGETUcQ5bD8hgywTwVrQ=; b=cveS1EZw56ZlC1e8zji2BwBfT3d07IO/0v0UiUvImQAVGNhE0KUgSGDrAjpIGWCm83eaf4 8O/KuWt6VBdArXNrfhaxMq06EKjEWnGI9TqOo9ge83CEtdOI/tsIlUjz3YGXh4yiWkV0cD Nz1cIxL26Q6yi+zmS0BRAtQRttev7tg= 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-7-_r-ooev0M6WV5IRF89L3Kg-1; Sun, 20 Oct 2019 19:00:54 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 960341800D9B; Sun, 20 Oct 2019 23:00:50 +0000 (UTC) Received: from x1w.redhat.com (ovpn-204-40.brq.redhat.com [10.40.204.40]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A7ABF60C18; Sun, 20 Oct 2019 23:00:31 +0000 (UTC) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: Paolo Bonzini , Igor Mammedov , qemu-devel@nongnu.org, Markus Armbruster , Eduardo Habkost Subject: [PATCH 11/21] hw/alpha: Let the machine be the owner of the system memory Date: Mon, 21 Oct 2019 00:56:40 +0200 Message-Id: <20191020225650.3671-12-philmd@redhat.com> In-Reply-To: <20191020225650.3671-1-philmd@redhat.com> References: <20191020225650.3671-1-philmd@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-MC-Unique: _r-ooev0M6WV5IRF89L3Kg-1 X-Mimecast-Spam-Score: 0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 207.211.31.120 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: Paul Burton , Peter Maydell , "Michael S. Tsirkin" , Leif Lindholm , Mark Cave-Ayland , KONRAD Frederic , "Edgar E. Iglesias" , Rob Herring , Andrey Smirnov , Helge Deller , =?utf-8?q?Herv=C3=A9_Poussineau?= , Joel Stanley , Aleksandar Rikalo , Richard Henderson , Artyom Tarasenko , Antony Pavlov , Alistair Francis , Fabien Chouteau , Beniamino Galvani , qemu-arm@nongnu.org, Peter Chubb , =?utf-8?q?C=C3=A9dric_Le_Goat?= =?utf-8?q?er?= , David Gibson , Radoslaw Biernacki , Thomas Huth , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?b?w6k=?= , Andrew Baumann , Jean-Christophe Dubois , Andrew Jeffery , Michael Walle , qemu-ppc@nongnu.org, Aleksandar Markovic , Jan Kiszka , Aurelien Jarno Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Philippe Mathieu-Daudé --- hw/alpha/dp264.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/alpha/dp264.c b/hw/alpha/dp264.c index ddc249261c..5696b1e79b 100644 --- a/hw/alpha/dp264.c +++ b/hw/alpha/dp264.c @@ -78,7 +78,7 @@ static void clipper_init(MachineState *machine) * Main memory region, 0x00.0000.0000. Real hardware supports 32GB, * but the address space hole reserved at this point is 8TB. */ - memory_region_allocate_system_memory(&ram_region, NULL, "ram", + memory_region_allocate_system_memory(&ram_region, machine, "ram", ram_size); memory_region_add_subregion(get_system_memory(), 0, &ram_region); From patchwork Sun Oct 20 22:56:41 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 1180102 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.b="g1htgIpI"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46xFsG3t40z9sP6 for ; Mon, 21 Oct 2019 10:12:02 +1100 (AEDT) Received: from localhost ([::1]:51268 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iMKMi-0003qz-65 for incoming@patchwork.ozlabs.org; Sun, 20 Oct 2019 19:12:00 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35066) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iMKCU-000272-Fm for qemu-devel@nongnu.org; Sun, 20 Oct 2019 19:01:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iMKCO-0001w9-4v for qemu-devel@nongnu.org; Sun, 20 Oct 2019 19:01:24 -0400 Received: from us-smtp-1.mimecast.com ([207.211.31.81]:49432 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 1iMKCN-0001vc-VD for qemu-devel@nongnu.org; Sun, 20 Oct 2019 19:01:20 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1571612479; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=7Jc2f00M6xHmkHXXGb5T12BbzTsN0gBBhZ999arg5vI=; b=g1htgIpIsY3YI91Q/wLoTlpv3WXOYA5nxYru5LMucfSuiS6iYSWe8tdzE6d2714Zc+5y3x astD5xzV4SJ/YGr9ofg8ttwvGy7bl7TerqSsLpTaD0pZP+8n91Y3y5+0PQiNrXTgLn3t4f ezDAPhMzyRw5IWN1PqscRl0pQwgMzZ0= 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-211-knGsZIHFNQCyvtw1Hyg-Bg-1; Sun, 20 Oct 2019 19:01:15 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 652961005509; Sun, 20 Oct 2019 23:01:11 +0000 (UTC) Received: from x1w.redhat.com (ovpn-204-40.brq.redhat.com [10.40.204.40]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A97D460C18; Sun, 20 Oct 2019 23:00:51 +0000 (UTC) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: Paolo Bonzini , Igor Mammedov , qemu-devel@nongnu.org, Markus Armbruster , Eduardo Habkost Subject: [PATCH 12/21] hw/arm: Let the machine be the owner of the system memory Date: Mon, 21 Oct 2019 00:56:41 +0200 Message-Id: <20191020225650.3671-13-philmd@redhat.com> In-Reply-To: <20191020225650.3671-1-philmd@redhat.com> References: <20191020225650.3671-1-philmd@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-MC-Unique: knGsZIHFNQCyvtw1Hyg-Bg-1 X-Mimecast-Spam-Score: 0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 207.211.31.81 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: Paul Burton , Peter Maydell , "Michael S. Tsirkin" , Leif Lindholm , Mark Cave-Ayland , KONRAD Frederic , "Edgar E. Iglesias" , Rob Herring , Andrey Smirnov , Helge Deller , =?utf-8?q?Herv=C3=A9_Poussineau?= , Joel Stanley , Aleksandar Rikalo , Richard Henderson , Artyom Tarasenko , Antony Pavlov , Alistair Francis , Fabien Chouteau , Beniamino Galvani , qemu-arm@nongnu.org, Peter Chubb , =?utf-8?q?C=C3=A9dric_Le_Goat?= =?utf-8?q?er?= , David Gibson , Radoslaw Biernacki , Thomas Huth , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?b?w6k=?= , Andrew Baumann , Jean-Christophe Dubois , Andrew Jeffery , Michael Walle , qemu-ppc@nongnu.org, Aleksandar Markovic , Jan Kiszka , Aurelien Jarno Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Philippe Mathieu-Daudé --- hw/arm/aspeed.c | 2 +- hw/arm/collie.c | 2 +- hw/arm/cubieboard.c | 2 +- hw/arm/digic_boards.c | 7 ++++--- hw/arm/highbank.c | 3 ++- hw/arm/imx25_pdk.c | 2 +- hw/arm/integratorcp.c | 2 +- hw/arm/kzm.c | 2 +- hw/arm/mcimx6ul-evk.c | 2 +- hw/arm/mcimx7d-sabre.c | 2 +- hw/arm/mps2-tz.c | 4 ++-- hw/arm/mps2.c | 4 ++-- hw/arm/musicpal.c | 2 +- hw/arm/nseries.c | 2 +- hw/arm/omap_sx1.c | 2 +- hw/arm/palm.c | 2 +- hw/arm/raspi.c | 2 +- hw/arm/sabrelite.c | 2 +- hw/arm/sbsa-ref.c | 2 +- hw/arm/versatilepb.c | 2 +- hw/arm/vexpress.c | 4 ++-- hw/arm/virt.c | 2 +- hw/arm/xilinx_zynq.c | 2 +- hw/arm/xlnx-versal-virt.c | 2 +- hw/arm/xlnx-zcu102.c | 2 +- 25 files changed, 32 insertions(+), 30 deletions(-) diff --git a/hw/arm/aspeed.c b/hw/arm/aspeed.c index 52993f84b4..f2a52e1ade 100644 --- a/hw/arm/aspeed.c +++ b/hw/arm/aspeed.c @@ -212,7 +212,7 @@ static void aspeed_board_init(MachineState *machine, ram_size = object_property_get_uint(OBJECT(&bmc->soc), "ram-size", &error_abort); - memory_region_allocate_system_memory(&bmc->ram, NULL, "ram", ram_size); + memory_region_allocate_system_memory(&bmc->ram, machine, "ram", ram_size); memory_region_add_subregion(&bmc->ram_container, 0, &bmc->ram); memory_region_add_subregion(get_system_memory(), sc->memmap[ASPEED_SDRAM], diff --git a/hw/arm/collie.c b/hw/arm/collie.c index 970a4405cc..632531a88d 100644 --- a/hw/arm/collie.c +++ b/hw/arm/collie.c @@ -31,7 +31,7 @@ static void collie_init(MachineState *machine) s = sa1110_init(machine->cpu_type); - memory_region_allocate_system_memory(sdram, NULL, "strongarm.sdram", + memory_region_allocate_system_memory(sdram, machine, "strongarm.sdram", collie_binfo.ram_size); memory_region_add_subregion(get_system_memory(), SA_SDCS0, sdram); diff --git a/hw/arm/cubieboard.c b/hw/arm/cubieboard.c index 6dc2f1d6b6..b76ad7ef69 100644 --- a/hw/arm/cubieboard.c +++ b/hw/arm/cubieboard.c @@ -65,7 +65,7 @@ static void cubieboard_init(MachineState *machine) exit(1); } - memory_region_allocate_system_memory(&s->sdram, NULL, "cubieboard.ram", + memory_region_allocate_system_memory(&s->sdram, machine, "cubieboard.ram", machine->ram_size); memory_region_add_subregion(get_system_memory(), AW_A10_SDRAM_BASE, &s->sdram); diff --git a/hw/arm/digic_boards.c b/hw/arm/digic_boards.c index ef3fc2b6a5..f3d1febe87 100644 --- a/hw/arm/digic_boards.c +++ b/hw/arm/digic_boards.c @@ -53,7 +53,7 @@ typedef struct DigicBoard { const char *rom1_def_filename; } DigicBoard; -static void digic4_board_init(DigicBoard *board) +static void digic4_board_init(MachineState *machine, DigicBoard *board) { Error *err = NULL; @@ -66,7 +66,8 @@ static void digic4_board_init(DigicBoard *board) exit(1); } - memory_region_allocate_system_memory(&s->ram, NULL, "ram", board->ram_size); + memory_region_allocate_system_memory(&s->ram, machine, "ram", + board->ram_size); memory_region_add_subregion(get_system_memory(), 0, &s->ram); if (board->add_rom0) { @@ -142,7 +143,7 @@ static DigicBoard digic4_board_canon_a1100 = { static void canon_a1100_init(MachineState *machine) { - digic4_board_init(&digic4_board_canon_a1100); + digic4_board_init(machine, &digic4_board_canon_a1100); } static void canon_a1100_machine_init(MachineClass *mc) diff --git a/hw/arm/highbank.c b/hw/arm/highbank.c index f1724d6929..57e549ec00 100644 --- a/hw/arm/highbank.c +++ b/hw/arm/highbank.c @@ -290,7 +290,8 @@ static void calxeda_init(MachineState *machine, enum cxmachines machine_id) sysmem = get_system_memory(); dram = g_new(MemoryRegion, 1); - memory_region_allocate_system_memory(dram, NULL, "highbank.dram", ram_size); + memory_region_allocate_system_memory(dram, machine, "highbank.dram", + ram_size); /* SDRAM at address zero. */ memory_region_add_subregion(sysmem, 0, dram); diff --git a/hw/arm/imx25_pdk.c b/hw/arm/imx25_pdk.c index c76fc2bd94..e88d325e10 100644 --- a/hw/arm/imx25_pdk.c +++ b/hw/arm/imx25_pdk.c @@ -84,7 +84,7 @@ static void imx25_pdk_init(MachineState *machine) machine->ram_size = FSL_IMX25_SDRAM0_SIZE + FSL_IMX25_SDRAM1_SIZE; } - memory_region_allocate_system_memory(&s->ram, NULL, "imx25.ram", + memory_region_allocate_system_memory(&s->ram, machine, "imx25.ram", machine->ram_size); memory_region_add_subregion(get_system_memory(), FSL_IMX25_SDRAM0_ADDR, &s->ram); diff --git a/hw/arm/integratorcp.c b/hw/arm/integratorcp.c index 524970840d..a8053be396 100644 --- a/hw/arm/integratorcp.c +++ b/hw/arm/integratorcp.c @@ -605,7 +605,7 @@ static void integratorcp_init(MachineState *machine) cpu = ARM_CPU(cpuobj); - memory_region_allocate_system_memory(ram, NULL, "integrator.ram", + memory_region_allocate_system_memory(ram, machine, "integrator.ram", ram_size); /* ??? On a real system the first 1Mb is mapped as SSRAM or boot flash. */ /* ??? RAM should repeat to fill physical memory space. */ diff --git a/hw/arm/kzm.c b/hw/arm/kzm.c index 1d5ef289d5..e81bd8e0dc 100644 --- a/hw/arm/kzm.c +++ b/hw/arm/kzm.c @@ -84,7 +84,7 @@ static void kzm_init(MachineState *machine) machine->ram_size = FSL_IMX31_SDRAM0_SIZE + FSL_IMX31_SDRAM1_SIZE; } - memory_region_allocate_system_memory(&s->ram, NULL, "kzm.ram", + memory_region_allocate_system_memory(&s->ram, machine, "kzm.ram", machine->ram_size); memory_region_add_subregion(get_system_memory(), FSL_IMX31_SDRAM0_ADDR, &s->ram); diff --git a/hw/arm/mcimx6ul-evk.c b/hw/arm/mcimx6ul-evk.c index e90b393a44..95653db599 100644 --- a/hw/arm/mcimx6ul-evk.c +++ b/hw/arm/mcimx6ul-evk.c @@ -48,7 +48,7 @@ static void mcimx6ul_evk_init(MachineState *machine) object_property_set_bool(OBJECT(&s->soc), true, "realized", &error_fatal); - memory_region_allocate_system_memory(&s->ram, NULL, "mcimx6ul-evk.ram", + memory_region_allocate_system_memory(&s->ram, machine, "mcimx6ul-evk.ram", machine->ram_size); memory_region_add_subregion(get_system_memory(), FSL_IMX6UL_MMDC_ADDR, &s->ram); diff --git a/hw/arm/mcimx7d-sabre.c b/hw/arm/mcimx7d-sabre.c index 0d1f62d30a..d535a119f7 100644 --- a/hw/arm/mcimx7d-sabre.c +++ b/hw/arm/mcimx7d-sabre.c @@ -50,7 +50,7 @@ static void mcimx7d_sabre_init(MachineState *machine) TYPE_FSL_IMX7, &error_fatal, NULL); object_property_set_bool(OBJECT(&s->soc), true, "realized", &error_fatal); - memory_region_allocate_system_memory(&s->ram, NULL, "mcimx7d-sabre.ram", + memory_region_allocate_system_memory(&s->ram, machine, "mcimx7d-sabre.ram", machine->ram_size); memory_region_add_subregion(get_system_memory(), FSL_IMX7_MMDC_ADDR, &s->ram); diff --git a/hw/arm/mps2-tz.c b/hw/arm/mps2-tz.c index f8b620bcc6..96fe815361 100644 --- a/hw/arm/mps2-tz.c +++ b/hw/arm/mps2-tz.c @@ -458,8 +458,8 @@ static void mps2tz_common_init(MachineState *machine) * tradeoffs. For QEMU they're all just RAM, though. We arbitrarily * call the 16MB our "system memory", as it's the largest lump. */ - memory_region_allocate_system_memory(&mms->psram, - NULL, "mps.ram", 16 * MiB); + memory_region_allocate_system_memory(&mms->psram, machine, + "mps.ram", 16 * MiB); memory_region_add_subregion(system_memory, 0x80000000, &mms->psram); /* The overflow IRQs for all UARTs are ORed together. diff --git a/hw/arm/mps2.c b/hw/arm/mps2.c index d002b126d3..4687bc7ed1 100644 --- a/hw/arm/mps2.c +++ b/hw/arm/mps2.c @@ -146,8 +146,8 @@ static void mps2_common_init(MachineState *machine) * This is of no use for QEMU so we don't implement it (as if * zbt_boot_ctrl is always zero). */ - memory_region_allocate_system_memory(&mms->psram, - NULL, "mps.ram", 16 * MiB); + memory_region_allocate_system_memory(&mms->psram, machine, + "mps.ram", 16 * MiB); memory_region_add_subregion(system_memory, 0x21000000, &mms->psram); switch (mmc->fpga_type) { diff --git a/hw/arm/musicpal.c b/hw/arm/musicpal.c index f68a399a98..2a2c7b3abf 100644 --- a/hw/arm/musicpal.c +++ b/hw/arm/musicpal.c @@ -1596,7 +1596,7 @@ static void musicpal_init(MachineState *machine) cpu = ARM_CPU(cpu_create(machine->cpu_type)); /* For now we use a fixed - the original - RAM size */ - memory_region_allocate_system_memory(ram, NULL, "musicpal.ram", + memory_region_allocate_system_memory(ram, machine, "musicpal.ram", MP_RAM_DEFAULT_SIZE); memory_region_add_subregion(address_space_mem, 0, ram); diff --git a/hw/arm/nseries.c b/hw/arm/nseries.c index 11f2c193f3..8ab30fde24 100644 --- a/hw/arm/nseries.c +++ b/hw/arm/nseries.c @@ -1315,7 +1315,7 @@ static void n8x0_init(MachineState *machine, struct n800_s *s = (struct n800_s *) g_malloc0(sizeof(*s)); uint64_t sdram_size = binfo->ram_size; - memory_region_allocate_system_memory(sdram, NULL, "omap2.dram", + memory_region_allocate_system_memory(sdram, machine, "omap2.dram", sdram_size); memory_region_add_subregion(get_system_memory(), OMAP2_Q2_BASE, sdram); diff --git a/hw/arm/omap_sx1.c b/hw/arm/omap_sx1.c index be245714db..26f4e1834b 100644 --- a/hw/arm/omap_sx1.c +++ b/hw/arm/omap_sx1.c @@ -119,7 +119,7 @@ static void sx1_init(MachineState *machine, const int version) flash_size = flash2_size; } - memory_region_allocate_system_memory(dram, NULL, "omap1.dram", + memory_region_allocate_system_memory(dram, machine, "omap1.dram", sx1_binfo.ram_size); memory_region_add_subregion(address_space, OMAP_EMIFF_BASE, dram); diff --git a/hw/arm/palm.c b/hw/arm/palm.c index 72eca8cc55..dceb4ab6a8 100644 --- a/hw/arm/palm.c +++ b/hw/arm/palm.c @@ -199,7 +199,7 @@ static void palmte_init(MachineState *machine) MemoryRegion *flash = g_new(MemoryRegion, 1); MemoryRegion *cs = g_new(MemoryRegion, 4); - memory_region_allocate_system_memory(dram, NULL, "omap1.dram", + memory_region_allocate_system_memory(dram, machine, "omap1.dram", palmte_binfo.ram_size); memory_region_add_subregion(address_space_mem, OMAP_EMIFF_BASE, dram); diff --git a/hw/arm/raspi.c b/hw/arm/raspi.c index f76b6eaad3..6f1520bad6 100644 --- a/hw/arm/raspi.c +++ b/hw/arm/raspi.c @@ -182,7 +182,7 @@ static void raspi_init(MachineState *machine, int version) &error_abort, NULL); /* Allocate and map RAM */ - memory_region_allocate_system_memory(&s->ram, NULL, "ram", + memory_region_allocate_system_memory(&s->ram, machine, "ram", machine->ram_size); /* FIXME: Remove when we have custom CPU address space support */ memory_region_add_subregion_overlap(get_system_memory(), 0, &s->ram, 0); diff --git a/hw/arm/sabrelite.c b/hw/arm/sabrelite.c index 96cc455c5c..dfeffcb2a7 100644 --- a/hw/arm/sabrelite.c +++ b/hw/arm/sabrelite.c @@ -64,7 +64,7 @@ static void sabrelite_init(MachineState *machine) exit(1); } - memory_region_allocate_system_memory(&s->ram, NULL, "sabrelite.ram", + memory_region_allocate_system_memory(&s->ram, machine, "sabrelite.ram", machine->ram_size); memory_region_add_subregion(get_system_memory(), FSL_IMX6_MMDC_ADDR, &s->ram); diff --git a/hw/arm/sbsa-ref.c b/hw/arm/sbsa-ref.c index 27046cc284..1d4db8d7fd 100644 --- a/hw/arm/sbsa-ref.c +++ b/hw/arm/sbsa-ref.c @@ -687,7 +687,7 @@ static void sbsa_ref_init(MachineState *machine) object_unref(cpuobj); } - memory_region_allocate_system_memory(ram, NULL, "sbsa-ref.ram", + memory_region_allocate_system_memory(ram, machine, "sbsa-ref.ram", machine->ram_size); memory_region_add_subregion(sysmem, sbsa_ref_memmap[SBSA_MEM].base, ram); diff --git a/hw/arm/versatilepb.c b/hw/arm/versatilepb.c index e86af01537..5cde8e3677 100644 --- a/hw/arm/versatilepb.c +++ b/hw/arm/versatilepb.c @@ -220,7 +220,7 @@ static void versatile_init(MachineState *machine, int board_id) cpu = ARM_CPU(cpuobj); - memory_region_allocate_system_memory(ram, NULL, "versatile.ram", + memory_region_allocate_system_memory(ram, machine, "versatile.ram", machine->ram_size); /* ??? RAM should repeat to fill physical memory space. */ /* SDRAM at address zero. */ diff --git a/hw/arm/vexpress.c b/hw/arm/vexpress.c index 4673a88a8d..b97770cc68 100644 --- a/hw/arm/vexpress.c +++ b/hw/arm/vexpress.c @@ -283,7 +283,7 @@ static void a9_daughterboard_init(const VexpressMachineState *vms, exit(1); } - memory_region_allocate_system_memory(ram, NULL, "vexpress.highmem", + memory_region_allocate_system_memory(ram, machine, "vexpress.highmem", ram_size); low_ram_size = ram_size; if (low_ram_size > 0x4000000) { @@ -375,7 +375,7 @@ static void a15_daughterboard_init(const VexpressMachineState *vms, } } - memory_region_allocate_system_memory(ram, NULL, "vexpress.highmem", + memory_region_allocate_system_memory(ram, machine, "vexpress.highmem", ram_size); /* RAM is from 0x80000000 upwards; there is no low-memory alias for it. */ memory_region_add_subregion(sysmem, 0x80000000, ram); diff --git a/hw/arm/virt.c b/hw/arm/virt.c index d4bedc2607..917d5549c1 100644 --- a/hw/arm/virt.c +++ b/hw/arm/virt.c @@ -1702,7 +1702,7 @@ static void machvirt_init(MachineState *machine) } } - memory_region_allocate_system_memory(ram, NULL, "mach-virt.ram", + memory_region_allocate_system_memory(ram, machine, "mach-virt.ram", machine->ram_size); memory_region_add_subregion(sysmem, vms->memmap[VIRT_MEM].base, ram); if (machine->device_memory) { diff --git a/hw/arm/xilinx_zynq.c b/hw/arm/xilinx_zynq.c index 3a0fa5b23f..abb3162cfc 100644 --- a/hw/arm/xilinx_zynq.c +++ b/hw/arm/xilinx_zynq.c @@ -190,7 +190,7 @@ static void zynq_init(MachineState *machine) } /* DDR remapped to address zero. */ - memory_region_allocate_system_memory(ext_ram, NULL, "zynq.ext_ram", + memory_region_allocate_system_memory(ext_ram, machine, "zynq.ext_ram", ram_size); memory_region_add_subregion(address_space_mem, 0, ext_ram); diff --git a/hw/arm/xlnx-versal-virt.c b/hw/arm/xlnx-versal-virt.c index 462493c467..565a52bdab 100644 --- a/hw/arm/xlnx-versal-virt.c +++ b/hw/arm/xlnx-versal-virt.c @@ -414,7 +414,7 @@ static void versal_virt_init(MachineState *machine) psci_conduit = QEMU_PSCI_CONDUIT_SMC; } - memory_region_allocate_system_memory(&s->mr_ddr, NULL, "ddr", + memory_region_allocate_system_memory(&s->mr_ddr, machine, "ddr", machine->ram_size); sysbus_init_child_obj(OBJECT(machine), "xlnx-ve", &s->soc, diff --git a/hw/arm/xlnx-zcu102.c b/hw/arm/xlnx-zcu102.c index 53cfe7c1f1..0de41adb75 100644 --- a/hw/arm/xlnx-zcu102.c +++ b/hw/arm/xlnx-zcu102.c @@ -87,7 +87,7 @@ static void xlnx_zcu102_init(MachineState *machine) ram_size); } - memory_region_allocate_system_memory(&s->ddr_ram, NULL, "ddr-ram", + memory_region_allocate_system_memory(&s->ddr_ram, machine, "ddr-ram", ram_size); object_initialize_child(OBJECT(machine), "soc", &s->soc, sizeof(s->soc), From patchwork Sun Oct 20 22:56:42 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 1180106 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.b="CG/A4biG"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46xFxJ1yzlz9sP6 for ; Mon, 21 Oct 2019 10:15:32 +1100 (AEDT) Received: from localhost ([::1]:51316 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iMKQ5-0006uc-5u for incoming@patchwork.ozlabs.org; Sun, 20 Oct 2019 19:15:29 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35130) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iMKCh-0002Ea-FC for qemu-devel@nongnu.org; Sun, 20 Oct 2019 19:01:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iMKCf-00021W-OS for qemu-devel@nongnu.org; Sun, 20 Oct 2019 19:01:39 -0400 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:27122 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iMKCf-000219-GP for qemu-devel@nongnu.org; Sun, 20 Oct 2019 19:01:37 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1571612497; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=EZOXsBkXNLN37T5Bu+Njxs6LEcBgnAgrnlrLO8iJTNM=; b=CG/A4biGRMYuEn4TADS0L4X77KQLXYL4QVvT8Pmv8L+YVeXm4ab7zF9zMs25sgqpr4XsQL Tymhp10b4k53yof5QH7naE+GN4xm4GN0ZEg72Xja+PTpFZ5JHHuuayYEGOsjXWxPGoF2Er qHGCaWPtA0CCA39L+KeV9OH0WXeULoM= 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-228-AAkSPIZANs2LarwPq2jSQA-1; Sun, 20 Oct 2019 19:01:33 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 640521800D9B; Sun, 20 Oct 2019 23:01:29 +0000 (UTC) Received: from x1w.redhat.com (ovpn-204-40.brq.redhat.com [10.40.204.40]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 1143A60C18; Sun, 20 Oct 2019 23:01:11 +0000 (UTC) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: Paolo Bonzini , Igor Mammedov , qemu-devel@nongnu.org, Markus Armbruster , Eduardo Habkost Subject: [PATCH 13/21] hw/cris: Let the machine be the owner of the system memory Date: Mon, 21 Oct 2019 00:56:42 +0200 Message-Id: <20191020225650.3671-14-philmd@redhat.com> In-Reply-To: <20191020225650.3671-1-philmd@redhat.com> References: <20191020225650.3671-1-philmd@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-MC-Unique: AAkSPIZANs2LarwPq2jSQA-1 X-Mimecast-Spam-Score: 0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 205.139.110.120 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: Paul Burton , Peter Maydell , "Michael S. Tsirkin" , Leif Lindholm , Mark Cave-Ayland , KONRAD Frederic , "Edgar E. Iglesias" , Rob Herring , Andrey Smirnov , Helge Deller , =?utf-8?q?Herv=C3=A9_Poussineau?= , Joel Stanley , Aleksandar Rikalo , Richard Henderson , Artyom Tarasenko , Antony Pavlov , Alistair Francis , Fabien Chouteau , Beniamino Galvani , qemu-arm@nongnu.org, Peter Chubb , =?utf-8?q?C=C3=A9dric_Le_Goat?= =?utf-8?q?er?= , David Gibson , Radoslaw Biernacki , Thomas Huth , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?b?w6k=?= , Andrew Baumann , Jean-Christophe Dubois , Andrew Jeffery , Michael Walle , qemu-ppc@nongnu.org, Aleksandar Markovic , Jan Kiszka , Aurelien Jarno Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Reviewed-by: Alistair Francis --- hw/cris/axis_dev88.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/cris/axis_dev88.c b/hw/cris/axis_dev88.c index 940c7dd122..faa7058733 100644 --- a/hw/cris/axis_dev88.c +++ b/hw/cris/axis_dev88.c @@ -270,7 +270,7 @@ void axisdev88_init(MachineState *machine) env = &cpu->env; /* allocate RAM */ - memory_region_allocate_system_memory(phys_ram, NULL, "axisdev88.ram", + memory_region_allocate_system_memory(phys_ram, machine, "axisdev88.ram", ram_size); memory_region_add_subregion(address_space_mem, 0x40000000, phys_ram); From patchwork Sun Oct 20 22:56:43 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 1180108 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.b="UPIWQCRL"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46xG0Y2FNYz9sP6 for ; Mon, 21 Oct 2019 10:18:21 +1100 (AEDT) Received: from localhost ([::1]:51402 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iMKSo-0001Ic-Nt for incoming@patchwork.ozlabs.org; Sun, 20 Oct 2019 19:18:18 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35231) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iMKD0-0002PE-Hm for qemu-devel@nongnu.org; Sun, 20 Oct 2019 19:01:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iMKCz-00029l-86 for qemu-devel@nongnu.org; Sun, 20 Oct 2019 19:01:58 -0400 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:31723 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iMKCz-00029M-2l for qemu-devel@nongnu.org; Sun, 20 Oct 2019 19:01:57 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1571612516; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=oJns0xteOCGMi06yvZdYLF3R/VWIFKcbGV5jx0ClKro=; b=UPIWQCRL1/ZPSpNnAi9ODqZn5gJbaUR8EFh200KIsdYzwd5cWFIcROPlmSnK+Q3iCJGUDA c89bNYTEpG8qiAcVO3spdafx7wpUWzpZvM2kFRJ0Oj0psxSARk/tMoYa2c3cyewSfuSuUQ kLS4lMX6Qgj2JX94ZJMHkFVAWAU8GAA= 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-96-yEmcAGV6Na2E9zoDVAEETA-1; Sun, 20 Oct 2019 19:01:52 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id F03731005509; Sun, 20 Oct 2019 23:01:48 +0000 (UTC) Received: from x1w.redhat.com (ovpn-204-40.brq.redhat.com [10.40.204.40]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 0C4EB60C18; Sun, 20 Oct 2019 23:01:29 +0000 (UTC) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: Paolo Bonzini , Igor Mammedov , qemu-devel@nongnu.org, Markus Armbruster , Eduardo Habkost Subject: [PATCH 14/21] hw/hppa: Let the machine be the owner of the system memory Date: Mon, 21 Oct 2019 00:56:43 +0200 Message-Id: <20191020225650.3671-15-philmd@redhat.com> In-Reply-To: <20191020225650.3671-1-philmd@redhat.com> References: <20191020225650.3671-1-philmd@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-MC-Unique: yEmcAGV6Na2E9zoDVAEETA-1 X-Mimecast-Spam-Score: 0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 205.139.110.120 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: Paul Burton , Peter Maydell , "Michael S. Tsirkin" , Leif Lindholm , Mark Cave-Ayland , KONRAD Frederic , "Edgar E. Iglesias" , Rob Herring , Andrey Smirnov , Helge Deller , =?utf-8?q?Herv=C3=A9_Poussineau?= , Joel Stanley , Aleksandar Rikalo , Richard Henderson , Artyom Tarasenko , Antony Pavlov , Alistair Francis , Fabien Chouteau , Beniamino Galvani , qemu-arm@nongnu.org, Peter Chubb , =?utf-8?q?C=C3=A9dric_Le_Goat?= =?utf-8?q?er?= , David Gibson , Radoslaw Biernacki , Thomas Huth , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?b?w6k=?= , Andrew Baumann , Jean-Christophe Dubois , Andrew Jeffery , Michael Walle , qemu-ppc@nongnu.org, Aleksandar Markovic , Jan Kiszka , Aurelien Jarno Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Reviewed-by: Alistair Francis --- hw/hppa/machine.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/hppa/machine.c b/hw/hppa/machine.c index dbe1ff0fe5..6703bfd351 100644 --- a/hw/hppa/machine.c +++ b/hw/hppa/machine.c @@ -96,7 +96,7 @@ static void machine_hppa_init(MachineState *machine) /* Main memory region. */ ram_region = g_new(MemoryRegion, 1); - memory_region_allocate_system_memory(ram_region, NULL, + memory_region_allocate_system_memory(ram_region, machine, "ram", ram_size); memory_region_add_subregion(addr_space, 0, ram_region); From patchwork Sun Oct 20 22:56:44 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 1180109 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.b="TzrlqVDR"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46xG2s5vpZz9sP6 for ; Mon, 21 Oct 2019 10:20:21 +1100 (AEDT) Received: from localhost ([::1]:51446 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iMKUl-0003IT-Ly for incoming@patchwork.ozlabs.org; Sun, 20 Oct 2019 19:20:19 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35308) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iMKDO-0002w5-ST for qemu-devel@nongnu.org; Sun, 20 Oct 2019 19:02:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iMKDN-0002L6-QZ for qemu-devel@nongnu.org; Sun, 20 Oct 2019 19:02:22 -0400 Received: from us-smtp-1.mimecast.com ([205.139.110.61]:56832 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 1iMKDN-0002Ku-N1 for qemu-devel@nongnu.org; Sun, 20 Oct 2019 19:02:21 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1571612541; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=KljiBr4SuG5p1A2LyoXGC8Cv9qdC6k/aXNJ3K9l1ji4=; b=TzrlqVDRLdgOqq6ZPXDiNQWRCfbzT2vZ6kkOZu55oC6UIyrmmRF66FlVCj82e3XXcCNT4R 1eOQk6PVlPHynq6Qj5Z22nhI7WeC74GwYFdmXrSsjQ0n9qWzY43j3dxXDdQ4xhUUzJ3gic B6S8HHKEsN3EwFfsmbop8nLXM6A15OM= 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-78-c9Bqdc6zNTygslosY0WXxQ-1; Sun, 20 Oct 2019 19:02:12 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 0A07D800D41; Sun, 20 Oct 2019 23:02:09 +0000 (UTC) Received: from x1w.redhat.com (ovpn-204-40.brq.redhat.com [10.40.204.40]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 86A0A60C18; Sun, 20 Oct 2019 23:01:49 +0000 (UTC) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: Paolo Bonzini , Igor Mammedov , qemu-devel@nongnu.org, Markus Armbruster , Eduardo Habkost Subject: [PATCH 15/21] hw/i386: Let the machine be the owner of the system memory Date: Mon, 21 Oct 2019 00:56:44 +0200 Message-Id: <20191020225650.3671-16-philmd@redhat.com> In-Reply-To: <20191020225650.3671-1-philmd@redhat.com> References: <20191020225650.3671-1-philmd@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-MC-Unique: c9Bqdc6zNTygslosY0WXxQ-1 X-Mimecast-Spam-Score: 0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] 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: Paul Burton , Peter Maydell , "Michael S. Tsirkin" , Leif Lindholm , Mark Cave-Ayland , KONRAD Frederic , "Edgar E. Iglesias" , Rob Herring , Andrey Smirnov , Helge Deller , =?utf-8?q?Herv=C3=A9_Poussineau?= , Joel Stanley , Aleksandar Rikalo , Richard Henderson , Artyom Tarasenko , Antony Pavlov , Alistair Francis , Fabien Chouteau , Beniamino Galvani , qemu-arm@nongnu.org, Peter Chubb , =?utf-8?q?C=C3=A9dric_Le_Goat?= =?utf-8?q?er?= , David Gibson , Radoslaw Biernacki , Thomas Huth , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?b?w6k=?= , Andrew Baumann , Jean-Christophe Dubois , Andrew Jeffery , Michael Walle , qemu-ppc@nongnu.org, Aleksandar Markovic , Jan Kiszka , Aurelien Jarno Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Reviewed-by: Alistair Francis --- hw/i386/pc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/i386/pc.c b/hw/i386/pc.c index 4b1904237e..3414dc423a 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -1655,7 +1655,7 @@ void pc_memory_init(PCMachineState *pcms, * with older qemus that used qemu_ram_alloc(). */ ram = g_malloc(sizeof(*ram)); - memory_region_allocate_system_memory(ram, NULL, "pc.ram", + memory_region_allocate_system_memory(ram, machine, "pc.ram", machine->ram_size); *ram_memory = ram; ram_below_4g = g_malloc(sizeof(*ram_below_4g)); From patchwork Sun Oct 20 22:56:45 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 1180100 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.b="iQUB/oUu"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46xFrB060Kz9sP6 for ; Mon, 21 Oct 2019 10:11:06 +1100 (AEDT) Received: from localhost ([::1]:51244 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iMKLn-0002Px-JB for incoming@patchwork.ozlabs.org; Sun, 20 Oct 2019 19:11:03 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35392) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iMKDc-0003CZ-KS for qemu-devel@nongnu.org; Sun, 20 Oct 2019 19:02:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iMKDb-0002Qk-3O for qemu-devel@nongnu.org; Sun, 20 Oct 2019 19:02:36 -0400 Received: from us-smtp-1.mimecast.com ([205.139.110.61]:37003 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 1iMKDb-0002QU-0I for qemu-devel@nongnu.org; Sun, 20 Oct 2019 19:02:35 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1571612554; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=8nN+Go+RSeTcnebYfeK3H4Ap4eDouNzPwOB+9HqRbY8=; b=iQUB/oUu+jqFdOTOf/f4Y8qiCcgJMdhFApYFvEGwLp6CGetsf1iTtOQmRXfVZiEPmZ/OUu w651gUUoFUus6Abl7n1py/SylEF9vhMihC814LBE9rUmWJEfJrmZZvADgUqBofieY4SM4Q XpjirLUkWpYn6QCCUi8hMqsipvtYlS8= 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-242-FaWxuisfM2eB3mh1V5C4NQ-1; Sun, 20 Oct 2019 19:02:31 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 84688107AD31; Sun, 20 Oct 2019 23:02:27 +0000 (UTC) Received: from x1w.redhat.com (ovpn-204-40.brq.redhat.com [10.40.204.40]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 97A5060C18; Sun, 20 Oct 2019 23:02:09 +0000 (UTC) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: Paolo Bonzini , Igor Mammedov , qemu-devel@nongnu.org, Markus Armbruster , Eduardo Habkost Subject: [PATCH 16/21] hw/lm32: Let the machine be the owner of the system memory Date: Mon, 21 Oct 2019 00:56:45 +0200 Message-Id: <20191020225650.3671-17-philmd@redhat.com> In-Reply-To: <20191020225650.3671-1-philmd@redhat.com> References: <20191020225650.3671-1-philmd@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-MC-Unique: FaWxuisfM2eB3mh1V5C4NQ-1 X-Mimecast-Spam-Score: 0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] 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: Paul Burton , Peter Maydell , "Michael S. Tsirkin" , Leif Lindholm , Mark Cave-Ayland , KONRAD Frederic , "Edgar E. Iglesias" , Rob Herring , Andrey Smirnov , Helge Deller , =?utf-8?q?Herv=C3=A9_Poussineau?= , Joel Stanley , Aleksandar Rikalo , Richard Henderson , Artyom Tarasenko , Antony Pavlov , Alistair Francis , Fabien Chouteau , Beniamino Galvani , qemu-arm@nongnu.org, Peter Chubb , =?utf-8?q?C=C3=A9dric_Le_Goat?= =?utf-8?q?er?= , David Gibson , Radoslaw Biernacki , Thomas Huth , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?b?w6k=?= , Andrew Baumann , Jean-Christophe Dubois , Andrew Jeffery , Michael Walle , qemu-ppc@nongnu.org, Aleksandar Markovic , Jan Kiszka , Aurelien Jarno Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Reviewed-by: Alistair Francis --- hw/lm32/lm32_boards.c | 4 ++-- hw/lm32/milkymist.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/hw/lm32/lm32_boards.c b/hw/lm32/lm32_boards.c index 5ae308bfcf..50b607e0cc 100644 --- a/hw/lm32/lm32_boards.c +++ b/hw/lm32/lm32_boards.c @@ -107,7 +107,7 @@ static void lm32_evr_init(MachineState *machine) reset_info->flash_base = flash_base; - memory_region_allocate_system_memory(phys_ram, NULL, "lm32_evr.sdram", + memory_region_allocate_system_memory(phys_ram, machine, "lm32_evr.sdram", ram_size); memory_region_add_subregion(address_space_mem, ram_base, phys_ram); @@ -200,7 +200,7 @@ static void lm32_uclinux_init(MachineState *machine) reset_info->flash_base = flash_base; - memory_region_allocate_system_memory(phys_ram, NULL, + memory_region_allocate_system_memory(phys_ram, machine, "lm32_uclinux.sdram", ram_size); memory_region_add_subregion(address_space_mem, ram_base, phys_ram); diff --git a/hw/lm32/milkymist.c b/hw/lm32/milkymist.c index 460d322de5..ee2eb1877e 100644 --- a/hw/lm32/milkymist.c +++ b/hw/lm32/milkymist.c @@ -116,7 +116,7 @@ milkymist_init(MachineState *machine) cpu_lm32_set_phys_msb_ignore(env, 1); - memory_region_allocate_system_memory(phys_sdram, NULL, "milkymist.sdram", + memory_region_allocate_system_memory(phys_sdram, machine, "milkymist.sdram", sdram_size); memory_region_add_subregion(address_space_mem, sdram_base, phys_sdram); From patchwork Sun Oct 20 22:56:46 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 1180110 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.b="SAds2F/c"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46xG3X133Gz9sP6 for ; Mon, 21 Oct 2019 10:20:56 +1100 (AEDT) Received: from localhost ([::1]:51468 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iMKVJ-00046t-Uh for incoming@patchwork.ozlabs.org; Sun, 20 Oct 2019 19:20:53 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35483) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iMKDu-0003Uk-VB for qemu-devel@nongnu.org; Sun, 20 Oct 2019 19:02:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iMKDt-0002Wj-V5 for qemu-devel@nongnu.org; Sun, 20 Oct 2019 19:02:54 -0400 Received: from us-smtp-1.mimecast.com ([205.139.110.61]:33831 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 1iMKDs-0002Vu-7Z for qemu-devel@nongnu.org; Sun, 20 Oct 2019 19:02:53 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1571612571; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=PnBCoSNSCKRtt+NC5OSwF3Y1UP3u5PcBNfHOXHNcJVc=; b=SAds2F/cbKzUGjVcO4SlRj1x+pLeD2ATH+pvnH7n3Mn9jODBa6PRmDWlliFgiPTFCrXdkt Z2GcmBFRd1bnJqITx2mDVDcy6bkr7D5HJlOtfegiQxm/Wpi29B5O3bSMpPyJ+w4RlQhOeD 3B8p9xRPebndWT8N0q8L4hdyUEeG4Wc= 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-344-B9DL2hqtPbyycJCqfC9sCA-1; Sun, 20 Oct 2019 19:02:47 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 3EA0C1005509; Sun, 20 Oct 2019 23:02:43 +0000 (UTC) Received: from x1w.redhat.com (ovpn-204-40.brq.redhat.com [10.40.204.40]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 547F460C18; Sun, 20 Oct 2019 23:02:27 +0000 (UTC) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: Paolo Bonzini , Igor Mammedov , qemu-devel@nongnu.org, Markus Armbruster , Eduardo Habkost Subject: [PATCH 17/21] hw/m68k: Let the machine be the owner of the system memory Date: Mon, 21 Oct 2019 00:56:46 +0200 Message-Id: <20191020225650.3671-18-philmd@redhat.com> In-Reply-To: <20191020225650.3671-1-philmd@redhat.com> References: <20191020225650.3671-1-philmd@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-MC-Unique: B9DL2hqtPbyycJCqfC9sCA-1 X-Mimecast-Spam-Score: 0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] 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: Paul Burton , Peter Maydell , "Michael S. Tsirkin" , Leif Lindholm , Mark Cave-Ayland , KONRAD Frederic , "Edgar E. Iglesias" , Rob Herring , Andrey Smirnov , Helge Deller , =?utf-8?q?Herv=C3=A9_Poussineau?= , Joel Stanley , Aleksandar Rikalo , Richard Henderson , Artyom Tarasenko , Antony Pavlov , Alistair Francis , Fabien Chouteau , Beniamino Galvani , qemu-arm@nongnu.org, Peter Chubb , =?utf-8?q?C=C3=A9dric_Le_Goat?= =?utf-8?q?er?= , David Gibson , Radoslaw Biernacki , Thomas Huth , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?b?w6k=?= , Andrew Baumann , Jean-Christophe Dubois , Andrew Jeffery , Michael Walle , qemu-ppc@nongnu.org, Aleksandar Markovic , Jan Kiszka , Aurelien Jarno Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Thomas Huth Reviewed-by: Richard Henderson Reviewed-by: Alistair Francis --- hw/m68k/an5206.c | 2 +- hw/m68k/mcf5208.c | 2 +- hw/m68k/next-cube.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/hw/m68k/an5206.c b/hw/m68k/an5206.c index 54ccbe1a82..fb045c2436 100644 --- a/hw/m68k/an5206.c +++ b/hw/m68k/an5206.c @@ -46,7 +46,7 @@ static void an5206_init(MachineState *machine) env->rambar0 = AN5206_RAMBAR_ADDR | 1; /* DRAM at address zero */ - memory_region_allocate_system_memory(ram, NULL, "an5206.ram", ram_size); + memory_region_allocate_system_memory(ram, machine, "an5206.ram", ram_size); memory_region_add_subregion(address_space_mem, 0, ram); /* Internal SRAM. */ diff --git a/hw/m68k/mcf5208.c b/hw/m68k/mcf5208.c index 34d34eba17..8e8c8ef349 100644 --- a/hw/m68k/mcf5208.c +++ b/hw/m68k/mcf5208.c @@ -248,7 +248,7 @@ static void mcf5208evb_init(MachineState *machine) memory_region_add_subregion(address_space_mem, 0x00000000, rom); /* DRAM at 0x40000000 */ - memory_region_allocate_system_memory(ram, NULL, "mcf5208.ram", ram_size); + memory_region_allocate_system_memory(ram, machine, "mcf5208.ram", ram_size); memory_region_add_subregion(address_space_mem, 0x40000000, ram); /* Internal SRAM. */ diff --git a/hw/m68k/next-cube.c b/hw/m68k/next-cube.c index e5343348d0..6aed9376f3 100644 --- a/hw/m68k/next-cube.c +++ b/hw/m68k/next-cube.c @@ -893,7 +893,7 @@ static void next_cube_init(MachineState *machine) memcpy(ns->rtc.ram, rtc_ram2, 32); /* 64MB RAM starting at 0x04000000 */ - memory_region_allocate_system_memory(ram, NULL, "next.ram", ram_size); + memory_region_allocate_system_memory(ram, machine, "next.ram", ram_size); memory_region_add_subregion(sysmem, 0x04000000, ram); /* Framebuffer */ From patchwork Sun Oct 20 22:56:47 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 1180112 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.b="LAUjmpwv"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46xG5V1b4pz9sP6 for ; Mon, 21 Oct 2019 10:22:38 +1100 (AEDT) Received: from localhost ([::1]:51510 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iMKWy-00061G-3t for incoming@patchwork.ozlabs.org; Sun, 20 Oct 2019 19:22:36 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35549) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iMKE9-0003gg-RF for qemu-devel@nongnu.org; Sun, 20 Oct 2019 19:03:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iMKE8-0002el-C1 for qemu-devel@nongnu.org; Sun, 20 Oct 2019 19:03:09 -0400 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:59156 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iMKE8-0002eS-8X for qemu-devel@nongnu.org; Sun, 20 Oct 2019 19:03:08 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1571612587; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=UV/XkDj03L9/ob11j7AhR7s+62zNXfZJySNjPD/IKPc=; b=LAUjmpwvSOM0be4ys368P+eGMR4/yogKBOZ0CTdJBinBcIjMD+XV3WmCJRpRHgZzgnRhQr 5ySgqWOfDQCIoPoSM4m5sjm9m+AcHUDJB5HNOBJtI5t7Ql5R7fsv6XeOZEVp/y0axeu2me ssZt3ROYn1makrKqSdPaNSl9AZBlypQ= 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-2-pIRY2_CLPJu_31UoJ2uEYw-1; Sun, 20 Oct 2019 19:03:04 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 4AF0B800D41; Sun, 20 Oct 2019 23:03:00 +0000 (UTC) Received: from x1w.redhat.com (ovpn-204-40.brq.redhat.com [10.40.204.40]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 1F59F60C5D; Sun, 20 Oct 2019 23:02:43 +0000 (UTC) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: Paolo Bonzini , Igor Mammedov , qemu-devel@nongnu.org, Markus Armbruster , Eduardo Habkost Subject: [PATCH 18/21] hw/mips: Let the machine be the owner of the system memory Date: Mon, 21 Oct 2019 00:56:47 +0200 Message-Id: <20191020225650.3671-19-philmd@redhat.com> In-Reply-To: <20191020225650.3671-1-philmd@redhat.com> References: <20191020225650.3671-1-philmd@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-MC-Unique: pIRY2_CLPJu_31UoJ2uEYw-1 X-Mimecast-Spam-Score: 0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 205.139.110.120 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: Paul Burton , Peter Maydell , "Michael S. Tsirkin" , Leif Lindholm , Mark Cave-Ayland , KONRAD Frederic , "Edgar E. Iglesias" , Rob Herring , Andrey Smirnov , Helge Deller , =?utf-8?q?Herv=C3=A9_Poussineau?= , Joel Stanley , Aleksandar Rikalo , Richard Henderson , Artyom Tarasenko , Antony Pavlov , Alistair Francis , Fabien Chouteau , Beniamino Galvani , qemu-arm@nongnu.org, Peter Chubb , =?utf-8?q?C=C3=A9dric_Le_Goat?= =?utf-8?q?er?= , David Gibson , Radoslaw Biernacki , Thomas Huth , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?b?w6k=?= , Andrew Baumann , Jean-Christophe Dubois , Andrew Jeffery , Michael Walle , qemu-ppc@nongnu.org, Aleksandar Markovic , Jan Kiszka , Aurelien Jarno Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Aleksandar Markovic --- hw/mips/boston.c | 2 +- hw/mips/mips_fulong2e.c | 3 ++- hw/mips/mips_jazz.c | 2 +- hw/mips/mips_malta.c | 2 +- hw/mips/mips_mipssim.c | 2 +- hw/mips/mips_r4k.c | 3 ++- 6 files changed, 8 insertions(+), 6 deletions(-) diff --git a/hw/mips/boston.c b/hw/mips/boston.c index ca7d813a52..8445fee0f1 100644 --- a/hw/mips/boston.c +++ b/hw/mips/boston.c @@ -474,7 +474,7 @@ static void boston_mach_init(MachineState *machine) memory_region_add_subregion_overlap(sys_mem, 0x18000000, flash, 0); ddr = g_new(MemoryRegion, 1); - memory_region_allocate_system_memory(ddr, NULL, "boston.ddr", + memory_region_allocate_system_memory(ddr, machine, "boston.ddr", machine->ram_size); memory_region_add_subregion_overlap(sys_mem, 0x80000000, ddr, 0); diff --git a/hw/mips/mips_fulong2e.c b/hw/mips/mips_fulong2e.c index cf537dd7e6..d5a5cef619 100644 --- a/hw/mips/mips_fulong2e.c +++ b/hw/mips/mips_fulong2e.c @@ -318,7 +318,8 @@ static void mips_fulong2e_init(MachineState *machine) ram_size = 256 * MiB; /* allocate RAM */ - memory_region_allocate_system_memory(ram, NULL, "fulong2e.ram", ram_size); + memory_region_allocate_system_memory(ram, machine, + "fulong2e.ram", ram_size); memory_region_init_ram(bios, NULL, "fulong2e.bios", BIOS_SIZE, &error_fatal); memory_region_set_readonly(bios, true); diff --git a/hw/mips/mips_jazz.c b/hw/mips/mips_jazz.c index 8d010a0b6e..88b125855f 100644 --- a/hw/mips/mips_jazz.c +++ b/hw/mips/mips_jazz.c @@ -188,7 +188,7 @@ static void mips_jazz_init(MachineState *machine, cc->do_transaction_failed = mips_jazz_do_transaction_failed; /* allocate RAM */ - memory_region_allocate_system_memory(ram, NULL, "mips_jazz.ram", + memory_region_allocate_system_memory(ram, machine, "mips_jazz.ram", machine->ram_size); memory_region_add_subregion(address_space, 0, ram); diff --git a/hw/mips/mips_malta.c b/hw/mips/mips_malta.c index 4d9c64b36a..af56a29ccb 100644 --- a/hw/mips/mips_malta.c +++ b/hw/mips/mips_malta.c @@ -1267,7 +1267,7 @@ void mips_malta_init(MachineState *machine) } /* register RAM at high address where it is undisturbed by IO */ - memory_region_allocate_system_memory(ram_high, NULL, "mips_malta.ram", + memory_region_allocate_system_memory(ram_high, machine, "mips_malta.ram", ram_size); memory_region_add_subregion(system_memory, 0x80000000, ram_high); diff --git a/hw/mips/mips_mipssim.c b/hw/mips/mips_mipssim.c index 282bbecb24..c1933231e2 100644 --- a/hw/mips/mips_mipssim.c +++ b/hw/mips/mips_mipssim.c @@ -166,7 +166,7 @@ mips_mipssim_init(MachineState *machine) qemu_register_reset(main_cpu_reset, reset_info); /* Allocate RAM. */ - memory_region_allocate_system_memory(ram, NULL, "mips_mipssim.ram", + memory_region_allocate_system_memory(ram, machine, "mips_mipssim.ram", ram_size); memory_region_init_ram(bios, NULL, "mips_mipssim.bios", BIOS_SIZE, &error_fatal); diff --git a/hw/mips/mips_r4k.c b/hw/mips/mips_r4k.c index bc0be26544..59f8cacfb6 100644 --- a/hw/mips/mips_r4k.c +++ b/hw/mips/mips_r4k.c @@ -203,7 +203,8 @@ void mips_r4k_init(MachineState *machine) " maximum 256MB", ram_size / MiB); exit(1); } - memory_region_allocate_system_memory(ram, NULL, "mips_r4k.ram", ram_size); + memory_region_allocate_system_memory(ram, machine, "mips_r4k.ram", + ram_size); memory_region_add_subregion(address_space_mem, 0, ram); From patchwork Sun Oct 20 22:56:48 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 1180105 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.b="Y8aD9Qef"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46xFwb0tnYz9sPc for ; Mon, 21 Oct 2019 10:14:55 +1100 (AEDT) Received: from localhost ([::1]:51304 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iMKPU-00065h-Jw for incoming@patchwork.ozlabs.org; Sun, 20 Oct 2019 19:14:52 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35591) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iMKES-00046q-V1 for qemu-devel@nongnu.org; Sun, 20 Oct 2019 19:03:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iMKER-0002k8-JQ for qemu-devel@nongnu.org; Sun, 20 Oct 2019 19:03:28 -0400 Received: from us-smtp-1.mimecast.com ([207.211.31.81]:43941 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 1iMKER-0002jn-FB for qemu-devel@nongnu.org; Sun, 20 Oct 2019 19:03:27 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1571612607; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=GYrjwKUtmGWNVT9jpBDGXDGVAk9jA0k5Lxt2r1TTs2k=; b=Y8aD9QefUh5qSgs4H4/1sxJZFo8BJ01i+TQ+NXfpllFngmFSwbNP6IPDzYiGExorBwRzHm iZwmK0mlTKfAsLCO0P8h3xlcpxbaL9FgjYBQZGCEBxmsLZu2lQeVzxxJRlWTyJen5Djook qAPh+NHPXJxVLd6qyjTd8On0KLSYoE4= 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-335-PfmdNgNiNvSjFWCeEovMUw-1; Sun, 20 Oct 2019 19:03:23 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id C3D4A476; Sun, 20 Oct 2019 23:03:19 +0000 (UTC) Received: from x1w.redhat.com (ovpn-204-40.brq.redhat.com [10.40.204.40]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 0694E60C18; Sun, 20 Oct 2019 23:03:00 +0000 (UTC) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: Paolo Bonzini , Igor Mammedov , qemu-devel@nongnu.org, Markus Armbruster , Eduardo Habkost Subject: [PATCH 19/21] hw/ppc: Let the machine be the owner of the system memory Date: Mon, 21 Oct 2019 00:56:48 +0200 Message-Id: <20191020225650.3671-20-philmd@redhat.com> In-Reply-To: <20191020225650.3671-1-philmd@redhat.com> References: <20191020225650.3671-1-philmd@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-MC-Unique: PfmdNgNiNvSjFWCeEovMUw-1 X-Mimecast-Spam-Score: 0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 207.211.31.81 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: Paul Burton , Peter Maydell , "Michael S. Tsirkin" , Leif Lindholm , Mark Cave-Ayland , KONRAD Frederic , "Edgar E. Iglesias" , Rob Herring , Andrey Smirnov , Helge Deller , =?utf-8?q?Herv=C3=A9_Poussineau?= , Joel Stanley , Aleksandar Rikalo , Richard Henderson , Artyom Tarasenko , Antony Pavlov , Alistair Francis , Fabien Chouteau , Beniamino Galvani , qemu-arm@nongnu.org, Peter Chubb , =?utf-8?q?C=C3=A9dric_Le_Goat?= =?utf-8?q?er?= , David Gibson , Radoslaw Biernacki , Thomas Huth , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?b?w6k=?= , Andrew Baumann , Jean-Christophe Dubois , Andrew Jeffery , Michael Walle , qemu-ppc@nongnu.org, Aleksandar Markovic , Jan Kiszka , Aurelien Jarno Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Philippe Mathieu-Daudé Acked-by: David Gibson Reviewed-by: Richard Henderson --- hw/ppc/e500.c | 3 ++- hw/ppc/mac_newworld.c | 3 ++- hw/ppc/mac_oldworld.c | 2 +- hw/ppc/pnv.c | 2 +- hw/ppc/ppc405_boards.c | 6 +++--- hw/ppc/prep.c | 3 ++- hw/ppc/spapr.c | 2 +- hw/ppc/virtex_ml507.c | 2 +- 8 files changed, 13 insertions(+), 10 deletions(-) diff --git a/hw/ppc/e500.c b/hw/ppc/e500.c index 91cd4c26f9..9c7be26248 100644 --- a/hw/ppc/e500.c +++ b/hw/ppc/e500.c @@ -912,7 +912,8 @@ void ppce500_init(MachineState *machine) machine->ram_size = ram_size; /* Register Memory */ - memory_region_allocate_system_memory(ram, NULL, "mpc8544ds.ram", ram_size); + memory_region_allocate_system_memory(ram, machine, "mpc8544ds.ram", + ram_size); memory_region_add_subregion(address_space_mem, 0, ram); dev = qdev_create(NULL, "e500-ccsr"); diff --git a/hw/ppc/mac_newworld.c b/hw/ppc/mac_newworld.c index c5bbcc7433..8409114eed 100644 --- a/hw/ppc/mac_newworld.c +++ b/hw/ppc/mac_newworld.c @@ -152,7 +152,8 @@ static void ppc_core99_init(MachineState *machine) } /* allocate RAM */ - memory_region_allocate_system_memory(ram, NULL, "ppc_core99.ram", ram_size); + memory_region_allocate_system_memory(ram, machine, "ppc_core99.ram", + ram_size); memory_region_add_subregion(get_system_memory(), 0, ram); /* allocate and load BIOS */ diff --git a/hw/ppc/mac_oldworld.c b/hw/ppc/mac_oldworld.c index 0fa680b749..9dd645476a 100644 --- a/hw/ppc/mac_oldworld.c +++ b/hw/ppc/mac_oldworld.c @@ -127,7 +127,7 @@ static void ppc_heathrow_init(MachineState *machine) exit(1); } - memory_region_allocate_system_memory(ram, NULL, "ppc_heathrow.ram", + memory_region_allocate_system_memory(ram, machine, "ppc_heathrow.ram", ram_size); memory_region_add_subregion(sysmem, 0, ram); diff --git a/hw/ppc/pnv.c b/hw/ppc/pnv.c index 7cf64b6d25..ac731c4f88 100644 --- a/hw/ppc/pnv.c +++ b/hw/ppc/pnv.c @@ -640,7 +640,7 @@ static void pnv_init(MachineState *machine) } ram = g_new(MemoryRegion, 1); - memory_region_allocate_system_memory(ram, NULL, "pnv.ram", + memory_region_allocate_system_memory(ram, machine, "pnv.ram", machine->ram_size); memory_region_add_subregion(get_system_memory(), 0, ram); diff --git a/hw/ppc/ppc405_boards.c b/hw/ppc/ppc405_boards.c index 388cae0b43..8a2d2f4511 100644 --- a/hw/ppc/ppc405_boards.c +++ b/hw/ppc/ppc405_boards.c @@ -162,8 +162,8 @@ static void ref405ep_init(MachineState *machine) MemoryRegion *sysmem = get_system_memory(); /* XXX: fix this */ - memory_region_allocate_system_memory(&ram_memories[0], NULL, "ef405ep.ram", - 0x08000000); + memory_region_allocate_system_memory(&ram_memories[0], machine, + "ef405ep.ram", 128 * MiB); ram_bases[0] = 0; ram_sizes[0] = 0x08000000; memory_region_init(&ram_memories[1], NULL, "ef405ep.ram1", 0); @@ -427,7 +427,7 @@ static void taihu_405ep_init(MachineState *machine) /* RAM is soldered to the board so the size cannot be changed */ ram_size = 0x08000000; - memory_region_allocate_system_memory(ram, NULL, "taihu_405ep.ram", + memory_region_allocate_system_memory(ram, machine, "taihu_405ep.ram", ram_size); ram_bases[0] = 0; diff --git a/hw/ppc/prep.c b/hw/ppc/prep.c index 4f3c6bf190..54b00805e0 100644 --- a/hw/ppc/prep.c +++ b/hw/ppc/prep.c @@ -445,7 +445,8 @@ static void ppc_prep_init(MachineState *machine) } /* allocate RAM */ - memory_region_allocate_system_memory(ram, NULL, "ppc_prep.ram", ram_size); + memory_region_allocate_system_memory(ram, machine, "ppc_prep.ram", + ram_size); memory_region_add_subregion(sysmem, 0, ram); if (linux_boot) { diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index 4eb97d3a9b..1f168edd43 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -2840,7 +2840,7 @@ static void spapr_machine_init(MachineState *machine) } /* allocate RAM */ - memory_region_allocate_system_memory(ram, NULL, "ppc_spapr.ram", + memory_region_allocate_system_memory(ram, machine, "ppc_spapr.ram", machine->ram_size); memory_region_add_subregion(sysmem, 0, ram); diff --git a/hw/ppc/virtex_ml507.c b/hw/ppc/virtex_ml507.c index 68625522d8..86c9273dc0 100644 --- a/hw/ppc/virtex_ml507.c +++ b/hw/ppc/virtex_ml507.c @@ -224,7 +224,7 @@ static void virtex_init(MachineState *machine) qemu_register_reset(main_cpu_reset, cpu); - memory_region_allocate_system_memory(phys_ram, NULL, "ram", ram_size); + memory_region_allocate_system_memory(phys_ram, machine, "ram", ram_size); memory_region_add_subregion(address_space_mem, ram_base, phys_ram); dinfo = drive_get(IF_PFLASH, 0, 0); From patchwork Sun Oct 20 22:56:49 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 1180113 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.b="cae6LM3H"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46xG782GNGz9sP6 for ; Mon, 21 Oct 2019 10:24:03 +1100 (AEDT) Received: from localhost ([::1]:51646 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iMKYL-0007wl-2I for incoming@patchwork.ozlabs.org; Sun, 20 Oct 2019 19:24:01 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35681) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iMKEk-0004PE-Qv for qemu-devel@nongnu.org; Sun, 20 Oct 2019 19:03:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iMKEj-0002q1-Qc for qemu-devel@nongnu.org; Sun, 20 Oct 2019 19:03:46 -0400 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:56701 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iMKEj-0002pG-M1 for qemu-devel@nongnu.org; Sun, 20 Oct 2019 19:03:45 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1571612623; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=DPbCDBS6I1JLm9PRPoFX786EP2/rQynjbMRZ4Kkujho=; b=cae6LM3HYa8PcQZWtAaHjxE0LfE5PA2wRWa2Q/hqOSVj1gd5sMNmTDMhT3JqFgTVfN+9rV N/OQ4i31PyLgXc0Pchv/uHmKeQN9lE3thUGOcvQvcWAUK3VsTMwStrodies+/qqNTrMm0X H6qccjVZhCj52e8aLHfDMX2D/2zLzp0= 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-152-RRXfVU6QP4qD9tFzs4IRwA-1; Sun, 20 Oct 2019 19:03:42 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 8469F80183E; Sun, 20 Oct 2019 23:03:38 +0000 (UTC) Received: from x1w.redhat.com (ovpn-204-40.brq.redhat.com [10.40.204.40]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 75EC760C18; Sun, 20 Oct 2019 23:03:20 +0000 (UTC) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: Paolo Bonzini , Igor Mammedov , qemu-devel@nongnu.org, Markus Armbruster , Eduardo Habkost Subject: [PATCH 20/21] hw/sparc: Let the machine be the owner of the system memory Date: Mon, 21 Oct 2019 00:56:49 +0200 Message-Id: <20191020225650.3671-21-philmd@redhat.com> In-Reply-To: <20191020225650.3671-1-philmd@redhat.com> References: <20191020225650.3671-1-philmd@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-MC-Unique: RRXfVU6QP4qD9tFzs4IRwA-1 X-Mimecast-Spam-Score: 0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 205.139.110.120 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: Paul Burton , Peter Maydell , "Michael S. Tsirkin" , Leif Lindholm , Mark Cave-Ayland , KONRAD Frederic , "Edgar E. Iglesias" , Rob Herring , Andrey Smirnov , Helge Deller , =?utf-8?q?Herv=C3=A9_Poussineau?= , Joel Stanley , Aleksandar Rikalo , Richard Henderson , Artyom Tarasenko , Antony Pavlov , Alistair Francis , Fabien Chouteau , Beniamino Galvani , qemu-arm@nongnu.org, Peter Chubb , =?utf-8?q?C=C3=A9dric_Le_Goat?= =?utf-8?q?er?= , David Gibson , Radoslaw Biernacki , Thomas Huth , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?b?w6k=?= , Andrew Baumann , Jean-Christophe Dubois , Andrew Jeffery , Michael Walle , qemu-ppc@nongnu.org, Aleksandar Markovic , Jan Kiszka , Aurelien Jarno Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- hw/sparc/leon3.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/sparc/leon3.c b/hw/sparc/leon3.c index c5f1b1ee72..f58f2782c6 100644 --- a/hw/sparc/leon3.c +++ b/hw/sparc/leon3.c @@ -244,7 +244,7 @@ static void leon3_generic_hw_init(MachineState *machine) exit(1); } - memory_region_allocate_system_memory(ram, NULL, "leon3.ram", ram_size); + memory_region_allocate_system_memory(ram, machine, "leon3.ram", ram_size); memory_region_add_subregion(address_space_mem, LEON3_RAM_OFFSET, ram); /* Allocate BIOS */ From patchwork Sun Oct 20 22:56:50 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 1180111 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.b="OUqYV38C"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46xG5F5TKBz9sPc for ; Mon, 21 Oct 2019 10:22:25 +1100 (AEDT) Received: from localhost ([::1]:51502 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iMKWl-0005hn-DG for incoming@patchwork.ozlabs.org; Sun, 20 Oct 2019 19:22:23 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35740) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iMKF8-0004ea-L2 for qemu-devel@nongnu.org; Sun, 20 Oct 2019 19:04:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iMKF7-0002wY-EE for qemu-devel@nongnu.org; Sun, 20 Oct 2019 19:04:10 -0400 Received: from us-smtp-1.mimecast.com ([207.211.31.81]:45078 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 1iMKF7-0002wC-AU for qemu-devel@nongnu.org; Sun, 20 Oct 2019 19:04:09 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1571612648; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Jjri3ozqyIA7pC6fyQCHJXD213k68SJrwDbSmMBjY3Q=; b=OUqYV38C65PlrrxWwI6Gi7hS4UNqiuqWpjec2waZQ6cd2ip+FT486lztgXnVmg8mPIdZjr cc9zBI9gQUt8AByCGxWAc75b5tklKomAtP9VGEWAEHCNXAahsymDAF9yzpxB0ExaiuJoO4 K8HjIH4nCYrFKQGvlIswtpI3ZEP8QWc= 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-235-0Z60vgfLOp2K7RkyzB4Ntw-1; Sun, 20 Oct 2019 19:04:01 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id C1D0D1005509; Sun, 20 Oct 2019 23:03:57 +0000 (UTC) Received: from x1w.redhat.com (ovpn-204-40.brq.redhat.com [10.40.204.40]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 6808060C18; Sun, 20 Oct 2019 23:03:39 +0000 (UTC) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: Paolo Bonzini , Igor Mammedov , qemu-devel@nongnu.org, Markus Armbruster , Eduardo Habkost Subject: [PATCH 21/21] hw/core: Assert memory_region_allocate_system_memory has machine owner Date: Mon, 21 Oct 2019 00:56:50 +0200 Message-Id: <20191020225650.3671-22-philmd@redhat.com> In-Reply-To: <20191020225650.3671-1-philmd@redhat.com> References: <20191020225650.3671-1-philmd@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-MC-Unique: 0Z60vgfLOp2K7RkyzB4Ntw-1 X-Mimecast-Spam-Score: 0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 207.211.31.81 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: Paul Burton , Peter Maydell , "Michael S. Tsirkin" , Leif Lindholm , Mark Cave-Ayland , KONRAD Frederic , "Edgar E. Iglesias" , Rob Herring , Andrey Smirnov , Helge Deller , =?utf-8?q?Herv=C3=A9_Poussineau?= , Joel Stanley , Aleksandar Rikalo , Richard Henderson , Artyom Tarasenko , Antony Pavlov , Alistair Francis , Fabien Chouteau , Beniamino Galvani , qemu-arm@nongnu.org, Peter Chubb , =?utf-8?q?C=C3=A9dric_Le_Goat?= =?utf-8?q?er?= , David Gibson , Radoslaw Biernacki , Thomas Huth , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?b?w6k=?= , Andrew Baumann , Jean-Christophe Dubois , Andrew Jeffery , Michael Walle , qemu-ppc@nongnu.org, Aleksandar Markovic , Jan Kiszka , Aurelien Jarno Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" All the memory_region_allocate_system_memory() pass a MachineState argument. Add an assertion to ensure the new boards/machines added set this argument, so all system memory object have the machine as its QOM owner. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Reviewed-by: Alistair Francis --- hw/core/numa.c | 4 +--- include/hw/boards.h | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/hw/core/numa.c b/hw/core/numa.c index 2e29e4bfe0..3e07e94d00 100644 --- a/hw/core/numa.c +++ b/hw/core/numa.c @@ -527,9 +527,7 @@ void memory_region_allocate_system_memory(MemoryRegion *mr, MachineState *ms, uint64_t addr = 0; int i; - if (!ms) { - ms = MACHINE(qdev_get_machine()); - } + g_assert(ms); if (ms->numa_state == NULL || ms->numa_state->num_nodes == 0 || !have_memdevs) { diff --git a/include/hw/boards.h b/include/hw/boards.h index 3b6cb82b6c..31ab6e7586 100644 --- a/include/hw/boards.h +++ b/include/hw/boards.h @@ -14,7 +14,7 @@ /** * memory_region_allocate_system_memory - Allocate a board's main memory * @mr: the #MemoryRegion to be initialized - * @ms: the #MachineState object that own the system memory + * @ms: the #MachineState object that own the system memory (must not be NULL) * @name: name of the memory region * @ram_size: size of the region in bytes *