Re: [Qemu-devel] [PATCH 1/1] tci: eliminate UB due to unaligned reads

2018-03-12 Thread Richard Henderson
On 03/03/2018 05:41 PM, Stefan Weil wrote: > Richard, the discussion about non-portable calls to helper functions is > not new, but I still have no test case which fails. Do you think of a > special case (architecture, helper function)? The two that come to mind immediately are: i386 with a

Re: [Qemu-devel] [PATCH 1/1] tci: eliminate UB due to unaligned reads

2018-03-03 Thread Anatoly Trosinenko
2018-03-03 18:41 GMT+03:00 Stefan Weil : > Am 03.03.2018 um 15:07 schrieb Anatoly Trosinenko: > > Can rewriting TCI in such a way that every operation is aligned at 4- or > > even 8-byte boundary fix the situation or are there some more serious > > problems? > > That's my

Re: [Qemu-devel] [PATCH 1/1] tci: eliminate UB due to unaligned reads

2018-03-03 Thread Stefan Weil
Am 03.03.2018 um 15:07 schrieb Anatoly Trosinenko: > Can rewriting TCI in such a way that every operation is aligned at 4- or > even 8-byte boundary fix the situation or are there some more serious > problems? That's my preferred solution. Are there cases which would require 8-byte alignment?

Re: [Qemu-devel] [PATCH 1/1] tci: eliminate UB due to unaligned reads

2018-03-03 Thread Anatoly Trosinenko
> So. Why do you want to use TCI instead of a native TCG backend? Frankly speaking, personally I just have a strange experiment on porting QEMU to JavaScript. :) I used the TCI bytecode as some intermediate patchable form for rarely executing BBs and for (re)generating asm.js from it when

Re: [Qemu-devel] [PATCH 1/1] tci: eliminate UB due to unaligned reads

2018-03-03 Thread Richard Henderson
On 03/03/2018 06:07 AM, Anatoly Trosinenko wrote: > Can rewriting TCI in such a way that every operation is aligned at 4- or even > 8-byte boundary fix the situation or are there some more serious problems? With the current TCI, there are also problems with calls to helper functions. The only

Re: [Qemu-devel] [PATCH 1/1] tci: eliminate UB due to unaligned reads

2018-03-03 Thread Anatoly Trosinenko
Can rewriting TCI in such a way that every operation is aligned at 4- or even 8-byte boundary fix the situation or are there some more serious problems? 2018-03-03 16:57 GMT+03:00 Richard Henderson : > On 03/03/2018 12:54 AM, Anatoly Trosinenko wrote: > > Ping. > > Patchwork

Re: [Qemu-devel] [PATCH 1/1] tci: eliminate UB due to unaligned reads

2018-03-03 Thread Richard Henderson
On 03/03/2018 12:54 AM, Anatoly Trosinenko wrote: > Ping. > Patchwork link: http://patchwork.ozlabs.org/patch/866732/ > > Patchew link: > http://patchew.org/QEMU/20180127134908.24095-1-anatoly.trosine...@gmail.com/ >

Re: [Qemu-devel] [PATCH 1/1] tci: eliminate UB due to unaligned reads

2018-03-03 Thread Anatoly Trosinenko
Ping. Patchwork link: http://patchwork.ozlabs.org/patch/866732/ Patchew link: http://patchew.org/QEMU/20180127134908.24095-1-anatoly. trosine...@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

Re: [Qemu-devel] [PATCH 1/1] tci: eliminate UB due to unaligned reads

2018-02-19 Thread Anatoly Trosinenko
Ping. Patchwork link: http://patchwork.ozlabs.org/patch/866732/ Patchew link: http://patchew.org/QEMU/20180127134908.24095-1- anatoly.trosine...@gmail.com/ Original cover letter: The code in tcg/tci.c reads some data from TCI bytecode through pointer dereferencing. As far as I know unaligned

Re: [Qemu-devel] [PATCH 1/1] tci: eliminate UB due to unaligned reads

2018-01-27 Thread Anatoly Trosinenko
My patch is kind of trivial quick fix that just eliminates these unaligned reads and doesn't seem to require complicated testing supposing my code properly handles integer promotion (and hope it will not slow the interpreter down). Aligning everything, on the other hand, can not only remove the

Re: [Qemu-devel] [PATCH 1/1] tci: eliminate UB due to unaligned reads

2018-01-27 Thread Stefan Weil
Am 27.01.2018 um 14:49 schrieb Anatoly Trosinenko: > Use ldl_he_p / ldq_he_p functions instead of a plain memory access > through pointer. > > Signed-off-by: Anatoly Trosinenko > --- > tcg/tci.c | 16 +++- > 1 file changed, 11 insertions(+), 5

[Qemu-devel] [PATCH 1/1] tci: eliminate UB due to unaligned reads

2018-01-27 Thread Anatoly Trosinenko
Use ldl_he_p / ldq_he_p functions instead of a plain memory access through pointer. Signed-off-by: Anatoly Trosinenko --- tcg/tci.c | 16 +++- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/tcg/tci.c b/tcg/tci.c index