Re: [PATCH] nvdimm: release the correct device list

2021-09-12 Thread lizhij...@fujitsu.com
ping again On 30/08/2021 09:04, Li Zhijian wrote: > ping > > > On 03/08/2021 12:00, Li, Zhijian wrote: >> ping >> >> Any body could help to review/queue this patch ? >> >> >> >> On 2021/6/29 22:05, Igor Mammedov wrote: >>> On Thu, 24 Jun 2021 19:04:15 +0800 >>> Li Zhijian wrote: >>> Sign

[qemu-web v2 PATCH] Update the information about the required version of macOS

2021-09-12 Thread Thomas Huth
The versions that we specify for macOS are way too old already. Let's rephrase this without specific version numbers, pointing the users to the latest version instead. Signed-off-by: Thomas Huth --- v2: Rephrased to be more in sync with docs/about/build-platforms.rst _download/macos.md | 6 +++

Re: Help adding package to gitlab runners

2021-09-12 Thread Thomas Huth
On 13/09/2021 03.14, Jag Raman wrote: Hi, I'm wondering about the best way to install a dependency package on GitLab runners. I'm adding libvfio-user [1] as a submodule to QEMU. libvfio-user depends on the availability of the "json-c" package. As such, we need to install this package to build t

Re: [PATCH] hw/nvme: Return error for fused operations

2021-09-12 Thread Klaus Jensen
On Sep 10 16:50, Pankaj Raghav wrote: > Currently, FUSED operations are not supported by QEMU. As per the 1.4 SPEC, > controller should abort the command that requested a fused operation with > an INVALID FIELD error code if they are not supported. > > > Signed-off-by: Pankaj Raghav > --- > hw

Re: [PATCH] qapi: define cleanup function for g_autoptr(Error)

2021-09-12 Thread Markus Armbruster
Paolo Bonzini writes: > Allow replacing calls to error_free() with g_autoptr(Error) > declarations. > > Signed-off-by: Paolo Bonzini > --- > include/qapi/error.h | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/include/qapi/error.h b/include/qapi/error.h > index 4a9260b0cc..8564657baf

Re: [PATCH] docs: link to archived Fedora code of conduct

2021-09-12 Thread Markus Armbruster
Paolo Bonzini writes: > Fedora has switched to a different CoC. QEMU's own code of conduct > is based on the previous version and cites it as a source. Replace > the link with one to the Wayback Machine. > > Signed-off-by: Paolo Bonzini > --- > docs/devel/code-of-conduct.rst | 4 ++-- > 1 fil

Re: [PATCH 1/2] vfio/pci: Fix vfio-pci sub-page MMIO BAR mmaping in live migration

2021-09-12 Thread Kunkun Jiang
On 2021/9/11 6:24, Alex Williamson wrote: On Fri, 10 Sep 2021 16:33:12 +0800 Kunkun Jiang wrote: Hi Alex, On 2021/9/9 4:45, Alex Williamson wrote: On Fri, 3 Sep 2021 17:36:10 +0800 Kunkun Jiang wrote: We expand MemoryRegions of vfio-pci sub-page MMIO BARs to vfio_pci_write_config to imp

Help adding package to gitlab runners

2021-09-12 Thread Jag Raman
Hi, I'm wondering about the best way to install a dependency package on GitLab runners. I'm adding libvfio-user [1] as a submodule to QEMU. libvfio-user depends on the availability of the "json-c" package. As such, we need to install this package to build the library as part of QEMU. I saw that

[PATCH v9 11/11] hvf: arm: Adhere to SMCCC 1.3 section 5.2

2021-09-12 Thread Alexander Graf
The SMCCC 1.3 spec section 5.2 says The Unknown SMC Function Identifier is a sign-extended value of (-1) that is returned in the R0, W0 or X0 registers. An implementation must return this error code when it receives: * An SMC or HVC call with an unknown Function Identifier * An SMC

[PATCH v9 08/11] arm: Add Hypervisor.framework build target

2021-09-12 Thread Alexander Graf
Now that we have all logic in place that we need to handle Hypervisor.framework on Apple Silicon systems, let's add CONFIG_HVF for aarch64 as well so that we can build it. Signed-off-by: Alexander Graf Reviewed-by: Roman Bolshakov Tested-by: Roman Bolshakov (x86 only) Reviewed-by: Peter Maydell

[PATCH v9 07/11] hvf: arm: Implement PSCI handling

2021-09-12 Thread Alexander Graf
We need to handle PSCI calls. Most of the TCG code works for us, but we can simplify it to only handle aa64 mode and we need to handle SUSPEND differently. This patch takes the TCG code as template and duplicates it in HVF. To tell the guest that we support PSCI 0.2 now, update the check in arm_c

[PATCH v9 04/11] hvf: Add Apple Silicon support

2021-09-12 Thread Alexander Graf
With Apple Silicon available to the masses, it's a good time to add support for driving its virtualization extensions from QEMU. This patch adds all necessary architecture specific code to get basic VMs working. It's still pretty raw, but definitely functional. Known limitations: - Vtimer ackn

[PATCH v9 10/11] arm: tcg: Adhere to SMCCC 1.3 section 5.2

