From: David Woodhouse <dwmw2@infradead.org>
To: BALATON Zoltan <balaton@eik.bme.hu>,
"Michael S. Tsirkin" <mst@redhat.com>,
Paolo Bonzini <pbonzini@redhat.com>
Cc: Bernhard Beschow <shentey@gmail.com>,
qemu-devel@nongnu.org, qemu-ppc@nongnu.org,
Gerd Hoffmann <kraxel@redhat.com>,
Daniel Henrique Barboza <danielhb413@gmail.com>,
Peter Maydell <peter.maydell@linaro.org>,
philmd@linaro.org, ReneEngel80@emailn.de
Subject: Re: [PATCH v5 5/7] hw/isa/vt82c686: Work around missing level sensitive irq in i8259 model
Date: Thu, 02 Mar 2023 08:59:41 +0000 [thread overview]
Message-ID: <81f53c106bf9584828402ab92e94ac4331c58c7a.camel@infradead.org> (raw)
In-Reply-To: <20eb7e98-aedb-1528-8ba0-806b93b123ea@eik.bme.hu>
[-- Attachment #1: Type: text/plain, Size: 2474 bytes --]
On Wed, 2023-03-01 at 23:47 +0100, BALATON Zoltan wrote:
> On Wed, 1 Mar 2023, David Woodhouse wrote:
> > On Wed, 2023-03-01 at 19:01 +0100, BALATON Zoltan wrote:
> > >
> > > > It isn't a *correct* fix without a little bit more typing, but does
> > > > this make it work?
> > > >
> > > > diff --git a/hw/intc/i8259.c b/hw/intc/i8259.c
> > > > index 17910f3bcb..36ebcff025 100644
> > > > --- a/hw/intc/i8259.c
> > > > +++ b/hw/intc/i8259.c
> > > > @@ -246,6 +246,7 @@ static void pic_ioport_write(void *opaque, hwaddr addr64,
> > > > if (val & 0x08) {
> > > > qemu_log_mask(LOG_UNIMP,
> > > > "i8259: level sensitive irq not supported\n");
> > > > + s->elcr = 0xff;
> > >
> > > This works too. I guess the log can be then removed too. Could you submit
> > > a proper patch or you want me to do that so we can drop the workaround for
> > > it? Thanks for looking into it.
> >
> >
> > Happy for you to do the rest of the typing ... :)
>
> I don't mind the typing but this is quite a bit more involved than I
> expected. You've lost me at the vmstate stuff which I don't quite know how
> to change or test. If these were stored as bits in an ISW1 register as
> described by the docs I've looked at now then no change in migration would
> be needed but this isn't how it seems to be in QEMU so I give up on that
> in this case. Could you please do the typing then?
Yeah, it is a bit weird that we store the ICW1 byte in *separate*
elements of persistent state, each of *them* a uint8_t which holds only
a single bit of ICW1:
s->init4 = val & 1;
s->single_mode = val & 2;
s->ltim = val & 8;
Still, it's a pattern that's easy enough to follow.
As for the rest of the typing, I'd basically done the bulk of it
already when showing how to adjust the existing (s->elcr&mask) checks;
there was only one more of those to type.
And then the vmstate part is basically just a cut and paste of the bit
in docs/devel/migration.rst which tells you exactly how to do it.
Patch follows. It builds, but I'll let you do the actual testing,
including migration to/from the new version, checking with
scripts/analyze-migration.py that the ltim is there when it should be,
and isn't when it shouldn't, and any other review feedback.
[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 5965 bytes --]
next prev parent reply other threads:[~2023-03-02 9:00 UTC|newest]
Thread overview: 37+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-01 0:17 [PATCH v5 0/7] Pegasos2 fixes and audio output support BALATON Zoltan
2023-03-01 0:17 ` [PATCH v5 1/7] hw/display/sm501: Add debug property to control pixman usage BALATON Zoltan
2023-03-02 21:51 ` BALATON Zoltan
2023-03-01 0:17 ` [PATCH v5 2/7] Revert "hw/isa/vt82c686: Remove intermediate IRQ forwarder" BALATON Zoltan
2023-03-01 0:33 ` BALATON Zoltan
2023-03-01 6:43 ` Bernhard Beschow
2023-03-01 11:17 ` BALATON Zoltan
2023-03-02 10:41 ` Philippe Mathieu-Daudé
2023-03-02 10:44 ` Philippe Mathieu-Daudé
2023-03-02 12:37 ` BALATON Zoltan
2023-03-02 12:46 ` Philippe Mathieu-Daudé
2023-03-01 0:17 ` [PATCH v5 3/7] hw/isa/vt82c686: Implement PCI IRQ routing BALATON Zoltan
2023-03-01 6:38 ` Bernhard Beschow
2023-03-01 11:15 ` BALATON Zoltan
2023-03-01 21:08 ` Bernhard Beschow
2023-03-01 21:27 ` BALATON Zoltan
2023-03-01 0:17 ` [PATCH v5 4/7] hw/ppc/pegasos2: Fix PCI interrupt routing BALATON Zoltan
2023-03-03 9:17 ` Daniel Henrique Barboza
2023-03-01 0:17 ` [PATCH v5 5/7] hw/isa/vt82c686: Work around missing level sensitive irq in i8259 model BALATON Zoltan
2023-03-01 6:49 ` Bernhard Beschow
2023-03-01 11:27 ` BALATON Zoltan
2023-03-01 11:52 ` David Woodhouse
2023-03-01 13:18 ` BALATON Zoltan
2023-03-01 14:05 ` David Woodhouse
2023-03-01 18:01 ` BALATON Zoltan
2023-03-01 21:53 ` David Woodhouse
2023-03-01 22:47 ` BALATON Zoltan
2023-03-02 8:59 ` David Woodhouse [this message]
2023-03-02 9:06 ` [PATCH] hw/intc/i8259: Implement legacy LTIM Edge/Level Bank Select David Woodhouse
2023-03-02 9:58 ` David Woodhouse
2023-03-02 12:35 ` BALATON Zoltan
2023-03-02 21:46 ` [PATCH v5 5/7] hw/isa/vt82c686: Work around missing level sensitive irq in i8259 model BALATON Zoltan
2023-03-01 20:58 ` Bernhard Beschow
2023-03-01 0:17 ` [PATCH v5 6/7] hw/usb/vt82c686-uhci-pci: Use PCI IRQ routing BALATON Zoltan
2023-03-01 0:17 ` [PATCH v5 7/7] hw/audio/via-ac97: Basic implementation of audio playback BALATON Zoltan
2023-03-02 21:59 ` BALATON Zoltan
2023-03-03 6:57 ` Volker Rümelin
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=81f53c106bf9584828402ab92e94ac4331c58c7a.camel@infradead.org \
--to=dwmw2@infradead.org \
--cc=ReneEngel80@emailn.de \
--cc=balaton@eik.bme.hu \
--cc=danielhb413@gmail.com \
--cc=kraxel@redhat.com \
--cc=mst@redhat.com \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=philmd@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@nongnu.org \
--cc=shentey@gmail.com \
/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).