From: Howard Spoelstra <hsp.cat7@gmail.com>
To: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Cc: "Cédric Le Goater" <clg@kaod.org>,
"Cédric Le Goater" <clegoate@redhat.com>,
"Peter Maydell" <peter.maydell@linaro.org>,
"Nicholas Piggin" <npiggin@gmail.com>,
qemu-ppc@nongnu.org, qemu-devel@nongnu.org,
"Christophe Leroy" <christophe.leroy@csgroup.eu>,
"BALATON Zoltan" <balaton@eik.bme.hu>,
"Harsh Prateek Bora" <harshpb@linux.ibm.com>,
"Daniel Henrique Barboza" <danielhb413@gmail.com>,
"David Gibson" <david@gibson.dropbear.id.au>,
"Greg Kurz" <groug@kaod.org>,
"Frederic Barrat" <frederic.barrat@fr.ibm.com>
Subject: Re: [PATCH 0/4] target/ppc: Catch invalid real address accesses
Date: Tue, 27 Jun 2023 12:28:39 +0200 [thread overview]
Message-ID: <CABLmASF92ux10=D5MJ4Ax3FbCi4digWJajHy4VE1fNUL9bOJxA@mail.gmail.com> (raw)
In-Reply-To: <cefdeb3f-3442-ede4-3e5d-6a4a99b38293@ilande.co.uk>
[-- Attachment #1: Type: text/plain, Size: 6183 bytes --]
On Tue, Jun 27, 2023 at 10:15 AM Mark Cave-Ayland <
mark.cave-ayland@ilande.co.uk> wrote:
> On 26/06/2023 14:35, Cédric Le Goater wrote:
>
> > On 6/23/23 14:37, Cédric Le Goater wrote:
> >> On 6/23/23 11:10, Peter Maydell wrote:
> >>> On Fri, 23 Jun 2023 at 09:21, Nicholas Piggin <npiggin@gmail.com>
> wrote:
> >>>>
> >>>> ppc has always silently ignored access to real (physical) addresses
> >>>> with nothing behind it, which can make debugging difficult at times.
> >>>>
> >>>> It looks like the way to handle this is implement the transaction
> >>>> failed call, which most target architectures do. Notably not x86
> >>>> though, I wonder why?
> >>>
> >>> Much of this is historical legacy. QEMU originally had no
> >>> concept of "the system outside the CPU returns some kind
> >>> of bus error and the CPU raises an exception for it".
> >>> This is turn is (I think) because the x86 PC doesn't do
> >>> that: you always get back some kind of response, I think
> >>> -1 on reads and writes ignored. We added the do_transaction_failed
> >>> hook largely because we wanted it to give more accurate
> >>> emulation of this kind of thing on Arm, but as usual with new
> >>> facilities we left the other architectures to do it themselves
> >>> if they wanted -- by default the behaviour remained the same.
> >>> Some architectures have picked it up; some haven't.
> >>>
> >>> The main reason it's a bit of a pain to turn the correct
> >>> handling on is because often boards don't actually implement
> >>> all the devices they're supposed to. For a pile of legacy Arm
> >>> boards, especially where we didn't have good test images,
> >>> we use the machine flag ignore_memory_transaction_failures to
> >>> retain the legacy behaviour. (This isn't great because it's
> >>> pretty much going to mean we have that flag set on those
> >>> boards forever because nobody is going to care enough to
> >>> investigate and test.)
> >>>
> >>>> Other question is, sometimes I guess it's nice to avoid crashing in
> >>>> order to try to quickly get past some unimplemented MMIO. Maybe a
> >>>> command line option or something could turn it off? It should
> >>>> probably be a QEMU-wide option if so, so that shouldn't hold this
> >>>> series up, I can propose a option for that if anybody is worried
> >>>> about it.
> >>>
> >>> I would not recommend going any further than maybe setting the
> >>> ignore_memory_transaction_failures flag for boards you don't
> >>> care about. (But in an ideal world, don't set it and deal with
> >>> any bug reports by implementing stub versions of missing devices.
> >>> Depends how confident you are in your test coverage.)
> >>
> >> It seems it broke the "mac99" and powernv10 machines, using the
> >> qemu-ppc-boot images which are mostly buildroot. See below for logs.
> >>
> >> Adding Mark for further testing on Mac OS.
> >
> >
> > Mac OS 9.2 fails to boot with a popup saying :
> > Sorry, a system error occured.
> > "Sound Manager"
> > address error
> > To temporarily turn off extensions, restart and
> > hold down the shift key
> >
> >
> > Darwin and Mac OSX look OK.
>
> My guess would be that MacOS 9.2 is trying to access the sound chip
> registers which
> isn't implemented in QEMU for the moment (I have a separate screamer
> branch
> available, but it's not ready for primetime yet). In theory they shouldn't
> be
> accessed at all because the sound device isn't present in the OpenBIOS
> device tree,
> but this is all fairly old stuff.
>
> Does implementing the sound registers using a dummy device help at all?
>
>
My uneducated guess is that you stumbled on a longstanding, but
intermittently occurring, issue specific to Mac OS 9.2 related to sound
support over USB in Apple monitors.
I believe It is not fixed by the patch set from the 23 of june, I still get
system errors when running Mac OS 9.2 with the mac99 machine after applying
them.
Mac OS 9.2 has required mac99,via=pmu for a long time now to always boot
successfully. (while 9.0.4 requires mac99 to boot, due to an undiagnosed
OHCI USB problem with the specific drivers that ship with it.) ;-)
Best,
Howard
>
> diff --git a/hw/misc/macio/macio.c b/hw/misc/macio/macio.c
> index 265c0bbd8d..e55f938da7 100644
> --- a/hw/misc/macio/macio.c
> +++ b/hw/misc/macio/macio.c
> @@ -26,6 +26,7 @@
> #include "qemu/osdep.h"
> #include "qapi/error.h"
> #include "qemu/module.h"
> +#include "hw/misc/unimp.h"
> #include "hw/misc/macio/cuda.h"
> #include "hw/pci/pci.h"
> #include "hw/ppc/mac_dbdma.h"
> @@ -94,6 +95,7 @@ static bool macio_common_realize(PCIDevice *d, Error
> **errp)
> {
> MacIOState *s = MACIO(d);
> SysBusDevice *sbd;
> + DeviceState *dev;
>
> if (!qdev_realize(DEVICE(&s->dbdma), BUS(&s->macio_bus), errp)) {
> return false;
> @@ -102,6 +104,14 @@ static bool macio_common_realize(PCIDevice *d, Error
> **errp)
> memory_region_add_subregion(&s->bar, 0x08000,
> sysbus_mmio_get_region(sbd, 0));
>
> + dev = qdev_new(TYPE_UNIMPLEMENTED_DEVICE);
> + qdev_prop_set_string(dev, "name", "screamer");
> + qdev_prop_set_uint64(dev, "size", 0x1000);
> + sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal);
> + sbd = SYS_BUS_DEVICE(dev);
> + memory_region_add_subregion(&s->bar, 0x14000,
> + sysbus_mmio_get_region(sbd, 0));
> +
> qdev_prop_set_uint32(DEVICE(&s->escc), "disabled", 0);
> qdev_prop_set_uint32(DEVICE(&s->escc), "frequency", ESCC_CLOCK);
> qdev_prop_set_uint32(DEVICE(&s->escc), "it_shift", 4);
> diff --git a/include/hw/misc/macio/macio.h b/include/hw/misc/macio/macio.h
> index 86df2c2b60..1894178a68 100644
> --- a/include/hw/misc/macio/macio.h
> +++ b/include/hw/misc/macio/macio.h
> @@ -109,6 +109,7 @@ struct MacIOState {
> PMUState pmu;
> DBDMAState dbdma;
> ESCCState escc;
> + MemoryRegion screamer;
> uint64_t frequency;
> };
>
>
>
> ATB,
>
> Mark.
>
>
[-- Attachment #2: Type: text/html, Size: 7938 bytes --]
next prev parent reply other threads:[~2023-06-27 10:29 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-23 8:19 [PATCH 0/4] target/ppc: Catch invalid real address accesses Nicholas Piggin
2023-06-23 8:19 ` [PATCH 1/4] target/ppc: Machine check on invalid real address access Nicholas Piggin
2023-06-23 8:19 ` [PATCH 2/4] target/ppc: Add POWER9/10 invalid-real machine check codes Nicholas Piggin
2023-06-23 8:19 ` [PATCH 3/4] target/ppc: Move common check in machne check handlers to a function Nicholas Piggin
2023-06-23 13:20 ` Fabiano Rosas
2023-06-23 16:16 ` BALATON Zoltan
2023-06-25 9:20 ` Nicholas Piggin
2023-06-23 8:19 ` [PATCH 4/4] target/ppc: Make checkstop stop the system Nicholas Piggin
2023-06-23 11:51 ` BALATON Zoltan
2023-06-25 9:15 ` Nicholas Piggin
2023-06-23 9:10 ` [PATCH 0/4] target/ppc: Catch invalid real address accesses Peter Maydell
2023-06-23 12:37 ` Cédric Le Goater
2023-06-23 23:35 ` Philippe Mathieu-Daudé
2023-06-24 9:50 ` BALATON Zoltan
2023-06-26 13:35 ` Cédric Le Goater
2023-06-26 23:28 ` Nicholas Piggin
2023-06-27 6:49 ` Cédric Le Goater
2023-06-27 8:14 ` Mark Cave-Ayland
2023-06-27 10:28 ` Howard Spoelstra [this message]
2023-06-27 11:24 ` Mark Cave-Ayland
2023-06-27 12:05 ` Howard Spoelstra
2023-06-27 12:41 ` Cédric Le Goater
2023-06-27 20:26 ` Mark Cave-Ayland
2023-06-28 7:02 ` Cédric Le Goater
2023-06-28 7:17 ` Cédric Le Goater
2023-06-29 8:29 ` Mark Cave-Ayland
2023-06-29 9:05 ` Cédric Le Goater
2023-06-29 9:41 ` Nicholas Piggin
2023-06-27 12:03 ` Cédric Le Goater
2023-06-27 20:24 ` Mark Cave-Ayland
2023-06-25 9:18 ` Nicholas Piggin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CABLmASF92ux10=D5MJ4Ax3FbCi4digWJajHy4VE1fNUL9bOJxA@mail.gmail.com' \
--to=hsp.cat7@gmail.com \
--cc=balaton@eik.bme.hu \
--cc=christophe.leroy@csgroup.eu \
--cc=clegoate@redhat.com \
--cc=clg@kaod.org \
--cc=danielhb413@gmail.com \
--cc=david@gibson.dropbear.id.au \
--cc=frederic.barrat@fr.ibm.com \
--cc=groug@kaod.org \
--cc=harshpb@linux.ibm.com \
--cc=mark.cave-ayland@ilande.co.uk \
--cc=npiggin@gmail.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).