Re: [PATCH v3 1/3] ui/cocoa: Run qemu_init in the main thread

2022-07-16 Thread Paolo Bonzini
Il sab 16 lug 2022, 22:42 Akihiko Odaki ha scritto: > > Is this documented anywhere? > > Thread-unsafe classes (and more importantly, main thread only classes) > are rather exceptional, and they are listed at: > > https://developer.apple.com/library/archive/documentation/Cocoa/Conceptual/Multithr

Re: [PATCH v3 1/3] ui/cocoa: Run qemu_init in the main thread

2022-07-16 Thread Akihiko Odaki
On 2022/07/17 1:39, Paolo Bonzini wrote: Il sab 16 lug 2022, 13:30 Akihiko Odaki ha scritto: On 2022/07/16 19:16, Paolo Bonzini wrote: On 7/15/22 15:47, Akihiko Odaki wrote: static void *call_qemu_main(void *opaque) { ... +[NSApp terminate:nil]; Is this thread-safe? I think

[PATCH v2 1/1] python/machine: Fix AF_UNIX path too long on macOS

2022-07-16 Thread Peter Delevoryas
On macOS, private $TMPDIR's are the default. These $TMPDIR's are generated from a user's unix UID and UUID [1], which can create a relatively long path: /var/folders/d7/rz20f6hd709c1ty8f6_6y_z4gn/T/ QEMU's avocado tests create a temporary directory prefixed by "avo_qemu_sock_", and create

[PATCH v2 0/1] python/machine: Fix AF_UNIX path too long on macOS

2022-07-16 Thread Peter Delevoryas
v2: - Reduced QEMUMachine socket directory prefix length. - Replaced QEMUMachine default name with "qmp". - Rewrote commit description. Thanks, Peter Delevoryas Peter Delevoryas (1): python/machine: Fix AF_UNIX path too long on macOS python/qemu/machine/machine.py | 2 +- tests/avocad

Re: [PATCH v3 1/3] ui/cocoa: Run qemu_init in the main thread

2022-07-16 Thread Paolo Bonzini
Il sab 16 lug 2022, 13:30 Akihiko Odaki ha scritto: > On 2022/07/16 19:16, Paolo Bonzini wrote: > > On 7/15/22 15:47, Akihiko Odaki wrote: > >> static void *call_qemu_main(void *opaque) > >> { > >> ... > >> +[NSApp terminate:nil]; > > Is this thread-safe? I think it should be someth

Re: [PATCH v2 07/11] acpi/tests/bits: add python test that exercizes QEMU bios tables using biosbits

2022-07-16 Thread Michael S. Tsirkin
On Sat, Jul 16, 2022 at 12:06:00PM +0530, Ani Sinha wrote: > > > On Fri, Jul 15, 2022 at 11:20 Michael S. Tsirkin wrote: > > On Fri, Jul 15, 2022 at 09:47:27AM +0530, Ani Sinha wrote: > > > Instead of all this mess, can't we just spawn e.g. "git clone --depth > 1"? > > > And if

[RFC PATCH 07/12] vhost: Add VhostVDPAStartOp operation

2022-07-16 Thread Eugenio Pérez
It allows to run commands at start of the device, before it have enabled any queue. Signed-off-by: Eugenio Pérez --- hw/virtio/vhost-shadow-virtqueue.h | 3 +++ include/hw/virtio/vhost-vdpa.h | 5 + hw/virtio/vhost-vdpa.c | 8 3 files changed, 16 insertions(+) diff

[RFC PATCH 11/12] vdpa: Add virtio-net mac address via CVQ at start

2022-07-16 Thread Eugenio Pérez
This is needed so the destination vdpa device see the same state a the guest set in the source. Signed-off-by: Eugenio Pérez --- net/vhost-vdpa.c | 53 +++- 1 file changed, 52 insertions(+), 1 deletion(-) diff --git a/net/vhost-vdpa.c b/net/vhost-vdpa

[RFC PATCH 05/12] vhost: stop transfer elem ownership in vhost_handle_guest_kick

2022-07-16 Thread Eugenio Pérez
It was easier to allow vhost_svq_add to handle the memory. Now that we will move SVQDesc to an opaque context, it's better to handle it in the caller. Signed-off-by: Eugenio Pérez --- hw/virtio/vhost-shadow-virtqueue.c | 10 -- 1 file changed, 4 insertions(+), 6 deletions(-) diff --git

[RFC PATCH 08/12] vdpa: Add vhost_vdpa_start_control_svq

2022-07-16 Thread Eugenio Pérez
As a first step we only enable CVQ first than others. Future patches add state restore. Signed-off-by: Eugenio Pérez --- net/vhost-vdpa.c | 13 + 1 file changed, 13 insertions(+) diff --git a/net/vhost-vdpa.c b/net/vhost-vdpa.c index 986e6414b4..211bd0468b 100644 --- a/net/vhost-vdp

[RFC PATCH 12/12] vdpa: Delete CVQ migration blocker

2022-07-16 Thread Eugenio Pérez
We can restore the device state in the destination via CVQ now. Remove the migration blocker. Signed-off-by: Eugenio Pérez --- include/hw/virtio/vhost-vdpa.h | 1 - hw/virtio/vhost-vdpa.c | 11 --- net/vhost-vdpa.c | 2 -- 3 files changed, 14 deletions(-) diff --

[RFC PATCH 10/12] vdpa: Make vhost_vdpa_net_cvq_map_elem accept any out sg

2022-07-16 Thread Eugenio Pérez
So its generic enough to accept any out sg buffer and we can inject NIC state messages. Signed-off-by: Eugenio Pérez --- net/vhost-vdpa.c | 29 +++-- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/net/vhost-vdpa.c b/net/vhost-vdpa.c index aaae51a778..0183

[RFC PATCH 06/12] vhost: Use opaque data in SVQDescState

2022-07-16 Thread Eugenio Pérez
Since we'll allow net/vhost-vdpa to add elements that don't come from the guest, we need to store opaque data that makes sense to the caller. Signed-off-by: Eugenio Pérez --- hw/virtio/vhost-shadow-virtqueue.h | 4 ++-- hw/virtio/vhost-shadow-virtqueue.c | 20 +++- 2 files chang

[RFC PATCH 04/12] vdpa: delay set_vring_ready after DRIVER_OK

2022-07-16 Thread Eugenio Pérez
To restore the device in the destination of a live migration we send the commands through control virtqueue. For a device to read CVQ it must have received DRIVER_OK status bit. However this open a window where the device could start receiving packets in rx queue 0 before it receive the RSS config

[RFC PATCH 00/12] NIC vhost-vdpa state restore via Shadow CVQ

2022-07-16 Thread Eugenio Pérez
CVQ of net vhost-vdpa devices can be intercepted since the work of [1]. The virtio-net device model is updated. The migration was blocked because although the state can be megrated between VMM it was not possible to restore on the destination NIC. This series add support for SVQ to inject external

[RFC PATCH 09/12] vdpa: Extract vhost_vdpa_net_svq_add from vhost_vdpa_net_handle_ctrl_avail

2022-07-16 Thread Eugenio Pérez
So we can reuse to inject state messages. Signed-off-by: Eugenio Pérez --- net/vhost-vdpa.c | 89 +++- 1 file changed, 51 insertions(+), 38 deletions(-) diff --git a/net/vhost-vdpa.c b/net/vhost-vdpa.c index 211bd0468b..aaae51a778 100644 --- a/net/vho

[RFC PATCH 03/12] vdpa: Small rename of error labels

2022-07-16 Thread Eugenio Pérez
So later patches are cleaner Signed-off-by: Eugenio Pérez --- hw/virtio/vhost-vdpa.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/hw/virtio/vhost-vdpa.c b/hw/virtio/vhost-vdpa.c index 4458c8d23e..906c365036 100644 --- a/hw/virtio/vhost-vdpa.c +++ b/hw/virtio/vhost-vdp

[RFC PATCH 01/12] vhost: Get vring base from vq, not svq

2022-07-16 Thread Eugenio Pérez
The SVQ vring used idx usually match with the guest visible one, as long as all the guest buffers (GPA) maps to exactly one buffer within qemu's VA. However, as we can see in virtqueue_map_desc, a single guest buffer could map to many buffers in SVQ vring. The solution is to stop using the device'

[RFC PATCH 02/12] vhost: Move SVQ queue rewind to the destination

2022-07-16 Thread Eugenio Pérez
Migration with SVQ already migrate the inflight descriptors, so the destination can perform the work. This makes easier to migrate between backends or to recover them in vhost devices that support set in flight descriptors. Signed-off-by: Eugenio Pérez --- hw/virtio/vhost-vdpa.c | 24 ++

[PATCH v4] Align Raspberry Pi DMA interrupts with Linux DTS

2022-07-16 Thread Andrey Makarov
There is nothing in the specs on DMA engine interrupt lines: it should have been in the "BCM2835 ARM Peripherals" datasheet but the appropriate "ARM peripherals interrupt table" (p.113) is nearly empty. All Raspberry Pi models 1-3 (based on bcm2835) have Linux device tree (arch/arm/boot/dts/bcm283

Re: [PATCH v3 1/3] ui/cocoa: Run qemu_init in the main thread

2022-07-16 Thread Akihiko Odaki
On 2022/07/16 19:16, Paolo Bonzini wrote: On 7/15/22 15:47, Akihiko Odaki wrote:   static void *call_qemu_main(void *opaque)   { ... +    [NSApp terminate:nil]; Is this thread-safe?  I think it should be something like: Yes, -[NSApplication terminate:] is thread-safe. Methods of NSAppli

Re: [PATCH v3 1/3] ui/cocoa: Run qemu_init in the main thread

2022-07-16 Thread Paolo Bonzini
On 7/15/22 15:47, Akihiko Odaki wrote: static void *call_qemu_main(void *opaque) { ... +[NSApp terminate:nil]; Is this thread-safe? I think it should be something like: - here: /* * Nothing more to do in the QEMU thread, ask the application * to exit. */

[PATCH 4/8] tests/tcg/loongarch64: Add clo related instructions test

2022-07-16 Thread Song Gao
This includes: - CL{O/Z}.{W/D} - CT{O/Z}.{W/D} Signed-off-by: Song Gao --- tests/tcg/loongarch64/Makefile.target | 15 + tests/tcg/loongarch64/test_bit.c | 88 +++ 2 files changed, 103 insertions(+) create mode 100644 tests/tcg/loongarch64/Makefile.target creat

[PATCH 0/8] tests/tcg/loongarch64: Add some tests.

2022-07-16 Thread Song Gao
Hi, All This series adds some float reference files, fixes some float_convd/float_convs/float_madds bugs, and adds some instructions tests. Thanks. Song Gao Philippe Mathieu-Daudé (1): tests/tcg/loongarch64: Add float reference files Song Gao (7): fpu/softfloat: Add LoongArch specializatio

[PATCH 3/8] target/loongarch: Fix float_convd/float_convs test failing

2022-07-16 Thread Song Gao
We should result zero when exception is invalid and operation is nan Signed-off-by: Song Gao --- target/loongarch/fpu_helper.c | 143 +++--- 1 file changed, 80 insertions(+), 63 deletions(-) diff --git a/target/loongarch/fpu_helper.c b/target/loongarch/fpu_helper.c i

[PATCH 7/8] tests/tcg/loongarch64: Add som comparison instructions test

2022-07-16 Thread Song Gao
Choose some instructions to test: - FCMP.cond.S - cond: ceq clt cle cne seq slt sle sne Signed-off-by: Song Gao --- tests/tcg/loongarch64/Makefile.target | 1 + tests/tcg/loongarch64/test_fpcom.c| 37 +++ 2 files changed, 38 insertions(+) create mode 100644 tests/tc

[PATCH 2/8] fpu/softfloat: Add LoongArch specialization for pickNaNMulAdd

2022-07-16 Thread Song Gao
LoongArch system follows IEEE754-2008 specificationa. The (inf,zero,nan) case sets InvalidOp and returns the input value 'c', and Prefer sNaN over qNaN, in the c, a, b order. Signed-off-by: Song Gao --- fpu/softfloat-specialize.c.inc | 23 +++ 1 file changed, 23 insertions(+)

[PATCH 8/8] tests/tcg/loongarch64: Add pcadd related instructions test

2022-07-16 Thread Song Gao
This includes: - PCADDI - PCADDU12I - PCADDU18I - PCALAU12I Signed-off-by: Song Gao --- tests/tcg/loongarch64/Makefile.target | 1 + tests/tcg/loongarch64/test_pcadd.c| 38 +++ 2 files changed, 39 insertions(+) create mode 100644 tests/tcg/loongarch64/test_pcadd.c

[PATCH 5/8] tests/tcg/loongarch64: Add div and mod related instructions test

2022-07-16 Thread Song Gao
This includes: - DIV.{W[U]/D[U]} - MOD.{W[U]/D[U]} Signed-off-by: Song Gao --- tests/tcg/loongarch64/Makefile.target | 1 + tests/tcg/loongarch64/test_div.c | 54 +++ 2 files changed, 55 insertions(+) create mode 100644 tests/tcg/loongarch64/test_div.c diff --git

[PATCH 1/8] tests/tcg/loongarch64: Add float reference files

2022-07-16 Thread Song Gao
From: Philippe Mathieu-Daudé Generated on Loongson-3A5000 (CPU revision 0x0014c011). Signed-off-by: Philippe Mathieu-Daudé Message-Id: <20220104132022.2146857-1-f4...@amsat.org> Signed-off-by: Song Gao --- tests/tcg/loongarch64/float_convd.ref | 988 ++ tests/tcg/loong

[PATCH 6/8] tests/tcg/loongarch64: Add fclass test

2022-07-16 Thread Song Gao
This includes: - FCLASS.{S/D} Signed-off-by: Song Gao --- tests/tcg/loongarch64/Makefile.target | 1 + tests/tcg/loongarch64/test_fclass.c | 130 ++ 2 files changed, 131 insertions(+) create mode 100644 tests/tcg/loongarch64/test_fclass.c diff --git a/tests/tcg/loon