Re: [PATCH qemu] Add TCG support for UMIP

2022-02-07 Thread Philippe Mathieu-Daudé via
On 6/2/22 20:16, ~hildardorf wrote: From: Gareth Webb --- target/i386/cpu.c | 2 +- target/i386/cpu.h | 4 +++- target/i386/helper.c| 8 +++- target/i386/tcg/translate.c | 12 4 files changed, 23 insertions(+), 3 deletions(-) Thanks for pos

[PATCH v2 3/9] hw/acpi/memory_hotplug: Remove unused 'hw/acpi/pc-hotplug.h' header

2022-02-07 Thread Philippe Mathieu-Daudé via
Reviewed-by: Richard Henderson Reviewed-by: Igor Mammedov Signed-off-by: Philippe Mathieu-Daudé --- hw/acpi/memory_hotplug.c | 1 - 1 file changed, 1 deletion(-) diff --git a/hw/acpi/memory_hotplug.c b/hw/acpi/memory_hotplug.c index a581a2183b..0a7e89a13e 100644 --- a/hw/acpi/memory_hotplug.c

Re: [PATCH v4 4/4] hw/i386/sgx: Attach SGX-EPC objects to machine

2022-02-07 Thread Philippe Mathieu-Daudé via
On 7/2/22 09:37, Igor Mammedov wrote: On Sat, 5 Feb 2022 13:45:26 +0100 Philippe Mathieu-Daudé wrote: Previously SGX-EPC objects were exposed in the QOM tree at a path /machine/unattached/device[nn] where the 'nn' varies depending on what devices were already created. With this change t

[PATCH v2 4/9] qtest: Add missing 'hw/qdev-core.h' include

2022-02-07 Thread Philippe Mathieu-Daudé via
Add "hw/qdev-core.h" to avoid when refactoring include/: softmmu/qtest.c:404:9: error: use of undeclared identifier 'NamedGPIOList' NamedGPIOList *ngl; ^ Reviewed-by: Thomas Huth Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé --- softmmu/qtest.c | 1 +

[PATCH v2 8/9] linux-user: Add missing "qemu/timer.h" include

2022-02-07 Thread Philippe Mathieu-Daudé via
"qemu/timer.h" declares cpu_get_host_ticks(). Reviewed-by: Thomas Huth Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé --- linux-user/i386/cpu_loop.c | 1 + linux-user/ppc/cpu_loop.c | 1 + 2 files changed, 2 insertions(+) diff --git a/linux-user/i386/cpu_loop.c b/linux-

[PATCH v2 1/9] hw/tpm: Clean includes

2022-02-07 Thread Philippe Mathieu-Daudé via
"tpm_ppi.h" only requires to include "exec/memory.h" to get the MemoryRegion declaration. tpm_ppi.c requires "hw/qdev-core.h" to use the DEVICE() macro, tpm_crb.c is the only source file requiring "exec/address-spaces.h". Reviewed-by: Thomas Huth Reviewed-by: Richard Henderson Signed-off-by: Ph

[PATCH v2 7/9] target: Add missing "qemu/timer.h" include

2022-02-07 Thread Philippe Mathieu-Daudé via
timer_new_ns(), cpu_get_host_ticks() and NANOSECONDS_PER_SECOND are declared in "qemu/timer.h". Reviewed-by: Thomas Huth Reviewed-by: Richard Henderson Reviewed-by: Alistair Francis Signed-off-by: Philippe Mathieu-Daudé --- target/arm/cpu.c | 1 + target/arm/helper.c | 1 + target/hppa

[PATCH v2 9/9] exec/exec-all: Move 'qemu/log.h' include in units requiring it

2022-02-07 Thread Philippe Mathieu-Daudé via
Many files use "qemu/log.h" declarations but neglect to include it (they inherit it via "exec/exec-all.h"). "exec/exec-all.h" is a core component and shouldn't be used that way. Move the "qemu/log.h" inclusion locally to each unit requiring it. Acked-by: Thomas Huth Reviewed-by: Richard Henderson

[PATCH v2 6/9] core/ptimers: Remove unnecessary 'sysemu/cpus.h' include

2022-02-07 Thread Philippe Mathieu-Daudé via
Reviewed-by: Thomas Huth Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé --- hw/core/ptimer.c | 1 - 1 file changed, 1 deletion(-) diff --git a/hw/core/ptimer.c b/hw/core/ptimer.c index 6ba19fd965..eb5ba1aff7 100644 --- a/hw/core/ptimer.c +++ b/hw/core/ptimer.c @@ -14,7 +1

[PATCH v2 5/9] exec/ramblock: Add missing includes

2022-02-07 Thread Philippe Mathieu-Daudé via
"exec/ramblock.h" requires "qemu/rcu.h" for the definition of rcu_head, and "exec/ramlist.h" for the definition of RAMBlockNotifier. Add them to avoid when when refactoring include/: include/exec/ramblock.h:26:21: error: field has incomplete type 'struct rcu_head' struct rcu_head rcu;

[PATCH v3 20/21] softmmu: Add qemu_init_arch_modules()

2022-02-07 Thread Philippe Mathieu-Daudé via
module_allow_arch() is the single target-specific call in the whole vl.c file. Move the module initialization out to arch_init.c, that way we'll be able to build vl.o once for all targets (the next commit). Reviewed-by: Paolo Bonzini Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu

[PATCH v2 0/9] exec: Remove 'qemu/log.h' from 'exec-all.h'

2022-02-07 Thread Philippe Mathieu-Daudé via
Yet another noisy/boring refactor, but it will allow us to better split exec/ includes as being target-agnostic/specific (the next series). Since v1: - Remove unrelated "hw/s390x/virtio: missing 'cpu.h'" (thuth) - Reword some commit descriptions (thuth) Based-on: <20220207075426.81934-1-f4...@ams

[PATCH v3 17/21] misc: Add missing "sysemu/cpu-timers.h" include

