Re: [PATCH] hw/i386: Improve bounds checking in OVMF table parsing

2022-02-14 Thread Philippe Mathieu-Daudé via
On 14/2/22 13:08, Dov Murik wrote: When pc_system_parse_ovmf_flash() parses the optional GUIDed table in the end of the OVMF flash memory area, the table length field is checked for sizes that are too small, but doesn't error on sizes that are too big (bigger than the flash content itself). Add

Re: bdrv_is_allocated

2022-02-13 Thread Philippe Mathieu-Daudé via
On 13/2/22 15:24, 沈梦姣 wrote: Hi, I’m trying to understand this function, but seems no note in the header file, could anyone help explain this function? It will be great if there is an example. Thanks in advance! thanks Cc'ing qemu-block@ list.

[PATCH v4 11/13] audio/dbus: Fix building with modules on macOS

2022-02-11 Thread Philippe Mathieu-Daudé via
When configuring QEMU with --enable-modules we get on macOS: --- stderr --- Dependency ui-dbus cannot be satisfied ui-dbus depends on pixman and opengl, so add these dependencies to audio-dbus. Fixes: 739362d420 ("audio: add "dbus" audio backend") Reviewed-by: Li Zhang Signed-off-by: Philip

[PATCH v4 13/13] gitlab-ci: Support macOS 12 via cirrus-run

2022-02-11 Thread Philippe Mathieu-Daudé via
Add support for macOS 12 build on Cirrus-CI, similarly to commit 0e103a65ba1 ("gitlab: support for ... macOS 11 via cirrus-run"), but with the following differences: - Enable modules (configure --enable-modules) - Do not run softfloat3 tests (make check-softfloat) Generate the vars file by calli

[PATCH v4 09/13] block/file-posix: Remove a deprecation warning on macOS 12

2022-02-11 Thread Philippe Mathieu-Daudé via
When building on macOS 12 we get: block/file-posix.c:3335:18: warning: 'IOMasterPort' is deprecated: first deprecated in macOS 12.0 [-Wdeprecated-declarations] kernResult = IOMasterPort( MACH_PORT_NULL, &masterPort ); ^~~~ IOMainPort Replace

[PATCH v4 10/13] audio/coreaudio: Remove a deprecation warning on macOS 12

2022-02-11 Thread Philippe Mathieu-Daudé via
When building on macOS 12 we get: audio/coreaudio.c:50:5: error: 'kAudioObjectPropertyElementMaster' is deprecated: first deprecated in macOS 12.0 [-Werror,-Wdeprecated-declarations] kAudioObjectPropertyElementMaster ^ kAudioObjectPropertyElemen

[PATCH v4 07/13] hvf: Make hvf_get_segments() / hvf_put_segments() local

2022-02-11 Thread Philippe Mathieu-Daudé via
Both hvf_get_segments/hvf_put_segments() functions are only used within x86hvf.c: do not declare them as public API. Reviewed-by: Roman Bolshakov Tested-by: Roman Bolshakov Signed-off-by: Philippe Mathieu-Daudé --- target/i386/hvf/x86hvf.c | 4 ++-- target/i386/hvf/x86hvf.h | 2 -- 2 files cha

[PATCH v4 04/13] hvf: Use standard CR0 and CR4 register definitions

2022-02-11 Thread Philippe Mathieu-Daudé via
From: Cameron Esfahani No need to have our own definitions of these registers. Signed-off-by: Cameron Esfahani Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Philippe Mathieu-Daudé --- target/i386/hvf/vmx.h | 17 + target/i386/hvf/x86.c | 6 +++--- target/i386/

[PATCH v4 08/13] hvf: Remove deprecated hv_vcpu_flush() calls

2022-02-11 Thread Philippe Mathieu-Daudé via
When building on macOS 11 [*], we get: In file included from ../target/i386/hvf/hvf.c:59: ../target/i386/hvf/vmx.h:174:5: error: 'hv_vcpu_flush' is deprecated: first deprecated in macOS 11.0 - This API has no effect and always returns HV_UNSUPPORTED [-Werror,-Wdeprecated-declarations]

[PATCH v4 05/13] hvf: Fix OOB write in RDTSCP instruction decode

2022-02-11 Thread Philippe Mathieu-Daudé via
From: Cameron Esfahani A guest could craft a specific stream of instructions that will have QEMU write 0xF9 to inappropriate locations in memory. Add additional asserts to check for this. Generate a #UD if there are more than 14 prefix bytes. Found by Julian Stecklina Signed-off-by: Cameron

[PATCH v4 12/13] ui/cocoa: Remove allowedFileTypes restriction in SavePanel

2022-02-11 Thread Philippe Mathieu-Daudé via
setAllowedFileTypes is deprecated in macOS 12. Per Akihiko Odaki [*]: An image file, which is being chosen by the panel, can be a raw file and have a variety of file extensions and many are not covered by the provided list (e.g. "udf"). Other platforms like GTK can provide an option to op

[PATCH v4 02/13] configure: Allow passing extra Objective C compiler flags

2022-02-11 Thread Philippe Mathieu-Daudé via
We can pass C/CPP/LD flags via CFLAGS/CXXFLAGS/LDFLAGS environment variables, or via configure --extra-cflags / --extra-cxxflags / --extra-ldflags options. Provide similar behavior for Objective C: use existing flags from $OBJCFLAGS, or passed via --extra-objcflags. Signed-off-by: Philippe Mathieu

[PATCH v4 00/13] host: Support macOS 12

2022-02-11 Thread Philippe Mathieu-Daudé via
Few patches to be able to build QEMU on macOS 12 (Monterey). This basically consists of adapting deprecated APIs. CI job added to avoid bitrotting. Since v3: - Fix --enable-modules - Ignore #pragma on softfloat3 tests - Addressed Akihiko Odaki comments - Include Cameron Esfahani patches Since v

