From nobody Wed May 15 10:11:41 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1576357247; cv=none; d=zohomail.com; s=zohoarc; b=iJRSrMmHAFjl3AQYmpRYCRdUHRZpsa9iqZj7HpSMOQRao5ycN/TeCDuJhhRNdLxoKepIm5nyVJ6eV+Fbj6s5/G8UC0uVsNorwXbEBZ5cN58U/VFIz4kBfab/kvFXUv4Y7ypRDVWC5kljyfvqc2iKQ6jrCkB7Ply4WZu/1hNgCvo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1576357247; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=IiMSoFUEZseoMxLw1sAmT/IUeieWX2EUqAxBTC+j+po=; b=cYomCoKjQdYddhALjyTIL5DH4GCT9rGTfubzHe/xlXk3XpygbGndbogB5j/DoMJBOVSKUpmiBD8OAisDNU9z3YFqzYgITbxkklpDPwLvFoabTjCrqcDeRGITH9LC9jcmC3C2kZxlsqX2Pju9qkhzwQr/2U5WOeiNVIGJ5o5nmMs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1576357247390451.15137482611283; Sat, 14 Dec 2019 13:00:47 -0800 (PST) Received: from localhost ([::1]:32848 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1igEWr-0000ML-9i for importer@patchew.org; Sat, 14 Dec 2019 16:00:45 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:40706) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1igEVV-0007kg-8W for qemu-devel@nongnu.org; Sat, 14 Dec 2019 15:59:22 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1igEVU-0007dq-4M for qemu-devel@nongnu.org; Sat, 14 Dec 2019 15:59:21 -0500 Received: from us-smtp-1.mimecast.com ([205.139.110.61]:30518 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 1igEVT-0007cB-UB for qemu-devel@nongnu.org; Sat, 14 Dec 2019 15:59:20 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-5-8GfcR2qbM7asPJU8NqZDDA-1; Sat, 14 Dec 2019 10:56:49 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 62B71107ACC4; Sat, 14 Dec 2019 15:56:47 +0000 (UTC) Received: from x1w.redhat.com (ovpn-205-147.brq.redhat.com [10.40.205.147]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 4C0F166A1A; Sat, 14 Dec 2019 15:56:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1576357159; 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=IiMSoFUEZseoMxLw1sAmT/IUeieWX2EUqAxBTC+j+po=; b=ghzBJP88B4iQgceh0fqNxwlCPfFlOCloNtEFCU0Ib+S32KOsLT92oA5z0PaRWSvm8rQNTE yiwh4E2wGl2Zwhchff9npqOkVrwWM6brULAyac3HyWhDRJI1EHqFNCd0V4itycMvcpo26S tjnB9bFORHcSqThCJn1kFRLDXiWdEcc= X-MC-Unique: 8GfcR2qbM7asPJU8NqZDDA-1 From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH 1/8] hw/arm/nrf51_soc: Use memory_region_add_subregion() when priority is 0 Date: Sat, 14 Dec 2019 16:56:07 +0100 Message-Id: <20191214155614.19004-2-philmd@redhat.com> In-Reply-To: <20191214155614.19004-1-philmd@redhat.com> References: <20191214155614.19004-1-philmd@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 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.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: Peter Maydell , Alistair Francis , Paul Burton , Eduardo Habkost , kvm@vger.kernel.org, "Michael S. Tsirkin" , Marcelo Tosatti , Andrew Baumann , Alex Williamson , qemu-arm@nongnu.org, Joel Stanley , Aleksandar Markovic , Paolo Bonzini , "Edgar E. Iglesias" , Aleksandar Rikalo , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Aurelien Jarno , Richard Henderson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" It is pointless to overlap a memory subregion with priority 0. Use the simpler memory_region_add_subregion() function. This patch was produced with the following spatch script: @@ expression region; expression offset; expression subregion; @@ -memory_region_add_subregion_overlap(region, offset, subregion, 0) +memory_region_add_subregion(region, offset, subregion) Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- hw/arm/nrf51_soc.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/hw/arm/nrf51_soc.c b/hw/arm/nrf51_soc.c index 74029169d0..ade06b225f 100644 --- a/hw/arm/nrf51_soc.c +++ b/hw/arm/nrf51_soc.c @@ -94,7 +94,7 @@ static void nrf51_soc_realize(DeviceState *dev_soc, Error= **errp) return; } mr =3D sysbus_mmio_get_region(SYS_BUS_DEVICE(&s->uart), 0); - memory_region_add_subregion_overlap(&s->container, NRF51_UART_BASE, mr= , 0); + memory_region_add_subregion(&s->container, NRF51_UART_BASE, mr); sysbus_connect_irq(SYS_BUS_DEVICE(&s->uart), 0, qdev_get_gpio_in(DEVICE(&s->cpu), BASE_TO_IRQ(NRF51_UART_BASE))); @@ -107,7 +107,7 @@ static void nrf51_soc_realize(DeviceState *dev_soc, Err= or **errp) } =20 mr =3D sysbus_mmio_get_region(SYS_BUS_DEVICE(&s->rng), 0); - memory_region_add_subregion_overlap(&s->container, NRF51_RNG_BASE, mr,= 0); + memory_region_add_subregion(&s->container, NRF51_RNG_BASE, mr); sysbus_connect_irq(SYS_BUS_DEVICE(&s->rng), 0, qdev_get_gpio_in(DEVICE(&s->cpu), BASE_TO_IRQ(NRF51_RNG_BASE))); @@ -127,13 +127,13 @@ static void nrf51_soc_realize(DeviceState *dev_soc, E= rror **errp) } =20 mr =3D sysbus_mmio_get_region(SYS_BUS_DEVICE(&s->nvm), 0); - memory_region_add_subregion_overlap(&s->container, NRF51_NVMC_BASE, mr= , 0); + memory_region_add_subregion(&s->container, NRF51_NVMC_BASE, mr); mr =3D sysbus_mmio_get_region(SYS_BUS_DEVICE(&s->nvm), 1); - memory_region_add_subregion_overlap(&s->container, NRF51_FICR_BASE, mr= , 0); + memory_region_add_subregion(&s->container, NRF51_FICR_BASE, mr); mr =3D sysbus_mmio_get_region(SYS_BUS_DEVICE(&s->nvm), 2); - memory_region_add_subregion_overlap(&s->container, NRF51_UICR_BASE, mr= , 0); + memory_region_add_subregion(&s->container, NRF51_UICR_BASE, mr); mr =3D sysbus_mmio_get_region(SYS_BUS_DEVICE(&s->nvm), 3); - memory_region_add_subregion_overlap(&s->container, NRF51_FLASH_BASE, m= r, 0); + memory_region_add_subregion(&s->container, NRF51_FLASH_BASE, mr); =20 /* GPIO */ object_property_set_bool(OBJECT(&s->gpio), true, "realized", &err); @@ -143,7 +143,7 @@ static void nrf51_soc_realize(DeviceState *dev_soc, Err= or **errp) } =20 mr =3D sysbus_mmio_get_region(SYS_BUS_DEVICE(&s->gpio), 0); - memory_region_add_subregion_overlap(&s->container, NRF51_GPIO_BASE, mr= , 0); + memory_region_add_subregion(&s->container, NRF51_GPIO_BASE, mr); =20 /* Pass all GPIOs to the SOC layer so they are available to the board = */ qdev_pass_gpios(DEVICE(&s->gpio), dev_soc, NULL); --=20 2.21.0 From nobody Wed May 15 10:11:41 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1576358026; cv=none; d=zohomail.com; s=zohoarc; b=FPOjcOJYWtgChcBct3o6ocnS8/Qkmoa2pzBMIyRaPD13bTgcEjs9GH/4DQvO3yH8MlTiWArj77XKcDcc3u5eNsCxnOfBZIQHeMcD0JzDgZKxLgRIcS8crtSYNsX3L1MwZvB9sSgL/MxbEMb/j1Z3iuGcThDKVIFPEXogcXmt99s= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1576358026; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=Os44yYqV4Qf/DGZHPDswJ/Ob+mUvkJTnaZl2qxMI8rM=; b=N378ufgt5kzZOiNEfmAev8M9grT/dXR5hWW8yvgmrWsOsXLuLnTjAKoh5QVKI67QgcQuJ1TSoQtL3PiRTmz0Phdo67kq6t83IBdtPASzuibjSw27SutXZU8hOXCTB0Z7xosN8WyEyys/JLUqEmjs1DBoAr9BotU3xyoiuQJX4Ec= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1576358026799924.9749729526825; Sat, 14 Dec 2019 13:13:46 -0800 (PST) Received: from localhost ([::1]:33082 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1igEjR-0006FW-Gc for importer@patchew.org; Sat, 14 Dec 2019 16:13:45 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:42866) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1igEVc-0007uW-62 for qemu-devel@nongnu.org; Sat, 14 Dec 2019 15:59:29 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1igEVa-0007zD-H0 for qemu-devel@nongnu.org; Sat, 14 Dec 2019 15:59:28 -0500 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:29845 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 1igEVZ-0007vF-Nn for qemu-devel@nongnu.org; Sat, 14 Dec 2019 15:59:25 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-386-BFIqEERuN2SIx64E6tImNQ-1; Sat, 14 Dec 2019 10:57:11 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 2FB26107ACC4; Sat, 14 Dec 2019 15:57:09 +0000 (UTC) Received: from x1w.redhat.com (ovpn-205-147.brq.redhat.com [10.40.205.147]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E3EC45D6A7; Sat, 14 Dec 2019 15:56:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1576357165; 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=Os44yYqV4Qf/DGZHPDswJ/Ob+mUvkJTnaZl2qxMI8rM=; b=SPCmSJimnrpzTIquAWYi2pQq9joNW5EoZIyavca/CeGUJDKp8Wh0DSY4m6DmojZ6vwYLOE hfFCAKHGsxHXxiOhlQqbSWcT6cWCOP6Y4vp34pWa5icyBd2thyv6dFI0/gbmWyPgnWFKHf SG1B2nBvc99DVUqnZ3rsczlxdVuTx5o= X-MC-Unique: BFIqEERuN2SIx64E6tImNQ-1 From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH 2/8] hw/arm/raspi: Use memory_region_add_subregion() when priority is 0 Date: Sat, 14 Dec 2019 16:56:08 +0100 Message-Id: <20191214155614.19004-3-philmd@redhat.com> In-Reply-To: <20191214155614.19004-1-philmd@redhat.com> References: <20191214155614.19004-1-philmd@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 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: Peter Maydell , Alistair Francis , Paul Burton , Eduardo Habkost , kvm@vger.kernel.org, "Michael S. Tsirkin" , Marcelo Tosatti , Andrew Baumann , Alex Williamson , qemu-arm@nongnu.org, Joel Stanley , Aleksandar Markovic , Paolo Bonzini , "Edgar E. Iglesias" , Aleksandar Rikalo , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Aurelien Jarno , Richard Henderson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" It is pointless to overlap a memory subregion with priority 0. Use the simpler memory_region_add_subregion() function. This patch was produced with the following spatch script: @@ expression region; expression offset; expression subregion; @@ -memory_region_add_subregion_overlap(region, offset, subregion, 0) +memory_region_add_subregion(region, offset, subregion) Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- hw/arm/bcm2835_peripherals.c | 4 ++-- hw/arm/raspi.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/hw/arm/bcm2835_peripherals.c b/hw/arm/bcm2835_peripherals.c index 17207ae07e..f792bd6bb1 100644 --- a/hw/arm/bcm2835_peripherals.c +++ b/hw/arm/bcm2835_peripherals.c @@ -160,8 +160,8 @@ static void bcm2835_peripherals_realize(DeviceState *de= v, Error **errp) for (n =3D 0; n < 4; n++) { memory_region_init_alias(&s->ram_alias[n], OBJECT(s), "bcm2835-gpu-ram-alias[*]", ram, 0, ram_s= ize); - memory_region_add_subregion_overlap(&s->gpu_bus_mr, (hwaddr)n << 3= 0, - &s->ram_alias[n], 0); + memory_region_add_subregion(&s->gpu_bus_mr, (hwaddr)n << 30, + &s->ram_alias[n]); } =20 /* Interrupt Controller */ diff --git a/hw/arm/raspi.c b/hw/arm/raspi.c index 6a510aafc1..3649b75449 100644 --- a/hw/arm/raspi.c +++ b/hw/arm/raspi.c @@ -187,7 +187,7 @@ static void raspi_init(MachineState *machine, int versi= on) memory_region_allocate_system_memory(&s->ram, OBJECT(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= ); + memory_region_add_subregion(get_system_memory(), 0, &s->ram); =20 /* Setup the SOC */ object_property_add_const_link(OBJECT(&s->soc), "ram", OBJECT(&s->ram), --=20 2.21.0 From nobody Wed May 15 10:11:41 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1576357369; cv=none; d=zohomail.com; s=zohoarc; b=UmQRedbEuda8vmqgavt0cNksIYGcIhxuY0zANkw7cmSUZqpyHYc++h/fMpFQfsMI/FKnG7ZFksBTCj2kVNAMf2dck0snfGFrogKjwR1xku/R6kJe3b9+JUKdtkMT1C5obwK8ZwJtj8ezr6i+scN9mEAlQBppSr8KtxjFHUCAEZ8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1576357369; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=MiLtQtAFIR7WooqjFNP7RA7pxFuVPXkVzD1becE3SHU=; b=EGRDQiJeRNr1HyhOLXDKuN4Xj3GwsqEoGOIXNsTNBstHSkuM5jm5+pkbs6Rd7FcRjOK8IBP8AvcJPTm3koB89lQo4Q4v/rzAdjNmOPmltnhg69uZJlUaHeOioHCs38PWp4o1GpqWcsvJMZJ4KQwcmKrDn25YiWzwO03V+Z1I30Q= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1576357369109845.610416679643; Sat, 14 Dec 2019 13:02:49 -0800 (PST) Received: from localhost ([::1]:32906 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1igEYq-00033I-1r for importer@patchew.org; Sat, 14 Dec 2019 16:02:48 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:42781) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1igEVb-0007u2-R4 for qemu-devel@nongnu.org; Sat, 14 Dec 2019 15:59:29 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1igEVZ-0007xv-Sp for qemu-devel@nongnu.org; Sat, 14 Dec 2019 15:59:27 -0500 Received: from us-smtp-1.mimecast.com ([205.139.110.61]:57044 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 1igEVZ-0007v8-L4 for qemu-devel@nongnu.org; Sat, 14 Dec 2019 15:59:25 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-95-GUjV9-9vPW2uksM1tC2tFw-1; Sat, 14 Dec 2019 10:57:21 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 6B6CA801E53; Sat, 14 Dec 2019 15:57:19 +0000 (UTC) Received: from x1w.redhat.com (ovpn-205-147.brq.redhat.com [10.40.205.147]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 9F5D75D6A7; Sat, 14 Dec 2019 15:57:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1576357165; 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=MiLtQtAFIR7WooqjFNP7RA7pxFuVPXkVzD1becE3SHU=; b=buos031Z8ORubbwg0qb79p4ex9zeZFsxAUxe9CgYSIONBNo6hmzTAJsdkiLl//NhjWtqPo ghsiKdAA8Asb9gx/S+aNnNQ41uGqju4zhsndqAZH3MFeSUTRY38H71AuuV5oCo23CO3F6t bFyO55xXLLmjt1ypOSmA509jJplZ12E= X-MC-Unique: GUjV9-9vPW2uksM1tC2tFw-1 From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH 3/8] hw/arm/xlnx-versal: Use memory_region_add_subregion() when priority is 0 Date: Sat, 14 Dec 2019 16:56:09 +0100 Message-Id: <20191214155614.19004-4-philmd@redhat.com> In-Reply-To: <20191214155614.19004-1-philmd@redhat.com> References: <20191214155614.19004-1-philmd@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 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.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: Peter Maydell , Alistair Francis , Paul Burton , Eduardo Habkost , kvm@vger.kernel.org, "Michael S. Tsirkin" , Marcelo Tosatti , Andrew Baumann , Alex Williamson , qemu-arm@nongnu.org, Joel Stanley , Aleksandar Markovic , Paolo Bonzini , "Edgar E. Iglesias" , Aleksandar Rikalo , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Aurelien Jarno , Richard Henderson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" It is pointless to overlap a memory subregion with priority 0. Use the simpler memory_region_add_subregion() function. This patch was produced with the following spatch script: @@ expression region; expression offset; expression subregion; @@ -memory_region_add_subregion_overlap(region, offset, subregion, 0) +memory_region_add_subregion(region, offset, subregion) Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- hw/arm/xlnx-versal-virt.c | 3 +-- hw/arm/xlnx-versal.c | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/hw/arm/xlnx-versal-virt.c b/hw/arm/xlnx-versal-virt.c index 462493c467..901e9ed86c 100644 --- a/hw/arm/xlnx-versal-virt.c +++ b/hw/arm/xlnx-versal-virt.c @@ -437,8 +437,7 @@ static void versal_virt_init(MachineState *machine) =20 /* Make the APU cpu address space visible to virtio and other * modules unaware of muliple address-spaces. */ - memory_region_add_subregion_overlap(get_system_memory(), - 0, &s->soc.fpd.apu.mr, 0); + memory_region_add_subregion(get_system_memory(), 0, &s->soc.fpd.apu.mr= ); =20 s->binfo.ram_size =3D machine->ram_size; s->binfo.loader_start =3D 0x0; diff --git a/hw/arm/xlnx-versal.c b/hw/arm/xlnx-versal.c index 8b3d8d85b8..538d907f8a 100644 --- a/hw/arm/xlnx-versal.c +++ b/hw/arm/xlnx-versal.c @@ -281,8 +281,8 @@ static void versal_realize(DeviceState *dev, Error **er= rp) memory_region_init_ram(&s->lpd.mr_ocm, OBJECT(s), "ocm", MM_OCM_SIZE, &error_fatal); =20 - memory_region_add_subregion_overlap(&s->mr_ps, MM_OCM, &s->lpd.mr_ocm,= 0); - memory_region_add_subregion_overlap(&s->fpd.apu.mr, 0, &s->mr_ps, 0); + memory_region_add_subregion(&s->mr_ps, MM_OCM, &s->lpd.mr_ocm); + memory_region_add_subregion(&s->fpd.apu.mr, 0, &s->mr_ps); } =20 static void versal_init(Object *obj) --=20 2.21.0 From nobody Wed May 15 10:11:41 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1576357635; cv=none; d=zohomail.com; s=zohoarc; b=KUBZLcSZdQJ/ACooZf/eIZxmrFojAWzKHEBuOpG2JLfPr6QR8J6oZLXEU2vphVa6CqgvN5dURhOdkHKwHLylooQtDB8NkXBecr2/zLQcLMHNdpJv4GtkkCgFXahcYDKVHxSARXsKvEbmU6H4qgciXbq9BUl6kWd7nnqqygMQOV0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1576357635; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=7SlorlqSNo6p31H7HgBYKxDoBhr5Y5T4+whsDnKxCwo=; b=TGH3UpXIsbhARR5K64M3+u9rfCKfJYxmZKb04YfrxWjqX5pFb0JihrG2B65cdt1jqjkw81yPHXD4D0URcGbI//CqXFpW/HoLPua7Xquh+sT2WDvsSDoP+bU/XrKkbomijhKQpN5QlKvcnSGFObGZ2mJJhSXimo/ZN08F1WzRsJE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1576357635648437.0712552239751; Sat, 14 Dec 2019 13:07:15 -0800 (PST) Received: from localhost ([::1]:32976 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1igEd8-0008E4-F8 for importer@patchew.org; Sat, 14 Dec 2019 16:07:14 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:56959) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1igEWI-0000Te-I9 for qemu-devel@nongnu.org; Sat, 14 Dec 2019 16:00:12 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1igEWH-0001qp-4Q for qemu-devel@nongnu.org; Sat, 14 Dec 2019 16:00:10 -0500 Received: from us-smtp-1.mimecast.com ([207.211.31.81]:48799 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 1igEWG-0001nZ-IQ for qemu-devel@nongnu.org; Sat, 14 Dec 2019 16:00:08 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-245-uNUZ_QilNLChRElt76KaAQ-1; Sat, 14 Dec 2019 10:57:34 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 61F701852E2A; Sat, 14 Dec 2019 15:57:32 +0000 (UTC) Received: from x1w.redhat.com (ovpn-205-147.brq.redhat.com [10.40.205.147]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 0764F5D6A7; Sat, 14 Dec 2019 15:57:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1576357208; 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=7SlorlqSNo6p31H7HgBYKxDoBhr5Y5T4+whsDnKxCwo=; b=UL7imkA/BKwGRVDgJT5IiD8P0Y9c1twCKg4fi/XlPKlqwGun78/+sw8+i21+mJBwHfYQmG wdsVS32BRw69tThNncfZDsvWxc4TjdebRlIrrR5Ar4cSzErynzhg26Jp1IJWOfvVU8OHCb I6VlBmczFRegk1dQmJ1Qbi/Euuheu9I= X-MC-Unique: uNUZ_QilNLChRElt76KaAQ-1 From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH 4/8] hw/i386/intel_iommu: Use memory_region_add_subregion when priority is 0 Date: Sat, 14 Dec 2019 16:56:10 +0100 Message-Id: <20191214155614.19004-5-philmd@redhat.com> In-Reply-To: <20191214155614.19004-1-philmd@redhat.com> References: <20191214155614.19004-1-philmd@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 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: 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: Peter Maydell , Alistair Francis , Paul Burton , Eduardo Habkost , kvm@vger.kernel.org, "Michael S. Tsirkin" , Marcelo Tosatti , Andrew Baumann , Alex Williamson , qemu-arm@nongnu.org, Joel Stanley , Aleksandar Markovic , Paolo Bonzini , "Edgar E. Iglesias" , Aleksandar Rikalo , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Aurelien Jarno , Richard Henderson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" It is pointless to overlap a memory subregion with priority 0. Use the simpler memory_region_add_subregion() function. This patch was produced with the following spatch script: @@ expression region; expression offset; expression subregion; @@ -memory_region_add_subregion_overlap(region, offset, subregion, 0) +memory_region_add_subregion(region, offset, subregion) Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- hw/i386/intel_iommu.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/hw/i386/intel_iommu.c b/hw/i386/intel_iommu.c index 43c94b993b..afa7e07b05 100644 --- a/hw/i386/intel_iommu.c +++ b/hw/i386/intel_iommu.c @@ -3363,11 +3363,9 @@ VTDAddressSpace *vtd_find_add_as(IntelIOMMUState *s,= PCIBus *bus, int devfn) * switch between DMAR & noDMAR by enable/disable * corresponding sub-containers */ - memory_region_add_subregion_overlap(&vtd_dev_as->root, 0, - MEMORY_REGION(&vtd_dev_as->iom= mu), - 0); - memory_region_add_subregion_overlap(&vtd_dev_as->root, 0, - &vtd_dev_as->nodmar, 0); + memory_region_add_subregion(&vtd_dev_as->root, 0, + MEMORY_REGION(&vtd_dev_as->iommu)); + memory_region_add_subregion(&vtd_dev_as->root, 0, &vtd_dev_as->nod= mar); =20 vtd_switch_address_space(vtd_dev_as); } @@ -3764,8 +3762,7 @@ static void vtd_realize(DeviceState *dev, Error **err= p) memory_region_init_alias(&s->mr_sys_alias, OBJECT(s), "vtd-sys-alias", get_system_memory(), 0, memory_region_size(get_system_memory())); - memory_region_add_subregion_overlap(&s->mr_nodmar, 0, - &s->mr_sys_alias, 0); + memory_region_add_subregion(&s->mr_nodmar, 0, &s->mr_sys_alias); memory_region_add_subregion_overlap(&s->mr_nodmar, VTD_INTERRUPT_ADDR_FIRST, &s->mr_ir, 1); --=20 2.21.0 From nobody Wed May 15 10:11:41 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1576357562; cv=none; d=zohomail.com; s=zohoarc; b=G3W5XfPRGTaSssCGF+Kkn+iyXDKmjfdvHPb1gXybXM4TnMrjClYj4CMGVuCQPfPeuFSp/F6DHA6DL5MMVJ56Mimilcr+EiNYFvhzVtc/K34OIb4kpxKsyKBNFaguT7EzAzNBdw27hVOtZB/dxaofTEaa9St0ktJSDEK7ujwiYIQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1576357562; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=LVY3k3PXmSJpFd+itDbLg545Lfy8MyLnQ8WHFK1FOqU=; b=MVE/nuamcKgxLq3ma1O+p7rqZ38va6DXSoZYkmliPFvWVHSRSVhBqyFzRuI6K8tr+p+oXg82IbxZexNRIcIM4wJWbJdAFcshTIUcz+x4qvW0hmASdZGtQq5HmvVZWP77Mmn24Y+YcHe2EqZlDjJv90eMLFFFoCTztVA3zqPBcKM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1576357562883922.2992580850402; Sat, 14 Dec 2019 13:06:02 -0800 (PST) Received: from localhost ([::1]:32954 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1igEbw-0006dr-Rc for importer@patchew.org; Sat, 14 Dec 2019 16:06:00 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:55529) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1igEWD-0000Np-3O for qemu-devel@nongnu.org; Sat, 14 Dec 2019 16:00:06 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1igEWB-0001aM-GE for qemu-devel@nongnu.org; Sat, 14 Dec 2019 16:00:04 -0500 Received: from us-smtp-1.mimecast.com ([207.211.31.81]:47741) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1igEWB-0001W9-5H for qemu-devel@nongnu.org; Sat, 14 Dec 2019 16:00:03 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-379-izlcFJRFOTCG14SMImFy1g-1; Sat, 14 Dec 2019 10:57:43 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id BBADE107ACC4; Sat, 14 Dec 2019 15:57:41 +0000 (UTC) Received: from x1w.redhat.com (ovpn-205-147.brq.redhat.com [10.40.205.147]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 04D3D5D6A7; Sat, 14 Dec 2019 15:57:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1576357202; 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=LVY3k3PXmSJpFd+itDbLg545Lfy8MyLnQ8WHFK1FOqU=; b=HcCFqXiHdYLJtC3TlOlDcgG04EeX+VORp7/uhRWYY9niDo/mBjCj6mUw0fCjNM5S9Ilroc TeLY110yfKf3+Mk4rAEbkWhaZ67Y8mEU7Pz6DVxhZsxACvbUSPfszfDTYCRrP9BIUnPcOG Uze2u+Qkgk1pgtG99P3VkLM1IlD0jOk= X-MC-Unique: izlcFJRFOTCG14SMImFy1g-1 From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH 5/8] hw/mips/boston: Use memory_region_add_subregion() when priority is 0 Date: Sat, 14 Dec 2019 16:56:11 +0100 Message-Id: <20191214155614.19004-6-philmd@redhat.com> In-Reply-To: <20191214155614.19004-1-philmd@redhat.com> References: <20191214155614.19004-1-philmd@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 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: 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: Peter Maydell , Alistair Francis , Paul Burton , Eduardo Habkost , kvm@vger.kernel.org, "Michael S. Tsirkin" , Marcelo Tosatti , Andrew Baumann , Alex Williamson , qemu-arm@nongnu.org, Joel Stanley , Aleksandar Markovic , Paolo Bonzini , "Edgar E. Iglesias" , Aleksandar Rikalo , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Aurelien Jarno , Richard Henderson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" It is pointless to overlap a memory subregion with priority 0. Use the simpler memory_region_add_subregion() function. This patch was produced with the following spatch script: @@ expression region; expression offset; expression subregion; @@ -memory_region_add_subregion_overlap(region, offset, subregion, 0) +memory_region_add_subregion(region, offset, subregion) Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- hw/mips/boston.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/hw/mips/boston.c b/hw/mips/boston.c index ca7d813a52..a27258b4d1 100644 --- a/hw/mips/boston.c +++ b/hw/mips/boston.c @@ -412,10 +412,10 @@ xilinx_pcie_init(MemoryRegion *sys_mem, uint32_t bus_= nr, qdev_init_nofail(dev); =20 cfg =3D sysbus_mmio_get_region(SYS_BUS_DEVICE(dev), 0); - memory_region_add_subregion_overlap(sys_mem, cfg_base, cfg, 0); + memory_region_add_subregion(sys_mem, cfg_base, cfg); =20 mmio =3D sysbus_mmio_get_region(SYS_BUS_DEVICE(dev), 1); - memory_region_add_subregion_overlap(sys_mem, 0, mmio, 0); + memory_region_add_subregion(sys_mem, 0, mmio); =20 qdev_connect_gpio_out_named(dev, "interrupt_out", 0, irq); =20 @@ -471,17 +471,17 @@ static void boston_mach_init(MachineState *machine) =20 flash =3D g_new(MemoryRegion, 1); memory_region_init_rom(flash, NULL, "boston.flash", 128 * MiB, &err); - memory_region_add_subregion_overlap(sys_mem, 0x18000000, flash, 0); + memory_region_add_subregion(sys_mem, 0x18000000, flash); =20 ddr =3D g_new(MemoryRegion, 1); memory_region_allocate_system_memory(ddr, NULL, "boston.ddr", machine->ram_size); - memory_region_add_subregion_overlap(sys_mem, 0x80000000, ddr, 0); + memory_region_add_subregion(sys_mem, 0x80000000, ddr); =20 ddr_low_alias =3D g_new(MemoryRegion, 1); memory_region_init_alias(ddr_low_alias, NULL, "boston_low.ddr", ddr, 0, MIN(machine->ram_size, (256 * MiB))); - memory_region_add_subregion_overlap(sys_mem, 0, ddr_low_alias, 0); + memory_region_add_subregion(sys_mem, 0, ddr_low_alias); =20 xilinx_pcie_init(sys_mem, 0, 0x10000000, 32 * MiB, @@ -501,7 +501,7 @@ static void boston_mach_init(MachineState *machine) platreg =3D g_new(MemoryRegion, 1); memory_region_init_io(platreg, NULL, &boston_platreg_ops, s, "boston-platregs", 0x1000); - memory_region_add_subregion_overlap(sys_mem, 0x17ffd000, platreg, 0); + memory_region_add_subregion(sys_mem, 0x17ffd000, platreg); =20 s->uart =3D serial_mm_init(sys_mem, 0x17ffe000, 2, get_cps_irq(&s->cps, 3), 10000000, @@ -509,7 +509,7 @@ static void boston_mach_init(MachineState *machine) =20 lcd =3D g_new(MemoryRegion, 1); memory_region_init_io(lcd, NULL, &boston_lcd_ops, s, "boston-lcd", 0x8= ); - memory_region_add_subregion_overlap(sys_mem, 0x17fff000, lcd, 0); + memory_region_add_subregion(sys_mem, 0x17fff000, lcd); =20 chr =3D qemu_chr_new("lcd", "vc:320x240", NULL); qemu_chr_fe_init(&s->lcd_display, chr, NULL); --=20 2.21.0 From nobody Wed May 15 10:11:41 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1576357454; cv=none; d=zohomail.com; s=zohoarc; b=dciBXphgntmvdS1s3He/PhIu4YiD+AOnr9SZz6HosMA+rQcfaH5E/gMIA9JZZM1uks7wQ7BMdoL0yCdxU+nwTaJMWuJpxdCJxE/xzqXtBFSeTQCgynOQrmWtmy7veWjxb4WJfyoFVtzoSMsOVuQMRXWJLysQQsr9wHN9ug5wzYE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1576357454; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=LRDNXmBjVfes+8mRt7KTS+s8kaJK3nwCAodGqedjxW4=; b=c5xRw3UOu5VBc1OPulna9rF/Os7wjNz38Pkrbv89f4pLjTqWUQwI8Cxz4a3lcA8DIixuZxc4oC3sXOzjHcjfaPs+FXY3ojpQ/wASZ+yYwqotQ+ArA312Lre0EC8kXQcntho6ggMCGovWaU9KFruzfG4UBE7UNexjj+GBdEESEfY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1576357454613527.612120139637; Sat, 14 Dec 2019 13:04:14 -0800 (PST) Received: from localhost ([::1]:32922 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1igEaD-0004Xd-84 for importer@patchew.org; Sat, 14 Dec 2019 16:04:13 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:55371) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1igEWC-0000NY-Ip for qemu-devel@nongnu.org; Sat, 14 Dec 2019 16:00:05 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1igEWB-0001Zl-CC for qemu-devel@nongnu.org; Sat, 14 Dec 2019 16:00:04 -0500 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:36222 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 1igEWB-0001Wb-4G for qemu-devel@nongnu.org; Sat, 14 Dec 2019 16:00:03 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-271-InHhu3ggMleXW3tOq5yXNw-1; Sat, 14 Dec 2019 10:57:59 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id C1EA11852E2D; Sat, 14 Dec 2019 15:57:56 +0000 (UTC) Received: from x1w.redhat.com (ovpn-205-147.brq.redhat.com [10.40.205.147]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 88D2B5D6A7; Sat, 14 Dec 2019 15:57:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1576357202; 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=LRDNXmBjVfes+8mRt7KTS+s8kaJK3nwCAodGqedjxW4=; b=U6Ysk7CKH3hnQSV3zJWl3yLKj3sVtG733qDWXIrnk5CmeawZKj+Ke3NPwIgCXuidUG11wi +sjo6L+vbJ0OmgBoKIAewndNW6tONejicWCHSBGPdXbwckM+7qrOxJ+Cmvvwu9OFZa2q6m WDFxvQE8rq1L1yGj+ZCv+DeSQYGqWzY= X-MC-Unique: InHhu3ggMleXW3tOq5yXNw-1 From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH 6/8] hw/vfio/pci: Use memory_region_add_subregion() when priority is 0 Date: Sat, 14 Dec 2019 16:56:12 +0100 Message-Id: <20191214155614.19004-7-philmd@redhat.com> In-Reply-To: <20191214155614.19004-1-philmd@redhat.com> References: <20191214155614.19004-1-philmd@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 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: 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: Peter Maydell , Alistair Francis , Paul Burton , Eduardo Habkost , kvm@vger.kernel.org, "Michael S. Tsirkin" , Marcelo Tosatti , Andrew Baumann , Alex Williamson , qemu-arm@nongnu.org, Joel Stanley , Aleksandar Markovic , Paolo Bonzini , "Edgar E. Iglesias" , Aleksandar Rikalo , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Aurelien Jarno , Richard Henderson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" It is pointless to overlap a memory subregion with priority 0. Use the simpler memory_region_add_subregion() function. This patch was produced with the following spatch script: @@ expression region; expression offset; expression subregion; @@ -memory_region_add_subregion_overlap(region, offset, subregion, 0) +memory_region_add_subregion(region, offset, subregion) Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- hw/vfio/pci.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c index 2d40b396f2..74b1eb7ddc 100644 --- a/hw/vfio/pci.c +++ b/hw/vfio/pci.c @@ -1095,8 +1095,7 @@ static void vfio_sub_page_bar_update_mapping(PCIDevic= e *pdev, int bar) memory_region_set_size(mmap_mr, size); if (size !=3D vdev->bars[bar].size && memory_region_is_mapped(base_mr)= ) { memory_region_del_subregion(r->address_space, base_mr); - memory_region_add_subregion_overlap(r->address_space, - bar_addr, base_mr, 0); + memory_region_add_subregion(r->address_space, bar_addr, base_mr); } =20 memory_region_transaction_commit(); --=20 2.21.0 From nobody Wed May 15 10:11:41 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1576357315; cv=none; d=zohomail.com; s=zohoarc; b=fcY68UQsiiYnanWTe3VTKYdAaggSRz9Z+/8y7vvVwg4CLN+Kvs82pgWh16vQ6dQ99QPhGI78P7V8X/mU1pe7C6ECtKZ5ts2kpgHTzUWZNOkjTXFevyoVT3QO6rNWpgPf+jNWnJTDrqBIVsF+3oIR9gDaeXvosjWL45sMg0gngQ0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1576357315; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=1cebHdve3ZnvlZJWxH5a8KchlZuVrxNjKmx0NHd8T+o=; b=bn9qme/yqVfdq/xU16/0CAJh/hbK+VtLNQtlCdt+BebP4sQSb74UuVLalOfPya0kU7qaA2Wlvnqu3Gmgbky41rHBUZeaMbPcNYygdLHnSx2NAqBTe/NURRNoTMjpX5ksbpRkNU/ohXP76xFsCcbrPrheGORiNyaTOi5fgZ1U6T8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 157635731590425.10764660292898; Sat, 14 Dec 2019 13:01:55 -0800 (PST) Received: from localhost ([::1]:32896 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1igEXy-00025m-Ob for importer@patchew.org; Sat, 14 Dec 2019 16:01:54 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:55455) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1igEWC-0000Nf-Rb for qemu-devel@nongnu.org; Sat, 14 Dec 2019 16:00:06 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1igEWB-0001aY-Hc for qemu-devel@nongnu.org; Sat, 14 Dec 2019 16:00:04 -0500 Received: from us-smtp-1.mimecast.com ([207.211.31.81]:39305) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1igEWB-0001X9-7e for qemu-devel@nongnu.org; Sat, 14 Dec 2019 16:00:03 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-30-FmV6NzRAPFqS56q6qZWsiQ-1; Sat, 14 Dec 2019 10:58:07 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 74DD11005502; Sat, 14 Dec 2019 15:58:05 +0000 (UTC) Received: from x1w.redhat.com (ovpn-205-147.brq.redhat.com [10.40.205.147]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 7DCAF5D6A7; Sat, 14 Dec 2019 15:57:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1576357202; 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=1cebHdve3ZnvlZJWxH5a8KchlZuVrxNjKmx0NHd8T+o=; b=AOZSTBzPMR+g53eBKaMsby9yOBMukc9O+tFR5tZBwSq2cRuw1ceadAExwh6FLC3W5lLj7w DN7irXVhR6dGOUqXhvgvEozT5etBtJGVQ8iCoFh99xlMAKwUkaoUM7EPuM65P6ilquUWsA F8NeMDH5gmuGet5A4ATa4CGApKHsxL4= X-MC-Unique: FmV6NzRAPFqS56q6qZWsiQ-1 From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH 7/8] target/i386: Use memory_region_add_subregion() when priority is 0 Date: Sat, 14 Dec 2019 16:56:13 +0100 Message-Id: <20191214155614.19004-8-philmd@redhat.com> In-Reply-To: <20191214155614.19004-1-philmd@redhat.com> References: <20191214155614.19004-1-philmd@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 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: 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: Peter Maydell , Alistair Francis , Paul Burton , Eduardo Habkost , kvm@vger.kernel.org, "Michael S. Tsirkin" , Marcelo Tosatti , Andrew Baumann , Alex Williamson , qemu-arm@nongnu.org, Joel Stanley , Aleksandar Markovic , Paolo Bonzini , "Edgar E. Iglesias" , Aleksandar Rikalo , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Aurelien Jarno , Richard Henderson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" It is pointless to overlap a memory subregion with priority 0. Use the simpler memory_region_add_subregion() function. This patch was produced with the following spatch script: @@ expression region; expression offset; expression subregion; @@ -memory_region_add_subregion_overlap(region, offset, subregion, 0) +memory_region_add_subregion(region, offset, subregion) Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- target/i386/cpu.c | 2 +- target/i386/kvm.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/target/i386/cpu.c b/target/i386/cpu.c index 69f518a21a..6131c62f9d 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -6483,7 +6483,7 @@ static void x86_cpu_realizefn(DeviceState *dev, Error= **errp) */ memory_region_init_alias(cpu->cpu_as_mem, OBJECT(cpu), "memory", get_system_memory(), 0, ~0ull); - memory_region_add_subregion_overlap(cpu->cpu_as_root, 0, cpu->cpu_= as_mem, 0); + memory_region_add_subregion(cpu->cpu_as_root, 0, cpu->cpu_as_mem); memory_region_set_enabled(cpu->cpu_as_mem, true); =20 cs->num_ases =3D 2; diff --git a/target/i386/kvm.c b/target/i386/kvm.c index 1d10046a6c..4e1ba9d474 100644 --- a/target/i386/kvm.c +++ b/target/i386/kvm.c @@ -2081,7 +2081,7 @@ static void register_smram_listener(Notifier *n, void= *unused) */ memory_region_init_alias(&smram_as_mem, OBJECT(kvm_state), "mem-smram", get_system_memory(), 0, ~0ull); - memory_region_add_subregion_overlap(&smram_as_root, 0, &smram_as_mem, = 0); + memory_region_add_subregion(&smram_as_root, 0, &smram_as_mem); memory_region_set_enabled(&smram_as_mem, true); =20 if (smram) { --=20 2.21.0 From nobody Wed May 15 10:11:41 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1576357223; cv=none; d=zohomail.com; s=zohoarc; b=m/NHFbt+QrlNjk2eGJq+jgo3yYmo34jjs2T5qjPoHIKvJZKjbt7NMR1lcy12NxctWxlQlAcFBSo2WZN0QqhAvRqVQCLGPeXqNnZcE2gh8Mh+MW03XX9ACU9UQZBGGSTezpgEcz0ievQaEFAyH0RWU/JWwmWwjbKqeDnOtkzGbcs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1576357223; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=cFyYhSJaR8h39Rbqagf85ifWXxR+w0L7k4hKSrlfago=; b=CnTA0ql5ds4HydTZqxDlmET+Jrd0S75ZLs2hlEVgXwAFg9ka22CbAZIQJOPkLL+/D5bYCU6t8WqYNA2IRGKTdtsI1rGyy37WPkuWp4WWO6KEFkQs0UutdxzRnGkGOkb5u+/5XTyz1Fqzrm+swrdpuyUNTyfOnMqhHToQZXNY/a0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1576357223746203.19742050713774; Sat, 14 Dec 2019 13:00:23 -0800 (PST) Received: from localhost ([::1]:32840 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1igEWT-00008k-3H for importer@patchew.org; Sat, 14 Dec 2019 16:00:21 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:37791) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1igEVM-0007ZF-Fz for qemu-devel@nongnu.org; Sat, 14 Dec 2019 15:59:13 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1igEVL-0007Bz-E2 for qemu-devel@nongnu.org; Sat, 14 Dec 2019 15:59:12 -0500 Received: from us-smtp-1.mimecast.com ([207.211.31.81]:60198 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 1igEVL-00078E-7a for qemu-devel@nongnu.org; Sat, 14 Dec 2019 15:59:11 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-205-GKZmRrbXNv-VBjqVcGU-Mg-1; Sat, 14 Dec 2019 10:58:20 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 3AAA1801E74; Sat, 14 Dec 2019 15:58:18 +0000 (UTC) Received: from x1w.redhat.com (ovpn-205-147.brq.redhat.com [10.40.205.147]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E18B066A1A; Sat, 14 Dec 2019 15:58:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1576357150; 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=cFyYhSJaR8h39Rbqagf85ifWXxR+w0L7k4hKSrlfago=; b=fFOyT04NXIGFh6MrBpyYxVtESBvmCSsEMcmq3FHJpXkR8amvdf1JEuzvJGBT+WFRvG65sB YVdpeKWcgpgbuQORCPUDVq/3pJfSATITb3BRnhZxFcRf8TG8kZMOZOOsyEvDSqlH9WRcUc j85ksL8/KnGcBvAknSFHUt6WgKde1Nk= X-MC-Unique: GKZmRrbXNv-VBjqVcGU-Mg-1 From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH 8/8] target/i386/cpu: Use 'mr' for MemoryRegion variables Date: Sat, 14 Dec 2019 16:56:14 +0100 Message-Id: <20191214155614.19004-9-philmd@redhat.com> In-Reply-To: <20191214155614.19004-1-philmd@redhat.com> References: <20191214155614.19004-1-philmd@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 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: 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: Peter Maydell , Alistair Francis , Paul Burton , Eduardo Habkost , kvm@vger.kernel.org, "Michael S. Tsirkin" , Marcelo Tosatti , Andrew Baumann , Alex Williamson , qemu-arm@nongnu.org, Joel Stanley , Aleksandar Markovic , Paolo Bonzini , "Edgar E. Iglesias" , Aleksandar Rikalo , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Aurelien Jarno , Richard Henderson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" The codebase use 'as' in variable names for AddressSpace objects, and 'mr' for MemoryRegion objects. Since these variables are MemoryRegion objects, rename them as 'mr' to avoid confusion with AddressSpace objects. Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- target/i386/cpu.h | 2 +- target/i386/cpu.c | 18 +++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/target/i386/cpu.h b/target/i386/cpu.h index cde2a16b94..1e5ded6e84 100644 --- a/target/i386/cpu.h +++ b/target/i386/cpu.h @@ -1713,7 +1713,7 @@ struct X86CPU { /* in order to simplify APIC support, we leave this pointer to the user */ struct DeviceState *apic_state; - struct MemoryRegion *cpu_as_root, *cpu_as_mem, *smram; + MemoryRegion *cpu_mr_root, *cpu_mr_mem, *smram; Notifier machine_done; =20 struct kvm_msrs *kvm_msr_buf; diff --git a/target/i386/cpu.c b/target/i386/cpu.c index 6131c62f9d..b5d22740b8 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -5983,7 +5983,7 @@ static void x86_cpu_machine_done(Notifier *n, void *u= nused) memory_region_init_alias(cpu->smram, OBJECT(cpu), "smram", smram, 0, 1ull << 32); memory_region_set_enabled(cpu->smram, true); - memory_region_add_subregion_overlap(cpu->cpu_as_root, 0, cpu->smra= m, 1); + memory_region_add_subregion_overlap(cpu->cpu_mr_root, 0, cpu->smra= m, 1); } } #else @@ -6471,24 +6471,24 @@ static void x86_cpu_realizefn(DeviceState *dev, Err= or **errp) =20 #ifndef CONFIG_USER_ONLY if (tcg_enabled()) { - cpu->cpu_as_mem =3D g_new(MemoryRegion, 1); - cpu->cpu_as_root =3D g_new(MemoryRegion, 1); + cpu->cpu_mr_mem =3D g_new(MemoryRegion, 1); + cpu->cpu_mr_root =3D g_new(MemoryRegion, 1); =20 /* Outer container... */ - memory_region_init(cpu->cpu_as_root, OBJECT(cpu), "memory", ~0ull); - memory_region_set_enabled(cpu->cpu_as_root, true); + memory_region_init(cpu->cpu_mr_root, OBJECT(cpu), "memory", ~0ull); + memory_region_set_enabled(cpu->cpu_mr_root, true); =20 /* ... with two regions inside: normal system memory with low * priority, and... */ - memory_region_init_alias(cpu->cpu_as_mem, OBJECT(cpu), "memory", + memory_region_init_alias(cpu->cpu_mr_mem, OBJECT(cpu), "memory", get_system_memory(), 0, ~0ull); - memory_region_add_subregion(cpu->cpu_as_root, 0, cpu->cpu_as_mem); - memory_region_set_enabled(cpu->cpu_as_mem, true); + memory_region_add_subregion(cpu->cpu_mr_root, 0, cpu->cpu_mr_mem); + memory_region_set_enabled(cpu->cpu_mr_mem, true); =20 cs->num_ases =3D 2; cpu_address_space_init(cs, 0, "cpu-memory", cs->memory); - cpu_address_space_init(cs, 1, "cpu-smm", cpu->cpu_as_root); + cpu_address_space_init(cs, 1, "cpu-smm", cpu->cpu_mr_root); =20 /* ... SMRAM with higher priority, linked from /machine/smram. */ cpu->machine_done.notify =3D x86_cpu_machine_done; --=20 2.21.0