2022-02-07 Thread Philippe Mathieu-Daudé via
Reviewed-by: Paolo Bonzini Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé --- accel/tcg/tcg-accel-ops-icount.c | 1 + accel/tcg/tcg-accel-ops-mttcg.c | 1 + accel/tcg/tcg-accel-ops-rr.c | 1 + accel/tcg/tcg-accel-ops.c| 1 + include/exec/exec-all.h |

[PATCH v2 2/9] hw/remote: Add missing include

2022-02-07 Thread Philippe Mathieu-Daudé via
Currently "qemu/error-report.h" is implicitly included, however if headers in include/ get refactored, we get: hw/remote/proxy-memory-listener.c: In function ‘proxy_memory_listener_commit’: hw/remote/proxy-memory-listener.c:183:9: error: implicit declaration of function ‘error_report’; did yo

[PATCH v3 19/21] exec/cpu: Make address_space_init/reloading_memory_map target agnostic

2022-02-07 Thread Philippe Mathieu-Daudé via
cpu_address_space_init() and cpu_reloading_memory_map() are target-agnostic, but are declared in "exec/exec-all.h" which contains target-specific declarations. Any target-agnostic source including "exec/exec-all.h" becomes target-specific and we have to compile it N times for the N targets built.

[PATCH v3 15/21] softmmu/cpu-timers: Remove unused 'exec/exec-all.h' header

2022-02-07 Thread Philippe Mathieu-Daudé via
Reviewed-by: Richard Henderson Reviewed-by: Paolo Bonzini Signed-off-by: Philippe Mathieu-Daudé --- softmmu/cpu-timers.c | 1 - 1 file changed, 1 deletion(-) diff --git a/softmmu/cpu-timers.c b/softmmu/cpu-timers.c index 34ddfa02f1..204d946a17 100644 --- a/softmmu/cpu-timers.c +++ b/softmmu/cp

[PATCH v3 14/21] softmmu/physmem: Remove unnecessary include

2022-02-07 Thread Philippe Mathieu-Daudé via
Reviewed-by: Paolo Bonzini Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé --- softmmu/physmem.c | 1 - 1 file changed, 1 deletion(-) diff --git a/softmmu/physmem.c b/softmmu/physmem.c index eb4b3bcae7..09951c0996 100644 --- a/softmmu/physmem.c +++ b/softmmu/physmem.c @@ -

[PATCH v3 21/21] softmmu: Build target-agnostic objects once

2022-02-07 Thread Philippe Mathieu-Daudé via
Various softmmu objects aren't target specific. Move them to the generic softmmu source set. For our 31 softmmu targets, this is in total 330 objects less to build! Reviewed-by: Richard Henderson Reviewed-by: Paolo Bonzini Signed-off-by: Philippe Mathieu-Daudé --- softmmu/meson.build | 24 +++

[PATCH v3 12/21] softmmu/globals: Remove unused 'hw/i386/*' headers

2022-02-07 Thread Philippe Mathieu-Daudé via
Reviewed-by: Richard Henderson Reviewed-by: Paolo Bonzini Signed-off-by: Philippe Mathieu-Daudé --- softmmu/globals.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/softmmu/globals.c b/softmmu/globals.c index 7d0fc81183..3ebd718e35 100644 --- a/softmmu/globals.c +++ b/softmmu/globals.c @@

[PATCH v3 11/21] accel: Introduce AccelOpsClass::cpus_are_resettable()

2022-02-07 Thread Philippe Mathieu-Daudé via
Add cpus_are_resettable() to AccelOps, and implement it for the KVM accelerator. Suggested-by: Richard Henderson Reviewed-by: Paolo Bonzini Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé --- accel/kvm/kvm-accel-ops.c | 6 ++ include/sysemu/accel-ops.h | 2 ++ includ

[PATCH v3 16/21] misc: Remove unnecessary "sysemu/cpu-timers.h" include

2022-02-07 Thread Philippe Mathieu-Daudé via
Reviewed-by: Paolo Bonzini Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé --- accel/qtest/qtest.c| 1 - target/alpha/translate.c | 1 - tests/unit/ptimer-test-stubs.c | 1 - 3 files changed, 3 deletions(-) diff --git a/accel/qtest/qtest.c b/accel/qtest/q

[PATCH v3 09/21] softmmu/cpus: Code movement

2022-02-07 Thread Philippe Mathieu-Daudé via
We want cpu_thread_is_idle() to use cpus_accel, so declare this variable earlier. Reviewed-by: Paolo Bonzini Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé --- softmmu/cpus.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/softmmu/cpus.c b/s

[PATCH v3 08/21] accel/hax: Introduce CONFIG_HAX_IS_POSSIBLE

2022-02-07 Thread Philippe Mathieu-Daudé via
Mirror "sysemu/kvm.h" #ifdef'ry to define CONFIG_HAX_IS_POSSIBLE, expose hax_allowed to hax_enabled() macro. Suggested-by: Richard Henderson Reviewed-by: Paolo Bonzini Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé --- accel/stubs/hax-stub.c| 2 ++ include/sysemu/ha

[PATCH v3 18/21] exec/gdbstub: Make gdb_exit() / gdb_set_stop_cpu() target agnostic

2022-02-07 Thread Philippe Mathieu-Daudé via
gdb_exit() and gdb_set_stop_cpu() prototypes don't have to be target specific. Remove this limitation to be able to build softmmu/cpus.c and softmmu/runstate.c once for all targets. Reviewed-by: Richard Henderson Reviewed-by: Paolo Bonzini Signed-off-by: Philippe Mathieu-Daudé --- include/exec

[PATCH v3 13/21] softmmu/runstate: Clean headers

2022-02-07 Thread Philippe Mathieu-Daudé via
Add the missing 'qemu/log.h' header and remove the unused 'exec/exec-all.h' one. Reviewed-by: Richard Henderson Reviewed-by: Paolo Bonzini Signed-off-by: Philippe Mathieu-Daudé --- softmmu/runstate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/softmmu/runstate.c b/softm

