From: Paolo Bonzini <pbonzini@redhat.com>
To: "Philippe Mathieu-Daudé" <f4bug@amsat.org>
Cc: Mike Nawrocki <michael.nawrocki@gtri.gatech.edu>,
Avi Kivity <avi@redhat.com>,
Peter Maydell <peter.maydell@linaro.org>,
Konrad Frederic <fred.konrad@greensocs.com>,
qemu-devel@nongnu.org, mst@redhat.com
Subject: Re: [Qemu-devel] [PATCH] Enable 8-byte wide MMIO for 16550 serial devices
Date: Thu, 2 Nov 2017 16:04:47 -0400 (EDT) [thread overview]
Message-ID: <655342677.16706255.1509653087535.JavaMail.zimbra@redhat.com> (raw)
In-Reply-To: <0e24381c-3621-1dcb-02fb-1dc4f15358b2@amsat.org>
----- Original Message -----
> From: "Philippe Mathieu-Daudé" <f4bug@amsat.org>
> To: "Paolo Bonzini" <pbonzini@redhat.com>, "Mike Nawrocki" <michael.nawrocki@gtri.gatech.edu>, "Avi Kivity"
> <avi@redhat.com>, "Peter Maydell" <peter.maydell@linaro.org>, "Konrad Frederic" <fred.konrad@greensocs.com>
> Cc: qemu-devel@nongnu.org, mst@redhat.com
> Sent: Thursday, November 2, 2017 8:28:09 PM
> Subject: Re: [Qemu-devel] [PATCH] Enable 8-byte wide MMIO for 16550 serial devices
>
> Hi Mike, Paolo.
>
> >> diff --git a/hw/char/serial.c b/hw/char/serial.c
> >> index 376bd2f240..c16c19a406 100644
> >> --- a/hw/char/serial.c
> >> +++ b/hw/char/serial.c
> >> @@ -1005,7 +1005,7 @@ static void serial_mm_write(void *opaque, hwaddr
> >> addr,
> >> uint64_t value, unsigned size)
> >> {
> >> SerialState *s = opaque;
> >> - value &= ~0u >> (32 - (size * 8));
> >> + value &= ~((uint64_t)0) >> (64 - (size * 8));
> >> serial_ioport_write(s, addr >> s->it_shift, value, 1);
> >> }
> >
> > Couldn't this be simply "value &= 255"? Otherwise looks good.
>
> This is not incorrect, but I don't think this is the correct fix.
> Isn't it what memory::access_with_adjusted_size() is supposed to do with
> .impl.max_access_size = 1?
The mm version doesn't have .impl.max_access_size=1.
Thanks,
Paolo
> This looks like the same issue I tried to fix here:
> http://lists.nongnu.org/archive/html/qemu-devel/2017-08/msg02255.html
>
> I'll try to find some time to respin the full series with tests.
>
> >> @@ -1014,16 +1014,22 @@ static const MemoryRegionOps serial_mm_ops[3] = {
> >> .read = serial_mm_read,
> >> .write = serial_mm_write,
> >> .endianness = DEVICE_NATIVE_ENDIAN,
> >> + .valid.max_access_size = 8,
> >> + .impl.max_access_size = 8,
> >> },
> >> [DEVICE_LITTLE_ENDIAN] = {
> >> .read = serial_mm_read,
> >> .write = serial_mm_write,
> >> .endianness = DEVICE_LITTLE_ENDIAN,
> >> + .valid.max_access_size = 8,
> >> + .impl.max_access_size = 8,
> >> },
> >> [DEVICE_BIG_ENDIAN] = {
> >> .read = serial_mm_read,
> >> .write = serial_mm_write,
> >> .endianness = DEVICE_BIG_ENDIAN,
> >> + .valid.max_access_size = 8,
> >> + .impl.max_access_size = 8,
>
next prev parent reply other threads:[~2017-11-02 20:04 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-31 15:24 [Qemu-devel] [PATCH] Enable 8-byte wide MMIO for 16550 serial devices Mike Nawrocki
2017-11-02 18:09 ` Paolo Bonzini
2017-11-02 19:28 ` Philippe Mathieu-Daudé
2017-11-02 20:04 ` Paolo Bonzini [this message]
2017-11-06 16:08 ` Michael Nawrocki
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=655342677.16706255.1509653087535.JavaMail.zimbra@redhat.com \
--to=pbonzini@redhat.com \
--cc=avi@redhat.com \
--cc=f4bug@amsat.org \
--cc=fred.konrad@greensocs.com \
--cc=michael.nawrocki@gtri.gatech.edu \
--cc=mst@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@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).