[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 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 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 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 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 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 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 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 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 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 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 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 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 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 @@

[PULL 0/8] Linux user for 7.0 patches

2022-02-07 Thread Laurent Vivier
.git tags/linux-user-for-7.0-pull-request for you to fetch changes up to 244fd08323088db73590ff2317dfe86f810b51d7: linux-user/syscall: Translate TARGET_RLIMIT_RTTIME (2022-02-01 08:01:44 +0100) Linux-user pull request 20220207

[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 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 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

[PULL 2/8] linux-user/alpha: Fix target rlimits for alpha and rearrange for clarity

2022-02-07 Thread Laurent Vivier
From: Serge Belyshev Alpha uses different values of some TARGET_RLIMIT_* constants, which were missing and caused bugs like #577, fixed thus. Also rearranged all three (alpha, mips and sparc) that differ from everyone else for clarity. Signed-off-by: Serge Belyshev Resolves: https://gitlab.com

[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.

[PULL 5/8] linux-user: sigprocmask check read perms first

2022-02-07 Thread Laurent Vivier
From: Patrick Venture Linux kernel now checks the read permissions before validating `how` Suggested-by: Laurent Vivier Signed-off-by: Patrick Venture Reviewed-by: Laurent Vivier Message-Id: <20220126212559.1936290-3-vent...@google.com> [lv: remove unneeded ")"] Signed-off-by: Laurent Vivier

[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

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

2022-02-07 Thread Greg Kurz
On Sun, 6 Feb 2022 15:07:09 -0500 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 Da

[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 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

[PULL 3/8] linux-user: Fix inotify on aarch64

2022-02-07 Thread Laurent Vivier
From: Paul Brook The inotify implementation originally called the raw host syscalls. Commit 3b3f24add0 changed this to use the glibc wrappers. However ifdefs in syscall.c still test for presence of the raw syscalls. This causes a problem on e.g. aarch64 hosts which never had the inotify_init sys

[PULL 7/8] linux-user: Move generic TARGET_RLIMIT* definitions to generic/target_resource.h

2022-02-07 Thread Laurent Vivier
From: Serge Belyshev Signed-off-by: Serge Belyshev Message-Id: <87ee4ql3yk.fsf...@depni.sinp.msu.ru> Signed-off-by: Laurent Vivier --- linux-user/aarch64/target_resource.h| 1 + linux-user/alpha/target_resource.h | 21 ++ linux-user/arm/target_resource.h| 1 + linux-

[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 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 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

[PULL 1/8] linux-user: Remove unnecessary 'aligned' attribute from TaskState

2022-02-07 Thread Laurent Vivier
From: Peter Maydell The linux-user struct TaskState has an 'aligned(16)' attribute. When the struct was first added in commit 851e67a1b46f in 2003, there was a justification in a comment (still present in the source today): /* NOTE: we force a big alignment so that the stack stored after is

[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

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

2022-02-07 Thread Greg Kurz
On Sun, 6 Feb 2022 04:34:19 +0300 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 v9

[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 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 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-

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

2022-02-07 Thread Igor Mammedov
On Sat, 5 Feb 2022 13:45:24 +0100 Philippe Mathieu-Daudé wrote: > 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 chang

[PULL 8/8] linux-user/syscall: Translate TARGET_RLIMIT_RTTIME

2022-02-07 Thread Laurent Vivier
From: Serge Belyshev Signed-off-by: Serge Belyshev Reviewed-by: Laurent Vivier Reviewed-by: Laurent Vivier Message-Id: <87a6fel3w8.fsf...@depni.sinp.msu.ru> Signed-off-by: Laurent Vivier --- linux-user/generic/target_resource.h | 1 + linux-user/syscall.c | 2 ++ 2 files chan

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

2022-02-07 Thread Igor Mammedov
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 the SGX-EPC objects are now a

[PULL 4/8] linux-user: rt_sigprocmask, check read perms first

2022-02-07 Thread Laurent Vivier
From: Shu-Chun Weng Linux kernel does it this way (checks read permission before validating `how`) and the latest version of ABSL's `AddressIsReadable()` depends on this behavior. c.f. https://github.com/torvalds/linux/blob/9539ba4308ad5bdca6cb41c7b73cbb9f796dcdd7/kernel/signal.c#L3147 Reviewe

[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 +

[PULL 6/8] linux-user: Implement starttime field in self stat emulation

2022-02-07 Thread Laurent Vivier
From: Cameron Esfahani Instead of always returning 0, return actual starttime. Signed-off-by: Cameron Esfahani Reviewed-by: Laurent Vivier Message-Id: <20220128001251.45165-1-di...@apple.com> Signed-off-by: Laurent Vivier --- linux-user/main.c| 14 ++ linux-user/qemu.h|

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

Re: [PULL 31/31] linux-user: Remove the deprecated ppc64abi32 target

2022-02-07 Thread Thomas Huth
On 12/01/2022 12.27, Alex Bennée wrote: From: Thomas Huth It's likely broken, and nobody cared for picking it up again during the deprecation phase, so let's remove this now. Since this is the last entry in deprecated_targets_list, remove the related code in the configure script, too. Signed-

[PATCH] hw/timer: fix a9gtimer vmstate

2022-02-07 Thread Pavel Dovgalyuk
A9 gtimer includes global control field and number of per-cpu fields. But only per-cpu ones are migrated. This patch adds a subsection for global control field migration. Signed-off-by: Pavel Dovgalyuk --- hw/timer/a9gtimer.c | 21 + 1 file changed, 21 insertions(+) diff -

[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] memory: Fix qemu crash on starting dirty log twice with stopped VM

2022-02-07 Thread Paolo Bonzini
On 2/7/22 04:26, Peter Xu wrote: QEMU can now easily crash with two continuous migration carried out: (qemu) migrate -d exec:cat>out (qemu) migrate_cancel (qemu) migrate -d exec:cat>out [crash] ../softmmu/memory.c:2782: memory_global_dirty_log_start: Assertion `!(global_dirty_tracking & flags)'

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

2022-02-07 Thread Greg Kurz
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 specific > location! > Inline

Re: [PULL 1/2] tpm: CRB: Use ram_device for "tpm-crb-cmd" region

2022-02-07 Thread Eric Auger
Hi Igor, On 2/4/22 1:08 PM, Igor Mammedov wrote: > On Thu, 03 Feb 2022 15:35:35 -0700 > Alex Williamson wrote: > >> From: Eric Auger >> >> Representing the CRB cmd/response buffer as a standard >> RAM region causes some trouble when the device is used >> with VFIO. Indeed VFIO attempts to DMA_MAP

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

2022-02-07 Thread Igor Mammedov
On Mon, 7 Feb 2022 09:14:37 +0100 Igor Mammedov wrote: > On Sat, 5 Feb 2022 13:45:24 +0100 > Philippe Mathieu-Daudé wrote: > > > 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 >

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

2022-02-07 Thread Eric Auger
Hi On 2/5/22 12:19 PM, Philippe Mathieu-Daudé wrote: > 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/hdel

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

2022-02-07 Thread Peter Krempa
On Mon, Feb 07, 2022 at 10:18:43 +0100, Igor Mammedov wrote: > On Mon, 7 Feb 2022 09:14:37 +0100 > Igor Mammedov wrote: > > > On Sat, 5 Feb 2022 13:45:24 +0100 > > Philippe Mathieu-Daudé wrote: > > > > > Previously CPUs were exposed in the QOM tree at a path > > > > > > /machine/unattached/

Re: Add TCG support for UMIP

2022-02-07 Thread Paolo Bonzini
On 2/6/22 21:27, Gareth Webb wrote: @@ -7382,6 +7383,8 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) case 0: /* sldt */ if (!PE(s) || VM86(s)) goto illegal_op; +if ((PE(s) || LMA(s)) && s->cpuid_7_0_ecx_features & CPUID_7_0_E

RE: [RFC PATCH] Allow VIRTIO_F_IN_ORDER to be negotiated for vdpa devices

2022-02-07 Thread Gautam Dawar
Hi Jason, Thanks for your feedback. Pls see my comments inline. Regards, Gautam -Original Message- From: Jason Wang Sent: Monday, February 7, 2022 8:53 AM To: Gautam Dawar Cc: mst ; qemu-devel ; eperezma ; Gautam Dawar ; Martin Petrus Hubertus Habets ; Harpreet Singh Anand ; Tanuj

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

2022-02-07 Thread Peter Krempa
On Mon, Feb 07, 2022 at 10:36:42 +0100, Peter Krempa wrote: > On Mon, Feb 07, 2022 at 10:18:43 +0100, Igor Mammedov wrote: > > On Mon, 7 Feb 2022 09:14:37 +0100 > > Igor Mammedov wrote: [...] > Even if we change it in libvirt right away, changing qemu will break > forward compatibility. While we

Re: [PATCH v3 01/26] tests/Makefile.include: clean-up old code

2022-02-07 Thread Paolo Bonzini
On 2/4/22 21:43, Alex Bennée wrote: This is no longer needed since 5516623020 ("meson: convert migration directory to Meson") Signed-off-by: Alex Bennée Reviewed-by: Philippe Mathieu-Daudé Message-Id:<20220124201608.604599-2-alex.ben...@linaro.org> Actually a2ce7dbd91 ("meson: convert tests/qt

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

2022-02-07 Thread Daniel P . Berrangé
On Mon, Feb 07, 2022 at 10:36:42AM +0100, Peter Krempa wrote: > On Mon, Feb 07, 2022 at 10:18:43 +0100, Igor Mammedov wrote: > > On Mon, 7 Feb 2022 09:14:37 +0100 > > Igor Mammedov wrote: > > > > > On Sat, 5 Feb 2022 13:45:24 +0100 > > > Philippe Mathieu-Daudé wrote: > > > > > > > Previously C

Re: Notes on Generating Python signatures for QMP RPCs

2022-02-07 Thread Markus Armbruster
Daniel P. Berrangé writes: > On Thu, Feb 03, 2022 at 05:52:10PM -0500, John Snow wrote: >> On Thu, Feb 3, 2022 at 5:40 AM Daniel P. Berrangé >> wrote: >> > >> > On Wed, Jan 26, 2022 at 01:58:19PM -0500, John Snow wrote: >> > >> > As you mention though, bear in mind that a command returning >> >

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

Re: [PULL 31/31] linux-user: Remove the deprecated ppc64abi32 target

2022-02-07 Thread Alex Bennée
Thomas Huth writes: > On 12/01/2022 12.27, Alex Bennée wrote: >> From: Thomas Huth >> It's likely broken, and nobody cared for picking it up again >> during the deprecation phase, so let's remove this now. >> Since this is the last entry in deprecated_targets_list, remove >> the related code i

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

Re: [PATCH] memory: Fix qemu crash on starting dirty log twice with stopped VM

2022-02-07 Thread Peter Xu
On Mon, Feb 07, 2022 at 10:08:44AM +0100, Paolo Bonzini wrote: > > void memory_global_dirty_log_start(unsigned int flags) > > { > > unsigned int old_flags = global_dirty_tracking; > > -if (vmstate_change) { > > -qemu_del_vm_change_state_handler(vmstate_change); > > -vm

Re: Add TCG support for UMIP

2022-02-07 Thread Peter Maydell
On Sun, 6 Feb 2022 at 21:07, 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. > > This is my first time com

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

2022-02-07 Thread Greg Kurz
On Mon, 7 Feb 2022 11:30:18 +0100 Philippe Mathieu-Daudé wrote: > 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

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

2022-02-07 Thread Dr. David Alan Gilbert
* Greg Kurz (gr...@kaod.org) wrote: > On Mon, 7 Feb 2022 11:30:18 +0100 > Philippe Mathieu-Daudé wrote: > > > 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

Re: [PATCH 00/16] arm: Fix handling of unrecognized functions in PSCI emulation

2022-02-07 Thread Peter Maydell
On Thu, 27 Jan 2022 at 15:46, Peter Maydell wrote: > > This series fixes our handling of PSCI calls where the function ID is > not recognized. These are supposed to return an error value, but > currently we instead emulate the SMC or HVC instruction to trap to the > guest at EL3 or EL2. Particular

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

2022-02-07 Thread Ani Sinha
On Mon, Feb 7, 2022 at 3:12 PM Peter Krempa wrote: > > On Mon, Feb 07, 2022 at 10:36:42 +0100, Peter Krempa wrote: > > On Mon, Feb 07, 2022 at 10:18:43 +0100, Igor Mammedov wrote: > > > On Mon, 7 Feb 2022 09:14:37 +0100 > > > Igor Mammedov wrote: > > [...] > > > Even if we change it in libvirt ri

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

2022-02-07 Thread Igor Mammedov
On Mon, 7 Feb 2022 10:36:42 +0100 Peter Krempa wrote: > On Mon, Feb 07, 2022 at 10:18:43 +0100, Igor Mammedov wrote: > > On Mon, 7 Feb 2022 09:14:37 +0100 > > Igor Mammedov wrote: > > > > > On Sat, 5 Feb 2022 13:45:24 +0100 > > > Philippe Mathieu-Daudé wrote: > > > > > > > Previously CPU

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

2022-02-07 Thread Peter Krempa
On Mon, Feb 07, 2022 at 16:50:28 +0530, Ani Sinha wrote: > On Mon, Feb 7, 2022 at 3:12 PM Peter Krempa wrote: > > > > On Mon, Feb 07, 2022 at 10:36:42 +0100, Peter Krempa wrote: > > > On Mon, Feb 07, 2022 at 10:18:43 +0100, Igor Mammedov wrote: > > > > On Mon, 7 Feb 2022 09:14:37 +0100 > > > > Igo

[PATCH v2 3/3] hw/smbios: add an assertion to ensure tables 19 and 32 do not collide

2022-02-07 Thread Ani Sinha
Since change b3cddba9c14b034 ("hw/smbios: fix table memory corruption with large memory vms") we reserve additional memory space between tables 17 and 19 for large VMs. This may cause table 19 to collide with table 32 for those VMs. This change adds an assertion to make sure table 19 does not exte

[PATCH v2 2/3] hw/smbios: fix table memory corruption with large memory vms

2022-02-07 Thread Ani Sinha
With the current smbios table assignment code, we can have only 512 DIMM slots (each DIMM of 16 GiB in size) before tables 17 and 19 conflict with their addresses. A guest with more than 8 TiB of memory will hit this limitation and would fail with the following assertion in isa-debugcon: ASSERT_EF

Re: [RFC PATCH] spapr: Add SPAPR_CAP_AIL_MODES for supported AIL modes for H_SET_MODE hcall

2022-02-07 Thread Daniel Henrique Barboza
On 2/6/22 22:54, David Gibson wrote: On Mon, Jan 31, 2022 at 04:10:34PM -0300, Daniel Henrique Barboza wrote: On 1/29/22 03:50, Nicholas Piggin wrote: The behaviour of the Address Translation Mode on Interrupt resource is not consistently supported by all CPU versions or all KVM versions.

[PATCH v5 1/1] virtio: fix the condition for iommu_platform not supported

2022-02-07 Thread Halil Pasic
The commit 04ceb61a40 ("virtio: Fail if iommu_platform is requested, but unsupported") claims to fail the device hotplug when iommu_platform is requested, but not supported by the (vhost) device. On the first glance the condition for detecting that situation looks perfect, but because a certain pec

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

2022-02-07 Thread Ani Sinha
On Mon, Feb 7, 2022 at 4:58 PM Peter Krempa wrote: > > On Mon, Feb 07, 2022 at 16:50:28 +0530, Ani Sinha wrote: > > On Mon, Feb 7, 2022 at 3:12 PM Peter Krempa wrote: > > > > > > On Mon, Feb 07, 2022 at 10:36:42 +0100, Peter Krempa wrote: > > > > On Mon, Feb 07, 2022 at 10:18:43 +0100, Igor Mamme

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

2022-02-07 Thread Hanna Reitz
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/block/vvfat.c b/block/vvfat.c index b2b58

Re: [PATCH v4 1/1] virtio: fix the condition for iommu_platform not supported

2022-02-07 Thread Halil Pasic
On Fri, 4 Feb 2022 20:15:27 -0500 "Michael S. Tsirkin" wrote: > On Sat, Feb 05, 2022 at 01:02:05AM +0100, Halil Pasic wrote: > > On Fri, 4 Feb 2022 08:05:25 -0500 > > "Michael S. Tsirkin" wrote: > > > > > On Thu, Feb 03, 2022 at 05:06:35PM +0100, Halil Pasic wrote: > > > > On Wed, 2 Feb 20

[PATCH v2 0/3] hw/smbios: fix table memory corruption with large memory vms

2022-02-07 Thread Ani Sinha
This patchset tries to address the issue raised in https://bugzilla.redhat.com/show_bug.cgi?id=2023977 . Patch 2 and patch 3 are dependent on patch 1. Patch 1 makes some code cleanup to make thing more readable and also is a preparatory patch for patches 2 and 3. Patch 2 is the actual fix. Patch

Re: [PATCH v7 2/3] spapr: nvdimm: Implement H_SCM_FLUSH hcall

2022-02-07 Thread Daniel Henrique Barboza
On 2/4/22 05:15, Shivaprasad G Bhat wrote: The patch adds support for the SCM flush hcall for the nvdimm devices. To be available for exploitation by guest through the next patch. The hcall is applicable only for new SPAPR specific device class which is also introduced in this patch. The hcal

[PATCH v2 1/3] hw/smbios: code cleanup - use macro definitions for table base addresses

2022-02-07 Thread Ani Sinha
This is a minor cleanup. Using macro definitions makes the code more readable. It is at once clear which tables use which starting base addresses. It also makes it easy to calculate the gaps between the addresses and modify them if needed. Signed-off-by: Ani Sinha --- hw/smbios/smbios.c | 38 +++

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

2022-02-07 Thread Daniel P . Berrangé
On Mon, Feb 07, 2022 at 12:22:22PM +0100, Igor Mammedov wrote: > On Mon, 7 Feb 2022 10:36:42 +0100 > Peter Krempa wrote: > > > On Mon, Feb 07, 2022 at 10:18:43 +0100, Igor Mammedov wrote: > > > On Mon, 7 Feb 2022 09:14:37 +0100 > > > Igor Mammedov wrote: > > > > > > > On Sat, 5 Feb 2022 13:4

Re: [PATCH v7 0/3] spapr: nvdimm: Introduce spapr-nvdimm device

2022-02-07 Thread Daniel Henrique Barboza
On 2/4/22 05:15, Shivaprasad G Bhat wrote: If the device backend is not persistent memory for the nvdimm, there is need for explicit IO flushes to ensure persistence. On SPAPR, the issue is addressed by adding a new hcall to request for an explicit flush from the guest when the backend is not

Re: [PATCH v5 7/9] virtiofsd: Create new file with fscreate set

2022-02-07 Thread Dr. David Alan Gilbert
* Vivek Goyal (vgo...@redhat.com) wrote: > This patch adds support to set /proc/thread-self/attr/fscreate before > file creation. It is set to a value as sent by client. This will allow > for atomic creation of security context on files w.r.t file creation. > > This is primarily useful when either

Re: [RFC] thread-pool: Add option to fix the pool size

2022-02-07 Thread Nicolas Saenz Julienne
Hi Stefan, thanks for the review. I took note of your comments. On Thu, 2022-02-03 at 10:53 +, Stefan Hajnoczi wrote: > > Some background on my workload: I'm using IDE emulation, the guest is an > > old RTOS that doesn't support virtio, using 'aio=native' isn't possible > > either (unaligned I

Re: [RFC PATCH 1/1] virtio: fix feature negotiation for ACCESS_PLATFORM

2022-02-07 Thread Daniel Henrique Barboza
On 2/3/22 13:45, Halil Pasic wrote: Unlike most virtio features ACCESS_PATFORM is considered mandatory, i.e. the driver must accept it if offered by the device. The virtio specification says that the driver SHOULD accept the ACCESS_PLATFORM feature if offered, and that the device MAY fail to o

target/arm: cp15.dacr migration

2022-02-07 Thread Pavel Dovgalyuk
I recently encountered a problem with cp15.dacr register. It has _s and _ns versions. During the migration only dacr_ns is saved/loaded. But both of the values are used in get_phys_addr_v5 and get_phys_addr_v6 functions. Therefore VM behavior becomes incorrect after loading the vmstate. I fou

Re: [PATCH] docs: rstfy confidential guest documentation

2022-02-07 Thread Daniel Henrique Barboza
On 2/4/22 13:12, Cornelia Huck wrote: Also rstfy the documentation for AMD SEV, and link it. The documentation for PEF had been merged into the pseries doc, fix the reference. Yeah, we forgot to fix/remove the existing papr-pef.txt reference after the changes we made. Thanks for fixing thi

Re: [PATCH v5 8/9] virtiofsd: Create new file using O_TMPFILE and set security context

2022-02-07 Thread Dr. David Alan Gilbert
* Vivek Goyal (vgo...@redhat.com) wrote: > If guest and host policies can't work with each other, then guest security > context (selinux label) needs to be set into an xattr. Say remap guest > security.selinux xattr to trusted.virtiofs.security.selinux. > > That means setting "fscreate" is not goi

Re: [PATCH v4 01/12] mm/shmem: Introduce F_SEAL_INACCESSIBLE

2022-02-07 Thread Vlastimil Babka
On 1/18/22 14:21, Chao Peng wrote: > From: "Kirill A. Shutemov" > > Introduce a new seal F_SEAL_INACCESSIBLE indicating the content of > the file is inaccessible from userspace through ordinary MMU access > (e.g., read/write/mmap). However, the file content can be accessed > via a different mecha

[PATCH] kvm: drop work around for kernel header typo.

2022-02-07 Thread Nan Wang
From: "wangnan.light" Kernel header once had a typo(linux commit caa057a2cad6), qemu have to work around it with hardcode macro(qemu commit 6f131f13e68d). Now kernel fix it(linux commit 766d3571d8e5), so we can remove redundant code. Signed-off-by: wangnan.light --- target/i386/kvm/kvm.c | 4

[PATCH v2] memory: Fix qemu crash on starting dirty log twice with stopped VM

2022-02-07 Thread Peter Xu
QEMU can now easily crash with two continuous migration carried out: (qemu) migrate -d exec:cat>out (qemu) migrate_cancel (qemu) migrate -d exec:cat>out [crash] ../softmmu/memory.c:2782: memory_global_dirty_log_start: Assertion `!(global_dirty_tracking & flags)' failed. It's because memory API pr

Re: [PATCH v5 9/9] virtiofsd: Add an option to enable/disable security label

2022-02-07 Thread Dr. David Alan Gilbert
* Vivek Goyal (vgo...@redhat.com) wrote: > Provide an option "-o security_label/no_security_label" to enable/disable > security label functionality. By default these are turned off. > > If enabled, server will indicate to client that it is capable of handling > one security label during file creat

Re: [PATCH v8 1/5] QIOChannel: Add flags on io_writev and introduce io_flush callback

2022-02-07 Thread Peter Xu
On Tue, Feb 01, 2022 at 03:28:59AM -0300, Leonardo Bras wrote: > Add flags to io_writev and introduce io_flush as optional callback to > QIOChannelClass, allowing the implementation of zero copy writes by > subclasses. > > How to use them: > - Write data using qio_channel_writev*(...,QIO_CHANNEL_W

Re: [PATCH 1/5] linux-headers: Add vduse.h

2022-02-07 Thread Stefan Hajnoczi
On Tue, Jan 25, 2022 at 09:17:56PM +0800, Xie Yongji wrote: > diff --git a/scripts/update-linux-headers.sh b/scripts/update-linux-headers.sh > index fea4d6eb65..4c7846076f 100755 > --- a/scripts/update-linux-headers.sh > +++ b/scripts/update-linux-headers.sh > @@ -198,6 +198,7 @@ for i in "$tmpdir"

Re: [PATCH v5 0/9] virtiofsd: Add support for file security context at file creation

2022-02-07 Thread Dr. David Alan Gilbert
* Vivek Goyal (vgo...@redhat.com) wrote: > Hi, > > This is V5 of the patches. I posted V4 here. > > https://listman.redhat.com/archives/virtio-fs/2022-January/msg00041.html > > These will allow us to support SELinux with virtiofs. This will send > SELinux context at file creation to server and s

Re: [PATCH v5 3/9] virtiofsd: Parse extended "struct fuse_init_in"

2022-02-07 Thread Vivek Goyal
On Thu, Feb 03, 2022 at 06:56:58PM +, Dr. David Alan Gilbert wrote: > * Vivek Goyal (vgo...@redhat.com) wrote: > > Add some code to parse extended "struct fuse_init_in". And use a local > > variable "flag" to represent 64 bit flags. This will make it easier > > to add more features without havi

Re: [PATCH v5 0/9] virtiofsd: Add support for file security context at file creation

2022-02-07 Thread Daniel P . Berrangé
On Wed, Feb 02, 2022 at 02:39:26PM -0500, Vivek Goyal wrote: > Hi, > > This is V5 of the patches. I posted V4 here. > > https://listman.redhat.com/archives/virtio-fs/2022-January/msg00041.html > > These will allow us to support SELinux with virtiofs. This will send > SELinux context at file crea

[PATCH v3] hw/rx: rx-gdbsim DTB load address aligned of 16byte.

2022-02-07 Thread Yoshinori Sato
Linux kernel required alined address of DTB. But missing align in dtb load function. Fixed to load to the correct address. v3 changes. Fix round value. v2 changes. Use ROUND_DOWN macro. Signed-off-by: Yoshinori Sato Reviewed-by: Philippe Mathieu-Daudé --- hw/rx/rx-gdbsim.c | 2 +- 1 file chan

Re: [RFC PATCH 1/1] virtio: fix feature negotiation for ACCESS_PLATFORM

2022-02-07 Thread Cornelia Huck
On Mon, Feb 07 2022, Daniel Henrique Barboza wrote: > On 2/3/22 13:45, Halil Pasic wrote: >> Unlike most virtio features ACCESS_PATFORM is considered mandatory, i.e. s/ACCESS_PATFORM/ACCESS_PLATFORM/ >> the driver must accept it if offered by the device. The virtio >> specification says that th

Re: [PATCH v5 0/9] virtiofsd: Add support for file security context at file creation

2022-02-07 Thread Vivek Goyal
On Mon, Feb 07, 2022 at 01:05:16PM +, Daniel P. Berrangé wrote: > On Wed, Feb 02, 2022 at 02:39:26PM -0500, Vivek Goyal wrote: > > Hi, > > > > This is V5 of the patches. I posted V4 here. > > > > https://listman.redhat.com/archives/virtio-fs/2022-January/msg00041.html > > > > These will allo

Re: [PULL 1/2] tpm: CRB: Use ram_device for "tpm-crb-cmd" region

2022-02-07 Thread Eric Auger
Hi Igor, On 2/4/22 1:08 PM, Igor Mammedov wrote: > On Thu, 03 Feb 2022 15:35:35 -0700 > Alex Williamson wrote: > >> From: Eric Auger >> >> Representing the CRB cmd/response buffer as a standard >> RAM region causes some trouble when the device is used >> with VFIO. Indeed VFIO attempts to DMA_MA

  1   2   3   >