[PULL 19/30] iotests: Backup with different source/target size

2020-05-08 Thread Kevin Wolf
This tests that the backup job catches situations where the target node has a different size than the source node. It must also forbid resize operations when the job is already running. Signed-off-by: Kevin Wolf Message-Id: <20200430142755.315494-5-kw...@redhat.com> Reviewed-by: Vladimir Sementso

[PATCH 1/7] virtio-net: implement RSS configuration command

2020-05-08 Thread Yuri Benditovich
Optionally report RSS feature. Handle RSS configuration command and keep RSS parameters in virtio-net device context. Signed-off-by: Yuri Benditovich --- hw/net/trace-events| 3 + hw/net/virtio-net.c| 167 +++-- include/hw/virtio/virtio-net.h

[PULL 14/30] vmdk: Flush only once in vmdk_L2update()

2020-05-08 Thread Kevin Wolf
If we have a backup L2 table, we currently flush once after writing to the active L2 table and again after writing to the backup table. A single flush is enough and makes things a little less slow. Signed-off-by: Kevin Wolf Message-Id: <20200430133007.170335-6-kw...@redhat.com> Reviewed-by: Eric

Re: [PATCH v2 1/3] target: Remove unnecessary CPU() cast

2020-05-08 Thread Markus Armbruster
Philippe Mathieu-Daudé writes: > The CPU() macro is defined as: > > #define CPU(obj) ((CPUState *)(obj)) > > which expands to: > > ((CPUState *)object_dynamic_cast_assert((Object *)(obj), (name), > __FILE__, __LINE__, __func__)) > > This assertion can

[PULL 21/30] qcow2: Fix preallocation on block devices

2020-05-08 Thread Kevin Wolf
From: Max Reitz Calling bdrv_getlength() to get the pre-truncate file size will not really work on block devices, because they have always the same length, and trying to write beyond it will fail with a rather cryptic error message. Instead, we should use qcow2_get_last_cluster() and bdrv_getlen

[PATCH 3/7] tap: allow extended virtio header with hash info

2020-05-08 Thread Yuri Benditovich
Signed-off-by: Yuri Benditovich --- net/tap.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/net/tap.c b/net/tap.c index 6207f61f84..ca48f2a285 100644 --- a/net/tap.c +++ b/net/tap.c @@ -254,7 +254,8 @@ static void tap_set_vnet_hdr_len(NetClientState *nc, int len) a

[PATCH 0/7] reference implementation of RSS and hash report

2020-05-08 Thread Yuri Benditovich
Support for VIRTIO_NET_F_RSS and VIRTIO_NET_F_HASH_REPORT features in QEMU for reference purpose. Implements Toeplitz hash calculation for incoming packets according to configuration provided by driver. Uses calculated hash for decision on receive virtqueue and/or reports the hash in the virtio hea

[PULL 29/30] vhdx: Rework truncation logic

2020-05-08 Thread Kevin Wolf
From: Eric Blake The vhdx driver uses truncation for image growth, with a special case for blocks that already read as zero but which are only being partially written. But with a bit of rearranging, it's just as easy to defer the decision on whether truncation resulted in zeroes to the actual al

[PULL 18/30] backup: Make sure that source and target size match

