Received: by 2002:adf:e804:0:0:0:0:0 with SMTP id o4csp3786377wrm; Sun, 20 Oct 2019 15:58:30 -0700 (PDT) X-Google-Smtp-Source: APXvYqz+3wflN/wjpUvH6gfzGgZGK2PHZamqNcH0EX1Hm9WgecUiW6h6ONJo/N+mcK0luUyxUEIJ X-Received: by 2002:ac8:534a:: with SMTP id d10mr11109042qto.349.1571612310401; Sun, 20 Oct 2019 15:58:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571612310; cv=none; d=google.com; s=arc-20160816; b=sSXugxxhX9cp1MQXgxZl6ein4UohxihJHqUug8k0YBDJ0hmD1g6tbdT4WoPHmIDSsJ V1pj6m7p6b6k81c8XwGrpu7qcGgeJofFcnyxVgexVZ8kcSVi/XBtbuz0FUcc2zz/YwpX 0qupvdkE7nnujb0l9nCThuVw1zbLZmLh9pVQHj+kl21EObRIpRf5qkdyJrqLaEB3hKbN lmR6QuZEUNR15GD+Dsp5h2Ug8b+IQ6ME5rwcelL51ze1dM6yAsZCpz5ESoH6Ad7pyU/4 OD7ubmIQ22zitlDZVxmmVbBian3Hq0kPs7oAITmzLDlaIpSuE9rXj12TvTxcAXOtkUW3 EA4g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:message-id:date:subject:to:from:dkim-signature; bh=Llb/8OALtJXI9mwJaYEIRinlAzAxVy4qKKagrFZsSKA=; b=R0Y4FGm7+VcUTbVWk4GYB/gxqwWnfuCA0JHcG537X4nu5kCqwR5uocccXBc/t/yy/J dkOo8c5DkAEHiN6rlllBsTHBvkLkIwLO+uRCtJjtIucToJnMlEcrlY73zZK9RE+2XBR+ PPWujTIAmpil47cMJwz9NWrc7iwweVYf1Njg4u36ffhN9wCDHjwWVOZAKusrEWIbZ03U V5l2B+1aK9aSBhEqLsZ0NB4gHJN/npzOw5JwQGMPaQFl+/xki83bztrbJ4tKL3fRWoOf J9dusy0elVXkLX0FnmPvYioYn8PHkC9BK0mw7sRx2f6QJzxX3wfpmj/NsXXF3IUuSp4v Syxg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@redhat.com header.s=mimecast20190719 header.b=ZMwH+yYJ; spf=pass (google.com: domain of qemu-devel-bounces+alex.bennee=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+alex.bennee=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id x23si4029332qkb.291.2019.10.20.15.58.30 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 20 Oct 2019 15:58:30 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+alex.bennee=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@redhat.com header.s=mimecast20190719 header.b=ZMwH+yYJ; spf=pass (google.com: domain of qemu-devel-bounces+alex.bennee=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+alex.bennee=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from localhost ([::1]:50864 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iMK9d-0006jx-FZ for alex.bennee@linaro.org; Sun, 20 Oct 2019 18:58:29 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34285) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iMK8d-0006iu-GW for qemu-devel@nongnu.org; Sun, 20 Oct 2019 18:57:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iMK8a-0000H6-NX for qemu-devel@nongnu.org; Sun, 20 Oct 2019 18:57:26 -0400 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:58141 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 1iMK8a-0000GA-CY for qemu-devel@nongnu.org; Sun, 20 Oct 2019 18:57:24 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1571612243; 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; bh=Llb/8OALtJXI9mwJaYEIRinlAzAxVy4qKKagrFZsSKA=; b=ZMwH+yYJK9txjBS4rvSgxW6FUYM3YDIpGlkSwJLca7/08eg5wrdkgepiaeHxXUVe9F3XL1 L+5t38RgiYc1XneEe7kx5/e0xtDZNzgsNGMt6wNgmHnlsq8CafXKu+PULAupb561c79N2u si+PZybUV/BXgHKQzS6tFuGxoDbgeao= 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-288-Xgkgy1oBMsa9BZnuFG_tHA-1; Sun, 20 Oct 2019 18:57:19 -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 E710C80183E; Sun, 20 Oct 2019 22:57:14 +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 4214D60C18; Sun, 20 Oct 2019 22:56:54 +0000 (UTC) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: Paolo Bonzini , Igor Mammedov , qemu-devel@nongnu.org, Markus Armbruster , Eduardo Habkost Subject: [PATCH 00/21] hw: Let the machine be the owner of the system memory Date: Mon, 21 Oct 2019 00:56:29 +0200 Message-Id: <20191020225650.3671-1-philmd@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-MC-Unique: Xgkgy1oBMsa9BZnuFG_tHA-1 X-Mimecast-Spam-Score: 0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 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=20Poussineau?= , 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=20Le=20Goater?= , David Gibson , Radoslaw Biernacki , Thomas Huth , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Andrew Baumann , Jean-Christophe Dubois , Andrew Jeffery , Michael Walle , qemu-ppc@nongnu.org, Aleksandar Markovic , Jan Kiszka , Aurelien Jarno Errors-To: qemu-devel-bounces+alex.bennee=linaro.org@nongnu.org Sender: "Qemu-devel" X-TUID: udb/xMaF+WTd Hi, This series is based on Igor's "eliminate remaining places that abuse memory_region_allocate_system_memory()": https://lists.gnu.org/archive/html/qemu-devel/2019-10/msg01601.html It is quite simple, we enforce all machines to be the QOM owner of the system memory. This changes the memory tree from: (qemu) info mtree -o memory-region: pc.ram 0000000000000000-0000000007ffffff (prio 0, ram): pc.ram parent:{obj pat= h=3D/machine/unattached} to: (qemu) info mtree -o memory-region: pc.ram 0000000000000000-0000000007ffffff (prio 0, ram): pc.ram owner:{obj path= =3D/machine} Few patches are required to clean the codebase first, to unify the creation of the system memory in the board/machine code. Mostly some old ARM machines (pre-QOM) were affected. Please review (as a generic codebase cleanup). Regards, Phil. Based-on: <20191008113318.7012-1-imammedo@redhat.com> Philippe Mathieu-Daud=C3=A9 (21): hw/arm/xilinx_zynq: Use the IEC binary prefix definitions hw/arm/mps2: Use the IEC binary prefix definitions hw/arm/collie: Create the RAM in the board hw/arm/omap2: Create the RAM in the board hw/arm/omap1: Create the RAM in the board hw/arm/digic4: Inline digic4_board_setup_ram() function hw: Drop QOM ownership on memory_region_allocate_system_memory() calls hw/alpha/dp264: Create the RAM in the board hw: Let memory_region_allocate_system_memory take MachineState argument hw/core: Let the machine be the owner of the system memory hw/alpha: Let the machine be the owner of the system memory hw/arm: Let the machine be the owner of the system memory hw/cris: Let the machine be the owner of the system memory hw/hppa: Let the machine be the owner of the system memory hw/i386: Let the machine be the owner of the system memory hw/lm32: Let the machine be the owner of the system memory hw/m68k: Let the machine be the owner of the system memory hw/mips: Let the machine be the owner of the system memory hw/ppc: Let the machine be the owner of the system memory hw/sparc: Let the machine be the owner of the system memory hw/core: Assert memory_region_allocate_system_memory has machine owner hw/alpha/alpha_sys.h | 2 +- hw/alpha/dp264.c | 11 ++++++++++- hw/alpha/typhoon.c | 9 +-------- hw/arm/aspeed.c | 2 +- hw/arm/collie.c | 8 ++++++-- hw/arm/cubieboard.c | 2 +- hw/arm/digic_boards.c | 14 +++++--------- 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 | 5 +++-- hw/arm/mps2.c | 5 +++-- hw/arm/musicpal.c | 2 +- hw/arm/nseries.c | 10 +++++++--- hw/arm/omap1.c | 12 +++++------- hw/arm/omap2.c | 13 +++++-------- hw/arm/omap_sx1.c | 8 ++++++-- hw/arm/palm.c | 8 ++++++-- hw/arm/raspi.c | 2 +- hw/arm/sabrelite.c | 2 +- hw/arm/sbsa-ref.c | 2 +- hw/arm/strongarm.c | 7 +------ hw/arm/strongarm.h | 4 +--- hw/arm/versatilepb.c | 2 +- hw/arm/vexpress.c | 4 ++-- hw/arm/virt.c | 2 +- hw/arm/xilinx_zynq.c | 5 +++-- hw/arm/xlnx-versal-virt.c | 2 +- hw/arm/xlnx-zcu102.c | 2 +- hw/core/null-machine.c | 2 +- hw/core/numa.c | 9 +++++---- hw/cris/axis_dev88.c | 2 +- hw/hppa/machine.c | 2 +- hw/i386/pc.c | 2 +- hw/lm32/lm32_boards.c | 4 ++-- hw/lm32/milkymist.c | 2 +- hw/m68k/an5206.c | 2 +- hw/m68k/mcf5208.c | 2 +- hw/m68k/next-cube.c | 2 +- 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 ++- 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 +- hw/sparc/leon3.c | 2 +- hw/sparc/sun4m.c | 2 +- include/hw/arm/omap.h | 10 +++------- include/hw/boards.h | 6 ++++-- 60 files changed, 127 insertions(+), 117 deletions(-) --=20 2.21.0