[PATCH v4 06/13] hvf: Enable RDTSCP support

2022-02-11 Thread Philippe Mathieu-Daudé via
From: Cameron Esfahani Pass through RDPID and RDTSCP support in CPUID if host supports it. Correctly detect if CPU_BASED_TSC_OFFSET and CPU_BASED2_RDTSCP would be supported in primary and secondary processor-based VM-execution controls. Enable RDTSCP in secondary processor controls if RDTSCP sup

[PATCH v4 03/13] tests/fp/berkeley-testfloat-3: Ignore ignored #pragma directives

2022-02-11 Thread Philippe Mathieu-Daudé via
Since we already use -Wno-unknown-pragmas, we can also use -Wno-ignored-pragmas. This silences hundred of warnings using clang 13 on macOS Monterey: [409/771] Compiling C object tests/fp/libtestfloat.a.p/berkeley-testfloat-3_source_test_az_f128_rx.c.o ../tests/fp/berkeley-testfloat-3/source/t

[PATCH v4 01/13] lcitool: refresh

2022-02-11 Thread Philippe Mathieu-Daudé via
Signed-off-by: Philippe Mathieu-Daudé --- tests/docker/dockerfiles/ubuntu1804.docker | 2 -- tests/docker/dockerfiles/ubuntu2004.docker | 2 -- 2 files changed, 4 deletions(-) diff --git a/tests/docker/dockerfiles/ubuntu1804.docker b/tests/docker/dockerfiles/ubuntu1804.docker index 699f2dfc6a..

Re: [PATCH v5 1/2] semihosting/arm-compat: replace heuristic for softmmu SYS_HEAPINFO

2022-02-11 Thread Philippe Mathieu-Daudé via
On 11/2/22 14:22, Alex Bennée wrote: Peter Maydell writes: On Thu, 10 Feb 2022 at 11:48, Philippe Mathieu-Daudé wrote: Hi Alex, On 10/2/22 12:30, Alex Bennée wrote: The previous numbers were a guess at best and rather arbitrary without taking into account anything that might be loaded. I

Re: [PATCH 2/9] coverity-scan: Cover common-user/

2022-02-11 Thread Philippe Mathieu-Daudé via
On 11/2/22 12:56, Peter Maydell wrote: On Wed, 9 Feb 2022 at 23:12, Philippe Mathieu-Daudé via wrote: common-user/ has been added in commit bbf15aaf7c ("common-user: Move safe-syscall.* from linux-user"). Signed-off-by: Philippe Mathieu-Daudé --- scripts/coverity-scan/COMPONE

Re: [PATCH] Hexagon (target/hexagon) convert to OBJECT_DECLARE_TYPE

2022-02-11 Thread Philippe Mathieu-Daudé via
On 11/2/22 04:30, Taylor Simpson wrote: Suggested-by: Richard Henderson Signed-off-by: Taylor Simpson --- target/hexagon/cpu.h | 9 ++--- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/target/hexagon/cpu.h b/target/hexagon/cpu.h index 58a0d3870b..e3efbb2303 100644 --- a/ta

Re: [PATCH v3 1/2] hvf: arm: Use macros for sysreg shift/masking

2022-02-11 Thread Philippe Mathieu-Daudé via
On 9/2/22 13:41, Alexander Graf wrote: We are parsing the syndrome field for sysregs in multiple places across the hvf code, but repeat shift/mask operations with hard coded constants every time. This is an error prone approach and makes it harder to reason about the correctness of these operatio

Re: [PATCH 6/9] exec: Define MMUAccessType in 'exec/cpu-tlb.h' header

2022-02-11 Thread Philippe Mathieu-Daudé via
On 11/2/22 00:14, Richard Henderson wrote: On 2/10/22 10:00, Philippe Mathieu-Daudé wrote: To reduce the inclusion of "hw/core/cpu.h", extract MMUAccessType to its own "exec/cpu-tlb.h" header. Signed-off-by: Philippe Mathieu-Daudé --- Not keen on the name, unless you plan to put something els

Re: [PATCH 1/9] accel/tcg: Add missing 'tcg/tcg.h' header

2022-02-11 Thread Philippe Mathieu-Daudé via
On 11/2/22 00:25, Richard Henderson wrote: On 2/10/22 10:00, Philippe Mathieu-Daudé wrote: 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

Re: [PATCH 7/9] user: Declare target-specific prototypes in 'user/cpu-target.h'

2022-02-11 Thread Philippe Mathieu-Daudé via
+Thomas On 11/2/22 00:19, Richard Henderson wrote: On 2/10/22 10:00, Philippe Mathieu-Daudé wrote: Move user-mode specific prototypes from "exec/exec-all.h" to "user/cpu-target.h". Signed-off-by: Philippe Mathieu-Daudé --- Why a new cpu-target.h, and what is it supposed to mean?  What else i

Re: [PATCH] hw/i386/pc: when adding reserved E820 entries do not allocate dynamic entries

2022-02-10 Thread Philippe Mathieu-Daudé via
On 10/2/22 14:28, Ani Sinha wrote: When adding E820_RESERVED entries we also accidentally allocate dynamic entries. This is incorrect. We should simply return early with the count of the number of reserved entries added. fixes: 7d67110f2d9a6("pc: add etc/e820 fw_cfg file") 8 years old, so this

Re: [PATCH 1/2] vhost-user-blk: handle errors in vhost_user_blk_connect

2022-02-10 Thread Philippe Mathieu-Daudé via
On 10/2/22 12:46, Konstantin Khlebnikov wrote: Cleanup vhost device and update connection state when initialization fails. Signed-off-by: Konstantin Khlebnikov --- hw/block/vhost-user-blk.c | 10 -- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/hw/block/vhost-user-b