2021-09-12 Thread Alexander Graf
The SMCCC 1.3 spec section 5.2 says The Unknown SMC Function Identifier is a sign-extended value of (-1) that is returned in the R0, W0 or X0 registers. An implementation must return this error code when it receives: * An SMC or HVC call with an unknown Function Identifier * An SMC

[PATCH v9 06/11] hvf: arm: Implement -cpu host

2021-09-12 Thread Alexander Graf
Now that we have working system register sync, we push more target CPU properties into the virtual machine. That might be useful in some situations, but is not the typical case that users want. So let's add a -cpu host option that allows them to explicitly pass all CPU capabilities of their host C

[PATCH v9 09/11] hvf: arm: Add rudimentary PMC support

2021-09-12 Thread Alexander Graf
We can expose cycle counters on the PMU easily. To be as compatible as possible, let's do so, but make sure we don't expose any other architectural counters that we can not model yet. This allows OSs to work that require PMU support. Signed-off-by: Alexander Graf --- target/arm/hvf/hvf.c | 179

[PATCH v9 00/11] hvf: Implement Apple Silicon Support

2021-09-12 Thread Alexander Graf
Now that Apple Silicon is widely available, people are obviously excited to try and run virtualized workloads on them, such as Linux and Windows. This patch set implements a fully functional version to get the ball going on that. With this applied, I can successfully run both Linux and Windows as

[PATCH v9 05/11] arm/hvf: Add a WFI handler

2021-09-12 Thread Alexander Graf
From: Peter Collingbourne Sleep on WFI until the VTIMER is due but allow ourselves to be woken up on IPI. In this implementation IPI is blocked on the CPU thread at startup and pselect() is used to atomically unblock the signal and begin sleeping. The signal is sent unconditionally so there's no

[PATCH v9 01/11] arm: Move PMC register definitions to cpu.h

2021-09-12 Thread Alexander Graf
We will need PMC register definitions in accel specific code later. Move all constant definitions to common arm headers so we can reuse them. Signed-off-by: Alexander Graf --- target/arm/cpu.h| 44 target/arm/helper.c | 44

[PATCH v9 02/11] hvf: Add execute to dirty log permission bitmap

2021-09-12 Thread Alexander Graf
Hvf's permission bitmap during and after dirty logging does not include the HV_MEMORY_EXEC permission. At least on Apple Silicon, this leads to instruction faults once dirty logging was enabled. Add the bit to make it work properly. Signed-off-by: Alexander Graf --- accel/hvf/hvf-accel-ops.c |

[PATCH v9 03/11] hvf: Introduce hvf_arch_init() callback

2021-09-12 Thread Alexander Graf
We will need to install a migration helper for the ARM hvf backend. Let's introduce an arch callback for the overall hvf init chain to do so. Signed-off-by: Alexander Graf --- accel/hvf/hvf-accel-ops.c | 3 ++- include/sysemu/hvf_int.h | 1 + target/i386/hvf/hvf.c | 5 + 3 files changed

Re: [PATCH v2] accel/tcg/user-exec: Fix read-modify-write of code on s390 hosts

2021-09-12 Thread Richard Henderson
On 8/3/21 3:16 PM, Ilya Leoshkevich wrote: x86_64 dotnet/runtime uses cmpxchg for code patching. When running it under s390x qemu-linux user, cpu_signal_handler() does not recognize this as a write and does not restore PAGE_WRITE cleared by tb_page_add(), incorrectly forwarding the signal to the

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

2021-09-12 Thread Richard Henderson
Ping. The branch rebases to master without complaint. r~ On 6/25/21 10:02 PM, Richard Henderson wrote: Changes for v4: * Fix bug in RXB (david). r~ Richard Henderson (16): tcg/s390x: Rename from tcg/s390 tcg/s390x: Change FACILITY representation tcg/s390x: Merge TCG_AREG0 and TCG

Re: [PATCH] user: Mark cpu_loop() with noreturn attribute

2021-09-12 Thread Richard Henderson
On 9/4/21 5:04 PM, Philippe Mathieu-Daudé wrote: cpu_loop() never exits, so mark it with QEMU_NORETURN. Signed-off-by: Philippe Mathieu-Daudé --- bsd-user/qemu.h | 2 +- linux-user/qemu.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) Queued, thanks. r~

[PATCH v2 1/2] qemu-binfmt-conf.sh: fix -F option

2021-09-12 Thread mwilck
From: Martin Wilck qemu-binfmt-conf.sh should use "-F" as short option for "--qemu-suffix". Fix the getopt call to make this work. Signed-off-by: Martin Wilck --- v2: fixed overlong line to make patchew bot happy. Sorry for the long delay, I'd missed the bot's reply. --- scripts/qemu-binf

Re: [PATCH v8 16/19] hvf: arm: Implement PSCI handling

2021-09-12 Thread Richard Henderson
On 9/12/21 2:37 PM, Alexander Graf wrote: On 12.09.21 23:20, Richard Henderson wrote: On 9/12/21 1:36 PM, Alexander Graf wrote: I think the callsites would be clearer if you made the function return true for "PSCI call handled", false for "not recognised, give the guest an UNDEF". Code like  

Re: [PATCH v8 16/19] hvf: arm: Implement PSCI handling

