From: Anatoly Trosinenko <anatoly.trosinenko@gmail.com>
To: qemu-devel@nongnu.org
Cc: Stefan Weil <sw@weilnetz.de>,
Anatoly Trosinenko <anatoly.trosinenko@gmail.com>,
Richard Henderson <rth@twiddle.net>
Subject: Re: [Qemu-devel] [PATCH 0/1] Fix unaligned reads in the tcg/tci.c
Date: Mon, 5 Feb 2018 16:52:19 +0300 [thread overview]
Message-ID: <CAE5jQCcDUmaTc0xM6RLppL7xfOmqkAkcirXNAgyTukBFHMaXTA@mail.gmail.com> (raw)
In-Reply-To: <20180127134908.24095-1-anatoly.trosinenko@gmail.com>
Ping.
Patchwork link: http://patchwork.ozlabs.org/patch/866732/
Patchew link:
http://patchew.org/QEMU/20180127134908.24095-1-anatoly.trosinenko@gmail.com/
(Initially forgot to add Richard Henderson to CC.)
2018-01-27 16:49 GMT+03:00 Anatoly Trosinenko <anatoly.trosinenko@gmail.com>
:
> The code in tcg/tci.c reads some data from TCI bytecode through
> pointer dereferencing. As far as I know unaligned reads in such a way are
> undefined behavior and compiling with -fsanitize=undefined enumerated
> them as such at run-time.
>
> I have replaced such reads with invocations of ld{l,q}_he_p.
> A comment in include/qemu/bswap.h:310 suggests they should be properly
> translated by the compiler. I didn't added signed/unsigned casts
> since bswap.h does contain separate signed/unsigned versions
> for 16-bit integers but does not for 32- and 64-bit ones, so I supposed
> the developers of the bswap.h already arranged everything so
> integer promotions don't mess things up. I can add casts in case I'm
> not right about it.
>
> Anatoly Trosinenko (1):
> tci: eliminate UB due to unaligned reads
>
> tcg/tci.c | 16 +++++++++++-----
> 1 file changed, 11 insertions(+), 5 deletions(-)
>
> --
> 2.14.1
>
>
--
Best regards,
Anatoly Trosinenko
prev parent reply other threads:[~2018-02-05 13:52 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-27 13:49 [Qemu-devel] [PATCH 0/1] Fix unaligned reads in the tcg/tci.c Anatoly Trosinenko
2018-01-27 13:49 ` [Qemu-devel] [PATCH 1/1] tci: eliminate UB due to unaligned reads Anatoly Trosinenko
2018-01-27 16:38 ` Stefan Weil
2018-01-28 6:42 ` Anatoly Trosinenko
2018-02-19 14:26 ` Anatoly Trosinenko
2018-03-03 8:54 ` Anatoly Trosinenko
2018-03-03 13:57 ` Richard Henderson
2018-03-03 14:07 ` Anatoly Trosinenko
2018-03-03 14:13 ` Richard Henderson
2018-03-03 14:59 ` Anatoly Trosinenko
2018-03-03 15:41 ` Stefan Weil
2018-03-03 16:01 ` Anatoly Trosinenko
2018-03-12 13:45 ` Richard Henderson
2018-02-05 13:52 ` Anatoly Trosinenko [this message]
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=CAE5jQCcDUmaTc0xM6RLppL7xfOmqkAkcirXNAgyTukBFHMaXTA@mail.gmail.com \
--to=anatoly.trosinenko@gmail.com \
--cc=qemu-devel@nongnu.org \
--cc=rth@twiddle.net \
--cc=sw@weilnetz.de \
/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).