Re: [PATCH] vhost: fix repeated memory unmap in error paths

2022-02-10 Thread Philippe Mathieu-Daudé via
On 10/2/22 12:46, Konstantin Khlebnikov wrote: Fuzzing found that on some error paths vhost_memory_unmap() is called twice or for NULL address. Let's reset pointers after unmap and ingnore unmap for NULL. Signed-off-by: Konstantin Khlebnikov --- hw/virtio/vhost.c |4 +++- 1 file changed,

Re: [PATCH] meson: put custom CFLAGS after default CFLAGS

2022-02-10 Thread Philippe Mathieu-Daudé via
Hi Konstantin, On 10/2/22 12:44, Konstantin Khlebnikov wrote: Flags passed to configure must be at the end to override defaults. Signed-off-by: Konstantin Khlebnikov --- meson.build | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/meson.build b/meson.build

Re: [PATCH v5 1/2] semihosting/arm-compat: replace heuristic for softmmu SYS_HEAPINFO

2022-02-10 Thread Philippe Mathieu-Daudé via
Hi Alex, On 10/2/22 12:30, Alex Bennée wrote: The previous numbers were a guess at best and rather arbitrary without taking into account anything that might be loaded. Instead of using guesses based on the state of registers implement a new function that: a) scans the MemoryRegions for the la

Re: [PATCH v4] hw/sensor: Add lsm303dlhc magnetometer device

2022-02-10 Thread Philippe Mathieu-Daudé via
Hi Kevin, On 30/1/22 10:50, Kevin Townsend wrote: This commit adds emulation of the magnetometer on the LSM303DLHC. It allows the magnetometer's X, Y and Z outputs to be set via the mag-x, mag-y and mag-z properties, as well as the 12-bit temperature output via the temperature property. Sensor c

Re: [PATCH v2 06/15] target/arm: Use MAKE_64BIT_MASK to compute indexmask

2022-02-10 Thread Philippe Mathieu-Daudé via
On 10/2/22 05:04, Richard Henderson wrote: The macro is a bit more readable than the inlined computation. Signed-off-by: Richard Henderson --- target/arm/helper.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) Reviewed-by: Philippe Mathieu-Daudé

Re: [PATCH 0/2] Kconfig: Add an I2C_DEVICES device group

2022-02-10 Thread Philippe Mathieu-Daudé via
On 8/2/22 16:59, Peter Maydell wrote: Peter Maydell (2): Kconfig: Add I2C_DEVICES device group Kconfig: Add 'imply I2C_DEVICES' on boards with available i2c bus docs/devel/kconfig.rst | 8 ++-- hw/arm/Kconfig | 10 ++ hw/i2c/Kconfig | 5 + hw/rtc/Kco

Re: [PATCH v2 01/15] hw/registerfields: Add FIELD_SEX and FIELD_SDP

2022-02-10 Thread Philippe Mathieu-Daudé via
On 10/2/22 05:04, Richard Henderson wrote: Add new macros to manipulate signed fields within the register. Suggested-by: Peter Maydell Signed-off-by: Richard Henderson --- include/hw/registerfields.h | 48 - 1 file changed, 47 insertions(+), 1 deletion(-)

Re: [PATCH 3/4] hw/openrisc/openrisc_sim; Add support for loading a decice tree

2022-02-10 Thread Philippe Mathieu-Daudé via
Typo "device" in subject. On 10/2/22 07:30, Stafford Horne wrote: Using the device tree means that qemu can now directly tell the kernel what hardware is configured rather than use having to maintain and update a separate device tree file. This patch adds device tree support for the OpenRISC si

Re: [PATCH 2/4] hw/openrisc/openrisc_sim: Paramatarize initialization

2022-02-10 Thread Philippe Mathieu-Daudé via
On 10/2/22 07:30, Stafford Horne wrote: Move magic numbers to variables and enums. These will be reused for upcoming fdt initialization. Signed-off-by: Stafford Horne --- hw/openrisc/openrisc_sim.c | 42 ++ 1 file changed, 34 insertions(+), 8 deletions(-)

Re: [PATCH 1/4] hw/openrisc/openrisc_sim: Create machine state for or1ksim

2022-02-10 Thread Philippe Mathieu-Daudé via
On 10/2/22 07:30, Stafford Horne wrote: This will allow us to attach machine state attributes like the device tree fdt. Signed-off-by: Stafford Horne --- hw/openrisc/openrisc_sim.c | 31 +-- 1 file changed, 29 insertions(+), 2 deletions(-) @@ -141,6 +153,7 @@ s

[PATCH 6/9] exec: Define MMUAccessType in 'exec/cpu-tlb.h' header

2022-02-09 Thread Philippe Mathieu-Daudé via
To reduce the inclusion of "hw/core/cpu.h", extract MMUAccessType to its own "exec/cpu-tlb.h" header. Signed-off-by: Philippe Mathieu-Daudé --- include/exec/cpu-defs.h | 1 + include/exec/cpu-tlb.h| 16 include/exec/cpu_ldst.h | 1 + include/exec/exec-all.h

[PATCH 8/9] user: Declare target-agnostic prototypes in 'user/cpu-common.h'

2022-02-09 Thread Philippe Mathieu-Daudé via
Move user-mode common prototypes from "exec/exec-all.h" to "user/cpu-common.h". Signed-off-by: Philippe Mathieu-Daudé --- bsd-user/qemu.h | 2 -- include/exec/cpu-all.h | 3 +-- include/exec/exec-all.h | 10 -- include/user/cpu-common.h | 36 +

[PATCH 5/9] linux-user/cpu_loop: Add missing 'exec/cpu-all.h' header

