qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 0/1] Fix unaligned reads in the tcg/tci.c


From: Anatoly Trosinenko
Subject: Re: [Qemu-devel] [PATCH 0/1] Fix unaligned reads in the tcg/tci.c
Date: Mon, 5 Feb 2018 16:52:19 +0300

Ping.
Patchwork link: http://patchwork.ozlabs.org/patch/866732/
Patchew link:
http://patchew.org/QEMU/address@hidden/

(Initially forgot to add Richard Henderson to CC.)

2018-01-27 16:49 GMT+03:00 Anatoly Trosinenko <address@hidden>
:

> 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


reply via email to

[Prev in Thread] Current Thread [Next in Thread]