From patchwork Mon May 20 10:10:07 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: BALATON Zoltan X-Patchwork-Id: 1936981 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4VjYHW1XWVz20KG for ; Mon, 20 May 2024 20:11:01 +1000 (AEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s8zyR-0003gq-WA; Mon, 20 May 2024 06:10:32 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1s8zyK-0003eU-9q; Mon, 20 May 2024 06:10:24 -0400 Received: from zero.eik.bme.hu ([2001:738:2001:2001::2001]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1s8zyA-0002OD-Fm; Mon, 20 May 2024 06:10:24 -0400 Received: from zero.eik.bme.hu (localhost [127.0.0.1]) by zero.eik.bme.hu (Postfix) with ESMTP id 9C7634E6000; Mon, 20 May 2024 12:10:09 +0200 (CEST) X-Virus-Scanned: amavisd-new at eik.bme.hu Received: from zero.eik.bme.hu ([127.0.0.1]) by zero.eik.bme.hu (zero.eik.bme.hu [127.0.0.1]) (amavisd-new, port 10028) with ESMTP id ujGJWZknsGZ9; Mon, 20 May 2024 12:10:07 +0200 (CEST) Received: by zero.eik.bme.hu (Postfix, from userid 432) id A25A34E602E; Mon, 20 May 2024 12:10:07 +0200 (CEST) From: BALATON Zoltan Subject: [PATCH] macio: Add unimp region for debugging MIME-Version: 1.0 To: qemu-devel@nongnu.org, qemu-ppc@nongnu.org Cc: Andrew Randrianasulu , Mark Cave-Ayland Message-Id: <20240520101007.A25A34E602E@zero.eik.bme.hu> Date: Mon, 20 May 2024 12:10:07 +0200 (CEST) Received-SPF: pass client-ip=2001:738:2001:2001::2001; envelope-from=balaton@eik.bme.hu; helo=zero.eik.bme.hu X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-ppc@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org The macio device has a container mmio region that embeds several other devices. Some of these devices are not implemented but because of the container region, the unassigned memory traces don't catch accesses to these. To help debugging, add an unimplemented-device covering the container region to get logs when the guest accesses unassigned areas. Signed-off-by: BALATON Zoltan --- Here's a patch that should help getting logs for unimplemented registers in macio with -d unimp which may help finding out where the writes go and what needs to be implemented. hw/misc/Kconfig | 1 + hw/misc/macio/macio.c | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/hw/misc/Kconfig b/hw/misc/Kconfig index 1e08785b83..4197a786d6 100644 --- a/hw/misc/Kconfig +++ b/hw/misc/Kconfig @@ -66,6 +66,7 @@ config MACIO select MAC_DBDMA select MAC_NVRAM select MOS6522 + select UNIMP config IVSHMEM_DEVICE bool diff --git a/hw/misc/macio/macio.c b/hw/misc/macio/macio.c index 3f449f91c0..43b683c294 100644 --- a/hw/misc/macio/macio.c +++ b/hw/misc/macio/macio.c @@ -34,6 +34,7 @@ #include "hw/char/escc.h" #include "hw/misc/macio/macio.h" #include "hw/intc/heathrow_pic.h" +#include "hw/misc/unimp.h" #include "trace.h" #define ESCC_CLOCK 3686400 @@ -94,6 +95,14 @@ static bool macio_common_realize(PCIDevice *d, Error **errp) { MacIOState *s = MACIO(d); SysBusDevice *sbd; + DeviceState *dev = qdev_new(TYPE_UNIMPLEMENTED_DEVICE); + + qdev_prop_set_string(dev, "name", "macio-unimp"); + qdev_prop_set_uint64(dev, "size", memory_region_size(&s->bar)); + sbd = SYS_BUS_DEVICE(dev); + sysbus_realize_and_unref(sbd, &error_fatal); + memory_region_add_subregion_overlap(&s->bar, 0, + sysbus_mmio_get_region(sbd, 0), -1000); if (!qdev_realize(DEVICE(&s->dbdma), BUS(&s->macio_bus), errp)) { return false;