[PATCH v3 06/21] sysemu/kvm: Make kvm_on_sigbus() / kvm_on_sigbus_vcpu() target agnostic

2022-02-07 Thread Philippe Mathieu-Daudé via
kvm_on_sigbus() and kvm_on_sigbus_vcpu() prototypes don't have to be target specific. Remove this limitation to be able to build softmmu/cpus.c once for all targets. Reviewed-by: Richard Henderson Reviewed-by: Paolo Bonzini Signed-off-by: Philippe Mathieu-Daudé --- include/sysemu/kvm.h | 6 +++

[PATCH v3 05/21] sysemu/memory_mapping: Become target-agnostic

2022-02-07 Thread Philippe Mathieu-Daudé via
target_ulong is target-specific, while vaddr isn't. Remove the unnecessary "exec/cpu-defs.h" target-speficic header from "memory_mapping.h" and use the target-agnostic "hw/core/cpu.h" locally in memory_mapping.c. Remove "exec/memory.h" since MemoryRegion is forward-declared in "qemu/typedefs.h".

[PATCH v3 10/21] accel: Introduce AccelOpsClass::cpu_thread_is_idle()

2022-02-07 Thread Philippe Mathieu-Daudé via
Add cpu_thread_is_idle() to AccelOps, and implement it for the KVM / WHPX accelerators. Suggested-by: Richard Henderson Reviewed-by: Paolo Bonzini Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé --- accel/kvm/kvm-accel-ops.c | 6 ++ include/sysemu/accel-ops.h

[PATCH v3 04/21] exec: Make cpu_memory_rw_debug() target agnostic

2022-02-07 Thread Philippe Mathieu-Daudé via
cpu_memory_rw_debug() is declared in "exec/cpu-all.h" which contains target-specific declarations. To be able to use it from target agnostic source, move the declaration to the generic "exec/cpu-common.h" header. Replace the target-specific 'target_ulong' type by 'vaddr' which better reflects the

[PATCH v3 07/21] accel/kvm: Simplify user-mode #ifdef'ry

2022-02-07 Thread Philippe Mathieu-Daudé via
Now than we only build this stub with system emulation, remove the user-mode #ifdef'ry. Reviewed-by: Richard Henderson Reviewed-by: Paolo Bonzini Signed-off-by: Philippe Mathieu-Daudé --- accel/stubs/kvm-stub.c | 5 - 1 file changed, 5 deletions(-) diff --git a/accel/stubs/kvm-stub.c b/ac

[PATCH v3 02/21] accel/meson: Only build hw virtualization with system emulation

2022-02-07 Thread Philippe Mathieu-Daudé via
Reviewed-by: Richard Henderson Reviewed-by: Paolo Bonzini Signed-off-by: Philippe Mathieu-Daudé --- accel/meson.build | 12 +++- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/accel/meson.build b/accel/meson.build index dfd808d2c8..b9a963cf80 100644 --- a/accel/meson.buil

[PATCH v3 01/21] accel: Restrict sysemu stubs to system emulation

2022-02-07 Thread Philippe Mathieu-Daudé via
Reviewed-by: Thomas Huth Reviewed-by: Paolo Bonzini Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé --- accel/stubs/meson.build | 11 +++ 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/accel/stubs/meson.build b/accel/stubs/meson.build index 12dd1539a

[PATCH v3 03/21] exec: Declare vaddr as a generic target-agnostic type