2022-02-09 Thread Philippe Mathieu-Daudé via
env_cpu() is declared in "exec/cpu-all.h". Signed-off-by: Philippe Mathieu-Daudé --- linux-user/cpu_loop-common.h | 1 + 1 file changed, 1 insertion(+) diff --git a/linux-user/cpu_loop-common.h b/linux-user/cpu_loop-common.h index dc0042e4de..b0fd1ea3b1 100644 --- a/linux-user/cpu_loop-common.h

Re: [RFC PATCH 12/15] hw/m68k: Restrict M68kCPU type to target/ code

2022-02-09 Thread Philippe Mathieu-Daudé via
On 9/2/22 23:50, Richard Henderson wrote: On 2/10/22 08:54, Philippe Mathieu-Daudé wrote: Signed-off-by: Philippe Mathieu-Daudé ---   include/hw/m68k/mcf.h | 3 +--   target/m68k/cpu-qom.h | 2 --   target/m68k/cpu.h | 4 ++--   3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/in

[PATCH 7/9] user: Declare target-specific prototypes in 'user/cpu-target.h'

2022-02-09 Thread Philippe Mathieu-Daudé via
Move user-mode specific prototypes from "exec/exec-all.h" to "user/cpu-target.h". Signed-off-by: Philippe Mathieu-Daudé --- accel/tcg/user-exec.c| 1 + bsd-user/elfload.c | 1 + bsd-user/main.c | 1 + bsd-user/signal.c| 1 + include/

[PATCH 9/9] user: Share preexit_cleanup() with linux and bsd implementations

