From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52843) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g7KeQ-00071A-8v for qemu-devel@nongnu.org; Tue, 02 Oct 2018 09:23:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g7KeP-0007FD-Ac for qemu-devel@nongnu.org; Tue, 02 Oct 2018 09:23:46 -0400 Received: from mail-oi1-x243.google.com ([2607:f8b0:4864:20::243]:39551) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1g7KeP-0007Ey-5S for qemu-devel@nongnu.org; Tue, 02 Oct 2018 09:23:45 -0400 Received: by mail-oi1-x243.google.com with SMTP id y81-v6so1464239oia.6 for ; Tue, 02 Oct 2018 06:23:44 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <20181001220942.2382-10-f4bug@amsat.org> References: <20181001220942.2382-1-f4bug@amsat.org> <20181001220942.2382-10-f4bug@amsat.org> From: Peter Maydell Date: Tue, 2 Oct 2018 14:23:24 +0100 Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH 09/15] hw/mips/malta: Replace 'empty_slot' by 'unimplemented_device' List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?UTF-8?Q?Philippe_Mathieu=2DDaud=C3=A9?= Cc: =?UTF-8?Q?C=C3=A9dric_Le_Goater?= , QEMU Developers , Eduardo Habkost , Aurelien Jarno , Aleksandar Markovic On 1 October 2018 at 23:09, Philippe Mathieu-Daud=C3=A9 w= rote: > The TYPE_EMPTY_SLOT and TYPE_UNIMPLEMENTED_DEVICE are identical devices, > however the later use more recent APIs and is more widely used. > > Replace 'empty_slot' by 'unimplemented_device' to simplify devices code > maintenance. > > Signed-off-by: Philippe Mathieu-Daud=C3=A9 > --- > default-configs/mips-softmmu-common.mak | 1 - > hw/mips/mips_malta.c | 4 ++-- > 2 files changed, 2 insertions(+), 3 deletions(-) > > diff --git a/default-configs/mips-softmmu-common.mak b/default-configs/mi= ps-softmmu-common.mak > index fae2347ee7..f9d664e120 100644 > --- a/default-configs/mips-softmmu-common.mak > +++ b/default-configs/mips-softmmu-common.mak > @@ -32,7 +32,6 @@ CONFIG_PFLASH_CFI01=3Dy > CONFIG_I8259=3Dy > CONFIG_MC146818RTC=3Dy > CONFIG_ISA_TESTDEV=3Dy > -CONFIG_EMPTY_SLOT=3Dy > CONFIG_MIPS_CPS=3Dy > CONFIG_MIPS_ITU=3Dy > CONFIG_I2C=3Dy > diff --git a/hw/mips/mips_malta.c b/hw/mips/mips_malta.c > index 40041d5ec0..4ccfa87c35 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/unimp.h" > #include "sysemu/kvm.h" > #include "exec/semihost.h" > #include "hw/mips/cps.h" > @@ -1216,7 +1216,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); > + create_unimplemented_device("gt64120-SysAD", 0, 0x20000000); > > qdev_init_nofail(dev); Not sure about this one. unimplemented_device means "there should be something here, but QEMU's model is incomplete", and if the user asks for 'unimp' warnings via the -d option then all accesses will generate logging. In this MIPS board, we're modelling the hardware's actual behaviour, and we shouldn't generate debug messages that imply that QEMU has unimplemented functionality here. If we were writing a model of the Malta board from scratch we'd probably do it by having the GT-64120A be modelled as a device which was a container object that instantiated all its various bits and pieces and mapped them into a MemoryRegion that spanned the whole 1GB size of that part of the address space. We could then give that MR a background region with the "RAZ/WI" behaviour the hardware requires. thanks -- PMM