2021-09-12 Thread Alexander Graf
On 12.09.21 23:20, Richard Henderson wrote: > On 9/12/21 1:36 PM, Alexander Graf wrote: >>> I think the callsites would be clearer if you made the function >>> return true for "PSCI call handled", false for "not recognised, >>> give the guest an UNDEF". Code like >>>   if (hvf_handle_psci

Re: [PATCH] accel/tcg: assert insn_idx will always be valid before plugin_inject_cb

2021-09-12 Thread Richard Henderson
On 9/3/21 7:59 AM, Alex Bennée wrote: Coverity doesn't know enough about how we have arranged our plugin TCG ops to know we will always have incremented insn_idx before injecting the callback. Let us assert it for the benefit of Coverity and protect ourselves from accidentally breaking the assump

Re: [PATCH 1/3] ui/console: replace QEMUFIFO with Fifo8

2021-09-12 Thread Volker Rümelin
@@ -2233,8 +2188,7 @@ static void text_console_do_init(Chardev *chr, DisplayState *ds)      int g_width = 80 * FONT_WIDTH;      int g_height = 24 * FONT_HEIGHT; -    s->out_fifo.buf = s->out_fifo_buf; -    s->out_fifo.buf_size = sizeof(s->out_fifo_buf); +    fifo8_cr

Re: [PATCH v8 16/19] hvf: arm: Implement PSCI handling

2021-09-12 Thread Richard Henderson
On 9/12/21 1:36 PM, Alexander Graf wrote: I think the callsites would be clearer if you made the function return true for "PSCI call handled", false for "not recognised, give the guest an UNDEF". Code like if (hvf_handle_psci_call(cpu)) { stuff; } looks like the

Re: [PATCH v8 16/19] hvf: arm: Implement PSCI handling

2021-09-12 Thread Alexander Graf
On 15.06.21 14:54, Peter Maydell wrote: > On Wed, 19 May 2021 at 21:23, Alexander Graf wrote: >> We need to handle PSCI calls. Most of the TCG code works for us, >> but we can simplify it to only handle aa64 mode and we need to >> handle SUSPEND differently. >> >> This patch takes the TCG code a

Re: [PATCH v8 15/19] hvf: arm: Implement -cpu host

2021-09-12 Thread Alexander Graf
On 15.06.21 12:56, Peter Maydell wrote: > On Wed, 19 May 2021 at 21:23, Alexander Graf wrote: >> Now that we have working system register sync, we push more target CPU >> properties into the virtual machine. That might be useful in some >> situations, but is not the typical case that users want.

Re: [PATCH v3 00/24] accel/tcg: Restrict TCGCPUOps::cpu_exec_interrupt() to sysemu

2021-09-12 Thread Richard Henderson
On 9/11/21 9:54 AM, Philippe Mathieu-Daudé wrote: Philippe Mathieu-Daudé (24): target/avr: Remove pointless use of CONFIG_USER_ONLY definition target/i386: Restrict sysemu-only fpu_helper helpers target/i386: Simplify TARGET_X86_64 #ifdef'ry target/xtensa: Restrict do_transaction_fail

Re: [PATCH v4 21/30] target/ppc: Restrict has_work() handlers to sysemu and TCG

2021-09-12 Thread Richard Henderson
On 9/12/21 10:27 AM, Philippe Mathieu-Daudé wrote: Restrict PowerPCCPUClass::has_work() and ppc_cpu_has_work() - SysemuCPUOps::has_work() implementation - to TCG sysemu. Signed-off-by: Philippe Mathieu-Daudé --- target/ppc/cpu-qom.h | 4 +++- target/ppc/cpu_init.c | 24 ++---

Re: [PATCH v4 20/30] target/ppc: Introduce PowerPCCPUClass::has_work()

2021-09-12 Thread Richard Henderson
On 9/12/21 10:27 AM, Philippe Mathieu-Daudé wrote: We're moving the hook from CPUState to TCGCPUOps. TCGCPUOps is a const structure, so to avoid creating multiple versions of the same structure, simply changing the has_work() handler, introduce yet another indirection with a has_work() handler in

[RFC v5] virtio/vsock: add two more queues for datagram types

2021-09-12 Thread Jiang Wang
Datagram sockets are connectionless and unreliable. The sender does not know the capacity of the receiver and may send more packets than the receiver can handle. Add two more dedicate virtqueues for datagram sockets, so that it will not unfairly steal resources from stream and future connection-or

Re: [PATCH v4 26/30] target/sparc: Remove pointless use of CONFIG_TCG definition

2021-09-12 Thread Richard Henderson
On 9/12/21 10:27 AM, Philippe Mathieu-Daudé wrote: The SPARC target only support TCG acceleration. Remove the CONFIG_TCG supports definition introduced by mistake in commit 78271684719 ("cpu: tcg_ops: move to tcg-cpu-ops.h, keep a pointer in CPUClass"). Reported-by: Richard Henderson Signed-

Re: [PATCH 1/3] ui/console: replace QEMUFIFO with Fifo8

2021-09-12 Thread Volker Rümelin
Am 12.09.21 um 19:58 schrieb Volker Rümelin:     @@ -1185,6 +1138,7 @@ void kbd_put_keysym_console(QemuConsole *s,     int keysym)          uint8_t buf[16], *q;          CharBackend *be;          int c;     +    uint32_t free; Better call it num_free, to avoid symbol clash (even if we don't us

Re: [PATCH v4 01/30] accel/tcg: Restrict cpu_handle_halt() to sysemu

2021-09-12 Thread Richard Henderson
On 9/12/21 10:27 AM, Philippe Mathieu-Daudé wrote: Commit 372579427a5 ("tcg: enable thread-per-vCPU") added the following comment describing EXCP_HALTED in qemu_tcg_cpu_thread_fn(): case EXCP_HALTED: /* during start-up the vCPU is reset and the thread is * kicked severa

Re: [PATCH 1/3] ui/console: replace QEMUFIFO with Fifo8

2021-09-12 Thread Volker Rümelin
@@ -1185,6 +1138,7 @@ void kbd_put_keysym_console(QemuConsole *s, int keysym)      uint8_t buf[16], *q;      CharBackend *be;      int c; +    uint32_t free; Better call it num_free, to avoid symbol clash (even if we don't use free() directly), it helps reading and can

Re: [PATCH 04/20] nubus: use bitmap to manage available slots

2021-09-12 Thread Philippe Mathieu-Daudé
On 9/12/21 9:48 AM, Mark Cave-Ayland wrote: > Convert nubus_device_realize() to use a bitmap to manage available slots to > allow > for future Nubus devices to be plugged into arbitrary slots from the command > line. > > Update mac_nubus_bridge_init() to only allow slots 0x9 to 0xe on a Macintos

Re: [PATCH 16/20] nubus-bridge: embed the NubusBus object directly within nubus-bridge

2021-09-12 Thread Philippe Mathieu-Daudé
On 9/12/21 9:49 AM, Mark Cave-Ayland wrote: > Since nubus-bridge is a container for NubusBus then it should be embedded > directly within the bridge device using qbus_create_inplace(). > > Signed-off-by: Mark Cave-Ayland > --- > hw/m68k/q800.c | 2 +- > hw/nubus/mac-nubus-bridge.c |

Re: [PATCH 02/20] nubus-device: expose separate super slot memory region

2021-09-12 Thread Philippe Mathieu-Daudé
On 9/12/21 7:20 PM, Mark Cave-Ayland wrote: > On 12/09/2021 16:50, Philippe Mathieu-Daudé wrote: > >> On 9/12/21 9:48 AM, Mark Cave-Ayland wrote: >>> According to "Designing Cards and Drivers for the Macintosh Family" >>> each physical >>> nubus slot can access 2 separate address ranges: a super s

[PATCH v4 30/30] accel: Add missing AccelOpsClass::has_work() and drop SysemuCPUOps one

2021-09-12 Thread Philippe Mathieu-Daudé
cpu_common_has_work() is the default has_work() implementation and returns 'false'. Explicit it for the QTest / HAX / HVF / NVMM / Xen accelerators and remove cpu_common_has_work(). Since there are no more implementations of SysemuCPUOps::has_work, remove it along with the assertion in cpu_has_wo

[PATCH v4 29/30] target/xtensa: Restrict has_work() handler to sysemu

2021-09-12 Thread Philippe Mathieu-Daudé
Restrict has_work() to sysemu. Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé --- target/xtensa/cpu.c | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/target/xtensa/cpu.c b/target/xtensa/cpu.c index c1cbd03595e..5cb19a88819 100644 --- a/ta

[PATCH v4 28/30] target/tricore: Restrict has_work() handler to sysemu

2021-09-12 Thread Philippe Mathieu-Daudé
Restrict has_work() to sysemu. Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé --- target/tricore/cpu.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/target/tricore/cpu.c b/target/tricore/cpu.c index b95682b7f04..419fa624bd5 100644 --- a/target/tr

[PATCH v4 27/30] target/sparc: Restrict has_work() handler to sysemu

2021-09-12 Thread Philippe Mathieu-Daudé
Restrict has_work() to sysemu. Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé --- target/sparc/cpu.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/target/sparc/cpu.c b/target/sparc/cpu.c index e83e305aa9d..4a63ed12644 100644 --- a/target/sparc/cpu.

[PATCH v4 26/30] target/sparc: Remove pointless use of CONFIG_TCG definition

2021-09-12 Thread Philippe Mathieu-Daudé
The SPARC target only support TCG acceleration. Remove the CONFIG_TCG definition introduced by mistake in commit 78271684719 ("cpu: tcg_ops: move to tcg-cpu-ops.h, keep a pointer in CPUClass"). Reported-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé --- target/sparc/cpu.c | 2 -- 1

[PATCH v4 25/30] target/sh4: Restrict has_work() handler to sysemu

2021-09-12 Thread Philippe Mathieu-Daudé
Restrict has_work() to sysemu. Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé --- target/sh4/cpu.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/target/sh4/cpu.c b/target/sh4/cpu.c index 2047742d03c..fb2116dc52e 100644 --- a/target/sh4/cpu.c +++

[PATCH] tcg/arm: Reduce vector alignment requirement for NEON

2021-09-12 Thread Richard Henderson
With arm32, the ABI gives us 8-byte alignment for the stack. While it's possible to realign the stack to provide 16-byte alignment, it's far easier to simply not encode 16-byte alignment in the VLD1 and VST1 instructions that we emit. Remove the assertion in temp_allocate_frame, limit natural alig

Re: [PATCH 11/20] nubus-device: add romfile property for loading declaration ROMs

2021-09-12 Thread Philippe Mathieu-Daudé
On 9/12/21 9:49 AM, Mark Cave-Ayland wrote: > The declaration ROM is located at the top-most address of the standard slot > space. > > Signed-off-by: Mark Cave-Ayland > --- > hw/nubus/nubus-device.c | 43 +++- > include/hw/nubus/nubus.h | 5 + > 2 files

[PATCH v4 23/30] target/rx: Restrict has_work() handler to sysemu

2021-09-12 Thread Philippe Mathieu-Daudé
Restrict has_work() to sysemu. Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé --- target/rx/cpu.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/target/rx/cpu.c b/target/rx/cpu.c index 25a4aa2976d..ac6b40b2716 100644 --- a/target/rx/cpu.c +++ b/targ

[PATCH v4 20/30] target/ppc: Introduce PowerPCCPUClass::has_work()

2021-09-12 Thread Philippe Mathieu-Daudé
We're moving the hook from CPUState to TCGCPUOps. TCGCPUOps is a const structure, so to avoid creating multiple versions of the same structure, simply changing the has_work() handler, introduce yet another indirection with a has_work() handler in PowerPCCPUClass, and ppc_cpu_has_work() method which

[PATCH v4 21/30] target/ppc: Restrict has_work() handlers to sysemu and TCG

2021-09-12 Thread Philippe Mathieu-Daudé
Restrict PowerPCCPUClass::has_work() and ppc_cpu_has_work() - SysemuCPUOps::has_work() implementation - to TCG sysemu. Signed-off-by: Philippe Mathieu-Daudé --- target/ppc/cpu-qom.h | 4 +++- target/ppc/cpu_init.c | 24 ++-- 2 files changed, 21 insertions(+), 7 deletions(-)

[PATCH v4 18/30] target/nios2: Restrict has_work() handler to sysemu

2021-09-12 Thread Philippe Mathieu-Daudé
Restrict has_work() to sysemu. Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé --- target/nios2/cpu.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/target/nios2/cpu.c b/target/nios2/cpu.c index 947bb09bc1e..9938d7c2919 100644 --- a/target/nios2/cpu.

[PATCH v4 12/30] target/hexagon: Remove unused has_work() handler

2021-09-12 Thread Philippe Mathieu-Daudé
has_work() is sysemu specific, and Hexagon target only provides a linux-user implementation. Remove the unused hexagon_cpu_has_work(). Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé --- target/hexagon/cpu.c | 6 -- 1 file changed, 6 deletions(-) diff --git a/target/he

[PATCH v4 22/30] target/riscv: Restrict has_work() handler to sysemu and TCG

2021-09-12 Thread Philippe Mathieu-Daudé
Restrict has_work() to TCG sysemu. Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé --- target/riscv/cpu.c | 8 +++- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/target/riscv/cpu.c b/target/riscv/cpu.c index 13575c14085..abb555a8bdb 100644 --- a/target/r

[PATCH v4 15/30] target/m68k: Restrict has_work() handler to sysemu

2021-09-12 Thread Philippe Mathieu-Daudé
Restrict has_work() to sysemu. Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé --- target/m68k/cpu.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/target/m68k/cpu.c b/target/m68k/cpu.c index 66d22d11895..ad5d26b5c9e 100644 --- a/target/m68k/cpu.c ++

[PATCH v4 09/30] target/arm: Restrict has_work() handler to sysemu and TCG

2021-09-12 Thread Philippe Mathieu-Daudé
Restrict has_work() to TCG sysemu. Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé --- target/arm/cpu.c | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/target/arm/cpu.c b/target/arm/cpu.c index ba0741b20e4..e11aa625a5f 100644 --- a/target/arm/cpu.

[PATCH v4 19/30] target/openrisc: Restrict has_work() handler to sysemu

2021-09-12 Thread Philippe Mathieu-Daudé
Restrict has_work() to sysemu. Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé --- target/openrisc/cpu.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/target/openrisc/cpu.c b/target/openrisc/cpu.c index 27cb04152f9..3c368a1bde7 100644 --- a/target/o

[PATCH v4 14/30] target/i386: Restrict has_work() handler to sysemu and TCG

2021-09-12 Thread Philippe Mathieu-Daudé
Restrict has_work() to TCG sysemu. Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé --- target/i386/cpu.c | 6 -- target/i386/tcg/tcg-cpu.c | 8 +++- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/target/i386/cpu.c b/target/i386/cpu.c index 04

[PATCH v4 24/30] target/s390x: Restrict has_work() handler to sysemu and TCG

2021-09-12 Thread Philippe Mathieu-Daudé
Restrict has_work() to TCG sysemu. Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé --- target/s390x/cpu.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/target/s390x/cpu.c b/target/s390x/cpu.c index 7b7b05f1d3a..df8ade9021d 100644 --- a/target/s390x/

[PATCH v4 08/30] target/alpha: Restrict has_work() handler to sysemu

2021-09-12 Thread Philippe Mathieu-Daudé
Restrict has_work() to sysemu. Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé --- target/alpha/cpu.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/target/alpha/cpu.c b/target/alpha/cpu.c index 93e16a2ffb4..1ca601cac5b 100644 --- a/target/alpha/cpu.

[PATCH v4 10/30] target/avr: Restrict has_work() handler to sysemu

2021-09-12 Thread Philippe Mathieu-Daudé
Restrict has_work() to sysemu. Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé --- target/avr/cpu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/avr/cpu.c b/target/avr/cpu.c index 5d70e34dd54..6d51f91ca2c 100644 --- a/target/avr/cpu.c +++ b/tar

[PATCH v4 13/30] target/hppa: Restrict has_work() handler to sysemu

2021-09-12 Thread Philippe Mathieu-Daudé
Restrict has_work() to sysemu. Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé --- target/hppa/cpu.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/target/hppa/cpu.c b/target/hppa/cpu.c index e8edd189bfc..be940ae2246 100644 --- a/target/hppa/cpu.c ++

[PATCH v4 17/30] target/mips: Restrict has_work() handler to sysemu and TCG

2021-09-12 Thread Philippe Mathieu-Daudé
Restrict has_work() to TCG sysemu. Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé --- target/mips/cpu.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/target/mips/cpu.c b/target/mips/cpu.c index 00e0c55d0e4..3639c03f8ea 100644 --- a/target/mips/cpu.

[PATCH v4 05/30] accel/kvm: Implement AccelOpsClass::has_work()

2021-09-12 Thread Philippe Mathieu-Daudé
Implement KVM has_work() handler in AccelOpsClass and remove it from cpu_thread_is_idle() since cpu_has_work() is already called. Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé --- accel/kvm/kvm-accel-ops.c | 6 ++ softmmu/cpus.c| 2 +- 2 files changed, 7 i

[PATCH v4 06/30] accel/whpx: Implement AccelOpsClass::has_work()

2021-09-12 Thread Philippe Mathieu-Daudé
Implement WHPX has_work() handler in AccelOpsClass and remove it from cpu_thread_is_idle() since cpu_has_work() is already called. Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé --- softmmu/cpus.c| 4 +--- target/i386/whpx/whpx-accel-ops.c | 6 ++ 2

[PATCH v4 16/30] target/microblaze: Restrict has_work() handler to sysemu

2021-09-12 Thread Philippe Mathieu-Daudé
Restrict has_work() to sysemu. Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé --- target/microblaze/cpu.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/target/microblaze/cpu.c b/target/microblaze/cpu.c index 15db277925f..36e6e540483 100644 ---

[PATCH v4 07/30] accel/tcg: Implement AccelOpsClass::has_work() as stub

2021-09-12 Thread Philippe Mathieu-Daudé
Add TCG target-specific has_work() handler in TCGCPUOps, and add tcg_cpu_has_work() as AccelOpsClass has_work() implementation. Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé --- include/hw/core/tcg-cpu-ops.h | 4 accel/tcg/tcg-accel-ops.c | 12 2 fi

[PATCH v4 03/30] hw/core: Un-inline cpu_has_work()

2021-09-12 Thread Philippe Mathieu-Daudé
We want to make cpu_has_work() per-accelerator. Only declare its prototype and move its definition to softmmu/cpus.c. Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé --- include/hw/core/cpu.h | 8 +--- softmmu/cpus.c| 8 2 files changed, 9 insertions(+)

[PATCH v4 01/30] accel/tcg: Restrict cpu_handle_halt() to sysemu

2021-09-12 Thread Philippe Mathieu-Daudé
Commit 372579427a5 ("tcg: enable thread-per-vCPU") added the following comment describing EXCP_HALTED in qemu_tcg_cpu_thread_fn(): case EXCP_HALTED: /* during start-up the vCPU is reset and the thread is * kicked several times. If we don't ensure we go back * to sl

[PATCH v4 11/30] target/cris: Restrict has_work() handler to sysemu

2021-09-12 Thread Philippe Mathieu-Daudé
Restrict has_work() to sysemu. Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé --- target/cris/cpu.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/target/cris/cpu.c b/target/cris/cpu.c index c2e7483f5bd..b9f30ba58fa 100644 --- a/target/cris/cpu.c ++

[PATCH v4 04/30] sysemu: Introduce AccelOpsClass::has_work()

2021-09-12 Thread Philippe Mathieu-Daudé
Introduce an accelerator-specific has_work() handler. Eventually call it from cpu_has_work(). Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé --- include/sysemu/accel-ops.h | 5 + softmmu/cpus.c | 3 +++ 2 files changed, 8 insertions(+) diff --git a/include

[PATCH v4 02/30] hw/core: Restrict cpu_has_work() to sysemu

2021-09-12 Thread Philippe Mathieu-Daudé
cpu_has_work() is only called from system emulation code. Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé --- include/hw/core/cpu.h | 32 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/include/hw/core/cpu.h b/include/hw/core

[PATCH v4 00/30] accel: Move has_work() from SysemuCPUOps to AccelOpsClass

2021-09-12 Thread Philippe Mathieu-Daudé
Missing review: - 0001-accel-tcg-Restrict-cpu_handle_halt-to-sysemu.patch - 0020-target-ppc-Introduce-PowerPCCPUClass-has_work.patch - 0021-target-ppc-Restrict-has_work-handlers-to-sysemu-and-.patch - 0026-target-sparc-Remove-pointless-use-of-CONFIG_TCG-defi.patch Hi, CPU has_work() is a per-acce

Re: [PATCH 02/20] nubus-device: expose separate super slot memory region

2021-09-12 Thread Mark Cave-Ayland
On 12/09/2021 16:50, Philippe Mathieu-Daudé wrote: On 9/12/21 9:48 AM, Mark Cave-Ayland wrote: According to "Designing Cards and Drivers for the Macintosh Family" each physical nubus slot can access 2 separate address ranges: a super slot memory region which is 256MB and a standard slot memor

Re: [PATCH 18/20] nubus: add support for slot IRQs

2021-09-12 Thread Mark Cave-Ayland
On 12/09/2021 17:00, Philippe Mathieu-Daudé wrote: On 9/12/21 9:49 AM, Mark Cave-Ayland wrote: Each Nubus slot has an IRQ line that can be used to request service from the CPU. Connect the IRQs to the Nubus bridge so that they can be wired up using qdev gpios accordingly, and introduce a new n

Re: [PATCH 00/20] nubus: bus, device, bridge, IRQ and address space improvements

2021-09-12 Thread Mark Cave-Ayland
On 12/09/2021 16:47, Philippe Mathieu-Daudé wrote: On 9/12/21 9:48 AM, Mark Cave-Ayland wrote: This patchset is the next set of changes required to boot MacOS on the q800 machine. The main aim of these patches is to improve the Nubus support so that devices can be plugged into the Nubus from

Re: [PATCH 07/20] nubus: add trace-events for unassigned slot accesses

2021-09-12 Thread Mark Cave-Ayland
On 12/09/2021 16:18, Philippe Mathieu-Daudé wrote: On 9/12/21 9:49 AM, Mark Cave-Ayland wrote: These allow tracing of the Nubus enumeration process by the guest OS. Signed-off-by: Mark Cave-Ayland --- hw/nubus/nubus-bus.c | 10 +++--- hw/nubus/trace-events | 7 +++ hw/nubus/trac

Re: [PATCH 03/20] nubus-device: add device slot parameter

2021-09-12 Thread Mark Cave-Ayland
On 12/09/2021 16:15, Philippe Mathieu-Daudé wrote: On 9/12/21 9:48 AM, Mark Cave-Ayland wrote: This prepares for allowing Nubus devices to be placed in a specific slot instead of always being auto-allocated by the bus itself. Signed-off-by: Mark Cave-Ayland --- hw/nubus/nubus-device.c | 6

Re: [PATCH v2 9/9] linux-user: Drop unneeded includes from qemu.h

2021-09-12 Thread Richard Henderson
On 9/8/21 8:44 AM, Peter Maydell wrote: Trim down the #includes in qemu.h where we can, either by dropping unneeded headers or by moving them to user-internals.h. This includes deleting a couple of #includes that appear at weird points midway through the header file. Signed-off-by: Peter Maydel

Re: [PATCH v2 8/9] linux-user: Don't include gdbstub.h in qemu.h

2021-09-12 Thread Richard Henderson
On 9/8/21 8:44 AM, Peter Maydell wrote: Currently the linux-user qemu.h pulls in gdbstub.h. There's no real reason why it should do this; include it directly from the C files which require it, and drop the include line in qemu.h. (Note that several of the C files previously relying on this indir

Re: [PATCH 3/3] ui/console: remove chardev frontend connected test

2021-09-12 Thread Marc-André Lureau
On Sun, Sep 12, 2021 at 4:53 PM Volker Rümelin wrote: > The test if the chardev frontend is connected in > kbd_put_keysym_console() is redundant, because the call > to qemu_chr_be_can_write() in kbd_send_chars() tests > the connected condition again. > > Remove the redundant test whether the char

Re: [PATCH v2 7/9] linux-user: Split linux-user internals out of qemu.h

2021-09-12 Thread Richard Henderson
On 9/8/21 8:44 AM, Peter Maydell wrote: qemu.h is included in various non-linux-user files (which mostly want the TaskState struct and the functions for doing usermode access to guest addresses like lock_user(), unlock_user(), get_user*(), etc). Split out the parts that are only used in linux-us

[PATCH 0/2] Improve vhost-user VQ notifier unmap

2021-09-12 Thread Xueming Li
When vDPA applicaiton in client mode shutdown, unmapped VQ notifier might being accessed by VM thread under hight tx traffic, it will crash VM in rare conditon. This patch try to fix it with better RCU sychronization of new flatview. Xueming Li (2): vhost-user: fix VirtQ notifier cleanup vhost

Re: [PATCH v2 6/9] linux-user: Split safe-syscall macro into its own header

2021-09-12 Thread Richard Henderson
On 9/8/21 8:44 AM, Peter Maydell wrote: Split the safe-syscall macro from qemu.h into a new safe-syscall.h. Signed-off-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daudé --- linux-user/qemu.h | 135 - linux-user/safe-syscall.h | 154 +

[PATCH 1/2] vhost-user: fix VirtQ notifier cleanup

2021-09-12 Thread Xueming Li
When vhost-user device cleanup and unmmap notifier address, VM cpu thread that writing the notifier failed with accessing invalid address. To avoid this concurrent issue, wait memory flatview update by draining rcu callbacks, then unmap notifiers. Fixes: 44866521bd6e ("vhost-user: support registe

[PATCH 2/2] vhost-user: remove VirtQ notifier restore

2021-09-12 Thread Xueming Li
When vhost-user vdpa client restart, VQ notifier resources become invalid, no need to keep mmap, vdpa client will set VQ notifier after reconnect. Removes VQ notifier restore and related flags. Fixes: 44866521bd6e ("vhost-user: support registering external host notifiers") Cc: tiwei@intel.com

Re: [PATCH v2 5/9] linux-user: Split mmap prototypes into user-mmap.h

2021-09-12 Thread Richard Henderson
On 9/8/21 8:44 AM, Peter Maydell wrote: Split out the mmap prototypes into a new header user-mmap.h which we only include where required. Signed-off-by: Peter Maydell --- linux-user/qemu.h | 14 -- linux-user/user-mmap.h | 34 ++ linux

Re: [PATCH v2 4/9] linux-user: Split loader-related prototypes into loader.h

2021-09-12 Thread Richard Henderson
On 9/8/21 8:44 AM, Peter Maydell wrote: Split guest-binary loader prototypes out into a new header loader.h which we include only where required. Signed-off-by: Peter Maydell --- linux-user/loader.h| 59 ++ linux-user/qemu.h | 40 --

Re: [PATCH v2 3/9] linux-user: Split signal-related prototypes into signal-common.h

2021-09-12 Thread Richard Henderson
On 9/8/21 8:43 AM, Peter Maydell wrote: Split the signal related prototypes into the existing header file signal-common.h, and include it in those places that now require it. Signed-off-by: Peter Maydell --- v1->v2: use existing signal-common.h instead of new header --- linux-user/qemu.h

Re: [PATCH v2 2/9] linux-user: Split strace prototypes into strace.h

2021-09-12 Thread Richard Henderson
On 9/8/21 8:43 AM, Peter Maydell wrote: The functions implemented in strace.c are only used in a few files in linux-user; split them out of qemu.h and into a new strace.h header which we include in the places that need it. Signed-off-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daudé --- li

Re: [PATCH 18/20] nubus: add support for slot IRQs

2021-09-12 Thread Philippe Mathieu-Daudé
On 9/12/21 9:49 AM, Mark Cave-Ayland wrote: > Each Nubus slot has an IRQ line that can be used to request service from the > CPU. Connect the IRQs to the Nubus bridge so that they can be wired up using > qdev > gpios accordingly, and introduce a new nubus_set_irq() function that can be > used > b

Re: [PATCH v2 1/9] linux-user: Fix coding style nits in qemu.h

2021-09-12 Thread Richard Henderson
On 9/8/21 8:43 AM, Peter Maydell wrote: We're about to move a lot of the code in qemu.h out into different header files; fix the coding style nits first so that checkpatch is happy with the pure code-movement patches. This is mostly block-comment style but also a few whitespace issues. Signed-of

[PULL 8/9] tcg/ppc: Ensure _CALL_SYSV is set for 32-bit ELF

2021-09-12 Thread Richard Henderson
Clang only sets _CALL_ELF for ppc64, and nothing at all to specify the ABI for ppc32. Make a good guess based on other symbols. Reported-by: Brad Smith Signed-off-by: Richard Henderson --- tcg/ppc/tcg-target.c.inc | 21 ++--- 1 file changed, 18 insertions(+), 3 deletions(-) di

Re: [PATCH 2/3] ui/console: replace kbd_timer with chr_accept_input callback

2021-09-12 Thread Marc-André Lureau
On Sun, Sep 12, 2021 at 5:03 PM Volker Rümelin wrote: > There's a ChardevClass chr_accept_input() callback function that > can replace the write retry timer. > > Signed-off-by: Volker Rümelin > Reviewed-by: Marc-André Lureau --- > ui/console.c | 28 +--- > 1 file chan

[PULL 5/9] tcg: Remove tcg_global_reg_new defines

2021-09-12 Thread Richard Henderson
From: Bin Meng Since commit 1c2adb958fc0 ("tcg: Initialize cpu_env generically"), these tcg_global_reg_new_ macros are not used anywhere. Signed-off-by: Bin Meng Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20210816143507.11200-1-bmeng...@gmail.com> Signed-off-by: Richard Henderson --- i

[PULL 7/9] tcg/ppc: Replace TCG_TARGET_CALL_DARWIN with _CALL_DARWIN

2021-09-12 Thread Richard Henderson
If __APPLE__, ensure that _CALL_DARWIN is set, then remove our local TCG_TARGET_CALL_DARWIN. Signed-off-by: Richard Henderson --- tcg/ppc/tcg-target.c.inc | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tcg/ppc/tcg-target.c.inc b/tcg/ppc/tcg-target.c.inc index e0f4665

[PULL 9/9] tcg/arm: Fix tcg_out_vec_op function signature

2021-09-12 Thread Richard Henderson
From: "Jose R. Ziviani" Commit 5e8892db93 fixed several function signatures but tcg_out_vec_op for arm is missing. It causes a build error on armv6 and armv7: tcg-target.c.inc:2718:42: error: argument 5 of type 'const TCGArg *' {aka 'const unsigned int *'} declared as a pointer [-Werror=array-pa

[PULL 2/9] accel/tcg: Clear PAGE_WRITE before translation

2021-09-12 Thread Richard Henderson
From: Ilya Leoshkevich translate_insn() implementations fetch instruction bytes piecemeal, which can cause qemu-user to generate inconsistent translations if another thread modifies them concurrently [1]. Fix by making pages containing translated instruction non-writable right before loading ins

  1   2   >