2022-02-09 Thread Philippe Mathieu-Daudé via
preexit_cleanup() is not Linux specific, move it to common-user/. Signed-off-by: Philippe Mathieu-Daudé --- {linux-user => common-user}/exit.c | 0 common-user/meson.build| 1 + linux-user/meson.build | 1 - 3 files changed, 1 insertion(+), 1 deletion(-) rename {linux-us

[PATCH 2/9] coverity-scan: Cover common-user/

2022-02-09 Thread Philippe Mathieu-Daudé via
common-user/ has been added in commit bbf15aaf7c ("common-user: Move safe-syscall.* from linux-user"). Signed-off-by: Philippe Mathieu-Daudé --- scripts/coverity-scan/COMPONENTS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/coverity-scan/COMPONENTS.md b/scripts/

[PATCH 4/9] linux-user/exit: Add missing 'qemu/plugin.h' header

2022-02-09 Thread Philippe Mathieu-Daudé via
qemu_plugin_user_exit() is declared in "qemu/plugin.h". Signed-off-by: Philippe Mathieu-Daudé --- linux-user/exit.c | 1 + 1 file changed, 1 insertion(+) diff --git a/linux-user/exit.c b/linux-user/exit.c index fa6ef0b9b4..10989f17f8 100644 --- a/linux-user/exit.c +++ b/linux-user/exit.c @@ -17

[PATCH 3/9] include: Move exec/user/ to user/

2022-02-09 Thread Philippe Mathieu-Daudé via
Avoid spreading the headers in multiple directories, unify exec/user/ and user/. Signed-off-by: Philippe Mathieu-Daudé --- bsd-user/qemu.h | 4 ++-- include/exec/cpu-all.h | 2 +- include/{exec => }/user/abitypes.h | 0 include/user/safe-syscall.h | 6 ++

[PATCH 1/9] accel/tcg: Add missing 'tcg/tcg.h' header

2022-02-09 Thread Philippe Mathieu-Daudé via
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 + 4 files changed, 4 insertions(+) diff --git a/accel/tcg/tcg-accel-ops-icount.c b/accel/tcg/tcg

[PATCH 0/9] exec: Split some user-mode specific declarations from 'exec/exec-all.h'

2022-02-09 Thread Philippe Mathieu-Daudé via
- Add missing headers - Merge exec/user/ to user/ - Extract MMUAccessType from QOM "hw/core/cpu.h" to "exec/cpu-tlb.h" - Extract user-specific declarations to "user/cpu-{common,target}.h" - Share preexit_cleanup() from Linux with BSD More to come, but flushing for early feedback. Based-on: <20220

Re: [PATCH 11/15] target: Use ArchCPU as interface to target CPU

2022-02-09 Thread Philippe Mathieu-Daudé via
On 9/2/22 22:54, Philippe Mathieu-Daudé wrote: ArchCPU is our interface with target-specific code. Use it as a forward-declared opaque pointer (abstract type), having its structure defined by each target. Signed-off-by: Philippe Mathieu-Daudé --- include/qemu/typedefs.h | 1 + target/al

[PATCH 10/15] target: Use CPUArchState as interface to target-specific CPU state

2022-02-09 Thread Philippe Mathieu-Daudé via
While CPUState is our interface with generic code, CPUArchState is our interface with target-specific code. Use CPUArchState as an abstract type, defined by each target. Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé --- include/exec/poison.h | 2 -- include/hw/core/cpu.

Re: [PATCH] hw/block/fdc-isa: Respect QOM properties when building AML

2022-02-09 Thread Philippe Mathieu-Daudé via
On 9/2/22 20:15, Bernhard Beschow wrote: Other ISA devices such as serial-isa use the properties in their build_aml functions. fdc-isa not using them is probably an oversight. Signed-off-by: Bernhard Beschow --- hw/block/fdc-isa.c | 11 +++ 1 file changed, 7 insertions(+), 4 deletion

[PATCH 07/15] target/i386/tcg/sysemu: Include missing 'exec/exec-all.h' header

2022-02-09 Thread Philippe Mathieu-Daudé via
excp_helper.c requires "exec/exec-all.h" for tlb_set_page_with_attrs() and misc_helper.c for tlb_flush(). Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé --- target/i386/tcg/sysemu/excp_helper.c | 1 + target/i386/tcg/sysemu/misc_helper.c | 1 + 2 files changed, 2 insertion

[RFC PATCH 15/15] hw/sh4: Restrict SuperHCPU type to target/ code

2022-02-09 Thread Philippe Mathieu-Daudé via
Signed-off-by: Philippe Mathieu-Daudé --- include/hw/sh4/sh.h | 3 +-- target/sh4/cpu-qom.h | 2 -- target/sh4/cpu.h | 4 ++-- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/include/hw/sh4/sh.h b/include/hw/sh4/sh.h index ec716cdd45..a4245399d5 100644 --- a/include/hw/sh4/sh.

[RFC PATCH 13/15] hw/mips: Restrict MIPSCPU type to target/ code

2022-02-09 Thread Philippe Mathieu-Daudé via
Signed-off-by: Philippe Mathieu-Daudé --- include/hw/mips/cpudevs.h | 6 ++ target/mips/cpu-qom.h | 2 -- target/mips/cpu.h | 4 ++-- 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/include/hw/mips/cpudevs.h b/include/hw/mips/cpudevs.h index f7c9728fa9..6065932b0e 1

[PATCH 06/15] target/i386/cpu: Ensure accelerators set CPU addressble physical bits

2022-02-09 Thread Philippe Mathieu-Daudé via
The only accelerator allowed to use zero as default value is TCG. Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé --- target/i386/cpu.c | 1 + 1 file changed, 1 insertion(+) diff --git a/target/i386/cpu.c b/target/i386/cpu.c index aa9e636800..16523a78d9 100644 --- a/target

[PATCH 08/15] target: Include missing 'cpu.h'

2022-02-09 Thread Philippe Mathieu-Daudé via
These target-specific files use the target-specific CPU state but lack to include "cpu.h"; i.e.: ../target/riscv/pmp.h:61:23: error: unknown type name 'CPURISCVState' void pmpcfg_csr_write(CPURISCVState *env, uint32_t reg_index, ^ ../target/nios2/mmu.h:43:18:

[PATCH 05/15] cpu: Add missing 'exec/exec-all.h' and 'qemu/accel.h' headers

2022-02-09 Thread Philippe Mathieu-Daudé via
cpu.c requires "exec/exec-all.h" to call tlb_flush() and "qemu/accel.h" to call accel_cpu_realizefn(). Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé --- cpu.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cpu.c b/cpu.c index 97d42b6b2a..6b4aa53775 100644 --- a/cpu

[PATCH 11/15] target: Use ArchCPU as interface to target CPU

2022-02-09 Thread Philippe Mathieu-Daudé via
ArchCPU is our interface with target-specific code. Use it as a forward-declared opaque pointer (abstract type), having its structure defined by each target. Signed-off-by: Philippe Mathieu-Daudé --- include/qemu/typedefs.h | 1 + target/alpha/cpu-qom.h | 4 +++- target/alpha/cpu.h

[PATCH 09/15] target: Use forward declared type instead of structure type

2022-02-09 Thread Philippe Mathieu-Daudé via
The CPU / CPU state are forward declared. $ git grep -E 'struct [A-Za-z]+CPU\ \*' target/arm/hvf_arm.h:16:void hvf_arm_set_cpu_features_from_host(struct ARMCPU *cpu); target/openrisc/cpu.h:234:int (*cpu_openrisc_map_address_code)(struct OpenRISCCPU *cpu, target/openrisc/cpu.h:238:

[RFC PATCH 14/15] hw/sparc: Restrict SPARCCPU type to target/ code

2022-02-09 Thread Philippe Mathieu-Daudé via
Signed-off-by: Philippe Mathieu-Daudé --- include/hw/sparc/sparc64.h | 4 +--- target/sparc/cpu-qom.h | 2 -- target/sparc/cpu.h | 4 ++-- 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/include/hw/sparc/sparc64.h b/include/hw/sparc/sparc64.h index 4ced36fb5a..605ae4448

[PATCH 02/15] hw/m68k/mcf: Add missing 'exec/hwaddr.h' header

2022-02-09 Thread Philippe Mathieu-Daudé via
hwaddr type is defined in "exec/hwaddr.h". Signed-off-by: Philippe Mathieu-Daudé --- include/hw/m68k/mcf.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/hw/m68k/mcf.h b/include/hw/m68k/mcf.h index decf17ce42..8cbd587bbf 100644 --- a/include/hw/m68k/mcf.h +++ b/include/hw/m68k/mcf.h

[PATCH 03/15] hw/tricore: Remove unused and incorrect header

2022-02-09 Thread Philippe Mathieu-Daudé via
TriCore boards certainly don't need the ARM loader API :) Signed-off-by: Philippe Mathieu-Daudé --- include/hw/tricore/triboard.h | 1 - 1 file changed, 1 deletion(-) diff --git a/include/hw/tricore/triboard.h b/include/hw/tricore/triboard.h index f3844be447..094c8bd563 100644 --- a/include/hw/

[RFC PATCH 12/15] hw/m68k: Restrict M68kCPU type to target/ code

2022-02-09 Thread Philippe Mathieu-Daudé via
Signed-off-by: Philippe Mathieu-Daudé --- include/hw/m68k/mcf.h | 3 +-- target/m68k/cpu-qom.h | 2 -- target/m68k/cpu.h | 4 ++-- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/include/hw/m68k/mcf.h b/include/hw/m68k/mcf.h index 8cbd587bbf..e84fcfb4ca 100644 --- a/include/hw/

[PATCH 04/15] exec/cpu_ldst: Include 'cpu.h' to get target_ulong definition

2022-02-09 Thread Philippe Mathieu-Daudé via
Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé --- include/exec/cpu_ldst.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/exec/cpu_ldst.h b/include/exec/cpu_ldst.h index a878fd0105..5c66de 100644 --- a/include/exec/cpu_ldst.h +++ b/include/exec/cpu_ldst.h @

[PATCH 01/15] meson: Display libfdt as disabled when system emulation is disabled

2022-02-09 Thread Philippe Mathieu-Daudé via
When configuring QEMU with --disable-system, meson keeps showing libfdt as "auto". Mark it as disabled instead. Acked-by: Paolo Bonzini Signed-off-by: Philippe Mathieu-Daudé --- meson.build | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/meson.build b/meson.build index 57

[PATCH 00/15] target: Use ArchCPU & CPUArchState as abstract interface to target CPU

2022-02-09 Thread Philippe Mathieu-Daudé via
Hi Richard, Kind of respin of the "exec: Move translation declarations to 'translate-all.h'" series, but without modifying translate-all.h :) (same same but different). Last patches are RFC, not sure worthwhile (at least for now). Based-on: <20220207082756.82600-1-f4...@amsat.org> "exec: Remove

Re: [PATCH 13/13] exec: Move translation declarations to 'translate-all.h'

2022-02-09 Thread Philippe Mathieu-Daudé via
On 9/2/22 00:00, Richard Henderson wrote: On 2/9/22 02:22, Philippe Mathieu-Daudé wrote: Translation declarations are only useful to TCG accelerator. Signed-off-by: Philippe Mathieu-Daudé Ug. So, like, what's you vision of exec-all.h vs translate-all.h? Certainly there's not much in transl

Re: [PATCH 10/13] target: Use CPUArchState as interface to target-specific CPU state

2022-02-09 Thread Philippe Mathieu-Daudé via
On 8/2/22 23:40, Richard Henderson wrote: On 2/9/22 02:22, Philippe Mathieu-Daudé wrote: While CPUState is our interface with generic code, CPUArchState is our interface with target-specific code. Use CPUArchState as an abstract type, defined by each target. Signed-off-by: Philippe Mathieu-Daud

Re: [RFC PATCH] tcg/optimize: only read val after const check

2022-02-09 Thread Philippe Mathieu-Daudé via
On 9/2/22 12:21, Alex Bennée wrote: valgrind pointed out that arg_info()->val can be undefined which will be the case if the arguments are not constant. The ordering of the checks will have ensured we never relied on an undefined value but for the sake of completeness re-order the code to be clea

Re: [PATCH 5/5] include: Move hardware version declarations to new qemu/hw-version.h

2022-02-09 Thread Philippe Mathieu-Daudé via
On 9/2/22 10:25, Peter Maydell wrote: On Wed, 9 Feb 2022 at 09:20, Philippe Mathieu-Daudé wrote: On 8/2/22 21:08, Peter Maydell wrote: The "hardware version" machinery (qemu_set_hw_version(), qemu_hw_version(), and the QEMU_HW_VERSION define) is used by fewer than 10 files. Move it out from

Re: [PATCH 0/5] include: Trim some fat from osdep.h

2022-02-09 Thread Philippe Mathieu-Daudé via
On 8/2/22 21:08, Peter Maydell wrote: The osdep.h header is included by every C file we compile, so it helps build times to keep it small. (As the comment at the top of the file notes, in an ideal world this header would contain only things that everybody needs and things where we need to apply a

Re: [PATCH 5/5] include: Move hardware version declarations to new qemu/hw-version.h

2022-02-09 Thread Philippe Mathieu-Daudé via
On 8/2/22 21:08, Peter Maydell wrote: The "hardware version" machinery (qemu_set_hw_version(), qemu_hw_version(), and the QEMU_HW_VERSION define) is used by fewer than 10 files. Move it out from osdep.h into a new qemu/hw-version.h. Signed-off-by: Peter Maydell --- include/qemu/hw-version.h

Re: [PATCH] hw/arm/armv7m: Handle disconnected clock inputs

2022-02-09 Thread Philippe Mathieu-Daudé via
On 8/2/22 18:16, Peter Maydell wrote: In the armv7m object, handle clock inputs that aren't connected. This is always an error for 'cpuclk'. For 'refclk' it is OK for this to be disconnected, but we need to handle it by not trying to connect a sourceless-clock to the systick device. This fixes a

[PATCH 09/13] target: Use forward declared type instead of structure type

2022-02-08 Thread Philippe Mathieu-Daudé via
The CPU state is forward declared. Signed-off-by: Philippe Mathieu-Daudé --- target/mips/internal.h | 14 +++--- target/xtensa/cpu.h| 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/target/mips/internal.h b/target/mips/internal.h index f705d6bfa6..ac6e03e2f2 100

[PATCH 08/13] target: Include missing 'cpu.h'

2022-02-08 Thread Philippe Mathieu-Daudé via
These target-specific files use the target-specific CPU state but lack to include "cpu.h"; i.e.: ../target/riscv/pmp.h:61:23: error: unknown type name 'CPURISCVState' void pmpcfg_csr_write(CPURISCVState *env, uint32_t reg_index, ^ ../target/nios2/mmu.h:43:18:

[PATCH 07/13] cpu: Move common code to cpu-common

2022-02-08 Thread Philippe Mathieu-Daudé via
cpu_abort() and cpu_breakpoint*() don't use target-specific API. Signed-off-by: Philippe Mathieu-Daudé --- cpu.c | 109 cpus-common.c | 112 ++ 2 files changed, 112 insertions(+), 109 deletio

[PATCH 03/13] accel: Elide kvm_update_guest_debug by checking kvm_supports_guest_debug

2022-02-08 Thread Philippe Mathieu-Daudé via
Signed-off-by: Philippe Mathieu-Daudé --- accel/stubs/kvm-stub.c | 5 - cpu.c | 2 +- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/accel/stubs/kvm-stub.c b/accel/stubs/kvm-stub.c index 7e0fb884b9..924ffbde85 100644 --- a/accel/stubs/kvm-stub.c +++ b/accel/stu

[PATCH 12/13] exec/cpu-all: Restrict cpu_copy() to user emulation

2022-02-08 Thread Philippe Mathieu-Daudé via
Signed-off-by: Philippe Mathieu-Daudé --- include/exec/cpu-all.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/exec/cpu-all.h b/include/exec/cpu-all.h index c0f0fab28a..84188febfa 100644 --- a/include/exec/cpu-all.h +++ b/include/exec/cpu-all.h @@ -296,10 +296,11 @

[PATCH 06/13] cpu: Add missing 'exec/exec-all.h' and ''exec/exec-all.h'' headers

2022-02-08 Thread Philippe Mathieu-Daudé via
cpu.c requires "exec/exec-all.h" to call tlb_flush() and "qemu/accel.h" to call accel_cpu_realizefn(). Signed-off-by: Philippe Mathieu-Daudé --- cpu.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cpu.c b/cpu.c index 834e2b4cdb..a728f3e762 100644 --- a/cpu.c +++ b/cpu.c @@ -35,10 +35,12

[PATCH 01/13] meson: Display libfdt as disabled when system emulation is disabled

2022-02-08 Thread Philippe Mathieu-Daudé via
When configuring QEMU with --disable-system, meson keeps showing libfdt as "auto". Mark it as disabled instead. Signed-off-by: Philippe Mathieu-Daudé --- meson.build | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/meson.build b/meson.build index 571af34b7d..3c274386bb 1006

[PATCH 11/13] exec/cpu_ldst: Restrict TCG-specific code

2022-02-08 Thread Philippe Mathieu-Daudé via
Signed-off-by: Philippe Mathieu-Daudé --- include/exec/cpu_ldst.h | 53 ++--- 1 file changed, 28 insertions(+), 25 deletions(-) diff --git a/include/exec/cpu_ldst.h b/include/exec/cpu_ldst.h index 5c66de..0932096d29 100644 --- a/include/exec/cpu_ldst.h +++

[PATCH 10/13] target: Use CPUArchState as interface to target-specific CPU state

2022-02-08 Thread Philippe Mathieu-Daudé via
While CPUState is our interface with generic code, CPUArchState is our interface with target-specific code. Use CPUArchState as an abstract type, defined by each target. Signed-off-by: Philippe Mathieu-Daudé --- include/exec/poison.h | 2 -- include/hw/core/cpu.h | 2 +- include/qemu/typedef

[PATCH 04/13] target/i386/cpu: Ensure accelerators set CPU addressble physical bits

2022-02-08 Thread Philippe Mathieu-Daudé via
The only accelerator allowed to use zero as default value is TCG. Signed-off-by: Philippe Mathieu-Daudé --- target/i386/cpu.c | 1 + 1 file changed, 1 insertion(+) diff --git a/target/i386/cpu.c b/target/i386/cpu.c index aa9e636800..16523a78d9 100644 --- a/target/i386/cpu.c +++ b/target/i386/cp

[PATCH 13/13] exec: Move translation declarations to 'translate-all.h'

2022-02-08 Thread Philippe Mathieu-Daudé via
Translation declarations are only useful to TCG accelerator. Signed-off-by: Philippe Mathieu-Daudé --- accel/stubs/tcg-stub.c | 1 + accel/tcg/cpu-exec-common.c | 1 + accel/tcg/cpu-exec.c| 1 + accel/tcg/cputlb.c | 1

[PATCH 05/13] target/i386/tcg/sysemu: Include missing 'exec/exec-all.h' header

2022-02-08 Thread Philippe Mathieu-Daudé via
excp_helper.c requires "exec/exec-all.h" for tlb_set_page_with_attrs() and misc_helper.c for tlb_flush(). Signed-off-by: Philippe Mathieu-Daudé --- target/i386/tcg/sysemu/excp_helper.c | 1 + target/i386/tcg/sysemu/misc_helper.c | 1 + 2 files changed, 2 insertions(+) diff --git a/target/i386/t

[PATCH 02/13] exec/cpu_ldst: Include 'cpu.h' to get target_ulong definition

2022-02-08 Thread Philippe Mathieu-Daudé via
Signed-off-by: Philippe Mathieu-Daudé --- include/exec/cpu_ldst.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/exec/cpu_ldst.h b/include/exec/cpu_ldst.h index a878fd0105..5c66de 100644 --- a/include/exec/cpu_ldst.h +++ b/include/exec/cpu_ldst.h @@ -64,6 +64,7 @@ #include "ex

[PATCH 00/13] exec: Move translation declarations to 'translate-all.h'

2022-02-08 Thread Philippe Mathieu-Daudé via
This series move translation declarations from the generic 'cpu-all.h' to the TCG specific 'translate-all.h'. It is part of a bigger exec/ refactor which I'm splitting in multiple parts. Based-on: <20220207082756.82600-1-f4...@amsat.org> "exec: Remove 'qemu/log.h' from 'exec-all.h'" Philippe Math

Re: [RFC PATCH 2/3] net: initialize global variables early

2022-02-08 Thread Philippe Mathieu-Daudé via
On 8/2/22 15:44, Paolo Bonzini wrote: Initialize global variables separately from net_init_clients, so that calling net_cleanup does not crash miserably. Signed-off-by: Paolo Bonzini --- hw/net/xen_nic.c | 20 ++-- include/net/net.h | 1 + net/net.c | 5 -

Re: [PATCH 1/6] tests/qemu-iotests: Improve the check for GNU sed

2022-02-08 Thread Philippe Mathieu-Daudé via
On 8/2/22 13:38, Thomas Huth wrote: On 08/02/2022 13.28, Hanna Reitz wrote: On 08.02.22 13:13, Thomas Huth wrote: On 08/02/2022 12.46, Hanna Reitz wrote: On 08.02.22 11:13, Thomas Huth wrote: Instead of failing the iotests if GNU sed is not available (or skipping them completely in the check

Re: [PATCH 2/6] tests/qemu-iotests/meson.build: Improve the indentation

2022-02-08 Thread Philippe Mathieu-Daudé via
On 8/2/22 11:13, Thomas Huth wrote: By using subdir_done(), we can get rid of one level of indentation in this file. This will make it easier to add more conditions to skip the iotests in future patches. Signed-off-by: Thomas Huth --- tests/qemu-iotests/meson.build | 61 ++

Re: [PATCH 3/5] linux-user: Introduce host_sigcontext

2022-02-08 Thread Philippe Mathieu-Daudé via
On 8/2/22 08:12, Richard Henderson wrote: Do not directly access ucontext_t as the third signal parameter. This is preparation for a sparc64 fix. Signed-off-by: Richard Henderson --- linux-user/include/host/aarch64/host-signal.h | 13 - linux-user/include/host/alpha/host-sign

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

2022-02-08 Thread Philippe Mathieu-Daudé via
On 7/2/22 23:40, 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 4/5] linux-user: Move sparc/host-signal.h to sparc64/host-signal.h

2022-02-08 Thread Philippe Mathieu-Daudé via
On 8/2/22 08:12, Richard Henderson wrote: We do not support sparc32 as a host, so there's no point in sparc64 redirecting to sparc. Signed-off-by: Richard Henderson --- linux-user/include/host/sparc/host-signal.h | 71 --- linux-user/include/host/sparc64/host-signal.h | 64

Re: [PATCH v6 5/8] tcg/sparc: Convert patch_reloc to return bool

2022-02-08 Thread Philippe Mathieu-Daudé via
On 8/2/22 08:17, Richard Henderson wrote: Since 7ecd02a06f8, if patch_reloc fails we restart translation with a smaller TB. Sparc had its function signature changed, "SPARC"? but not the logic. Replace assert with return false. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson

Re: [PATCH 2/5] linux-user: Introduce host_signal_mask

2022-02-08 Thread Philippe Mathieu-Daudé via
On 8/2/22 08:12, Richard Henderson wrote: Do not directly access the uc_sigmask member. This is preparation for a sparc64 fix. Signed-off-by: Richard Henderson --- linux-user/include/host/aarch64/host-signal.h | 5 + linux-user/include/host/alpha/host-signal.h| 5 + linux-use

Re: [PATCH 08/11] mos6522: add "info via" HMP command for debugging

2022-02-07 Thread Philippe Mathieu-Daudé via
On 7/2/22 20:34, Peter Maydell wrote: On Thu, 27 Jan 2022 at 21:03, Mark Cave-Ayland wrote: This displays detailed information about the device registers and timers to aid debugging problems with timers and interrupts. Signed-off-by: Mark Cave-Ayland --- hmp-commands-info.hx | 12 ++

Re: [PATCH] MAINTAINERS: python - remove ehabkost and add bleal

2022-02-07 Thread Philippe Mathieu-Daudé via
On 8/2/22 01:05, John Snow wrote: Eduardo Habkost has left Red Hat and has other daily responsibilities to attend to. In order to stop spamming him on every series, remove him as "Reviewer" for the python/ library dir and add Beraldo Leal instead. For the "python scripts" stanza (which is separa

Re: [PATCH 06/16] hw/arm/xlnx-zcu102: Don't enable PSCI conduit when booting guest in EL3

2022-02-07 Thread Philippe Mathieu-Daudé via
On 7/2/22 19:13, Edgar E. Iglesias wrote: On Mon, Feb 7, 2022 at 5:24 PM Alexander Graf > wrote: On 07.02.22 17:06, Philippe Mathieu-Daudé wrote: > On 7/2/22 16:59, Alexander Graf wrote: >> >> On 07.02.22 16:52, Edgar E. Iglesias wrote: > >

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

2022-02-07 Thread Philippe Mathieu-Daudé via
On 7/2/22 16:50, Alex Williamson wrote: On Sat, 5 Feb 2022 10:49:35 + Peter Maydell wrote: Hi; this has a format-string issue that means it doesn't build on 32-bit systems: https://gitlab.com/qemu-project/qemu/-/jobs/2057116569 ../hw/vfio/common.c: In function 'vfio_listener_region_add'

Re: [PATCH 06/16] hw/arm/xlnx-zcu102: Don't enable PSCI conduit when booting guest in EL3

2022-02-07 Thread Philippe Mathieu-Daudé via
On 7/2/22 16:59, Alexander Graf wrote: On 07.02.22 16:52, Edgar E. Iglesias wrote: Both Versal and ZynqMP require MicroBlaze firmware to run the reference implementations of Trusted Firmware. We never supported this in upstream QEMU but we do support it with our fork (by running multiple QE

Re: [PATCH] block/vvfat: Fix memleaks in vvfat_close()

2022-02-07 Thread Philippe Mathieu-Daudé via
On 7/2/22 12:37, Hanna Reitz wrote: qcow_filename and used_clusters are allocated in enable_write_target(), but freed only in the error path of vvfat_open(). Free them in vvfat_close(), too. Signed-off-by: Hanna Reitz --- block/vvfat.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/b

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

2022-02-07 Thread Philippe Mathieu-Daudé via
On 7/2/22 09:47, Greg Kurz wrote: On Sun, 6 Feb 2022 20:10:23 -0500 Will Cohen wrote: This patch set currently places it in 9p-util only because 9p is the only place where this issue seems to have come up so far and we were wary of editing files too far afield, but I have no attachment to its

<    2   3   4   5   6   7   8   9   10   11   >