[PATCH] hw/arm/smmuv3: Fix addr_mask for range-based invalidation

2020-12-25 Thread Zenghui Yu
When performing range-based IOTLB invalidation, we should decode the TG field into the corresponding translation granule size so that we can pass the correct invalidation range to backend. Set @granule to (tg * 2 + 10) to properly emulate the architecture. Fixes: d52915616c05 ("hw/arm/smmuv3: Get

[PATCH 04/16] tcg/s390x: Add host vector framework

2020-12-25 Thread Richard Henderson
Add registers and function stubs. The functionality is disabled via squashing s390_facilities[2] to 0. We must still include results for the mandatory opcodes in tcg_target_op_def, as all opcodes are checked during tcg init. Signed-off-by: Richard Henderson --- tcg/s390x/tcg-target-conset.h |

[PATCH 07/16] tcg/s390x: Implement tcg_out_dup*_vec

2020-12-25 Thread Richard Henderson
Signed-off-by: Richard Henderson --- tcg/s390x/tcg-target.c.inc | 122 - 1 file changed, 119 insertions(+), 3 deletions(-) diff --git a/tcg/s390x/tcg-target.c.inc b/tcg/s390x/tcg-target.c.inc index 50113dbdd7..808d50190f 100644 --- a/tcg/s390x/tcg-target.c.inc

[PATCH 00/16] tcg/s390x: host vector support

2020-12-25 Thread Richard Henderson
Based-on: 20201217145215.534637-1-richard.hender...@linaro.org ("tcg: Better handling of constants") Based-on: 20201223060204.576856-1-richard.hender...@linaro.org ("tcg: backend constraints cleanup") Once upon a time there were some previous versions, but it was a long time ago and I was too lazy

[PATCH 01/16] tcg/s390x: Rename from tcg/s390

2020-12-25 Thread Richard Henderson
This emphasizes that we don't support s390, only 64-bit s390x hosts. Signed-off-by: Richard Henderson --- meson.build | 2 -- tcg/{s390 => s390x}/tcg-target-conset.h | 0 tcg/{s390 => s390x}/tcg-target-constr.h | 0 tcg/{s390 => s390x}/tcg-target.h| 0 tcg/{s3

[PATCH 15/16] tcg/s390x: Implement TCG_TARGET_HAS_bitsel_vec

2020-12-25 Thread Richard Henderson
Signed-off-by: Richard Henderson --- tcg/s390x/tcg-target-conset.h | 1 + tcg/s390x/tcg-target.h| 2 +- tcg/s390x/tcg-target.c.inc| 20 3 files changed, 22 insertions(+), 1 deletion(-) diff --git a/tcg/s390x/tcg-target-conset.h b/tcg/s390x/tcg-target-conset.h i

[PATCH 02/16] tcg/s390x: Change FACILITY representation

2020-12-25 Thread Richard Henderson
We will shortly need to be able to check facilities beyond the first 64. Instead of explicitly masking against s390_facilities, create a HAVE_FACILITY macro that indexes an array. Reviewed-by: David Hildenbrand Signed-off-by: Richard Henderson --- v2: Change name to HAVE_FACILITY (david) --- t

[PATCH 03/16] tcg/s390x: Merge TCG_AREG0 and TCG_REG_CALL_STACK into TCGReg

2020-12-25 Thread Richard Henderson
They are rightly values in the same enumeration. Reviewed-by: David Hildenbrand Signed-off-by: Richard Henderson --- tcg/s390x/tcg-target.h | 28 +++- 1 file changed, 7 insertions(+), 21 deletions(-) diff --git a/tcg/s390x/tcg-target.h b/tcg/s390x/tcg-target.h index 264

[PATCH 08/16] tcg/s390x: Implement minimal vector operations

2020-12-25 Thread Richard Henderson
Implementing add, sub, and, or, xor as the minimal set. This allows us to actually enable vectors in query_s390_facilities. Signed-off-by: Richard Henderson --- tcg/s390x/tcg-target.c.inc | 154 - 1 file changed, 150 insertions(+), 4 deletions(-) diff --git a

[PATCH 05/16] tcg/s390x: Implement tcg_out_ld/st for vector types

2020-12-25 Thread Richard Henderson
Signed-off-by: Richard Henderson --- tcg/s390x/tcg-target.c.inc | 117 + 1 file changed, 105 insertions(+), 12 deletions(-) diff --git a/tcg/s390x/tcg-target.c.inc b/tcg/s390x/tcg-target.c.inc index 6140385e4e..bae70b9119 100644 --- a/tcg/s390x/tcg-target.c.in

[PATCH 09/16] tcg/s390x: Implement andc, orc, abs, neg, not vector operations

2020-12-25 Thread Richard Henderson
These logical and arithmetic operations are optional but trivial. Signed-off-by: Richard Henderson --- tcg/s390x/tcg-target-conset.h | 1 + tcg/s390x/tcg-target.h| 10 +- tcg/s390x/tcg-target.c.inc| 34 +- 3 files changed, 39 insertions(+), 6

[PATCH 10/16] tcg/s390x: Implement TCG_TARGET_HAS_mul_vec

2020-12-25 Thread Richard Henderson
Signed-off-by: Richard Henderson --- tcg/s390x/tcg-target.h | 2 +- tcg/s390x/tcg-target.c.inc | 7 +++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/tcg/s390x/tcg-target.h b/tcg/s390x/tcg-target.h index f4a1de931a..3f0be23323 100644 --- a/tcg/s390x/tcg-target.h +++ b/tcg/

[PATCH 06/16] tcg/s390x: Implement tcg_out_mov for vector types

2020-12-25 Thread Richard Henderson
Signed-off-by: Richard Henderson --- tcg/s390x/tcg-target.c.inc | 72 +++--- 1 file changed, 68 insertions(+), 4 deletions(-) diff --git a/tcg/s390x/tcg-target.c.inc b/tcg/s390x/tcg-target.c.inc index bae70b9119..50113dbdd7 100644 --- a/tcg/s390x/tcg-target.c.inc

[PATCH 11/16] tcg/s390x: Implement vector shift operations

2020-12-25 Thread Richard Henderson
Signed-off-by: Richard Henderson --- tcg/s390x/tcg-target-conset.h | 1 + tcg/s390x/tcg-target.h| 12 ++--- tcg/s390x/tcg-target.c.inc| 93 ++- 3 files changed, 99 insertions(+), 7 deletions(-) diff --git a/tcg/s390x/tcg-target-conset.h b/tcg/s390x/tc

[PATCH 12/16] tcg/s390x: Implement TCG_TARGET_HAS_minmax_vec

2020-12-25 Thread Richard Henderson
Signed-off-by: Richard Henderson --- tcg/s390x/tcg-target.h | 2 +- tcg/s390x/tcg-target.c.inc | 25 + 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/tcg/s390x/tcg-target.h b/tcg/s390x/tcg-target.h index a97738e525..acea745016 100644 --- a/tcg/s390x/tc

[PATCH 14/16] tcg/s390x: Implement TCG_TARGET_HAS_sat_vec

2020-12-25 Thread Richard Henderson
The unsigned saturations are handled via generic code using min/max. The signed saturations are expanded using double-sized arithmetic and a saturating pack. Since all operations are done via expansion, do not actually set TCG_TARGET_HAS_sat_vec. Signed-off-by: Richard Henderson --- tcg/s390x/

[PATCH 16/16] tcg/s390x: Implement TCG_TARGET_HAS_cmpsel_vec

2020-12-25 Thread Richard Henderson
This is via expansion; don't actually set TCG_TARGET_HAS_cmpsel_vec. Signed-off-by: Richard Henderson --- tcg/s390x/tcg-target.c.inc | 24 +++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/tcg/s390x/tcg-target.c.inc b/tcg/s390x/tcg-target.c.inc index 251287dd

[PATCH 13/16] tcg: Expand usadd/ussub with umin/umax

2020-12-25 Thread Richard Henderson
For usadd, we only have to consider overflow. Since ~B + B == -1, the maximum value for A that saturates is ~B. For ussub, we only have to consider underflow. The minimum value that saturates to 0 from A - B is B. Signed-off-by: Richard Henderson --- tcg/tcg-op-vec.c | 37

[PATCH 2/3] sam460ex: Drop unneeded dependencies

2020-12-25 Thread BALATON Zoltan via
Remove dependencies from KConfig that are not actually needed. Signed-off-by: BALATON Zoltan --- hw/ppc/Kconfig | 2 -- 1 file changed, 2 deletions(-) diff --git a/hw/ppc/Kconfig b/hw/ppc/Kconfig index 8548f42b0d..5893f80909 100644 --- a/hw/ppc/Kconfig +++ b/hw/ppc/Kconfig @@ -55,7 +55,6 @@ con

[PATCH 1/3] ppc4xx: Move common dependency on serial to common option

2020-12-25 Thread BALATON Zoltan via
All machines that select SERIAL also select PPC4XX so we can just add this common dependency there once. Signed-off-by: BALATON Zoltan --- hw/ppc/Kconfig | 5 + 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/hw/ppc/Kconfig b/hw/ppc/Kconfig index dd86e664d2..8548f42b0d 100644 --

[PATCH 0/3] Clean up sam460ex irq mapping

2020-12-25 Thread BALATON Zoltan via
This cleans up irq mapping in sam460ex inspired by similar changes to other machines recently although there's no known or noticable problem that this fixes. The first two patches are just simplifying dependencies in Kconfig that I've noticed during writing the patch. Regards, BALATON Zoltan BALA

[PATCH 3/3] sam460ex: Clean up irq mapping

2020-12-25 Thread BALATON Zoltan via
Avoid mapping multiple interrupts to the same irq. Instead map them to the 4 PCI interrupts and use an or-gate in the board to connect them to the interrupt controller. This does not fix any known problem but does not seem to cause a new problem either and may be cleaner at least. Signed-off-by: B

Re: Problems with irq mapping in qemu v5.2

2020-12-25 Thread BALATON Zoltan via
On Tue, 22 Dec 2020, Guenter Roeck wrote: On 12/22/20 10:23 AM, Mark Cave-Ayland wrote: On 22/12/2020 16:16, Guenter Roeck wrote: Hi, commit 459ca8bfa41 ("pci: Assert irqnum is between 0 and bus->nirqs in pci_bus_change_irq_level") added sanity checks to the interrupt number passed to pci_bus

Re: [PATCH] hw/arm/smmuv3: Fix addr_mask for range-based invalidation

2020-12-25 Thread Zenghui Yu
On 2020/12/25 17:50, Zenghui Yu wrote: @@ -821,6 +821,8 @@ static void smmuv3_notify_iova(IOMMUMemoryRegion *mr, return; } granule = tt->granule_sz; +} else { +guanule = tg * 2 + 10; I'm embarrassed about that. s/guanule/granule/ }

Re: [PATCH v2 1/2] ramlist: Make dirty bitmap blocks of ramlist resizable

2020-12-25 Thread Keqian Zhu
[...] >>> -for (j = old_num_blocks; j < new_num_blocks; j++) { >>> -new_blocks->blocks[j] = bitmap_new(DIRTY_MEMORY_BLOCK_SIZE); >>> +if (extend) { >>> +for (j = cpy_num_blocks; j < new_num_blocks; j++) { >>> +new_blocks->blocks[j] = >>> b