From nobody Wed May 15 04:32:12 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.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 (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1561414146; cv=none; d=zoho.com; s=zohoarc; b=Z6ezwdFsguKLV23/gIpKw5UsOZCPK8GTBGiDc6GJtVQHd5QiDGsjUTScb28E2sW88yPETJsIyFZlJ2h3MFcG55iZva2lFxG7id9O3zemyTPfVrgkwtSTk2rB/3xl7En06usT3RnMCYkqs+BAQVWO1xTVKd4jr5Ob3gJ9NwsGQ8c= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1561414146; 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:ARC-Authentication-Results; bh=CqzSg8zo4MBdOpl0X3dMGpLIXRC6uXRJAn0bBo9bK7c=; b=LN5ZQ13rbAKdOXVqJpZGScZx6oJh+P9ptit4Rn1dtBAFdtk7T2VI/X/4T+f42dgwVBUEF0Ut8jWu70OujogB5xyjmx3MUcUdUpEdsUeVlZ0Ca/TdlLDLdi0c/vgqEOXQA1Izs8iKERyVX33D/nzF4pDMS6F4aQ1WWE5F+GNpl/c= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1561414146195963.298305142896; Mon, 24 Jun 2019 15:09:06 -0700 (PDT) Received: from localhost ([::1]:54908 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hfX97-0004mn-8U for importer@patchew.org; Mon, 24 Jun 2019 18:09:05 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54667) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hfX1L-0007jI-SH for qemu-devel@nongnu.org; Mon, 24 Jun 2019 18:01:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hfX1J-000317-KK for qemu-devel@nongnu.org; Mon, 24 Jun 2019 18:01:03 -0400 Received: from mail-wm1-x344.google.com ([2a00:1450:4864:20::344]:51412) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hfX1J-000301-DW for qemu-devel@nongnu.org; Mon, 24 Jun 2019 18:01:01 -0400 Received: by mail-wm1-x344.google.com with SMTP id 207so790029wma.1 for ; Mon, 24 Jun 2019 15:01:01 -0700 (PDT) Received: from x1.local (183.red-88-21-202.staticip.rima-tde.net. [88.21.202.183]) by smtp.gmail.com with ESMTPSA id z126sm1118612wmb.32.2019.06.24.15.00.58 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Mon, 24 Jun 2019 15:00:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=CqzSg8zo4MBdOpl0X3dMGpLIXRC6uXRJAn0bBo9bK7c=; b=lD2uCuKH6chTdQVqVYa/7gU6DU14+ItN7EFSol7TEDN5rO+vqbLXdpHW7BoHg1MTnW PCW8KAE7KbTsPebxBMFkHADiwGEKFztXyVMtCWG0LBJARhUNT+nP9V8zKJKJwpFvYvjf g+DNj89z6BN5kja8kZjIdag2kHgeAYVf4NY4/NlLuuDxdIhwADMnPnhw8WyY6Nm2oHU8 f4fxB2KyCQyE0tABv1IzGZxQnwQbWd0+AVu3ZJ+4TiACFbkDypXcQD/JEy2L/wSocEJk GBzk+ACCgKcUzKx43a2LOfxxbW3WUpiCtza45ihjLL6wVL6Z370jLc3psEyQPIk0qK43 pSUw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=CqzSg8zo4MBdOpl0X3dMGpLIXRC6uXRJAn0bBo9bK7c=; b=gwaNA/2ai+Jtt+hB3cs2oj9iC1xeYB07H5KjNZSdZOj8RLpJYyx13A104IJFX5ih83 L4p7LjjBSW5fnjBU33nTsQC4P7bG1GYRntn+UnvV9IKwfqIbv8RvO2RShyEl86pw6bW9 jH1rulnugOofDbGdKcGeImwwe5dkHR1TfJES2XCcMCdpJWBDKXMQPrBGt4lMCLCKUDly cnpBojcxTEmBxWnwfFH5Seis3ZmEUWZPenWb7UCixCCgsgxOSyL1x58JZ7qFDyBjt6VC wkUIEsDN/9ssfrDqsWgHaCXYYiQ3+sOpNecf+tZ9D0fjgddNHZFkASfgyRhxPZsgIQNm inOw== X-Gm-Message-State: APjAAAUAzqrqonFk2F5p0QjGN5niC1cMUmhyfz0rmmo7BbPCY4OHieq0 wCLnslcN9lnZ5WlqQdUa4d9AIaPC X-Google-Smtp-Source: APXvYqwuMeLCbGnHCLv7mdvBTdf2xDLPmRx3jG1weTHJx1B1pyh5zL6VLj+uC6drsZpAB/zldQ1GZA== X-Received: by 2002:a7b:cd84:: with SMTP id y4mr17403808wmj.79.1561413660101; Mon, 24 Jun 2019 15:01:00 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Date: Tue, 25 Jun 2019 00:00:48 +0200 Message-Id: <20190624220056.25861-2-f4bug@amsat.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190624220056.25861-1-f4bug@amsat.org> References: <20190624220056.25861-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::344 Subject: [Qemu-devel] [PATCH 1/9] hw/misc: Move the 'empty_slot' device to hw/misc/ 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 , Aleksandar Rikalo , Mark Cave-Ayland , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Aurelien Jarno , Aleksandar Markovic , Artyom Tarasenko Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Artyom Tarasenko --- include/hw/empty_slot.h | 7 ------- include/hw/misc/empty_slot.h | 32 ++++++++++++++++++++++++++++++++ hw/mips/mips_malta.c | 2 +- hw/{core =3D> misc}/empty_slot.c | 2 +- hw/sparc/sun4m.c | 2 +- hw/core/Makefile.objs | 1 - hw/misc/Makefile.objs | 1 + 7 files changed, 36 insertions(+), 11 deletions(-) delete mode 100644 include/hw/empty_slot.h create mode 100644 include/hw/misc/empty_slot.h rename hw/{core =3D> misc}/empty_slot.c (98%) diff --git a/include/hw/empty_slot.h b/include/hw/empty_slot.h deleted file mode 100644 index 123a9f8989..0000000000 --- a/include/hw/empty_slot.h +++ /dev/null @@ -1,7 +0,0 @@ -#ifndef HW_EMPTY_SLOT_H -#define HW_EMPTY_SLOT_H - -/* empty_slot.c */ -void empty_slot_init(hwaddr addr, uint64_t slot_size); - -#endif diff --git a/include/hw/misc/empty_slot.h b/include/hw/misc/empty_slot.h new file mode 100644 index 0000000000..46483f24c3 --- /dev/null +++ b/include/hw/misc/empty_slot.h @@ -0,0 +1,32 @@ +/* + * QEMU Empty Slot + * + * The empty_slot device emulates known to a bus but not connected devices. + * + * Copyright (c) 2010 Artyom Tarasenko + * + * This code is licensed under the GNU GPL v2 or (at your option) any later + * version. + */ + +#ifndef HW_EMPTY_SLOT_H +#define HW_EMPTY_SLOT_H + +/** + * empty_slot_init: create and map a RAZ/WI device + * @base: base address of the device's MMIO region + * @size: size of the device's MMIO region + * + * This utility function creates and maps an instance of empty slot, + * which is a dummy device which simply read as zero, and ignore writes. + * An empty slot sit on a bus, and no bus errors are generated when it is + * accessed. + * Guest accesses can be traced, using the '-trace empty_slot\*' command + * line argument. + * The device is mapped at priority -10000, which means that you can + * use it to cover a large region and then map other devices on top of it + * if necessary. + */ +void empty_slot_init(hwaddr addr, uint64_t slot_size); + +#endif diff --git a/hw/mips/mips_malta.c b/hw/mips/mips_malta.c index 37ec89b07e..7008be2e5b 100644 --- a/hw/mips/mips_malta.c +++ b/hw/mips/mips_malta.c @@ -53,7 +53,7 @@ #include "sysemu/qtest.h" #include "qapi/error.h" #include "qemu/error-report.h" -#include "hw/empty_slot.h" +#include "hw/misc/empty_slot.h" #include "sysemu/kvm.h" #include "hw/semihosting/semihost.h" #include "hw/mips/cps.h" diff --git a/hw/core/empty_slot.c b/hw/misc/empty_slot.c similarity index 98% rename from hw/core/empty_slot.c rename to hw/misc/empty_slot.c index c694532046..0adf7a26dc 100644 --- a/hw/core/empty_slot.c +++ b/hw/misc/empty_slot.c @@ -13,7 +13,7 @@ #include "hw/hw.h" #include "hw/sysbus.h" #include "qemu/module.h" -#include "hw/empty_slot.h" +#include "hw/misc/empty_slot.h" =20 //#define DEBUG_EMPTY_SLOT =20 diff --git a/hw/sparc/sun4m.c b/hw/sparc/sun4m.c index 7e4f61fc3e..cc85598d5b 100644 --- a/hw/sparc/sun4m.c +++ b/hw/sparc/sun4m.c @@ -41,7 +41,7 @@ #include "hw/nvram/chrp_nvram.h" #include "hw/nvram/fw_cfg.h" #include "hw/char/escc.h" -#include "hw/empty_slot.h" +#include "hw/misc/empty_slot.h" #include "hw/loader.h" #include "elf.h" #include "trace.h" diff --git a/hw/core/Makefile.objs b/hw/core/Makefile.objs index a799c83815..5122a28a3b 100644 --- a/hw/core/Makefile.objs +++ b/hw/core/Makefile.objs @@ -8,7 +8,6 @@ common-obj-y +=3D irq.o common-obj-y +=3D hotplug.o common-obj-$(CONFIG_SOFTMMU) +=3D nmi.o =20 -common-obj-$(CONFIG_EMPTY_SLOT) +=3D empty_slot.o common-obj-$(CONFIG_XILINX_AXI) +=3D stream.o common-obj-$(CONFIG_PTIMER) +=3D ptimer.o common-obj-$(CONFIG_SOFTMMU) +=3D sysbus.o diff --git a/hw/misc/Makefile.objs b/hw/misc/Makefile.objs index 77b9df9796..8ed900f9f5 100644 --- a/hw/misc/Makefile.objs +++ b/hw/misc/Makefile.objs @@ -10,6 +10,7 @@ common-obj-$(CONFIG_EDU) +=3D edu.o common-obj-$(CONFIG_PCA9552) +=3D pca9552.o =20 common-obj-y +=3D unimp.o +common-obj-$(CONFIG_EMPTY_SLOT) +=3D empty_slot.o common-obj-$(CONFIG_FW_CFG_DMA) +=3D vmcoreinfo.o =20 # ARM devices --=20 2.19.1 From nobody Wed May 15 04:32:12 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.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 (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1561414307; cv=none; d=zoho.com; s=zohoarc; b=XkiWVJKQZbH23ou4YbJ2XGEk9TRJcxil221t8wAnftxLsnyz3JbRB8uU1dAVut+iTm1KQmOsRQioX7s+J2Gnd5aotUzhkux+ZKknt8iXLNQmt9GadHxZfzDG0566I5b0AzVTZnajedoiAasBaDZ9JRjpN7OF0sulG4bJF4oztKI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1561414307; 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:ARC-Authentication-Results; bh=aBqxrS2+6+Ym/rs4g7maJmz+R7nY9F00WICb45xxr6c=; b=b9u0wgWQuwbgV2K0j1L39RlOJD+s7lanmK5Djee2kLefkG38TnHdq8Tiy6gFKUyG+Hz55UJPPD7LfnrqzjykXUSuIeX/KX1p8ihPBtjikswB6yLERFE4zBhKT0p2kO6xYfXzQxnHq2Gxmh2hGWC7L/Wy5ZVms2C0jL1me/fnuGA= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (209.51.188.17 [209.51.188.17]) by mx.zohomail.com with SMTPS id 1561414307229557.7462321976361; Mon, 24 Jun 2019 15:11:47 -0700 (PDT) Received: from localhost ([::1]:54928 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hfXBZ-0007kc-Po for importer@patchew.org; Mon, 24 Jun 2019 18:11:37 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54693) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hfX1R-0007jP-DE for qemu-devel@nongnu.org; Mon, 24 Jun 2019 18:01:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hfX1L-000340-MZ for qemu-devel@nongnu.org; Mon, 24 Jun 2019 18:01:04 -0400 Received: from mail-wm1-x342.google.com ([2a00:1450:4864:20::342]:33235) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hfX1K-00031R-LU for qemu-devel@nongnu.org; Mon, 24 Jun 2019 18:01:03 -0400 Received: by mail-wm1-x342.google.com with SMTP id h19so890721wme.0 for ; Mon, 24 Jun 2019 15:01:02 -0700 (PDT) Received: from x1.local (183.red-88-21-202.staticip.rima-tde.net. [88.21.202.183]) by smtp.gmail.com with ESMTPSA id z126sm1118612wmb.32.2019.06.24.15.01.00 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Mon, 24 Jun 2019 15:01:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=aBqxrS2+6+Ym/rs4g7maJmz+R7nY9F00WICb45xxr6c=; b=gZdgE9M+DoSv6ZkiBFY/h2BQqJjX3O6wwj/K/4+PD1YgV9fQg0TPtIBHyy9vOES5d5 MIA7noZWBfnLZsLoiLRIiF8JvBcIh5pw6AOjrhPyFZT6heUUl39W1+BZoeqjRYBYYZ6m bwCG6c0YDDK4U0Ne5dbt3FL6UCN0xok1PbsKl1Bx7Lh/GeutAmNUVNSE0HWoolWEOUtQ S9Swpxdn1YsCc5SnvMAP1nlzKf0S9BswMtaT3dq7fear/AGiU3yQL+MDqlpxZbqDGT3H JopRQuhIJXVBXN9kCXbdOtV9CSzZW/Ue2nzcjUVUmW+I1FEL/0bBvM3obq2r84DoEshp SPTQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=aBqxrS2+6+Ym/rs4g7maJmz+R7nY9F00WICb45xxr6c=; b=iA2ozcSBzSJDrsgsUotDla7PrP/fUDgJwK5579D8gPv6jqDxgIMGw8XIGOLqxHfKpR r5xHv5n5LuAuWUl11PdNiTn3jGjsW2zY0VULV82dLOt9kBl5MGWHp83pTmKFk82deuIo xOkLcgJ2bgArYsR8cVuIfbMakRVDQQa8FIMtHefoP62gSGC7UoVSBxrwEY0dKP95h3eL g6q6spwIe4v6FY/3hFnc6IYbUjVh2Cdg2VF1DLqf8VWLi92D5m5yfSqu6xFtrVkM6jpl bc6XHECaJJrCLDZ5OaSvTC+f3S0jJXBGivxXDTrqftDnOHT5bSHjry0sCT5CWvtrQcs0 kDIA== X-Gm-Message-State: APjAAAV8/wBXFrLQ+3CkbbvYyD1In0RlM7OAqPZFFdrHh6WqY3nMhmjk heScJbDYtKlz1PcqCfBBHX5cq4Lg X-Google-Smtp-Source: APXvYqyDwTsmwnY1ELVjqSytaPdzaZ7RQCFi0jiFSwQJ18TbakYtNig3lT8TwW852wUqj0t0YiXQwA== X-Received: by 2002:a1c:5f56:: with SMTP id t83mr16233899wmb.37.1561413661353; Mon, 24 Jun 2019 15:01:01 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Date: Tue, 25 Jun 2019 00:00:49 +0200 Message-Id: <20190624220056.25861-3-f4bug@amsat.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190624220056.25861-1-f4bug@amsat.org> References: <20190624220056.25861-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::342 Subject: [Qemu-devel] [RFC PATCH 2/9] MAINTAINERS: Add the 'empty_slot' device with the 'unimp' one 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 , Aleksandar Rikalo , Mark Cave-Ayland , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Aurelien Jarno , Aleksandar Markovic , Artyom Tarasenko Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) The EmptySlot and UnimplementedDevice are very similar, the only difference is how they log guest accesses. Maintain them altogether. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Artyom Tarasenko --- Peter, are you OK with that? Do you prefer 2 distinct sections? MAINTAINERS | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/MAINTAINERS b/MAINTAINERS index cad58b9487..abef4a1cfc 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -1643,11 +1643,13 @@ F: docs/specs/vmgenid.txt F: tests/vmgenid-test.c F: stubs/vmgenid.c =20 -Unimplemented device +Unimplemented device, empty slot device M: Peter Maydell R: Philippe Mathieu-Daud=C3=A9 S: Maintained +F: include/hw/misc/empty_slot.h F: include/hw/misc/unimp.h +F: hw/misc/empty_slot.c F: hw/misc/unimp.c =20 Standard VGA --=20 2.19.1 From nobody Wed May 15 04:32:12 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.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 (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1561413972; cv=none; d=zoho.com; s=zohoarc; b=IoDj3TZO9jglX2FriD9mh0q0hLAfzjTWgzoL6rSb9ZD1DnDU1e2Gsa8kR+L2x0z8riRn0DJA91DQT57ZfsCsibOvJgV+CzuZaBWMCdNKea/lUTztEEupyEFGp5b0EBw6EpWr7iZvC5x/UraKI990ySUV9ASjM/P+NTyeD4adFjY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1561413972; 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:ARC-Authentication-Results; bh=7EKnYYpyGahwvPODw7K+rdbzpGs5lyX2fVIZtlw39Ss=; b=UUipE9kCnTDwgXl8KxVVu5Gar7kN0FmEAZOtDWj387/W+BWevT8JCIV3pennE592cM++A+jrkAYRAvBgAAop2UXnpiTO5sQwgHwAFclRAtfZ8I5WdSit692pvJqhYfQB2LBGneifwytsZa4hQEb8GijO0X5ywygeePiIz47wxJw= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1561413972935168.33137390504794; Mon, 24 Jun 2019 15:06:12 -0700 (PDT) Received: from localhost ([::1]:54884 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hfX6G-0001VJ-NJ for importer@patchew.org; Mon, 24 Jun 2019 18:06:08 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54786) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hfX22-0007ou-4u for qemu-devel@nongnu.org; Mon, 24 Jun 2019 18:01:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hfX1w-0003oR-5x for qemu-devel@nongnu.org; Mon, 24 Jun 2019 18:01:43 -0400 Received: from mail-wm1-x341.google.com ([2a00:1450:4864:20::341]:40499) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hfX1s-00033n-HY for qemu-devel@nongnu.org; Mon, 24 Jun 2019 18:01:38 -0400 Received: by mail-wm1-x341.google.com with SMTP id v19so807816wmj.5 for ; Mon, 24 Jun 2019 15:01:03 -0700 (PDT) Received: from x1.local (183.red-88-21-202.staticip.rima-tde.net. [88.21.202.183]) by smtp.gmail.com with ESMTPSA id z126sm1118612wmb.32.2019.06.24.15.01.01 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Mon, 24 Jun 2019 15:01:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=7EKnYYpyGahwvPODw7K+rdbzpGs5lyX2fVIZtlw39Ss=; b=HUPbJUzp6naDPiSwVSrTpjQtDbZCEXj2cgITN39xZ8EunxLI0qageWQUHIebM+4l1Y XaOKHqKO9gZcC50S1jR4EllADgWgNG+gmt7UdqB1hXTuWGk4KFRWteSfZ5cc0yyytfx9 wpKDO5EbqfSRnGRkNEKDNJ+W3pNruML4Jqjnn2qWr9FVDDzUVuANltydxhGa4kszP8oj g9RxQhq0+dcd18cLZFq6FnIymn2DyhCY2pi+s99WYSJyvJPa8/TOiJ+XYCSDtgy+huqt gCg9jNtsXWo19qgzz/jFYYVpMQ1OPbW25J9X2AnUWiI0blFsdB8ySiXBFJJn2h2w/rxX 8sJA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=7EKnYYpyGahwvPODw7K+rdbzpGs5lyX2fVIZtlw39Ss=; b=LgefAkbF/3tqmyK+TfL7XKlwCM0o/rtvlcfSF3QDqAJBjHJdShLg0+nYG93Tce6gL+ 1tUGMWkVf10V0hsOEZE8/NJwHu7MwvmH9gaYGrG+5/BJULybUPHBhxZn7uB3EVjblsfO ima7HltFQbKYrusMSkZYftfP3YGApWSDA3NAGxlKVGLWD+Brml0G3FNsrQnRozQFR0J0 /NCOrQtQ90kommaAPdXU2ZNekR6yx8NACLXj8o3P8dRFDLY47DIWvh3XuEMTw2C5krVe s7fqQ4mdDF5zlAD4E/eMzkY9y6gl6e4RXe7GgOVgLRLMhRBk1hV8krXgoB+vL2F0qtvt TRXw== X-Gm-Message-State: APjAAAUHZoKgk4iZ8PRs8xqKVJplSp0rfcjYfZDlXDfqdgoG5maUiJvi Q6zyU3yvtqHrdsDjn5ztvS/R8kSV X-Google-Smtp-Source: APXvYqzrYVm6NXE2JYf5KrL9FmnssWwgsfD+6CgcTrDGvAYAxebTOIwGU2m1zN1CD0F1GQCmJf4b3w== X-Received: by 2002:a1c:be0a:: with SMTP id o10mr17176260wmf.91.1561413662818; Mon, 24 Jun 2019 15:01:02 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Date: Tue, 25 Jun 2019 00:00:50 +0200 Message-Id: <20190624220056.25861-4-f4bug@amsat.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190624220056.25861-1-f4bug@amsat.org> References: <20190624220056.25861-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::341 Subject: [Qemu-devel] [PATCH 3/9] hw/misc/empty_slot: Allow overide by device with higher priority 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 , Aleksandar Rikalo , Mark Cave-Ayland , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Aurelien Jarno , Aleksandar Markovic , Artyom Tarasenko Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) The 'empty_slot' models a ChipEnable (or ChipSelect) MMIO device pluggable on a bus. The bus allow such slots to be not connected ('empty), thus no bus errors are generated when this range is accessed. The device is mapped at priority -10000 to allow other devices to be mapped on top of it. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Artyom Tarasenko --- hw/misc/empty_slot.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/hw/misc/empty_slot.c b/hw/misc/empty_slot.c index 0adf7a26dc..53299cdbd1 100644 --- a/hw/misc/empty_slot.c +++ b/hw/misc/empty_slot.c @@ -68,7 +68,11 @@ void empty_slot_init(hwaddr addr, uint64_t slot_size) =20 qdev_init_nofail(dev); =20 - sysbus_mmio_map(s, 0, addr); + /* + * We use a priority lower than the default UNIMPLEMENTED_DEVICE + * to be able to plug a UnimplementedDevice on an EmptySlot. + */ + sysbus_mmio_map_overlap(s, 0, addr, -10000); } } =20 --=20 2.19.1 From nobody Wed May 15 04:32:12 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.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 (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1561413979; cv=none; d=zoho.com; s=zohoarc; b=ECwatTkBtIai6b21m30rUx4A3y5VujV8EXXBMZ7q77bAImnqzgi1XOVwtSJ39h/bKZDoo5qWBMeatn+40OMmlDKVeXMXJrBkbA6Rjkl+/9EeFwBJTLyCipXsB5dl+2o7HL352xo16f2JFo16cm6rWeKRaZ5KfIhS+Gb3COJhkMs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1561413979; 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:ARC-Authentication-Results; bh=KG1ocHR9CwXIKkrRGNYi2cBkFImhdlC2FkdsDqiv+kk=; b=ebkziYA3DpPrZf33ig2LVNG9Znefze+a6EEPeinDnCEdkRj4fJw33fciXVEcBrbNb3gwtyxSa5EhWjYqQE2uRVh3Br3MvUmaimTgaiPSglW2jUWrGSaoFYpMaaFdaEUTRYdTKmOhhS6LdO1hTNMVof/N42mIQa3Wk9x6uV4v5sY= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1561413979426729.2218140641414; Mon, 24 Jun 2019 15:06:19 -0700 (PDT) Received: from localhost ([::1]:54888 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hfX6O-0001oZ-D0 for importer@patchew.org; Mon, 24 Jun 2019 18:06:16 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54962) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hfX2C-0007yC-Em for qemu-devel@nongnu.org; Mon, 24 Jun 2019 18:01:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hfX2A-000498-Ba for qemu-devel@nongnu.org; Mon, 24 Jun 2019 18:01:56 -0400 Received: from mail-wr1-x441.google.com ([2a00:1450:4864:20::441]:36630) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hfX2A-00035Z-42 for qemu-devel@nongnu.org; Mon, 24 Jun 2019 18:01:54 -0400 Received: by mail-wr1-x441.google.com with SMTP id n4so14307239wrs.3 for ; Mon, 24 Jun 2019 15:01:05 -0700 (PDT) Received: from x1.local (183.red-88-21-202.staticip.rima-tde.net. [88.21.202.183]) by smtp.gmail.com with ESMTPSA id z126sm1118612wmb.32.2019.06.24.15.01.02 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Mon, 24 Jun 2019 15:01:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=KG1ocHR9CwXIKkrRGNYi2cBkFImhdlC2FkdsDqiv+kk=; b=AZDSUj0SfoAGxyrrVuFgGs14Hcf9GfGSo/aOcr+AR63a9VGW58off0Tkwf/5nxL9KW jc0xpZ0e8m0+X3Qa6cqB51BDNVtSSYrGB9M9IEzWUc3eII3ZkE3D9gCc5VFH7SGz3n6E qW1ApwnT2x8LbT1Yd7MvR7IELDKjMknw9IYAev2+c5ZOJMQR4cdXQz41O0gpVuPWi6F8 /Ov5K/gObGVbKjLIBY2DkP6Re4T4exKyzj0B8VEl6IW91ZzdEiAh/NttXFZFTs9P9Xc1 6VmlsQiSyo1A5OsuAfWaZ4E1oLFYBX5eBG/ni5VJ7xAe2UJ6jna1y0A3F6VyVLmNq7Pv 0vJQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=KG1ocHR9CwXIKkrRGNYi2cBkFImhdlC2FkdsDqiv+kk=; b=mU3C3Lj6QOny67/7Bge33j6RGojhLwQwxDih45MbEsk43RlD8aN4T+MvGeI3wzUJ/c Wtueqee1s3whQm7jx0ANXnK95Ksu3X7iVnt6TFAxaJaSYinAEzZbxO70gxVNeGp2d97s bKTx9xaTZHnHlveMvc88W9G9CouzUXGgEwy/hTViL9StU9TPTjZzSdIqix0kgQM7RwDj DyLrM+YzYFdGEGEFNnEqOhVelqczaUGo4pDEX2ns8VSIEpmxBmnsDyUTUzs1Mota7q8Y zQe3T5AcDwfVPlByCBcAr6GFf0mmusQLs5YQGvT8TgYmudb1VQOtl2CuLOCauG/a2hIO 6vkQ== X-Gm-Message-State: APjAAAUR/nfn/oLTICcOaONVOslCDd/SfsUEu4OfRROIYFrR+mGOUFX2 jYRHlxEDp8aX2EddCQItEb73ncx+ X-Google-Smtp-Source: APXvYqzlFENU9TL7FeDoaTbmH6CR0WZ4w3bOLyTaW7fjWOPvi2TsFCQFW+LOOvrnIKgWA7ujeaDqrQ== X-Received: by 2002:adf:e442:: with SMTP id t2mr37800775wrm.286.1561413664324; Mon, 24 Jun 2019 15:01:04 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Date: Tue, 25 Jun 2019 00:00:51 +0200 Message-Id: <20190624220056.25861-5-f4bug@amsat.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190624220056.25861-1-f4bug@amsat.org> References: <20190624220056.25861-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::441 Subject: [Qemu-devel] [PATCH 4/9] hw/misc/empty_slot: Add a qdev property 'size' 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 , Aleksandar Rikalo , Mark Cave-Ayland , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Aurelien Jarno , Aleksandar Markovic , Artyom Tarasenko Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Add a qdev 'size' property, check the size is not zero in the realize() function, simplify the empty_slot_init() logic. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Artyom Tarasenko --- hw/misc/empty_slot.c | 43 ++++++++++++++++++++++++------------------- 1 file changed, 24 insertions(+), 19 deletions(-) diff --git a/hw/misc/empty_slot.c b/hw/misc/empty_slot.c index 53299cdbd1..ef0a7b99ba 100644 --- a/hw/misc/empty_slot.c +++ b/hw/misc/empty_slot.c @@ -10,6 +10,7 @@ */ =20 #include "qemu/osdep.h" +#include "qapi/error.h" #include "hw/hw.h" #include "hw/sysbus.h" #include "qemu/module.h" @@ -55,41 +56,45 @@ static const MemoryRegionOps empty_slot_ops =3D { =20 void empty_slot_init(hwaddr addr, uint64_t slot_size) { - if (slot_size > 0) { - /* Only empty slots larger than 0 byte need handling. */ - DeviceState *dev; - SysBusDevice *s; - EmptySlot *e; - - dev =3D qdev_create(NULL, TYPE_EMPTY_SLOT); - s =3D SYS_BUS_DEVICE(dev); - e =3D EMPTY_SLOT(dev); - e->size =3D slot_size; - - qdev_init_nofail(dev); - - /* - * We use a priority lower than the default UNIMPLEMENTED_DEVICE - * to be able to plug a UnimplementedDevice on an EmptySlot. - */ - sysbus_mmio_map_overlap(s, 0, addr, -10000); - } + DeviceState *dev; + + dev =3D qdev_create(NULL, TYPE_EMPTY_SLOT); + + qdev_prop_set_uint64(dev, "size", slot_size); + qdev_init_nofail(dev); + + /* + * We use a priority lower than the default UNIMPLEMENTED_DEVICE + * to be able to plug a UnimplementedDevice on an EmptySlot. + */ + sysbus_mmio_map_overlap(SYS_BUS_DEVICE(dev), 0, addr, -10000); } =20 static void empty_slot_realize(DeviceState *dev, Error **errp) { EmptySlot *s =3D EMPTY_SLOT(dev); =20 + if (s->size =3D=3D 0) { + error_setg(errp, "property 'size' not specified or zero"); + return; + } + memory_region_init_io(&s->iomem, OBJECT(s), &empty_slot_ops, s, "empty-slot", s->size); sysbus_init_mmio(SYS_BUS_DEVICE(dev), &s->iomem); } =20 +static Property empty_slot_properties[] =3D { + DEFINE_PROP_UINT64("size", EmptySlot, size, 0), + DEFINE_PROP_END_OF_LIST(), +}; + static void empty_slot_class_init(ObjectClass *klass, void *data) { DeviceClass *dc =3D DEVICE_CLASS(klass); =20 dc->realize =3D empty_slot_realize; + dc->props =3D empty_slot_properties; } =20 static const TypeInfo empty_slot_info =3D { --=20 2.19.1 From nobody Wed May 15 04:32:12 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.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 (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1561414447; cv=none; d=zoho.com; s=zohoarc; b=cdxQfHpgwqMd+jJNitxVx5aYlbYiCVNBnTMgl5brmPAVar9pYxRsS0FgzfFVtutiKBecTkJhfHqUuWtDNuIRq0Y9SIutE4MgpWej+0Pwn2KyTo63BHWbTnVXgJ4eRUcIDgJAeMYxmHF6DHapBn6z1HUc56gwzprSs1quqasAeKQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1561414447; 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:ARC-Authentication-Results; bh=N2yUkYsSR8v9ROfwrGSPlP7dTQtRzCezFC3jdcl89BQ=; b=Dqu96iV6fyncClLtv7gXyUk48GBWBpz7BykGwlpH+QTRF8A+gCuiUz9Mqg6WjXbBoAnk5mz3rNZVAb5shGnKxp4EK4VH0qlsEowNZzoMbIcHEvhGcLM/Jok0uv6pk18aes62RZdcyNY23If/QGrUCwojYsFjeC7bC7cZuAnjRsg= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1561414447419625.2196708050521; Mon, 24 Jun 2019 15:14:07 -0700 (PDT) Received: from localhost ([::1]:54958 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hfXDy-0001iC-H9 for importer@patchew.org; Mon, 24 Jun 2019 18:14:06 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54801) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hfX23-0007q4-J5 for qemu-devel@nongnu.org; Mon, 24 Jun 2019 18:01:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hfX20-0003v2-Ta for qemu-devel@nongnu.org; Mon, 24 Jun 2019 18:01:46 -0400 Received: from mail-wr1-x443.google.com ([2a00:1450:4864:20::443]:45418) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hfX1w-00036b-4x for qemu-devel@nongnu.org; Mon, 24 Jun 2019 18:01:42 -0400 Received: by mail-wr1-x443.google.com with SMTP id f9so15473525wre.12 for ; Mon, 24 Jun 2019 15:01:06 -0700 (PDT) Received: from x1.local (183.red-88-21-202.staticip.rima-tde.net. [88.21.202.183]) by smtp.gmail.com with ESMTPSA id z126sm1118612wmb.32.2019.06.24.15.01.04 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Mon, 24 Jun 2019 15:01:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=N2yUkYsSR8v9ROfwrGSPlP7dTQtRzCezFC3jdcl89BQ=; b=LzqZ8ohJ4FjorLBmMCHMNPYFVgcXfUlIi7wmOkKcP5nRRhWZoBgfIkWpT+SWtjX18+ qhN4Q07RWHad1o9eyo5RH1d635AwL5DBWI8I5AmE+6CYAvglV1W1+hq94n24Rzw84A+M LApDZhOz56XhMqSOwBdKs9B6OJPGYSY/wz7+PvmkN4J0G9TMP7rEk6/YIyhMxF+Cs/jn bSf9RC+xiWvJ5sgKlG2ZXWLVa6CiCZ7B9f+dXN8ofl+dZjcElw+vS8DlDKFd22pNOUAV iF5QIZ1rOPvJ90BTLksJChc8ejg3dnjWws8vwiopTksJGjjA1o93wLS48xja/fzleJxo 5YJA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=N2yUkYsSR8v9ROfwrGSPlP7dTQtRzCezFC3jdcl89BQ=; b=J45iGsdxse4gb5anPaMeeu8JRu3DkDfgKJ62pODosesR8MV6wHBec9hsMNkjRYI05z waB4OxyqmBa1DHmUlxqy5SxWO9/oXd+JBwlKN2lbTDDf1gtrBzZoNbCayLntMG6wZgg6 wPsN8/t312sUj0ZvqaV0AEvOR7RBQb58CL9CwK/iKPyb+8bvDzDMwlHTv1VVechQoiYU MCCc1013mQ9L82II4CAOX6TCb3x6OMHs5ujUelHbBRUGFhFjAwc2g2W7QVgp3W25ipdy voJ6gatbTcPT2sMFEOVZx6DXCZ+z0nP/jRlNfws4qN1fUT8um7FA14/FP48sUu6Qr7d1 HqMA== X-Gm-Message-State: APjAAAVV1eeK03qXB7S5+TZU/vgyyvVOQ/JbVYXMbqG3SLx9Zdl25iwV Iq1mcekBlDqUG7m1fzD5+ZQjgLx4 X-Google-Smtp-Source: APXvYqywH8/SFWYxb+o2WegSQa3p/IKLWnUCHoAMhCuofraffqRJq4ui95X2NVozpyt587tccqWNZA== X-Received: by 2002:adf:b605:: with SMTP id f5mr55222878wre.305.1561413665653; Mon, 24 Jun 2019 15:01:05 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Date: Tue, 25 Jun 2019 00:00:52 +0200 Message-Id: <20190624220056.25861-6-f4bug@amsat.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190624220056.25861-1-f4bug@amsat.org> References: <20190624220056.25861-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::443 Subject: [Qemu-devel] [PATCH 5/9] hw/misc/empty_slot: Add a qdev property 'name' 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 , Aleksandar Rikalo , Mark Cave-Ayland , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Aurelien Jarno , Aleksandar Markovic , Artyom Tarasenko Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) If few commits empty_slot_init() will take 'name' as argument. Meanwhile, initialize it as 'empty-slot'. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Artyom Tarasenko --- hw/misc/empty_slot.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/hw/misc/empty_slot.c b/hw/misc/empty_slot.c index ef0a7b99ba..c32241a9e5 100644 --- a/hw/misc/empty_slot.c +++ b/hw/misc/empty_slot.c @@ -32,6 +32,7 @@ typedef struct EmptySlot { SysBusDevice parent_obj; =20 MemoryRegion iomem; + char *name; uint64_t size; } EmptySlot; =20 @@ -78,14 +79,18 @@ static void empty_slot_realize(DeviceState *dev, Error = **errp) error_setg(errp, "property 'size' not specified or zero"); return; } + if (s->name =3D=3D NULL) { + s->name =3D g_strdup("empty-slot"); + } =20 memory_region_init_io(&s->iomem, OBJECT(s), &empty_slot_ops, s, - "empty-slot", s->size); + s->name, s->size); sysbus_init_mmio(SYS_BUS_DEVICE(dev), &s->iomem); } =20 static Property empty_slot_properties[] =3D { DEFINE_PROP_UINT64("size", EmptySlot, size, 0), + DEFINE_PROP_STRING("name", EmptySlot, name), DEFINE_PROP_END_OF_LIST(), }; =20 --=20 2.19.1 From nobody Wed May 15 04:32:12 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.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 (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1561413976; cv=none; d=zoho.com; s=zohoarc; b=oCz88jryjkbkp4C0utxLw4AkTGgx0xzg9T8Iwo5XK2llw3bCOKeMx6TrZ/4hJJpQt6K0Is5BMOEzEB22ycvuo88KDN2goavDtMj682e5MXGyb8oKC8ml7Kzjb8Ugm6LqCLlZQmpza7yi/vypXbd9rXWxzJD9aUJWU97qFwgfpEs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1561413976; 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:ARC-Authentication-Results; bh=GjTm6e+XgHIg/sbtKGfSEXk9pQub5okzFZZW+hOKTwI=; b=ceebDasUrFex7CVUtxmEGT5vw7KwZvQCWEmNntdS3SrytupjiMPFZtjyGxyju4LXDGKN3mecPn/fhapXVM1rIOx3BzDaECQBK++yR7MTb+VxZQOs+KvnOWHd1g3gGFRmFaZWj++xBkjfpI8nRlODaNVDQgYdJtt11ZkdwwgA7as= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1561413976596915.1266931625612; Mon, 24 Jun 2019 15:06:16 -0700 (PDT) Received: from localhost ([::1]:54886 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hfX6K-0001eg-JG for importer@patchew.org; Mon, 24 Jun 2019 18:06:12 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54832) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hfX27-0007s3-GI for qemu-devel@nongnu.org; Mon, 24 Jun 2019 18:01:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hfX25-00041w-IL for qemu-devel@nongnu.org; Mon, 24 Jun 2019 18:01:51 -0400 Received: from mail-wr1-x441.google.com ([2a00:1450:4864:20::441]:42715) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hfX23-000399-Nq for qemu-devel@nongnu.org; Mon, 24 Jun 2019 18:01:48 -0400 Received: by mail-wr1-x441.google.com with SMTP id x17so15484413wrl.9 for ; Mon, 24 Jun 2019 15:01:07 -0700 (PDT) Received: from x1.local (183.red-88-21-202.staticip.rima-tde.net. [88.21.202.183]) by smtp.gmail.com with ESMTPSA id z126sm1118612wmb.32.2019.06.24.15.01.05 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Mon, 24 Jun 2019 15:01:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=GjTm6e+XgHIg/sbtKGfSEXk9pQub5okzFZZW+hOKTwI=; b=fogSvtHxzfn8cn6+I4eMwl1xIHtPxipedeqjcceUIE3ToDjF3aU9kltzQYGe4cbLI2 oRmAbUMZHsPUl07jyrHLdiU6l//pAwbGesCc2EWQfqPCf6Os4RRlVSK7cDthLsIgp0Yn HEhG/dmD7GsIUjRxaSI2o0rVvHPZN+2K7wEvziunEaSkzKpry5Z4LloMVIK86kqvTbtL UV5/jIR243pNDzy0oZ64uqTsZJzUyNiKW39RZRi1Sd2+h8a5J0mkbBU9PkWM/py7L+dy ycfgWfHXfOYII2nMlNt4dWwYzfMPTgW7Ti2aDkZsJhMW3r/yRpNQDS1FXoVZbpIhq8/5 +HTg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=GjTm6e+XgHIg/sbtKGfSEXk9pQub5okzFZZW+hOKTwI=; b=ZCOoWR92gagfewmAmG+lZjFRwN430MTCq/Ly+dK6BgbQe1bPEGy7uSVwmTQfef3Fgt invcdjIRrtWTsf4fVhsMx/P0XJv55DP813Sv+fUt1Xwz2cEbL+Jj5jaQT6Xc/bwoW20M JrZPJKEoZ/7J+vDnBusgrp4U5VmTyND8rqSyx+sa3Myx+rq3L9ykw5BsB5tDoMACHS00 IKVzdAGYtIRxFG3VyJO1jNqYvW0fWcz2jCKR14FLr7lGDnaDxJUtmTiHaXlkpYdqnHz2 EWH5WGd4gTIqS9t6JGh4CSGayBbJV8aW++k0Ur02XLsgIXxFTV0Yus9egz92YUfQk6D7 rKhQ== X-Gm-Message-State: APjAAAUXimR8oDox6vf9c+eFdrxeWNa/oYkbo+l0XAG8bGy56lLLlwy0 GAR/VBOIo4NYBFlXY/QIunaCxr4x X-Google-Smtp-Source: APXvYqxkPE+K3nx4phbcqLSyRSw2KjLsG/GoBAhbKAiXpqG2XOYHiyXe6AJYYRxAL/vSruVqwCsuIA== X-Received: by 2002:adf:e2c7:: with SMTP id d7mr55049953wrj.272.1561413666933; Mon, 24 Jun 2019 15:01:06 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Date: Tue, 25 Jun 2019 00:00:53 +0200 Message-Id: <20190624220056.25861-7-f4bug@amsat.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190624220056.25861-1-f4bug@amsat.org> References: <20190624220056.25861-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::441 Subject: [Qemu-devel] [PATCH 6/9] hw/misc/empty_slot: Convert debug printf()s to trace events 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 , Aleksandar Rikalo , Mark Cave-Ayland , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Aurelien Jarno , Aleksandar Markovic , Artyom Tarasenko Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Artyom Tarasenko --- hw/misc/empty_slot.c | 19 ++++++++----------- hw/misc/trace-events | 4 ++++ 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/hw/misc/empty_slot.c b/hw/misc/empty_slot.c index c32241a9e5..b810655554 100644 --- a/hw/misc/empty_slot.c +++ b/hw/misc/empty_slot.c @@ -15,15 +15,7 @@ #include "hw/sysbus.h" #include "qemu/module.h" #include "hw/misc/empty_slot.h" - -//#define DEBUG_EMPTY_SLOT - -#ifdef DEBUG_EMPTY_SLOT -#define DPRINTF(fmt, ...) \ - do { printf("empty_slot: " fmt , ## __VA_ARGS__); } while (0) -#else -#define DPRINTF(fmt, ...) do {} while (0) -#endif +#include "trace.h" =20 #define TYPE_EMPTY_SLOT "empty_slot" #define EMPTY_SLOT(obj) OBJECT_CHECK(EmptySlot, (obj), TYPE_EMPTY_SLOT) @@ -39,14 +31,19 @@ typedef struct EmptySlot { static uint64_t empty_slot_read(void *opaque, hwaddr addr, unsigned size) { - DPRINTF("read from " TARGET_FMT_plx "\n", addr); + EmptySlot *s =3D EMPTY_SLOT(opaque); + + trace_empty_slot_write(addr, size << 1, 0, size, s->name); + return 0; } =20 static void empty_slot_write(void *opaque, hwaddr addr, uint64_t val, unsigned size) { - DPRINTF("write 0x%x to " TARGET_FMT_plx "\n", (unsigned)val, addr); + EmptySlot *s =3D EMPTY_SLOT(opaque); + + trace_empty_slot_write(addr, size << 1, val, size, s->name); } =20 static const MemoryRegionOps empty_slot_ops =3D { diff --git a/hw/misc/trace-events b/hw/misc/trace-events index 47e1bccf71..b81135ab1e 100644 --- a/hw/misc/trace-events +++ b/hw/misc/trace-events @@ -1,5 +1,9 @@ # See docs/devel/tracing.txt for syntax documentation. =20 +# empty_slot.c +empty_slot_read(uint64_t addr, unsigned width, uint64_t value, unsigned si= ze, const char *name) "rd addr:0x%04"PRIx64" data:0x%0*"PRIx64" size %u [%s= ]" +empty_slot_write(uint64_t addr, unsigned width, uint64_t value, unsigned s= ize, const char *name) "wr addr:0x%04"PRIx64" data:0x%0*"PRIx64" size %u [%= s]" + # eccmemctl.c ecc_mem_writel_mer(uint32_t val) "Write memory enable 0x%08x" ecc_mem_writel_mdr(uint32_t val) "Write memory delay 0x%08x" --=20 2.19.1 From nobody Wed May 15 04:32:12 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.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 (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1561414388; cv=none; d=zoho.com; s=zohoarc; b=VxMy+1mLIx0v74kh9gc/WooguDOjvBpesEqCGgWypnGDg6Aj/0CYJNwkOzid1hhjc+wuKxfSmc55e1XJD9ysTjMUjwvEgB2YtKexKzUU1hn+Y+jJMsRYAo2+DhZbJGqjK6lPidsN4VVSd5BhSpo0o39VS5MfrQ/dAloxjYV/vWI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1561414388; 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:ARC-Authentication-Results; bh=HOm2CbtgSjlbFOA7w5702X1sF3QJOmfprmZwNYY5LhY=; b=KYz2bVjdS+AfXQ6CVfcW/6fkeKDOeUHsEhiLGOo51qo1G3ZMzHjisVzuiTiCXxvHPo1NgC1lRuiVvV8mLiDLfmRdAb8u2GAtnIuw4tF89a+0Y//hkYQTqQHvQi67x7goKLDZGd0224+ov8IZk8kR7o6GcajIPd6hdO6w03zz1fA= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1561414388872438.2944558165709; Mon, 24 Jun 2019 15:13:08 -0700 (PDT) Received: from localhost ([::1]:54948 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hfXCy-0000p7-HO for importer@patchew.org; Mon, 24 Jun 2019 18:13:04 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54765) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hfX1y-0007oN-5o for qemu-devel@nongnu.org; Mon, 24 Jun 2019 18:01:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hfX1u-0003kd-8M for qemu-devel@nongnu.org; Mon, 24 Jun 2019 18:01:40 -0400 Received: from mail-wr1-x444.google.com ([2a00:1450:4864:20::444]:35454) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hfX1q-0003AO-Hm for qemu-devel@nongnu.org; Mon, 24 Jun 2019 18:01:36 -0400 Received: by mail-wr1-x444.google.com with SMTP id f15so5621190wrp.2 for ; Mon, 24 Jun 2019 15:01:09 -0700 (PDT) Received: from x1.local (183.red-88-21-202.staticip.rima-tde.net. [88.21.202.183]) by smtp.gmail.com with ESMTPSA id z126sm1118612wmb.32.2019.06.24.15.01.07 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Mon, 24 Jun 2019 15:01:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=HOm2CbtgSjlbFOA7w5702X1sF3QJOmfprmZwNYY5LhY=; b=Z5wxTZCK1uB1wFDuzBbKJsKri+5wjc6KJiCn3FzzIbOeyB3mj8gmd+dhQ8HSfcJW8D U3IlISELC0eX9Z/eq2VyXn3bE0bpoY7Cm9L7JLlSCJgwYX0A7oAxIZ9XGCShopGf9/pg UBPFGF95yJo6XonMkc83lDMjWCE2Dg3Bw0tmIyzyKNIBHwUUgg0BKB+RU3d0s0XreWHD WQil2znc1wpFp4/94euzQY3GCRShOzav1jdYz+949Xdlx8r/wJEcz+zSYgoQqUKX8hlr 3Jdao4Fx5kt/8tYyeBA244niOSN5OBinABuxKzmAXRxuRMIEf9gpFKY74NHfzicyfaPh ffAA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=HOm2CbtgSjlbFOA7w5702X1sF3QJOmfprmZwNYY5LhY=; b=SOw+1c4eDV4MSDMr/hJz3tGeHTVrzDnAsZhncwEAqtqapAVD2BOHC+nxM4f+ZCPHt0 jBEuGeZEZkXEM7VDVVMERHji+twxvCil6768ywbAZTP4sqy4M/G2VCCWzJFEn65ztJyD Arp2NXLVWFJr9c4YuKE4LT/3XDcGeJOMHsKqsYZl+sv6dyieACyCbrxpjktaCMJX9f9/ motaX1gpdPzoSut9qQS6Lyv4AJAE4vvqsNCzK8p6kY+MYn3BilELGHXKedbrhrNqsCbd 3Co9YRuzNDL8Q5Mb4A2b9G6DmCIoiSJiY2VOec6iZf6Dt3QjvtNkkw1zigxtN7nArpte I2PQ== X-Gm-Message-State: APjAAAURbFudR8dvYkPdLaIF4mth7wwNvCWd9vfIF97l7HKHsSWCEwZf PoZsafN08P2XPCABcArgO1qatk6v X-Google-Smtp-Source: APXvYqx+QmtgCy4HL7VJWm1FgASUGcFH/SufN8h6XUcXs5oh0dwXuoXXhrAVGv6IDdUMUd/+0DBgEw== X-Received: by 2002:a5d:5542:: with SMTP id g2mr35317620wrw.232.1561413668126; Mon, 24 Jun 2019 15:01:08 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Date: Tue, 25 Jun 2019 00:00:54 +0200 Message-Id: <20190624220056.25861-8-f4bug@amsat.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190624220056.25861-1-f4bug@amsat.org> References: <20190624220056.25861-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::444 Subject: [Qemu-devel] [PATCH 7/9] hw/sparc/sun4m: Mark some devices as 'unimplemented' 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 , Aleksandar Rikalo , Mark Cave-Ayland , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Aurelien Jarno , Aleksandar Markovic , Artyom Tarasenko Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) These devices are not slots on a bus, but real devices that we do not implement. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Artyom Tarasenko --- hw/sparc/sun4m.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/hw/sparc/sun4m.c b/hw/sparc/sun4m.c index cc85598d5b..0df5a8edfc 100644 --- a/hw/sparc/sun4m.c +++ b/hw/sparc/sun4m.c @@ -42,6 +42,7 @@ #include "hw/nvram/fw_cfg.h" #include "hw/char/escc.h" #include "hw/misc/empty_slot.h" +#include "hw/misc/unimp.h" #include "hw/loader.h" #include "elf.h" #include "trace.h" @@ -970,7 +971,7 @@ static void sun4m_hw_init(const struct sun4m_hwdef *hwd= ef, } =20 if (hwdef->sx_base) { - empty_slot_init(hwdef->sx_base, 0x2000); + create_unimplemented_device("sx", hwdef->sx_base, 0x2000); } =20 nvram =3D m48t59_init(slavio_irq[0], hwdef->nvram_base, 0, 0x2000, 196= 8, 8); @@ -1033,14 +1034,16 @@ static void sun4m_hw_init(const struct sun4m_hwdef = *hwdef, if (hwdef->dbri_base) { /* ISDN chip with attached CS4215 audio codec */ /* prom space */ - empty_slot_init(hwdef->dbri_base+0x1000, 0x30); + create_unimplemented_device("SUNW,DBRI.prom", + hwdef->dbri_base + 0x1000, 0x30); /* reg space */ - empty_slot_init(hwdef->dbri_base+0x10000, 0x100); + create_unimplemented_device("SUNW,DBRI", + hwdef->dbri_base + 0x10000, 0x100); } =20 if (hwdef->bpp_base) { /* parallel port */ - empty_slot_init(hwdef->bpp_base, 0x20); + create_unimplemented_device("parallel", hwdef->bpp_base, 0x20); } =20 initrd_size =3D 0; --=20 2.19.1 From nobody Wed May 15 04:32:12 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.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 (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1561414159; cv=none; d=zoho.com; s=zohoarc; b=YqVBUeyNFRDFIaFypNNOLxeE6hVedlE9h1u1QF44h/8S2RWrnutimFlQEDP00AWS04QeJygowDLabcSb4i8D+6ZsE9PFLOjkE0bqYSexB5LduSRUonKpG3IvCWyco4G1BH3Q8oshBi3uUuFY3B1OBrMMR9P4L98c2QDUIaYCZog= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1561414159; 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:ARC-Authentication-Results; bh=NSm3cZqHH/H9Xl/1qUBzg4MSsd8N7p36v5WOTsFnvFI=; b=SBUh3KllUxDDBgw4rALZGX0CTzUQ2lnyMu/BkuaLNq+PL5hRTseOaRJ93UpurnWwO3Gj/vaMOyE6/fGTKM+/bRYvqllzm1gu5w3mM5SvhBe2dmw9/JyjX68LBW2xHxSj7Euv8sm8d+P42s1SALfOvnw6gcjnL1MI6DksMZQ8ST4= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1561414159741816.1023577823618; Mon, 24 Jun 2019 15:09:19 -0700 (PDT) Received: from localhost ([::1]:54912 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hfX9I-0005O5-Qx for importer@patchew.org; Mon, 24 Jun 2019 18:09:16 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54931) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hfX2B-0007xQ-T3 for qemu-devel@nongnu.org; Mon, 24 Jun 2019 18:01:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hfX29-00048T-SD for qemu-devel@nongnu.org; Mon, 24 Jun 2019 18:01:55 -0400 Received: from mail-wr1-x444.google.com ([2a00:1450:4864:20::444]:36634) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hfX29-0003Bk-K9 for qemu-devel@nongnu.org; Mon, 24 Jun 2019 18:01:53 -0400 Received: by mail-wr1-x444.google.com with SMTP id n4so14307432wrs.3 for ; Mon, 24 Jun 2019 15:01:10 -0700 (PDT) Received: from x1.local (183.red-88-21-202.staticip.rima-tde.net. [88.21.202.183]) by smtp.gmail.com with ESMTPSA id z126sm1118612wmb.32.2019.06.24.15.01.08 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Mon, 24 Jun 2019 15:01:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=NSm3cZqHH/H9Xl/1qUBzg4MSsd8N7p36v5WOTsFnvFI=; b=DpwGZqRWkKIh6RUDNi9bb/rODZnY1AeMANICf9+oudzvbUU2W7PqG9qy7rLIjGztXY ytk3eqrySw17H7OA6+467a5Ci2ymuCHMgFpavcp8WfGYDNWfNgHTxN10VMW6dP9A0413 g/WMqdXU0LmHvmM5+3I8vsko7XB428Vcnlviuo2mAMoNfb+NH22NlXXhbnS+eA0UQefz GEt/8zAZWoyV7W8jvh+g+BBAVWiTA9KWbcGxTuBX6FWghSTh15l1WF7+2Yiw3BR2Fyn0 ZuD81zIr0u3TqIpT7OwqMnALDv0ONdIqrvlTF11X0zcIpp6kura2DY8HuKFa+IHe9kPW ffzA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=NSm3cZqHH/H9Xl/1qUBzg4MSsd8N7p36v5WOTsFnvFI=; b=hb1W3GFhd3hFVNW7Gq1obR/lWJfjD0yJC4+SRkTPRfqqAuhw2mWHRqZCdFX7TOwwko f6v16VM6719FiJJUmtj6t4Tj1fSxiV9SSX0PHfwg4a8BBQqkJYa4XWuBbi/Nku4+6L89 zd1f103tBLAtWmvSFtlcuGUUIFaEkV7iSmSMIc8jjuyN86qqjKRQTeCLcvr6IY1N9UVd /FRSR2+8wxpnpMcQhhoIKra2y5KmWNX/N/cK1cOGecSbR4wih+DLNqcVMh6ci9twZDgv ruQKtw3dBaoBE9ewuY77Dw07O+CRcC22KoPHgbQe3Vj4APgUmntX7V+p9WfBa3wINiVp 8hrg== X-Gm-Message-State: APjAAAVxdiMVWXt+Xomua/T+cNskD5+whRv2hLEn9ws7eC2b/zArSpbN 1tss+iV06U5sBuTTJOZlBuucVYkE X-Google-Smtp-Source: APXvYqz5Wf1kOYa6V33yDPG0EK9jBkZI5wFT4Q8bCe/rBQXbcLVPbMeOdlYcxCh2CKoUD0u3L1kbbQ== X-Received: by 2002:a05:6000:124a:: with SMTP id j10mr10330123wrx.191.1561413669297; Mon, 24 Jun 2019 15:01:09 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Date: Tue, 25 Jun 2019 00:00:55 +0200 Message-Id: <20190624220056.25861-9-f4bug@amsat.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190624220056.25861-1-f4bug@amsat.org> References: <20190624220056.25861-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::444 Subject: [Qemu-devel] [PATCH 8/9] hw/sparc/sun4m: Simplify the RAM creation 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 , Aleksandar Rikalo , Mark Cave-Ayland , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Aurelien Jarno , Aleksandar Markovic , Artyom Tarasenko Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Now than the empty_slot device can be overlapped, use it to cover the maximum memory range. We can simplify now the main RAM is created. The TYPE_SUN4M_MEMORY is not migratable, simply remove it. Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- hw/sparc/sun4m.c | 85 ++++++++---------------------------------------- 1 file changed, 13 insertions(+), 72 deletions(-) diff --git a/hw/sparc/sun4m.c b/hw/sparc/sun4m.c index 0df5a8edfc..d55753d5cb 100644 --- a/hw/sparc/sun4m.c +++ b/hw/sparc/sun4m.c @@ -767,71 +767,6 @@ static const TypeInfo prom_info =3D { .class_init =3D prom_class_init, }; =20 -#define TYPE_SUN4M_MEMORY "memory" -#define SUN4M_RAM(obj) OBJECT_CHECK(RamDevice, (obj), TYPE_SUN4M_MEMORY) - -typedef struct RamDevice { - SysBusDevice parent_obj; - - MemoryRegion ram; - uint64_t size; -} RamDevice; - -/* System RAM */ -static void ram_realize(DeviceState *dev, Error **errp) -{ - RamDevice *d =3D SUN4M_RAM(dev); - SysBusDevice *sbd =3D SYS_BUS_DEVICE(dev); - - memory_region_allocate_system_memory(&d->ram, OBJECT(d), "sun4m.ram", - d->size); - sysbus_init_mmio(sbd, &d->ram); -} - -static void ram_init(hwaddr addr, ram_addr_t RAM_size, - uint64_t max_mem) -{ - DeviceState *dev; - SysBusDevice *s; - RamDevice *d; - - /* allocate RAM */ - if ((uint64_t)RAM_size > max_mem) { - error_report("Too much memory for this machine: %" PRId64 "," - " maximum %" PRId64, - RAM_size / MiB, max_mem / MiB); - exit(1); - } - dev =3D qdev_create(NULL, "memory"); - s =3D SYS_BUS_DEVICE(dev); - - d =3D SUN4M_RAM(dev); - d->size =3D RAM_size; - qdev_init_nofail(dev); - - sysbus_mmio_map(s, 0, addr); -} - -static Property ram_properties[] =3D { - DEFINE_PROP_UINT64("size", RamDevice, size, 0), - DEFINE_PROP_END_OF_LIST(), -}; - -static void ram_class_init(ObjectClass *klass, void *data) -{ - DeviceClass *dc =3D DEVICE_CLASS(klass); - - dc->realize =3D ram_realize; - dc->props =3D ram_properties; -} - -static const TypeInfo ram_info =3D { - .name =3D TYPE_SUN4M_MEMORY, - .parent =3D TYPE_SYS_BUS_DEVICE, - .instance_size =3D sizeof(RamDevice), - .class_init =3D ram_class_init, -}; - static void cpu_devinit(const char *cpu_type, unsigned int id, uint64_t prom_addr, qemu_irq **cpu_irqs) { @@ -872,6 +807,19 @@ static void sun4m_hw_init(const struct sun4m_hwdef *hw= def, FWCfgState *fw_cfg; DeviceState *dev; SysBusDevice *s; + MemoryRegion ram; + + if ((uint64_t)machine->ram_size > hwdef->max_mem) { + error_report("Too much memory for this machine: %" PRId64 "," + " maximum %" PRId64, + machine->ram_size / MiB, hwdef->max_mem / MiB); + exit(1); + } + memory_region_allocate_system_memory(&ram, OBJECT(machine), "sun4m.ram= ", + machine->ram_size); + memory_region_add_subregion(get_system_memory(), 0x00000000, &ram); + /* models without ECC don't trap when missing ram is accessed */ + empty_slot_init(0x00000000, hwdef->max_mem); =20 /* init CPUs */ for(i =3D 0; i < smp_cpus; i++) { @@ -881,13 +829,7 @@ static void sun4m_hw_init(const struct sun4m_hwdef *hw= def, for (i =3D smp_cpus; i < MAX_CPUS; i++) cpu_irqs[i] =3D qemu_allocate_irqs(dummy_cpu_set_irq, NULL, MAX_PI= LS); =20 - /* set up devices */ - ram_init(0, machine->ram_size, hwdef->max_mem); - /* models without ECC don't trap when missing ram is accessed */ - if (!hwdef->ecc_base) { - empty_slot_init(machine->ram_size, hwdef->max_mem - machine->ram_s= ize); - } =20 prom_init(hwdef->slavio_base, bios_name); =20 @@ -1561,7 +1503,6 @@ static void sun4m_register_types(void) type_register_static(&idreg_info); type_register_static(&afx_info); type_register_static(&prom_info); - type_register_static(&ram_info); =20 type_register_static(&ss5_type); type_register_static(&ss10_type); --=20 2.19.1 From nobody Wed May 15 04:32:12 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.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 (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1561414151; cv=none; d=zoho.com; s=zohoarc; b=OKL1vtuI0Vr+BOMFjMlZYKA1HpT8/zqTJcciSL18VPlvQkc9gY2iQSlsOIv12pXvoV4GcR//kmuFPXOdeDOTrYKZ1s1cmV7kSkvybOz26wWNh8t+yMCUAmViGbyROpI12oaklntQvVgXpBvAdG+5+3Z1EIS4T1gNef+L+djE3xc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1561414151; 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:ARC-Authentication-Results; bh=IIHLqb+Tji18CeWo1iHa+k4D0J8xhz1pLarQhDAY1ak=; b=hyrcxgBmy0k6ZeTKWKV/Fhrj9jlJ3847EQP7hlENidPBiiD/ohBU3/Wfvlwa/QYtloPNm5C6zT9BG+WwaReXU3CrLRLndAXam8iCAvU1JxqUjYMN8rpWkbFIBK4GUR8K/g0CPgtRIrc1g4LBB3EF72EURdu4KlI/NUOa6MumiuQ= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1561414151316717.9860550389077; Mon, 24 Jun 2019 15:09:11 -0700 (PDT) Received: from localhost ([::1]:54910 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hfX9C-00059P-Bh for importer@patchew.org; Mon, 24 Jun 2019 18:09:10 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54845) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hfX29-0007tk-J9 for qemu-devel@nongnu.org; Mon, 24 Jun 2019 18:01:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hfX27-00044m-GC for qemu-devel@nongnu.org; Mon, 24 Jun 2019 18:01:53 -0400 Received: from mail-wr1-x443.google.com ([2a00:1450:4864:20::443]:37203) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hfX25-0003Cx-Ht for qemu-devel@nongnu.org; Mon, 24 Jun 2019 18:01:51 -0400 Received: by mail-wr1-x443.google.com with SMTP id v14so15514939wrr.4 for ; Mon, 24 Jun 2019 15:01:11 -0700 (PDT) Received: from x1.local (183.red-88-21-202.staticip.rima-tde.net. [88.21.202.183]) by smtp.gmail.com with ESMTPSA id z126sm1118612wmb.32.2019.06.24.15.01.09 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Mon, 24 Jun 2019 15:01:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=IIHLqb+Tji18CeWo1iHa+k4D0J8xhz1pLarQhDAY1ak=; b=STvIRsYS7c4ixW9EM2qXv466H5GuFA4qgeyPVE2hktxzDJCyLso7WfRHGLs0WDrAnN 3AjygYnO6wxX2Kf8PToIpM1Va/x4z2+YfmZgWcMuvaH1HohCb3lolpTsOa+AFXRCy/ul zVGjFfWtvV5o6HMGW9HODZxPzTKNNO96aHOqp+Osy4+hrE8bSyFBxCvtrld9pHxLeADE KcKp0hYzwAlsBedmZfgAUGnaQIrVgpxX56SrdfUNFOtcIPk1KQ5bhF544fPdmYflVChi ft3w9urYvsm6bgiiZKgRS3zBcIKofp2Md2cB5sTqrE+zhe2a19qhdsb4AKQAHPIWDNWD b/5A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=IIHLqb+Tji18CeWo1iHa+k4D0J8xhz1pLarQhDAY1ak=; b=E5HdQy4CA282XDPW5xJpb+eNOIZwDIN5eGKUgFtxFs+Y4Qj+9MZJekb8hHpf3OG/9Z QJ4CDi7Ib3d+7LLpZjaaV6Dvqab4Ri/qYQ7MMUrfFYACHmhpFa4bxySFFwL8+2ncYvc7 PT16RkoRXNhyLHuXO3+2CxBTHuA/Y4HCiW5WLiSWiGzo3ucpvaWB9bbFkpPzDRTppj5x CEq8Eyo/QYEf6PQcUTMuwr1K0/Hr/GzONAkXdURooYnIuSS2YaSG41+Av1lCNYnWr7Ar YwhzLG9f3Pb84uGS03CbZrIUxI1skLVdjX3PARAIBMigl/ptPRtF2EpDscAJ3Gu+Nqoj WeJg== X-Gm-Message-State: APjAAAUDciPUjg/x/GmQkIUD68wX1wlgPy2uDTlQz18RkWUWJUlrbjDH ZwI9tQvkCjMlvTquVQfMk9BUyHNW X-Google-Smtp-Source: APXvYqwOiq7JbOmk3mmwzAEUSz+GNrlGtkk0+NELdqvIv5ttHSyBIo0/MB7n1bl2JpFb0QGpbBxOVA== X-Received: by 2002:a5d:56cb:: with SMTP id m11mr14964052wrw.255.1561413670596; Mon, 24 Jun 2019 15:01:10 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Date: Tue, 25 Jun 2019 00:00:56 +0200 Message-Id: <20190624220056.25861-10-f4bug@amsat.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190624220056.25861-1-f4bug@amsat.org> References: <20190624220056.25861-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::443 Subject: [Qemu-devel] [PATCH 9/9] hw/misc/empty_slot: Pass the slot name as argument 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 , Aleksandar Rikalo , Mark Cave-Ayland , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Aurelien Jarno , Aleksandar Markovic , Artyom Tarasenko Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Use the slot name to have more meaningful tracing logs. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Artyom Tarasenko --- include/hw/misc/empty_slot.h | 3 ++- hw/mips/mips_malta.c | 2 +- hw/misc/empty_slot.c | 6 ++++-- hw/sparc/sun4m.c | 9 ++++++--- 4 files changed, 13 insertions(+), 7 deletions(-) diff --git a/include/hw/misc/empty_slot.h b/include/hw/misc/empty_slot.h index 46483f24c3..d0cd989d2d 100644 --- a/include/hw/misc/empty_slot.h +++ b/include/hw/misc/empty_slot.h @@ -14,6 +14,7 @@ =20 /** * empty_slot_init: create and map a RAZ/WI device + * @name: name of the device for debug logging * @base: base address of the device's MMIO region * @size: size of the device's MMIO region * @@ -27,6 +28,6 @@ * use it to cover a large region and then map other devices on top of it * if necessary. */ -void empty_slot_init(hwaddr addr, uint64_t slot_size); +void empty_slot_init(const char *name, hwaddr addr, uint64_t slot_size); =20 #endif diff --git a/hw/mips/mips_malta.c b/hw/mips/mips_malta.c index 7008be2e5b..51db5212be 100644 --- a/hw/mips/mips_malta.c +++ b/hw/mips/mips_malta.c @@ -1212,7 +1212,7 @@ void mips_malta_init(MachineState *machine) /* The whole address space decoded by the GT-64120A doesn't generate exception when accessing invalid memory. Create an empty slot to emulate this feature. */ - empty_slot_init(0, 0x20000000); + empty_slot_init("gt64120-ad", 0x00000000, 0x20000000); =20 qdev_init_nofail(dev); =20 diff --git a/hw/misc/empty_slot.c b/hw/misc/empty_slot.c index b810655554..396f9dd06a 100644 --- a/hw/misc/empty_slot.c +++ b/hw/misc/empty_slot.c @@ -52,12 +52,13 @@ static const MemoryRegionOps empty_slot_ops =3D { .endianness =3D DEVICE_NATIVE_ENDIAN, }; =20 -void empty_slot_init(hwaddr addr, uint64_t slot_size) +void empty_slot_init(const char *name, hwaddr addr, uint64_t slot_size) { DeviceState *dev; =20 dev =3D qdev_create(NULL, TYPE_EMPTY_SLOT); =20 + qdev_prop_set_string(dev, "name", name); qdev_prop_set_uint64(dev, "size", slot_size); qdev_init_nofail(dev); =20 @@ -77,7 +78,8 @@ static void empty_slot_realize(DeviceState *dev, Error **= errp) return; } if (s->name =3D=3D NULL) { - s->name =3D g_strdup("empty-slot"); + error_setg(errp, "property 'name' not specified"); + return; } =20 memory_region_init_io(&s->iomem, OBJECT(s), &empty_slot_ops, s, diff --git a/hw/sparc/sun4m.c b/hw/sparc/sun4m.c index d55753d5cb..b17be3ddb8 100644 --- a/hw/sparc/sun4m.c +++ b/hw/sparc/sun4m.c @@ -819,7 +819,7 @@ static void sun4m_hw_init(const struct sun4m_hwdef *hwd= ef, machine->ram_size); memory_region_add_subregion(get_system_memory(), 0x00000000, &ram); /* models without ECC don't trap when missing ram is accessed */ - empty_slot_init(0x00000000, hwdef->max_mem); + empty_slot_init("dram", 0x00000000, hwdef->max_mem); =20 /* init CPUs */ for(i =3D 0; i < smp_cpus; i++) { @@ -859,7 +859,8 @@ static void sun4m_hw_init(const struct sun4m_hwdef *hwd= ef, Software shouldn't use aliased addresses, neither should it cra= sh when does. Using empty_slot instead of aliasing can help with debugging such accesses */ - empty_slot_init(hwdef->iommu_pad_base,hwdef->iommu_pad_len); + empty_slot_init("iommu.alias", + hwdef->iommu_pad_base, hwdef->iommu_pad_len); } =20 sparc32_dma_init(hwdef->dma_base, @@ -908,7 +909,9 @@ static void sun4m_hw_init(const struct sun4m_hwdef *hwd= ef, for (i =3D 0; i < MAX_VSIMMS; i++) { /* vsimm registers probed by OBP */ if (hwdef->vsimm[i].reg_base) { - empty_slot_init(hwdef->vsimm[i].reg_base, 0x2000); + char *name =3D g_strdup_printf("vsimm[%d]", i); + empty_slot_init(name, hwdef->vsimm[i].reg_base, 0x2000); + g_free(name); } } =20 --=20 2.19.1