2022-02-06 Thread Philippe Mathieu-Daudé via
Move vaddr type declaration to the generic "exec/cpu-common.h" header. Reviewed-by: Paolo Bonzini Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé --- include/exec/cpu-common.h | 12 include/hw/core/cpu.h | 13 + 2 files changed, 13 insertions(+

[PATCH v3 00/21] softmmu: Make various objects target agnostic

2022-02-06 Thread Philippe Mathieu-Daudé via
This is a re-org accel/ and softmmu/ to have more target-agnostic objects. Series fully reviewed. Paolo, Richard, do you want me to send a pull request for this and the 'Remove "qemu/log.h"' series? Since v1: - Simplify kvm_cpus_are_resettable (Richard) Since RFC: - Rework accel/meson (Richard)

Re: [PATCH v4 10/11] 9p: darwin: meson: Allow VirtFS on Darwin

2022-02-06 Thread Philippe Mathieu-Daudé via
On 6/2/22 21:07, Will Cohen wrote: From: Keno Fischer Signed-off-by: Keno Fischer [Michael Roitzsch: - Rebase for NixOS] Signed-off-by: Michael Roitzsch [Will Cohen: - Rebase to master] Signed-off-by: Will Cohen Reviewed-by: Paolo Bonzini [Will Cohen: - Add check for pthread_fchdir_np to vi

Re: [PATCH v4 09/11] 9p: darwin: Implement compatibility for mknodat

2022-02-06 Thread Philippe Mathieu-Daudé via
On 6/2/22 21:07, Will Cohen wrote: From: Keno Fischer Darwin does not support mknodat. However, to avoid race conditions with later setting the permissions, we must avoid using mknod on the full path instead. We could try to fchdir, but that would cause problems if multiple threads try to call

Re: [PATCH v4 02/11] 9p: Rename 9p-util -> 9p-util-linux

2022-02-06 Thread Philippe Mathieu-Daudé via
On 6/2/22 21:07, Will Cohen wrote: From: Keno Fischer The current file only has the Linux versions of these functions. Rename the file accordingly and update the Makefile to only build it on Linux. A Darwin version of these will follow later in the series. Signed-off-by: Keno Fischer [Michael

Re: [PATCH v4 01/11] 9p: linux: Fix a couple Linux assumptions

2022-02-06 Thread Philippe Mathieu-Daudé via
On 6/2/22 21:07, Will Cohen wrote: From: Keno Fischer - Guard Linux only headers. - Add qemu/statfs.h header to abstract over the which headers are needed for struct statfs - Define `ENOATTR` only if not only defined (it's defined in system headers on Darwin). Signed-off-by: Keno

Re: [PATCH v3 1/2] hw/display/vmware_vga: replace fprintf calls with trace events

2022-02-06 Thread Philippe Mathieu-Daudé via
On 6/2/22 19:39, Carwyn Ellis wrote: Debug output was always being sent to STDERR. This has been replaced with trace events. Signed-off-by: Carwyn Ellis --- hw/display/trace-events | 3 +++ hw/display/vmware_vga.c | 30 ++ 2 files changed, 21 insertions(+), 12

Re: Add TCG support for UMIP

2022-02-06 Thread Philippe Mathieu-Daudé via
On 6/2/22 21:27, Gareth Webb wrote: Dear Maintainers, Please find attached a .patch that adds support for the UMIP cpu feature to x86 TCG. Apologies for the patch being via attachment, I can not get git send-email to play nice with office365. Can you try posting from sourcehut? It worked for

Re: [PATCH v3 16/26] tests/tcg/sh4: disable another unreliable test

2022-02-06 Thread Philippe Mathieu-Daudé via
On 4/2/22 21:43, Alex Bennée wrote: Given the other failures it looks like general thread handling on sh4 is sketchy. It fails more often on CI than on my developer machine though. See https://gitlab.com/qemu-project/qemu/-/issues/856 for more details. Signed-off-by: Alex Bennée Cc: Yoshinori S

Re: [PATCH 0/6] target/arm: -cpu host/max KVM and HVF fixes

2022-02-06 Thread Philippe Mathieu-Daudé via
On 4/2/22 17:55, Peter Maydell wrote: Peter Maydell (6): target/arm: Move '-cpu host' code to cpu64.c target/arm: Use aarch64_cpu_register() for 'host' CPU type target/arm: Make KVM -cpu max exactly like -cpu host target/arm: Unindent unnecessary else-clause target/arm: Fix '-cpu

Re: [PATCH] erst: drop cast to long long

2022-02-06 Thread Philippe Mathieu-Daudé via
On 6/2/22 10:35, Michael S. Tsirkin wrote: The way to print uint64_t is with PRIx64, not with a cast to long long. Cc: Eric DeVolder Signed-off-by: Michael S. Tsirkin --- tests/qtest/erst-test.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Reviewed-by: Philippe Mathieu-Daudé

Re: [PATCH 1/2] isa/piix4: Resolve RTCState attribute

2022-02-05 Thread Philippe Mathieu-Daudé via
On 5/2/22 19:53, Peter Maydell wrote: On Sat, 5 Feb 2022 at 18:05, Bernhard Beschow wrote: Assuming that mc146818_rtc_init() is "syntactic sugar" for code that could be converted into configuration in the future, this patch is a step towards this future by freeing piix4 to care about the inner

Re: [PATCH v4 0/4] hw/i386: QOM-attach CPUs/SGX-EPC objects to their parents

2022-02-05 Thread Philippe Mathieu-Daudé via
On 5/2/22 13:45, Philippe Mathieu-Daudé wrote: Trying to fix the issue reported here: https://lists.nongnu.org/archive/html/qemu-devel/2021-11/msg05670.html First attach the CPUs and SGX-EPC objects to the machine. Since v3: - update VIOT ACPI table (Paolo) This now works on Debian, but fails

[PATCH v4 2/4] hw/i386: Attach CPUs to machine

2022-02-05 Thread Philippe Mathieu-Daudé via
Previously CPUs were exposed in the QOM tree at a path /machine/unattached/device[nn] where the 'nn' of the first CPU is usually zero, but can vary depending on what devices were already created. With this change the CPUs are now at /machine/cpu[nn] where the 'nn' of the first CPU is alway

Re: [PATCH v3 1/2] hw/i386: Attach CPUs to machine

2022-02-05 Thread Philippe Mathieu-Daudé via
On 5/2/22 11:32, Philippe Mathieu-Daudé wrote: +Igor On 5/2/22 10:21, Paolo Bonzini wrote: It broke check-system-debian in CI. OK. This is odd because I am using Ubuntu 20.04 x86_64 host and can not reproduce. I'll investigate. OK I could reproduce using the Docker image pulled from registr

[PATCH v4 1/4] tests/qtest/acpi: Temporary allow VIOT table changes

2022-02-05 Thread Philippe Mathieu-Daudé via
In preparation of changing the VIOT table, add it to the ACPI tests allowlist. Signed-off-by: Philippe Mathieu-Daudé --- tests/qtest/bios-tables-test-allowed-diff.h | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/qtest/bios-tables-test-allowed-diff.h b/tests/qtest/bios-tables-test-all

[PATCH v4 3/4] tests/qtest/acpi: Update VIOT table blob

2022-02-05 Thread Philippe Mathieu-Daudé via
Empty bios-tables-test-allowed-diff.h and run rebuild-expected-aml.sh to update the VIOT blob. The iasl output diff is: /* * Intel ACPI Component Architecture * AML/ASL+ Disassembler version 20210604 (64-bit version) * Copyright (c) 2000 - 2021 Intel Corporation * * Disassembly of tests

[PATCH v4 4/4] hw/i386/sgx: Attach SGX-EPC objects to machine

2022-02-05 Thread Philippe Mathieu-Daudé via
Previously SGX-EPC objects were exposed in the QOM tree at a path /machine/unattached/device[nn] where the 'nn' varies depending on what devices were already created. With this change the SGX-EPC objects are now at /machine/sgx-epc[nn] where the 'nn' of the first SGX-EPC object is always z

[PATCH v4 0/4] hw/i386: QOM-attach CPUs/SGX-EPC objects to their parents

2022-02-05 Thread Philippe Mathieu-Daudé via
Trying to fix the issue reported here: https://lists.nongnu.org/archive/html/qemu-devel/2021-11/msg05670.html First attach the CPUs and SGX-EPC objects to the machine. Since v3: - update VIOT ACPI table (Paolo) Since v2: - added missing QOM property auto-enum: [*] (Yang Zhong) Since v1: - addre

Re: [PATCH v3] 9pfs: Fix segfault in do_readdir_many caused by struct dirent overread

2022-02-05 Thread Philippe Mathieu-Daudé via
On 5/2/22 12:36, Christian Schoenebeck wrote: On Freitag, 4. Februar 2022 06:06:09 CET Vitaly Chikunov wrote: `struct dirent' returned from readdir(3) could be shorter (or longer) than `sizeof(struct dirent)', thus memcpy of sizeof length will overread into unallocated page causing SIGSEGV. Exam

Re: [PULL 0/2] VFIO fixes 2022-02-03

2022-02-05 Thread Philippe Mathieu-Daudé via
On 5/2/22 11:49, Peter Maydell wrote: On Thu, 3 Feb 2022 at 22:38, Alex Williamson wrote: The following changes since commit 8f3e5ce773c62bb5c4a847f3a9a5c98bbb3b359f: Merge remote-tracking branch 'remotes/hdeller/tags/hppa-updates-pull-request' into staging (2022-02-02 19:54:30 +) a

Re: [PATCH 01/11] mos6522: add defines for IFR bit flags

2022-02-05 Thread Philippe Mathieu-Daudé via
On 5/2/22 11:51, Mark Cave-Ayland wrote: On 27/01/2022 23:16, BALATON Zoltan wrote: On Thu, 27 Jan 2022, Mark Cave-Ayland wrote: These are intended to make it easier to see how the physical control lines are wired for each instance. Signed-off-by: Mark Cave-Ayland --- include/hw/misc/mos652

Re: [PATCH] input/adb: Only include where needed

2022-02-05 Thread Philippe Mathieu-Daudé via
On 5/2/22 12:02, Mark Cave-Ayland wrote: On 27/01/2022 23:39, BALATON Zoltan wrote: On Mon, 5 Jul 2021, BALATON Zoltan wrote: The header hw/input/adb.h is included by some files that don't need it. Clean it up and include only where necessary. When you're touching mos6522, I've also have thi

Re: [PATCH v3 1/2] hw/i386: Attach CPUs to machine

2022-02-05 Thread Philippe Mathieu-Daudé via
+Igor On 5/2/22 10:21, Paolo Bonzini wrote: It broke check-system-debian in CI. OK. This is odd because I am using Ubuntu 20.04 x86_64 host and can not reproduce. I'll investigate. Il ven 4 feb 2022, 20:31 Philippe Mathieu-Daudé > ha scritto: On 4/2/22 18:59, Pao

Re: [PATCH 4/4] qapi/meson: Restrict machine-specific objects to sysemu

2022-02-04 Thread Philippe Mathieu-Daudé via
On 4/2/22 18:00, Paolo Bonzini wrote: On 2/4/22 16:29, Philippe Mathieu-Daudé via wrote: machine/ and net/ are only useful to machines; block/ and migration/ to machine or tools. Note we need to keep building machine.json generated sources on all targets because some want to access

Re: [PATCH v3 23/26] tests/plugin: allow libinsn.so per-CPU counts

2022-02-04 Thread Philippe Mathieu-Daudé via
On 4/2/22 21:43, Alex Bennée wrote: We won't go fully flexible but for most system emulation 8 vCPUs resolution should be enough for anybody ;-) Signed-off-by: Alex Bennée Message-Id: <20220124201608.604599-20-alex.ben...@linaro.org> --- tests/plugin/insn.c | 39 ++

Re: [PATCH v3 24/26] tests/plugins: add instruction matching to libinsn.so

2022-02-04 Thread Philippe Mathieu-Daudé via
On 4/2/22 21:43, Alex Bennée wrote: This adds simple instruction matching to the libinsn.so plugin which is useful for examining the execution distance between instructions. For example to track how often we flush in ARM due to TLB updates: -plugin ./tests/plugin/libinsn.so,match=tlbi which

Re: [PATCH v3 03/26] Makefile: also remove .gcno files when cleaning

2022-02-04 Thread Philippe Mathieu-Daudé via
On 4/2/22 21:43, Alex Bennée wrote: Left over .gcno files from old builds can really confuse gcov and the user expects a clean slate after "make clean". Make clean mean clean. Signed-off-by: Alex Bennée Message-Id: <20220124201608.604599-4-alex.ben...@linaro.org> --- v2 - fix whitespace dam

Re: [PATCH v3 26/26] plugins: move reset of plugin data to tb_start

2022-02-04 Thread Philippe Mathieu-Daudé via
On 4/2/22 21:43, Alex Bennée wrote: We can't always guarantee we get to the end of a translator loop. Although this can happen for a variety of reasons it does happen more often on x86 system emulation when an instruction spans across to an un-faulted page. This caused confusion of the instructio

Re: [PATCH v3] 9pfs: Fix segfault in do_readdir_many caused by struct dirent overread

2022-02-04 Thread Philippe Mathieu-Daudé via
On 4/2/22 17:04, Christian Schoenebeck wrote: On Freitag, 4. Februar 2022 16:54:12 CET Philippe Mathieu-Daudé wrote: On 4/2/22 16:50, Dmitry V. Levin wrote: On Fri, Feb 04, 2022 at 06:32:07PM +0300, Vitaly Chikunov wrote: [...] struct dirent * qemu_dirent_dup(struct dirent *dent) { siz

Re: [PATCH v3 1/2] hw/i386: Attach CPUs to machine

2022-02-04 Thread Philippe Mathieu-Daudé via
On 4/2/22 18:59, Paolo Bonzini wrote: This is causing breakage in the acpi-tables-test, sorry. $ make check-qtest-x86_64 Ok: 49 Expected Fail: 0 Fail: 0 Unexpected Pass:0 Skipped:7 Timeout:0 $ make check-qtest-i386 Ok:

Re: [PATCH 3/4] qom: Remove user-creatable objects from user emulation

2022-02-04 Thread Philippe Mathieu-Daudé via
On 4/2/22 16:56, Thomas Huth wrote: On 04/02/2022 16.29, Philippe Mathieu-Daudé wrote: user-mode don't use user-creatable objects. Restrict it to sysemu / tools. Add a stub to avoid a link failure with the global callback:    /usr/bin/ld: libqom.fa(qom_object.c.o): in function `object_initial

Re: [PATCH v3] 9pfs: Fix segfault in do_readdir_many caused by struct dirent overread

2022-02-04 Thread Philippe Mathieu-Daudé via
On 4/2/22 16:50, Dmitry V. Levin wrote: On Fri, Feb 04, 2022 at 06:32:07PM +0300, Vitaly Chikunov wrote: [...] struct dirent * qemu_dirent_dup(struct dirent *dent) { size_t sz = offsetof(struct dirent, d_name) + _D_EXACT_NAMLEN(dent) + 1; But d_namlen is not populated by synth_direntry, s

[PATCH 4/4] qapi/meson: Restrict machine-specific objects to sysemu

2022-02-04 Thread Philippe Mathieu-Daudé via
machine/ and net/ are only useful to machines; block/ and migration/ to machine or tools. Note we need to keep building machine.json generated sources on all targets because some want to access X86CPUFeatureWordInfo from any architecture ¯\_(ツ)_/¯ Otherwise we get on all but x86 targets: /usr/b

[PATCH 1/4] configure: Restrict TCG to emulation

2022-02-04 Thread Philippe Mathieu-Daudé via
If we don't need to emulate any target, we certainly don't need TCG. Signed-off-by: Philippe Mathieu-Daudé --- configure | 12 ++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/configure b/configure index 9f40d60196..4002f81ac9 100755 --- a/configure +++ b/configure @@

[PATCH 2/4] tests/fp: Do not build softfloat3 tests if TCG is disabled

2022-02-04 Thread Philippe Mathieu-Daudé via
Technically we don't need the TCG accelerator to run the softfloat3 tests. However it is unlikely an interesting build combination. Developers using softfloat3 likely use TCG too. Similarly, developers disabling TCG shouldn't mind much about softfloat3 tests. This reduces a non-TCG build by 474 ob

[PATCH 3/4] qom: Remove user-creatable objects from user emulation

2022-02-04 Thread Philippe Mathieu-Daudé via
user-mode don't use user-creatable objects. Restrict it to sysemu / tools. Add a stub to avoid a link failure with the global callback: /usr/bin/ld: libqom.fa(qom_object.c.o): in function `object_initialize_child_with_propsv': ../qom/object.c:578: undefined reference to `user_creatable_compl

[PATCH 0/4] buildsys: Avoid building unused objects

2022-02-04 Thread Philippe Mathieu-Daudé via
Hi, I already sent these patches few times. I am refactoring the whole tree and building over and over various combinations, and still see unuseful objects being built, so posting these patches again (rebased). Based-on: <20220203193803.45671-1-f4...@amsat.org> Philippe Mathieu-Daudé (4): conf

Re: [PATCH v3] 9pfs: Fix segfault in do_readdir_many caused by struct dirent overread

2022-02-04 Thread Philippe Mathieu-Daudé via
On 4/2/22 06:06, Vitaly Chikunov wrote: `struct dirent' returned from readdir(3) could be shorter (or longer) than `sizeof(struct dirent)', thus memcpy of sizeof length will overread into unallocated page causing SIGSEGV. Example stack trace: #0 0x559ebeed v9fs_co_readdir_many (/usr/b

Re: [PATCH v4 2/5] tcg/sparc: Improve code gen for shifted 32-bit constants

2022-02-04 Thread Philippe Mathieu-Daudé via
On 4/2/22 08:00, Richard Henderson wrote: We had code for checking for 13 and 21-bit shifted constants, but we can do better and allow 32-bit shifted constants. This is still 2 insns shorter than the full 64-bit sequence. Signed-off-by: Richard Henderson --- tcg/sparc/tcg-target.c.inc | 12 ++

Re: [PATCH 03/10] hw/s390x/virtio: Add missing 'cpu.h' include

2022-02-04 Thread Philippe Mathieu-Daudé via
On 4/2/22 08:50, Thomas Huth wrote: On 03/02/2022 20.37, Philippe Mathieu-Daudé wrote: CPUS390XState is declared in "cpu.h". And how is this related to your qemu/log.h refactoring / why is this patch needed now? Hmm I might have been too overzealous when splitting in 3 parts, this belong to

Re: [PATCH v2 02/21] accel/meson: Only build hw virtualization with system emulation

2022-02-04 Thread Philippe Mathieu-Daudé via
On 4/2/22 08:37, Thomas Huth wrote: On 03/02/2022 20.17, Philippe Mathieu-Daudé wrote: Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé ---   accel/meson.build | 12 +++-   1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/accel/meson.build b/accel/meson.

Re: [PATCH v5 2/2] tcg/mips: Support unaligned access for softmmu

2022-02-03 Thread Philippe Mathieu-Daudé via
On 2/2/22 00:41, Richard Henderson wrote: We can use the routines just added for user-only to emit unaligned accesses in softmmu mode too. Signed-off-by: Richard Henderson --- tcg/mips/tcg-target.c.inc | 91 ++- 1 file changed, 51 insertions(+), 40 deletio

Re: [PATCH v5 1/2] tcg/mips: Support unaligned access for user-only

2022-02-03 Thread Philippe Mathieu-Daudé via
On 2/2/22 00:41, Richard Henderson wrote: This is kinda sorta the opposite of the other tcg hosts, where we get (normal) alignment checks for free with host SIGBUS and need to add code to support unaligned accesses. Fortunately, the ISA contains pairs of instructions that are used to implement u

Re: [PATCH v5 0/2] tcg/mips: Unaligned access support

2022-02-03 Thread Philippe Mathieu-Daudé via
Cc'ing other reviewers: $ ./scripts/get_maintainer.pl -f tcg/mips/tcg-target.h "Philippe Mathieu-Daudé" (odd fixer:MIPS TCG target) Aurelien Jarno (reviewer:MIPS TCG target) Huacai Chen (reviewer:MIPS TCG target) Jiaxun Yang (reviewer:MIPS TCG target) Aleksandar Rikalo (reviewer:MIPS TCG tar

Re: [PATCH 25/27] meson: require dynamic linking for VSS support

2022-02-03 Thread Philippe Mathieu-Daudé via
On 3/2/22 18:33, Paolo Bonzini wrote: From: Marc-André Lureau The glib_dynamic detection does not work because the dependency is overridden in the main meson.build. Signed-off-by: Marc-André Lureau [Rewritten commit message, added requirement in qga/meson.build - Paolo] Signed-off-by: Paolo B

Re: [PATCH 24/27] qga/vss-win32: require widl/midl, remove pre-built TLB file

2022-02-03 Thread Philippe Mathieu-Daudé via
On 3/2/22 18:33, Paolo Bonzini wrote: From: Marc-André Lureau There are no good reason anymore to keep a pre-built file in the repository. Signed-off-by: Marc-André Lureau Signed-off-by: Paolo Bonzini --- meson.build | 4 qga/meson.build | 2 ++ qga/vss-w

Re: [PATCH 21/27] qga/vss: use standard windows headers location

2022-02-03 Thread Philippe Mathieu-Daudé via
On 3/2/22 18:33, Paolo Bonzini wrote: From: Marc-André Lureau Stop using special paths with outdated headers from an old SDK. Instead, use standard include paths. You can still build against the old SDK by running configure with --extra-cxxflags="-isystem `/path/to/inc/win2003/" Superfluous

Re: [PATCH 11/27] meson: define qemu_cflags/qemu_ldflags

2022-02-03 Thread Philippe Mathieu-Daudé via
On 3/2/22 18:33, Paolo Bonzini wrote: Prepare for moving more compiler tests to Meson. If the full set of compiler flags is needed in a cc.compiles/cc.links test, it will be handy to have a variable analogous to QEMU_CFLAGS. Signed-off-by: Paolo Bonzini --- meson.build | 13 +++-- 1

[PATCH 01/10] hw/tpm: Clean includes

2022-02-03 Thread Philippe Mathieu-Daudé via
"tpm_ppi.h" only requires to include "exec/memory.h" to get the MemoryRegion declaration. tpm_ppi.c requires "hw/qdev-core.h" to use the DEVICE() macro, tpm_crb.c is the only source file requiring "exec/address-spaces.h". Signed-off-by: Philippe Mathieu-Daudé --- hw/tpm/tpm_crb.c | 1 + hw/tpm/

[PATCH 00/10] exec: Remove 'qemu/log.h' from 'exec-all.h'

2022-02-03 Thread Philippe Mathieu-Daudé via
Yet another noisy/boring refactor, but it will allow us to better split exec/ includes as being target-agnostic/specific (the next series). Based-on: <20220203191814.45023-1-f4...@amsat.org> "softmmu: Make various objects target agnostic" Philippe Mathieu-Daudé (10): hw/tpm: Clean includes hw

[PATCH 10/10] exec/exec-all: Move 'qemu/log.h' include in units requiring it

2022-02-03 Thread Philippe Mathieu-Daudé via
Many files use "qemu/log.h" declarations but neglect to include it (they inherit it via "exec/exec-all.h"). "exec/exec-all.h" is a core component and shouldn't be used that way. Move the "qemu/log.h" inclusion locally to each unit requiring it. Signed-off-by: Philippe Mathieu-Daudé --- bsd-user/

[PATCH 09/10] linux-user: Add missing "qemu/timer.h" include

2022-02-03 Thread Philippe Mathieu-Daudé via
"qemu/timer.h" declares cpu_get_host_ticks(). Signed-off-by: Philippe Mathieu-Daudé --- linux-user/i386/cpu_loop.c | 1 + linux-user/ppc/cpu_loop.c | 1 + 2 files changed, 2 insertions(+) diff --git a/linux-user/i386/cpu_loop.c b/linux-user/i386/cpu_loop.c index 29dfd7cd0c..90bffc1956 100644 -

[PATCH 08/10] target: Add missing "qemu/timer.h" include

2022-02-03 Thread Philippe Mathieu-Daudé via
cpu_get_host_ticks() and NANOSECONDS_PER_SECOND are declared in "qemu/timer.h". Signed-off-by: Philippe Mathieu-Daudé --- target/arm/cpu.c | 1 + target/arm/helper.c | 1 + target/hppa/cpu.c | 1 + target/riscv/csr.c| 1 + target/sparc/helper.c | 1 + 5 files changed, 5 insertions

[PATCH v2 13/21] softmmu/runstate: Clean headers

2022-02-03 Thread Philippe Mathieu-Daudé via
Add the missing 'qemu/log.h' header and remove the unused 'exec/exec-all.h' one. Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé --- softmmu/runstate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/softmmu/runstate.c b/softmmu/runstate.c index 10d9b736

[PATCH 06/10] exec/ramblock: Add missing includes

2022-02-03 Thread Philippe Mathieu-Daudé via
Add missing includes to avoid when refactoring include/ include/exec/ramblock.h:26:21: error: field has incomplete type 'struct rcu_head' struct rcu_head rcu; ^ Signed-off-by: Philippe Mathieu-Daudé --- include/exec/ramblock.h | 2 ++ 1 file changed, 2 insertions(+)

[PATCH v2 11/21] accel: Introduce AccelOpsClass::cpus_are_resettable()

2022-02-03 Thread Philippe Mathieu-Daudé via
Add cpus_are_resettable() to AccelOps, and implement it for the KVM accelerator. Suggested-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé --- accel/kvm/kvm-accel-ops.c | 6 ++ include/sysemu/accel-ops.h | 2 ++ include/sysemu/hw_accel.h | 5 - softmmu/cpus.c |

[PATCH 07/10] core/ptimers: Remove unnecessary 'sysemu/cpus.h' include

2022-02-03 Thread Philippe Mathieu-Daudé via
Signed-off-by: Philippe Mathieu-Daudé --- hw/core/ptimer.c | 1 - 1 file changed, 1 deletion(-) diff --git a/hw/core/ptimer.c b/hw/core/ptimer.c index 6ba19fd965..eb5ba1aff7 100644 --- a/hw/core/ptimer.c +++ b/hw/core/ptimer.c @@ -14,7 +14,6 @@ #include "sysemu/cpu-timers.h" #include "sysemu/q

[PATCH v2 10/21] accel: Introduce AccelOpsClass::cpu_thread_is_idle()

2022-02-03 Thread Philippe Mathieu-Daudé via
Add cpu_thread_is_idle() to AccelOps, and implement it for the KVM / WHPX accelerators. Suggested-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé --- accel/kvm/kvm-accel-ops.c | 6 ++ include/sysemu/accel-ops.h| 1 + softmmu/cpus.c| 6 --

[PATCH 04/10] hw/acpi/memory_hotplug: Remove unused 'hw/acpi/pc-hotplug.h' header

2022-02-03 Thread Philippe Mathieu-Daudé via
Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé --- hw/acpi/memory_hotplug.c | 1 - 1 file changed, 1 deletion(-) diff --git a/hw/acpi/memory_hotplug.c b/hw/acpi/memory_hotplug.c index a581a2183b..0a7e89a13e 100644 --- a/hw/acpi/memory_hotplug.c +++ b/hw/acpi/memory_hotplug

[PATCH 05/10] qtest: Add missing 'hw/qdev-core.h' include

2022-02-03 Thread Philippe Mathieu-Daudé via
Add "hw/qdev-core.h" to avoid when refactoring include/: softmmu/qtest.c:404:9: error: use of undeclared identifier 'NamedGPIOList' NamedGPIOList *ngl; ^ Signed-off-by: Philippe Mathieu-Daudé --- softmmu/qtest.c | 1 + 1 file changed, 1 insertion(+) diff --git a/softmmu/qtest

[PATCH 02/10] hw/remote: Add missing include

2022-02-03 Thread Philippe Mathieu-Daudé via
Currently "qemu/error-report.h" is implicitly included, however if headers in include/ get refactored, we get: hw/remote/proxy-memory-listener.c: In function ‘proxy_memory_listener_commit’: hw/remote/proxy-memory-listener.c:183:9: error: implicit declaration of function ‘error_report’; did yo

[PATCH v2 05/21] sysemu/memory_mapping: Become target-agnostic

2022-02-03 Thread Philippe Mathieu-Daudé via
target_ulong is target-specific, while vaddr isn't. Remove the unnecessary "exec/cpu-defs.h" target-speficic header from "memory_mapping.h" and use the target-agnostic "hw/core/cpu.h" locally in memory_mapping.c. Remove "exec/memory.h" since MemoryRegion is forward-declared in "qemu/typedefs.h".

[PATCH 03/10] hw/s390x/virtio: Add missing 'cpu.h' include

2022-02-03 Thread Philippe Mathieu-Daudé via
CPUS390XState is declared in "cpu.h". Signed-off-by: Philippe Mathieu-Daudé --- hw/s390x/s390-virtio-hcall.h | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/s390x/s390-virtio-hcall.h b/hw/s390x/s390-virtio-hcall.h index 9800c4b351..9773ed8a21 100644 --- a/hw/s390x/s390-virtio-hcall.h +++

[PATCH v2 04/21] exec: Make cpu_memory_rw_debug() target agnostic

2022-02-03 Thread Philippe Mathieu-Daudé via
cpu_memory_rw_debug() is declared in "exec/cpu-all.h" which contains target-specific declarations. To be able to use it from target agnostic source, move the declaration to the generic "exec/cpu-common.h" header. Replace the target-specific 'target_ulong' type by 'vaddr' which better reflects the

[PATCH v2 21/21] softmmu: Build target-agnostic objects once

2022-02-03 Thread Philippe Mathieu-Daudé via
Various softmmu objects aren't target specific. Move them to the generic softmmu source set. For our 31 softmmu targets, this is in total 330 objects less to build! Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé --- softmmu/meson.build | 24 1 fil

[PATCH v2 15/21] softmmu/cpu-timers: Remove unused 'exec/exec-all.h' header

2022-02-03 Thread Philippe Mathieu-Daudé via
Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé --- softmmu/cpu-timers.c | 1 - 1 file changed, 1 deletion(-) diff --git a/softmmu/cpu-timers.c b/softmmu/cpu-timers.c index 34ddfa02f1..204d946a17 100644 --- a/softmmu/cpu-timers.c +++ b/softmmu/cpu-timers.c @@ -28,7 +28,6 @@

[PATCH v2 03/21] exec: Declare vaddr as a generic target-agnostic type

2022-02-03 Thread Philippe Mathieu-Daudé via
Move vaddr type declaration to the generic "exec/cpu-common.h" header. Signed-off-by: Philippe Mathieu-Daudé --- include/exec/cpu-common.h | 12 include/hw/core/cpu.h | 13 + 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/include/exec/cpu-common.h b

<    3   4   5   6   7   8   9   10   11   >