From patchwork Sun Oct 20 22:56:29 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: 1180088 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="ZMwH+yYJ"; 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 46xFYY2qJkz9sCJ for ; Mon, 21 Oct 2019 09:58:25 +1100 (AEDT) Received: from localhost ([::1]:50864 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iMK9W-0006jx-8n for incoming@patchwork.ozlabs.org; Sun, 20 Oct 2019 18:58:22 -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_Mathieu-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 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" 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 path=/machine/unattached} to: (qemu) info mtree -o memory-region: pc.ram 0000000000000000-0000000007ffffff (prio 0, ram): pc.ram owner:{obj path=/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é (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(-)