2020-05-08 Thread Kevin Wolf
Since the introduction of a backup filter node in commit 00e30f05d, the backup block job crashes when the target image is smaller than the source image because it will try to write after the end of the target node without having BLK_PERM_RESIZE. (Previously, the BlockBackend layer would have caught

[PATCH 4/7] virtio-net: reference implementation of hash report

2020-05-08 Thread Yuri Benditovich
Suggest VIRTIO_NET_F_HASH_REPORT if specified in device parameters. If the VIRTIO_NET_F_HASH_REPORT is set, the device extends configuration space. If the feature is negotiated, the packet layout is extended to accomodate the hash information. In this case deliver packet's hash value and report typ

[PULL 27/30] ssh: Support BDRV_REQ_ZERO_WRITE for truncate

2020-05-08 Thread Kevin Wolf
From: Eric Blake Our .bdrv_has_zero_init_truncate can detect when the remote side always zero fills; we can reuse that same knowledge to implement BDRV_REQ_ZERO_WRITE by ignoring it when the server gives it to us for free. Signed-off-by: Eric Blake Message-Id: <20200428202905.770727-7-ebl...@re

[PATCH v8 2/7] virtio-net: implement RX RSS processing

2020-05-08 Thread Yuri Benditovich
If VIRTIO_NET_F_RSS negotiated and RSS is enabled, process incoming packets, calculate packet's hash and place the packet into respective RX virtqueue. Signed-off-by: Yuri Benditovich --- hw/net/virtio-net.c| 88 +- include/hw/virtio/virtio-net.h | 1

[PATCH 6/7] virtio-net: add migration support for RSS and hash report

2020-05-08 Thread Yuri Benditovich
Save and restore RSS/hash report configuration. Signed-off-by: Yuri Benditovich --- hw/net/virtio-net.c | 37 + 1 file changed, 37 insertions(+) diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c index 5facd333ce..c263b1511d 100644 --- a/hw/net/virtio-net

Re: [PATCH v3 1/2] io/channel: fix crash when qio_channel_readv_all return 0

2020-05-08 Thread Li Feng
Marc-André Lureau 于2020年5月8日周五 下午8:32写道: > > Hi > > On Fri, May 8, 2020 at 7:14 AM Li Feng wrote: > > > > Root cause: > > From `man recvmsg`, the RETURN VALUE says: > > These calls return the number of bytes received, or -1 if an error > > occurred. > > In the event of an error, errno is set to

[PATCH v8 6/7] virtio-net: add migration support for RSS and hash report

2020-05-08 Thread Yuri Benditovich
Save and restore RSS/hash report configuration. Signed-off-by: Yuri Benditovich --- hw/net/virtio-net.c | 37 + 1 file changed, 37 insertions(+) diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c index 5facd333ce..c263b1511d 100644 --- a/hw/net/virtio-net

Re: [PATCH v2 2/3] various: Remove unnecessary OBJECT() cast

2020-05-08 Thread Markus Armbruster
Philippe Mathieu-Daudé writes: > The OBJECT() macro is defined as: > > #define OBJECT(obj) ((Object *)(obj)) > > which expands to: > > ((Object *)object_dynamic_cast_assert((Object *)(obj), (name), > __FILE__, __LINE__, __func__)) Nope :) > This asser

Re: [PATCH 0/7] reference implementation of RSS and hash report

2020-05-08 Thread Yuri Benditovich
Please ignore mistaken v7 instead of v8 On Fri, May 8, 2020 at 3:54 PM Yuri Benditovich wrote: > Support for VIRTIO_NET_F_RSS and VIRTIO_NET_F_HASH_REPORT > features in QEMU for reference purpose. > Implements Toeplitz hash calculation for incoming > packets according to configuration provided b

Re: [PATCH v2 3/3] hw: Remove unnecessary DEVICE() cast

2020-05-08 Thread Markus Armbruster
Philippe Mathieu-Daudé writes: > The DEVICE() macro is defined as: > > #define DEVICE(obj) OBJECT_CHECK(DeviceState, (obj), TYPE_DEVICE) > > which expands to: > > ((DeviceState *)object_dynamic_cast_assert((Object *)(obj), (name), > __FILE__, __LIN

RE: [PATCH v6 2/8] fw_cfg: Write the extra roots into the fw_cfg

2020-05-08 Thread miaoyubo
> -Original Message- > From: Michael S. Tsirkin [mailto:m...@redhat.com] > Sent: Monday, May 4, 2020 10:03 PM > To: miaoyubo > Cc: peter.mayd...@linaro.org; shannon.zha...@gmail.com; > ler...@redhat.com; imamm...@redhat.com; qemu-devel@nongnu.org; > berra...@redhat.com; Xiexiangyou > Subj

[PATCH v8 0/7] reference implementation of RSS and hash report

2020-05-08 Thread Yuri Benditovich
Support for VIRTIO_NET_F_RSS and VIRTIO_NET_F_HASH_REPORT features in QEMU for reference purpose. Implements Toeplitz hash calculation for incoming packets according to configuration provided by driver. Uses calculated hash for decision on receive virtqueue and/or reports the hash in the virtio hea

[PATCH 2/7] virtio-net: implement RX RSS processing

2020-05-08 Thread Yuri Benditovich
If VIRTIO_NET_F_RSS negotiated and RSS is enabled, process incoming packets, calculate packet's hash and place the packet into respective RX virtqueue. Signed-off-by: Yuri Benditovich --- hw/net/virtio-net.c| 88 +- include/hw/virtio/virtio-net.h | 1

[PATCH 5/7] vmstate.h: provide VMSTATE_VARRAY_UINT16_ALLOC macro

2020-05-08 Thread Yuri Benditovich
Similar to VMSTATE_VARRAY_UINT32_ALLOC, but the size is 16-bit field. Signed-off-by: Michael S. Tsirkin Signed-off-by: Yuri Benditovich --- include/migration/vmstate.h | 10 ++ 1 file changed, 10 insertions(+) diff --git a/include/migration/vmstate.h b/include/migration/vmstate.h index

Re: [PATCH v4 00/34] Configurable policy for handling deprecated interfaces

2020-05-08 Thread Markus Armbruster
Peter Krempa writes: > On Tue, Mar 17, 2020 at 12:54:25 +0100, Markus Armbruster wrote: >> This series extends QMP introspection to cover deprecation. >> Additionally, new option -compat lets you configure what to do when >> deprecated interfaces get used. This is intended for testing users of >

[PATCH 7/7] virtio-net: align RSC fields with updated virtio-net header

2020-05-08 Thread Yuri Benditovich
Removal of duplicated RSC definitions. Changing names of the fields to ones defined in the Linux header. Signed-off-by: Yuri Benditovich --- hw/net/virtio-net.c | 28 1 file changed, 4 insertions(+), 24 deletions(-) diff --git a/hw/net/virtio-net.c b/hw/net/virtio-n

[PATCH v8 1/7] virtio-net: implement RSS configuration command

2020-05-08 Thread Yuri Benditovich
Optionally report RSS feature. Handle RSS configuration command and keep RSS parameters in virtio-net device context. Signed-off-by: Yuri Benditovich --- hw/net/trace-events| 3 + hw/net/virtio-net.c| 167 +++-- include/hw/virtio/virtio-net.h

[PATCH v8 7/7] virtio-net: align RSC fields with updated virtio-net header

2020-05-08 Thread Yuri Benditovich
Removal of duplicated RSC definitions. Changing names of the fields to ones defined in the Linux header. Signed-off-by: Yuri Benditovich --- hw/net/virtio-net.c | 28 1 file changed, 4 insertions(+), 24 deletions(-) diff --git a/hw/net/virtio-net.c b/hw/net/virtio-n

Re: [PATCH v2 2/3] various: Remove unnecessary OBJECT() cast

2020-05-08 Thread Philippe Mathieu-Daudé
On 5/8/20 2:49 PM, Markus Armbruster wrote: Philippe Mathieu-Daudé writes: The OBJECT() macro is defined as: #define OBJECT(obj) ((Object *)(obj)) which expands to: ((Object *)object_dynamic_cast_assert((Object *)(obj), (name), __FILE__, __LINE

[PATCH v8 3/7] tap: allow extended virtio header with hash info

2020-05-08 Thread Yuri Benditovich
Signed-off-by: Yuri Benditovich --- net/tap.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/net/tap.c b/net/tap.c index 6207f61f84..ca48f2a285 100644 --- a/net/tap.c +++ b/net/tap.c @@ -254,7 +254,8 @@ static void tap_set_vnet_hdr_len(NetClientState *nc, int len) a

RE: [PATCH v6 4/8] acpi: Refactor the source of host bridge and build tables for pxb

2020-05-08 Thread miaoyubo
Thanks so much for such a careful review!! > -Original Message- > From: Michael S. Tsirkin [mailto:m...@redhat.com] > Sent: Monday, May 4, 2020 10:01 PM > To: miaoyubo > Cc: peter.mayd...@linaro.org; shannon.zha...@gmail.com; > ler...@redhat.com; imamm...@redhat.com; qemu-devel@nongnu.org

[PATCH v8 4/7] virtio-net: reference implementation of hash report

2020-05-08 Thread Yuri Benditovich
Suggest VIRTIO_NET_F_HASH_REPORT if specified in device parameters. If the VIRTIO_NET_F_HASH_REPORT is set, the device extends configuration space. If the feature is negotiated, the packet layout is extended to accomodate the hash information. In this case deliver packet's hash value and report typ

[PATCH v8 5/7] vmstate.h: provide VMSTATE_VARRAY_UINT16_ALLOC macro

2020-05-08 Thread Yuri Benditovich
Similar to VMSTATE_VARRAY_UINT32_ALLOC, but the size is 16-bit field. Signed-off-by: Michael S. Tsirkin Signed-off-by: Yuri Benditovich --- include/migration/vmstate.h | 10 ++ 1 file changed, 10 insertions(+) diff --git a/include/migration/vmstate.h b/include/migration/vmstate.h index

Re: [PATCH] tests/acceptance/boot_linux: Skip slow Aarch64 'virt' machine TCG test

2020-05-08 Thread Philippe Mathieu-Daudé
On 5/7/20 10:32 PM, Alex Bennée wrote: Peter Maydell writes: On Thu, 7 May 2020 at 19:38, Alex Bennée wrote: Philippe Mathieu-Daudé writes: The BootLinuxAarch64.test_virt_tcg is reported to take >7min to run. Add a possibility to users to skip this particular test, by setting the AVOCA

RE: [PATCH v6 5/8] acpi: Align the size to 128k

2020-05-08 Thread miaoyubo
> -Original Message- > From: Michael S. Tsirkin [mailto:m...@redhat.com] > Sent: Monday, May 4, 2020 10:03 PM > To: miaoyubo > Cc: peter.mayd...@linaro.org; shannon.zha...@gmail.com; > ler...@redhat.com; imamm...@redhat.com; qemu-devel@nongnu.org; > berra...@redhat.com; Xiexiangyou > S

Re: [PATCH v2] ui/sdl2: fix segment fault caused by null pointer dereference

2020-05-08 Thread Changbin Du
hello, is this ready to merge now? On Mon, Apr 27, 2020 at 09:24:12PM +0800, Changbin Du wrote: > I found SDL_GetWindowFromID() sometimes return NULL when I start qemu via > ssh forwarding even the window has been crated already. I am not sure > whether this is a bug of SDL, but we'd better check

Re: Emulating Solaris 10 on SPARC64 sun4u

2020-05-08 Thread Artyom Tarasenko
On Fri, May 8, 2020 at 10:51 AM Peter Tribble wrote: > > I see the same behaviour as reported here when booting current SPARC illumos > (illumos is the ongoing fork of OpenSolaris) under qemu - looks like it's > booted > up fine, but I can't type anything on the console. There is one more option

Re: [PATCH] cpus: Fix botched configure_icount() error API violation fix

2020-05-08 Thread Eric Blake
On 5/8/20 5:49 AM, Markus Armbruster wrote: Fixes: abc9bf69a66a11499a801ff545b8fe7adbb3a04c Fixes: Coverity CID 1428754 Signed-off-by: Markus Armbruster --- cpus.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Reviewed-by: Eric Blake diff --git a/cpus.c b/cpus.c index 5670c96bcf

Re: [PATCH v2 2/6] blockdev: Split off basic bitmap operations for qemu-img

2020-05-08 Thread Eric Blake
On 5/8/20 6:37 AM, Kevin Wolf wrote: --- Makefile.objs | 2 +- include/sysemu/blockdev.h | 14 ++ blockbitmaps.c| 324 ++ Hm. Can we get a better name? blockdev-bitmaps.c, for example? Sure, I'm open to bike-shed suggesti

Re: [PATCH 2/5] virtio-iommu: Implement RESV_MEM probe request

2020-05-08 Thread Auger Eric
Hi Jean, On 5/8/20 11:26 AM, Jean-Philippe Brucker wrote: > On Thu, May 07, 2020 at 04:31:58PM +0200, Eric Auger wrote: >> +static ssize_t virtio_iommu_fill_resv_mem_prop(VirtIOIOMMU *s, uint32_t ep, >> + uint8_t *buf, size_t free) >> +{ >> +struct

Re: [PATCH] ppc/pnv: Fix NMI system reset SRR1 value

2020-05-08 Thread Cédric Le Goater
>> of a pending interrupt. It occurs on a SMP PowerNV machine when it is >> stressed with IO, such as scp of a big file. >> >> I am suspecting more and more an issue with an interrupt being handled >> when the CPU is coming out of idle. I haven't seen anything wrong in > > So you can't hit it w

Re: [PATCH] qom/object: Fix object_child_foreach_recursive() return value

2020-05-08 Thread Cédric Le Goater
Hello, On 4/4/20 5:33 PM, Cédric Le Goater wrote: > When recursing, the return value of do_object_child_foreach() is not > taken into account. > > Cc: Peter Crosthwaite > Fixes: d714b8de7747 ("qom: Add recursive version of object_child_for_each") > Signed-off-by: Cédric Le Goater What are the

Re: [PATCH v3] aspeed: Add boot stub for smp booting

2020-05-08 Thread Cédric Le Goater
On 5/8/20 8:52 AM, Joel Stanley wrote: > On Mon, 4 May 2020 at 08:20, Joel Stanley wrote: > ... > >> v3: Use WFI instead of WFE >> v2: test for number of CPUs > >> +static void aspeed_write_smpboot(ARMCPU *cpu, >> + const struct arm_boot_info *info) >> +{ >> +

[Bug 1877526] Re: KVM internal crash

2020-05-08 Thread Thomas Huth
RHEL 6.6 and qemu-kvm 0.12 are *very* old, can't you update the machine to a newer version? At least RHEL 6.10, or even better RHEL 7 or 8? ** Changed in: qemu Status: New => Incomplete -- You received this bug notification because you are a member of qemu- devel-ml, which is subscribed t

[PATCH v3 01/10] tcg: Implement gvec support for rotate by immediate

2020-05-08 Thread Richard Henderson
No host backend support yet, but the interfaces for rotli are in place. Canonicalize immediate rotate to the left, based on a survey of architectures, but provide both left and right shift interfaces to the translators. Reviewed-by: Alex Bennée Signed-off-by: Richard Henderson --- accel/tcg/tc

[PATCH v3 00/10] tcg vector rotate operations

2020-05-08 Thread Richard Henderson
Split out from the v2 omnibus patch from 21 Apr. No real changes, just a rebase on master. r~ Richard Henderson (10): tcg: Implement gvec support for rotate by immediate tcg: Implement gvec support for rotate by vector tcg: Remove expansion to shift by vector from do_shifts tcg: Impleme

Re: [PULL 00/30] Block layer patches

2020-05-08 Thread Peter Maydell
On Fri, 8 May 2020 at 13:41, Kevin Wolf wrote: > > The following changes since commit 1b8c45899715d292398152ba97ef755ccaf84680: > > Merge remote-tracking branch > 'remotes/dgilbert/tags/pull-migration-20200507a' into staging (2020-05-07 > 18:43:20 +0100) > > are available in the Git repository

[PATCH v3 08/10] target/ppc: Use tcg_gen_gvec_rotlv

2020-05-08 Thread Richard Henderson
Cc: David Gibson Signed-off-by: Richard Henderson --- target/ppc/helper.h | 4 target/ppc/int_helper.c | 17 - target/ppc/translate/vmx-impl.inc.c | 8 3 files changed, 4 insertions(+), 25 deletions(-) diff --git a/target/ppc/helper.h

[PATCH v3 04/10] tcg: Implement gvec support for rotate by scalar

2020-05-08 Thread Richard Henderson
No host backend support yet, but the interfaces for rotls are in place. Only implement left-rotate for now, as the only known use of vector rotate by scalar is s390x, so any right-rotate would be unused and untestable. Reviewed-by: Alex Bennée Signed-off-by: Richard Henderson --- include/tcg/t

[PATCH v3 05/10] tcg/i386: Implement INDEX_op_rotl{i,s,v}_vec

2020-05-08 Thread Richard Henderson
For immediates, we must continue the special casing of 8-bit elements. The other element sizes and shift types are trivially implemented with shifts. Signed-off-by: Richard Henderson --- tcg/i386/tcg-target.inc.c | 116 -- 1 file changed, 100 insertions(+), 1

[PATCH v3 02/10] tcg: Implement gvec support for rotate by vector

2020-05-08 Thread Richard Henderson
No host backend support yet, but the interfaces for rotlv and rotrv are in place. Reviewed-by: Alex Bennée Signed-off-by: Richard Henderson --- v3: Drop the generic expansion from rot to shift; we can do better for each backend, and then this code becomes unused. --- accel/tcg/tcg-runtime.h

[PATCH v3 07/10] tcg/ppc: Implement INDEX_op_rot[lr]v_vec

2020-05-08 Thread Richard Henderson
We already had support for rotlv, using a target-specific opcode; convert to use the generic opcode. Handle rotrv via simple negation. Signed-off-by: Richard Henderson --- tcg/ppc/tcg-target.h | 2 +- tcg/ppc/tcg-target.opc.h | 1 - tcg/ppc/tcg-target.inc.c | 23 +++ 3

[PATCH v3 03/10] tcg: Remove expansion to shift by vector from do_shifts

2020-05-08 Thread Richard Henderson
We do not reflect this expansion in tcg_can_emit_vecop_list, so it is unused and unusable. However, we actually perform the same expansion in do_gvec_shifts, so it is also unneeded. Signed-off-by: Richard Henderson --- tcg/tcg-op-vec.c | 35 +++ 1 file changed, 1

[PATCH v3 06/10] tcg/aarch64: Implement INDEX_op_rotl{i,v}_vec

2020-05-08 Thread Richard Henderson
For immediate rotate , we can implement this in two instructions, using SLI. For variable rotate, the oddness of aarch64 right-shift- as-negative-left-shift means a backend-specific expansion works best. Signed-off-by: Richard Henderson --- tcg/aarch64/tcg-target.opc.h | 1 + tcg/aarch64/tcg-t

[PATCH v3 09/10] target/s390x: Use tcg_gen_gvec_rotl{i,s,v}

2020-05-08 Thread Richard Henderson
Merge VERLL and VERLLV into op_vesv and op_ves, alongside all of the other vector shift operations. Cc: David Hildenbrand Signed-off-by: Richard Henderson --- target/s390x/helper.h | 4 -- target/s390x/translate_vx.inc.c | 66 + target/s390x/vec_int_he

[PATCH v3 10/10] tcg: Improve move ops in liveness_pass_2

2020-05-08 Thread Richard Henderson
If the output of the move is dead, then the last use is in the store. If we propagate the input to the store, then we can remove the move opcode entirely. Signed-off-by: Richard Henderson --- tcg/tcg.c | 78 +++ 1 file changed, 56 insertions(+

[PATCH v3 03/19] tcg: Introduce TYPE_CONST temporaries

2020-05-08 Thread Richard Henderson
These will hold a single constant for the duration of the TB. They are hashed, so that each value has one temp across the TB. Not used yet, this is all infrastructure. Signed-off-by: Richard Henderson --- include/tcg/tcg.h | 27 +++- tcg/optimize.c| 13 +++- tcg/tcg-op-vec.c | 17 ++

[PATCH v3 00/19] tcg: Better handling of constants

2020-05-08 Thread Richard Henderson
V3 fixes the target/sparc regression during register allocation. V1 blurb: This promotes constants to full-fledged temporaries, which are then hashed so we have only a single copy across the TB. If an opcode requires forcing one into a register, then we will only do this once -- at least until t

[PATCH v3 01/19] tcg: Consolidate 3 bits into enum TCGTempKind

2020-05-08 Thread Richard Henderson
The temp_fixed, temp_global, temp_local bits are all related. Combine them into a single enumeration. Signed-off-by: Richard Henderson --- include/tcg/tcg.h | 20 +--- tcg/optimize.c| 8 +-- tcg/tcg.c | 122 -- 3 files changed, 90 in

[PATCH v3 06/19] tcg: Use tcg_constant_{i32, vec} with tcg vec expanders

2020-05-08 Thread Richard Henderson
Signed-off-by: Richard Henderson --- tcg/tcg-op-vec.c | 63 ++-- 1 file changed, 34 insertions(+), 29 deletions(-) diff --git a/tcg/tcg-op-vec.c b/tcg/tcg-op-vec.c index 43101defe4..0e3e80a612 100644 --- a/tcg/tcg-op-vec.c +++ b/tcg/tcg-op-vec.c @@ -23

[PATCH v3 02/19] tcg: Add temp_readonly

2020-05-08 Thread Richard Henderson
In most, but not all, places that we check for TEMP_FIXED, we are really testing that we do not modify the temporary. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- include/tcg/tcg.h | 5 + tcg/tcg.c | 21 ++--- 2 files changed, 15 insertio

[PATCH v3 05/19] tcg: Use tcg_constant_{i32, i64} with tcg int expanders

2020-05-08 Thread Richard Henderson
Signed-off-by: Richard Henderson --- include/tcg/tcg-op.h | 13 +-- tcg/tcg-op.c | 216 --- 2 files changed, 100 insertions(+), 129 deletions(-) diff --git a/include/tcg/tcg-op.h b/include/tcg/tcg-op.h index 5abf17fecc..b4fba35e87 100644 --- a/inc

[PATCH v3 04/19] tcg: Use tcg_constant_i32 with icount expander

2020-05-08 Thread Richard Henderson
We must do this before we adjust how tcg_out_movi_i32, lest the under-the-hood poking that we do be broken. Signed-off-by: Richard Henderson --- include/exec/gen-icount.h | 25 + 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/include/exec/gen-icount.h b/i

[PATCH v3 08/19] tcg: Use tcg_constant_{i32,i64} with tcg plugins

2020-05-08 Thread Richard Henderson
Signed-off-by: Richard Henderson --- accel/tcg/plugin-gen.c | 49 +++--- 1 file changed, 22 insertions(+), 27 deletions(-) diff --git a/accel/tcg/plugin-gen.c b/accel/tcg/plugin-gen.c index 51580d51a0..e5dc9d0ca9 100644 --- a/accel/tcg/plugin-gen.c +++ b/accel

[PATCH v3 13/19] tcg/tci: Add special tci_movi_{i32,i64} opcodes

2020-05-08 Thread Richard Henderson
The normal movi opcodes are going away. We need something for TCI to use internally. Signed-off-by: Richard Henderson --- include/tcg/tcg-opc.h| 8 tcg/tci.c| 4 ++-- tcg/tci/tcg-target.inc.c | 4 ++-- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/

[PATCH v3 10/19] tcg/optimize: Improve find_better_copy

2020-05-08 Thread Richard Henderson
Prefer TEMP_CONST over anything else. Signed-off-by: Richard Henderson --- tcg/optimize.c | 27 --- 1 file changed, 12 insertions(+), 15 deletions(-) diff --git a/tcg/optimize.c b/tcg/optimize.c index c0fc5e3da6..b86bf3d707 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.

[PATCH v3 07/19] tcg: Use tcg_constant_{i32, i64, vec} with tcg gvec expanders

2020-05-08 Thread Richard Henderson
Signed-off-by: Richard Henderson --- tcg/tcg-op-gvec.c | 125 +++--- 1 file changed, 50 insertions(+), 75 deletions(-) diff --git a/tcg/tcg-op-gvec.c b/tcg/tcg-op-gvec.c index 3707c0effb..8ecaf4d67e 100644 --- a/tcg/tcg-op-gvec.c +++ b/tcg/tcg-op-gvec.c @@

[PATCH v3 09/19] tcg: Rename struct tcg_temp_info to TempOptInfo

2020-05-08 Thread Richard Henderson
Fix this name vs our coding style. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- tcg/optimize.c | 32 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/tcg/optimize.c b/tcg/optimize.c index 8f3bd99ff4..c0fc5e3da6 100644 -

[PATCH v3 12/19] tcg/optimize: Use tcg_constant_internal with constant folding

2020-05-08 Thread Richard Henderson
Signed-off-by: Richard Henderson --- tcg/optimize.c | 106 ++--- 1 file changed, 48 insertions(+), 58 deletions(-) diff --git a/tcg/optimize.c b/tcg/optimize.c index d36d7e1d7f..dd5187be31 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -178,37 +17

[PATCH v3 16/19] tcg: Increase tcg_out_dupi_vec immediate to int64_t

2020-05-08 Thread Richard Henderson
While we don't store more than tcg_target_long in TCGTemp, we shouldn't be limited to that for code generation. We will be able to use this for INDEX_op_dup2_vec with 2 constants. Signed-off-by: Richard Henderson --- tcg/aarch64/tcg-target.inc.c | 2 +- tcg/i386/tcg-target.inc.c| 20 ++

[PATCH v3 14/19] tcg: Remove movi and dupi opcodes

2020-05-08 Thread Richard Henderson
These are now completely covered by mov from a TYPE_CONST temporary. Signed-off-by: Richard Henderson --- include/tcg/tcg-opc.h| 3 --- tcg/aarch64/tcg-target.inc.c | 3 --- tcg/arm/tcg-target.inc.c | 1 - tcg/i386/tcg-target.inc.c| 3 --- tcg/mips/tcg-target.inc.c| 2 --

[PATCH v3 11/19] tcg/optimize: Adjust TempOptInfo allocation

2020-05-08 Thread Richard Henderson
Do not allocate a large block for indexing. Instead, allocate for each temporary as they are seen. In general, this will use less memory, if we consider that most TBs do not touch every target register. This also allows us to allocate TempOptInfo for new temps created during optimization. Signe

[PATCH v3 15/19] tcg: Use tcg_out_dupi_vec from temp_load

2020-05-08 Thread Richard Henderson
Having dupi pass though movi is confusing and arguably wrong. Signed-off-by: Richard Henderson --- tcg/aarch64/tcg-target.inc.c | 7 tcg/i386/tcg-target.inc.c| 63 tcg/ppc/tcg-target.inc.c | 6 tcg/tcg.c| 8 - 4 fi

[PATCH v3 17/19] tcg: Add tcg_reg_alloc_dup2

2020-05-08 Thread Richard Henderson
There are several ways we can expand a vector dup of a 64-bit element on a 32-bit host. Signed-off-by: Richard Henderson --- tcg/tcg.c | 88 +++ 1 file changed, 88 insertions(+) diff --git a/tcg/tcg.c b/tcg/tcg.c index 18ebcc98f6..e8fe2d580b 1

Re: [PATCH 0/4] memory: Add memory_region_msync() & make NVMe emulated device generic

2020-05-08 Thread Beata Michalska
On Fri, 8 May 2020 at 07:33, Paolo Bonzini wrote: > > On 08/05/20 08:24, Philippe Mathieu-Daudé wrote: > > It is not clear if dccvap_writefn() really needs > > memory_region_writeback() or could use memory_region_msync(). > > Indeed, I don't understand the code and why it matters that > mr->dirty_

[PATCH v3 01/16] target/arm: Create gen_gvec_[us]sra

2020-05-08 Thread Richard Henderson
The functions eliminate duplication of the special cases for this operation. They match up with the GVecGen2iFn typedef. Add out-of-line helpers. We got away with only having inline expanders because the neon vector size is only 16 bytes, and we know that the inline expansion will always succeed

[PATCH v3 19/19] tcg: Remove tcg_gen_dup{8,16,32,64}i_vec

2020-05-08 Thread Richard Henderson
These interfaces have been replaced by tcg_gen_dupi_vec and tcg_constant_vec. Signed-off-by: Richard Henderson --- include/tcg/tcg-op.h | 4 tcg/tcg-op-vec.c | 20 2 files changed, 24 deletions(-) diff --git a/include/tcg/tcg-op.h b/include/tcg/tcg-op.h index b4fb

[PATCH v3 02/16] target/arm: Create gen_gvec_{u,s}{rshr,rsra}

2020-05-08 Thread Richard Henderson
Create vectorized versions of handle_shri_with_rndacc for shift+round and shift+round+accumulate. Add out-of-line helpers in preparation for longer vector lengths from SVE. Signed-off-by: Richard Henderson --- target/arm/helper.h| 20 ++ target/arm/translate.h | 9 + target/arm/t

[PATCH v3 06/16] target/arm: Create gen_gvec_{ceq,clt,cle,cgt,cge}0

2020-05-08 Thread Richard Henderson
Provide a functional interface for the vector expansion. This fits better with the existing set of helpers that we provide for other operations. Macro-ize the 5 nearly identical comparisons. Signed-off-by: Richard Henderson --- target/arm/translate.h | 16 ++- target/arm/translate-a64.c |

[PATCH v3 18/19] tcg/i386: Use tcg_constant_vec with tcg vec expanders

2020-05-08 Thread Richard Henderson
Signed-off-by: Richard Henderson --- tcg/i386/tcg-target.inc.c | 26 +- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/tcg/i386/tcg-target.inc.c b/tcg/i386/tcg-target.inc.c index 5e73e5d02b..cce28c81d7 100644 --- a/tcg/i386/tcg-target.inc.c +++ b/tcg/i386/

Re: [PATCH v2 3/3] arm/acpi: Add the TPM2.0 device under the DSDT

2020-05-08 Thread Shannon Zhao
Hi, On 2020/5/5 22:44, Eric Auger wrote: +static void acpi_dsdt_add_tpm(Aml *scope, VirtMachineState *vms) +{ +hwaddr pbus_base = vms->memmap[VIRT_PLATFORM_BUS].base; +PlatformBusDevice *pbus = PLATFORM_BUS_DEVICE(vms->platform_bus_dev); +MemoryRegion *sbdev_mr; +SysBusDevice *sb

[PATCH v3 03/16] target/arm: Create gen_gvec_{sri,sli}

2020-05-08 Thread Richard Henderson
The functions eliminate duplication of the special cases for this operation. They match up with the GVecGen2iFn typedef. Add out-of-line helpers. We got away with only having inline expanders because the neon vector size is only 16 bytes, and we know that the inline expansion will always succeed

[PATCH v3 08/16] target/arm: Swap argument order for VSHL during decode

2020-05-08 Thread Richard Henderson
Rather than perform the argument swap during code generation, perform it during decode. This means it doesn't have to be special cased later, and we can share code with aarch64 code generation. Hopefully the decode comment addresses any confusion that might arise in between. Signed-off-by: Richa

[PATCH v3 07/16] target/arm: Create gen_gvec_{mla,mls}

2020-05-08 Thread Richard Henderson
Provide a functional interface for the vector expansion. This fits better with the existing set of helpers that we provide for other operations. Signed-off-by: Richard Henderson --- target/arm/translate.h | 7 +- target/arm/translate-a64.c | 4 +- target/arm/translate-neon.inc.

[PATCH v3 00/16] target/arm: partial vector cleanup

2020-05-08 Thread Richard Henderson
This is not complete, but shows the direction I'd like to go. Version 2 extracts more bits from my sve2 branch. There's still more to pull back, especially for crypto_helper.c, where there are also tail clearing bugs to fix. Version 3 rebases on master, which has some of the arm neon decodetree

[PATCH v3 10/16] target/arm: Create gen_gvec_{uqadd, sqadd, uqsub, sqsub}

2020-05-08 Thread Richard Henderson
Provide a functional interface for the vector expansion. This fits better with the existing set of helpers that we provide for other operations. Signed-off-by: Richard Henderson --- target/arm/translate.h | 13 +- target/arm/translate-a64.c | 22 ++- target/arm/translate-neon.inc

[PATCH v3 09/16] target/arm: Create gen_gvec_{cmtst,ushl,sshl}

2020-05-08 Thread Richard Henderson
Provide a functional interface for the vector expansion. This fits better with the existing set of helpers that we provide for other operations. Signed-off-by: Richard Henderson --- target/arm/translate.h | 10 ++- target/arm/translate-a64.c | 18 ++-- target/arm/translate-neon.i

[PATCH v3 11/16] target/arm: Remove fp_status from helper_{recpe, rsqrte}_u32

2020-05-08 Thread Richard Henderson
These operations do not touch fp_status. Signed-off-by: Richard Henderson --- target/arm/helper.h| 4 ++-- target/arm/translate-a64.c | 5 ++--- target/arm/translate.c | 12 ++-- target/arm/vfp_helper.c| 4 ++-- 4 files changed, 8 insertions(+), 17 deletions(-) diff -

[PATCH v3 04/16] target/arm: Remove unnecessary range check for VSHL

2020-05-08 Thread Richard Henderson
In 1dc8425e551, while converting to gvec, I added an extra range check against the shift count. This was unnecessary because the encoding of the shift count produces 0 to the element size - 1. Signed-off-by: Richard Henderson --- target/arm/translate.c | 12 ++-- 1 file changed, 2 inser

[PATCH v3 05/16] target/arm: Tidy handle_vec_simd_shri

2020-05-08 Thread Richard Henderson
Now that we've converted all cases to gvec, there is quite a bit of dead code at the end of the function. Remove it. Sink the call to gen_gvec_fn2i to the end, loading a function pointer within the switch statement. Signed-off-by: Richard Henderson --- target/arm/translate-a64.c | 56 +

[PATCH v3 12/16] target/arm: Create gen_gvec_{qrdmla,qrdmls}

2020-05-08 Thread Richard Henderson
Provide a functional interface for the vector expansion. This fits better with the existing set of helpers that we provide for other operations. Signed-off-by: Richard Henderson --- target/arm/translate.h | 5 target/arm/translate-a64.c | 34 ++-- target/arm/transla

[PATCH v3 16/16] target/arm: Vectorize SABA/UABA

2020-05-08 Thread Richard Henderson
Include 64-bit element size in preparation for SVE2. Signed-off-by: Richard Henderson --- target/arm/helper.h| 17 +++-- target/arm/translate.h | 5 ++ target/arm/neon_helper.c | 10 --- target/arm/translate-a64.c | 17 ++--- target/arm/translate.c | 134 ++

[PATCH v3 14/16] target/arm: Clear tail in gvec_fmul_idx_*, gvec_fmla_idx_*

2020-05-08 Thread Richard Henderson
Must clear the tail for AdvSIMD when SVE is enabled. Fixes: ca40a6e6e39 Signed-off-by: Richard Henderson --- target/arm/vec_helper.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/target/arm/vec_helper.c b/target/arm/vec_helper.c index 6aa2ca0827..a483841add 100644 --- a/target/arm/vec_he

[PATCH v3 13/16] target/arm: Pass pointer to qc to qrdmla/qrdmls

2020-05-08 Thread Richard Henderson
Pass a pointer directly to env->vfp.qc[0], rather than env. This will allow SVE2, which does not modify QC, to pass a pointer to dummy storage. Signed-off-by: Richard Henderson --- target/arm/translate.c | 18 --- target/arm/vec_helper.c | 70 +++-- 2

[PATCH v5 01/19] exec: Add block comments for watchpoint routines

2020-05-08 Thread Richard Henderson
Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- include/hw/core/cpu.h | 23 +++ 1 file changed, 23 insertions(+) diff --git a/include/hw/core/cpu.h b/include/hw/core/cpu.h index 5bf94d28cf..07f7698155 100644 --- a/include/hw/core/cpu.h +++ b/include/hw/core/c

Re: [PATCH v2 3/3] arm/acpi: Add the TPM2.0 device under the DSDT

2020-05-08 Thread Ard Biesheuvel
On Fri, 8 May 2020 at 17:24, Shannon Zhao wrote: > > Hi, > > On 2020/5/5 22:44, Eric Auger wrote: > > +static void acpi_dsdt_add_tpm(Aml *scope, VirtMachineState *vms) > > +{ > > +hwaddr pbus_base = vms->memmap[VIRT_PLATFORM_BUS].base; > > +PlatformBusDevice *pbus = PLATFORM_BUS_DEVICE(vms

[PATCH v3 15/16] target/arm: Vectorize SABD/UABD

2020-05-08 Thread Richard Henderson
Include 64-bit element size in preparation for SVE2. Signed-off-by: Richard Henderson --- target/arm/helper.h| 10 +++ target/arm/translate.h | 5 ++ target/arm/translate-a64.c | 8 ++- target/arm/translate.c | 133 - target/arm/vec_helper

[PATCH v5 06/19] accel/tcg: Add endian-specific cpu_{ld, st}* operations

2020-05-08 Thread Richard Henderson
We currently have target-endian versions of these operations, but no easy way to force a specific endianness. This can be helpful if the target has endian-specific operations, or a mode that swaps endianness. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- docs/devel/loads-stor

Re: [PATCH 0/4] memory: Add memory_region_msync() & make NVMe emulated device generic

2020-05-08 Thread Philippe Mathieu-Daudé
On 5/8/20 5:33 PM, Paolo Bonzini wrote: On 08/05/20 17:20, Beata Michalska wrote: mr->dirty_log_mask tells if dirty tracking has been enabled, not if the page is dirty. It would always be true during live migration and when running on TCG, but otherwise it would always be false. Beata, can yo

Re: [PATCH] qom/object: Fix object_child_foreach_recursive() return value

2020-05-08 Thread Philippe Mathieu-Daudé
On 4/4/20 5:33 PM, Cédric Le Goater wrote: When recursing, the return value of do_object_child_foreach() is not taken into account. Cc: Peter Crosthwaite Fixes: d714b8de7747 ("qom: Add recursive version of object_child_for_each") Indeed. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by:

[PATCH v5 02/19] exec: Fix cpu_watchpoint_address_matches address length

2020-05-08 Thread Richard Henderson
The only caller of cpu_watchpoint_address_matches passes TARGET_PAGE_SIZE, so the bug is not currently visible. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- exec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exec.c b/exec.c index 2874bb5088..5162f0d12f

[PATCH v5 08/19] target/arm: Drop manual handling of set/clear_helper_retaddr

2020-05-08 Thread Richard Henderson
Since we converted back to cpu_*_data_ra, we do not need to do this ourselves. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- target/arm/sve_helper.c | 38 -- 1 file changed, 38 deletions(-) diff --git a/target/arm/sve_helper.c b/target/arm/

<    1   2   3   4   >