Re: [Qemu-devel] [PATCH v2] Improve the alignment check infrastructure

2016-06-23 Thread Richard Henderson
On 06/23/2016 11:21 AM, Sergey Sorokin wrote: Yes, I thought about it. tcg_canonicalize_memop() is good place too. But do you think that get_alignment_bits() is not good enough? I think the earlier a target-* translator problem is diagnosed the better. Leaving things in get_alignment_bits is o

Re: [Qemu-devel] [PATCH v2] Improve the alignment check infrastructure

2016-06-23 Thread Sergey Sorokin
Yes, I thought about it. tcg_canonicalize_memop() is good place too. But do you think that get_alignment_bits() is not good enough? 23.06.2016, 19:13, "Richard Henderson" : > On 06/23/2016 07:13 AM, Sergey Sorokin wrote: >>>  I think we ought to check this in tcg-op.c, rather than wait until >>>

Re: [Qemu-devel] [PATCH v2] Improve the alignment check infrastructure

2016-06-23 Thread Richard Henderson
On 06/23/2016 07:13 AM, Sergey Sorokin wrote: I think we ought to check this in tcg-op.c, rather than wait until generating code in the backend. I think it's better to check this in one place in get_alignment_bits() function because there can be a direct call of helpers from softmmu_template.h

Re: [Qemu-devel] [PATCH v2] Improve the alignment check infrastructure

2016-06-23 Thread Sergey Sorokin
I have sentA the third version of the patch.

Re: [Qemu-devel] [PATCH v2] Improve the alignment check infrastructure

2016-06-23 Thread Sergey Sorokin
A A 23.06.2016, 17:05, "Richard Henderson" : On 06/23/2016 03:03 AM, Sergey Sorokin wrote: A So what's wrong in this part of the patch? I think I just misread it. A It happens :) A A 22.06.2016, 18:50, "Richard Henderson" : On 06/22/2016 05:37 A

Re: [Qemu-devel] [PATCH v2] Improve the alignment check infrastructure

2016-06-23 Thread Richard Henderson
On 06/23/2016 03:03 AM, Sergey Sorokin wrote: So what's wrong in this part of the patch? I think I just misread it. 22.06.2016, 20:12, "Richard Henderson" : On 06/22/2016 09:30 AM, Sergey Sorokin wrote: diff --git a/tcg/ppc/tcg-target.inc.c b/tcg/ppc/tcg-target.inc.c index da1

Re: [Qemu-devel] [PATCH v2] Improve the alignment check infrastructure

2016-06-23 Thread Sergey Sorokin
So what's wrong in this part of the patch? 22.06.2016, 20:12, "Richard Henderson" : > On 06/22/2016 09:30 AM, Sergey Sorokin wrote: >>>   diff --git a/tcg/ppc/tcg-target.inc.c b/tcg/ppc/tcg-target.inc.c >>>   index da10052..3dc38fa 100644 >>>   --- a/tcg/ppc/tcg-target.inc.c >>>   

Re: [Qemu-devel] [PATCH v2] Improve the alignment check infrastructure

2016-06-22 Thread Richard Henderson
On 06/22/2016 09:30 AM, Sergey Sorokin wrote: >> diff --git a/tcg/ppc/tcg-target.inc.c b/tcg/ppc/tcg-target.inc.c >> index da10052..3dc38fa 100644 >> --- a/tcg/ppc/tcg-target.inc.c >> +++ b/tcg/ppc/tcg-target.inc.c >> @@ -1399,6 +1399,7 @@ static TCGReg tcg_out_tlb_read(TCG

Re: [Qemu-devel] [PATCH v2] Improve the alignment check infrastructure

2016-06-22 Thread Sergey Sorokin
A A 22.06.2016, 18:50, "Richard Henderson" : On 06/22/2016 05:37 AM, Sergey Sorokin wrote: A +/* Use this mask to check interception with an alignment mask A + * in a TCG backend. A + */ A +#define TLB_FLAGS_MASK (TLB_INVALID_MASK | TLB_NOTDIRTY | TLB_MMIO

Re: [Qemu-devel] [PATCH v2] Improve the alignment check infrastructure

2016-06-22 Thread Richard Henderson
On 06/22/2016 05:37 AM, Sergey Sorokin wrote: > +/* Use this mask to check interception with an alignment mask > + * in a TCG backend. > + */ > +#define TLB_FLAGS_MASK (TLB_INVALID_MASK | TLB_NOTDIRTY | TLB_MMIO) I think we ought to check this in tcg-op.c, rather than wait until generating code i

[Qemu-devel] [PATCH v2] Improve the alignment check infrastructure

2016-06-22 Thread Sergey Sorokin
Some architectures (e.g. ARMv8) need the address which is aligned to a size more than the size of the memory access. To support such check it's enough the current costless alignment check implementation in QEMU, but we need to support an alignment size specifying. Signed-off-by: Sergey Sorokin --