Re: [PATCH v2 for-8.0 0/5] scripts/make-release: Decrease size of the release tarballs

2022-12-09 Thread Thomas Huth
On 30/11/2022 13.09, Daniel P. Berrangé wrote: On Wed, Nov 30, 2022 at 11:49:50AM +0100, Thomas Huth wrote: On 28/11/2022 18.04, Daniel P. Berrangé wrote: On Mon, Nov 28, 2022 at 10:25:50AM +0100, Thomas Huth wrote: Our release tarballs are huge - qemu-7.2.0-rc2.tar.xz has a size of 116 MiB. I

Re: [PATCH v3 1/8] util: Add interval-tree.c

2022-12-09 Thread Philippe Mathieu-Daudé
On 9/12/22 06:19, Richard Henderson wrote: Copy and simplify the Linux kernel's interval_tree_generic.h, instantiating for uint64_t. Reviewed-by: Alex Bennée Signed-off-by: Richard Henderson --- include/qemu/interval-tree.h| 99 tests/unit/test-interval-tree.c | 209 uti

Re: Target-dependent include path, why?

2022-12-09 Thread Markus Armbruster
Richard Henderson writes: > On 12/8/22 23:12, Markus Armbruster wrote: >> I stumbled over this: >> ../include/ui/qemu-pixman.h:12:10: fatal error: pixman.h: No such file >> or directory >> 12 | #include >>| ^~ >> Works when included into target-dependen

Re: [PATCH v15 1/6] qmp: add QMP command x-query-virtio

2022-12-09 Thread Jonah Palmer
On 12/7/22 08:22, Markus Armbruster wrote: Jonah Palmer writes: On 12/2/22 10:21, Markus Armbruster wrote: Philippe Mathieu-Daudé writes: On 2/12/22 13:23, Jonah Palmer wrote: On 11/30/22 11:16, Philippe Mathieu-Daudé wrote: Hi, On 11/8/22 14:24, Jonah Palmer wrote: From: Laurent Viv

Re: [PATCH] blockdev: add 'media=cdrom' argument to support usb cdrom emulated as cdrom

2022-12-09 Thread Paolo Bonzini
On 12/9/22 03:28, Zhipeng Lu wrote: Thanks.  -device usb-bot,id=bot0  -device scsi-{cd,hd},bus=bot0.0,drive=drive0 Qemu implements virtio scsi to emulate scsi controller, but if the virtual machine(for example windows guest os) don't install the virtio scsi driver, it don't work i need the

Re: [PATCH v10 6/9] KVM: Unmap existing mappings when change the memory attributes

2022-12-09 Thread Fuad Tabba
Hi, On Thu, Dec 8, 2022 at 11:18 AM Chao Peng wrote: > > On Wed, Dec 07, 2022 at 05:16:34PM +, Fuad Tabba wrote: > > Hi, > > > > On Fri, Dec 2, 2022 at 6:19 AM Chao Peng > > wrote: > > > > > > Unmap the existing guest mappings when memory attribute is changed > > > between shared and privat

Re: [PATCH for-8.0] hw/rtc/mc146818rtc: Make this rtc device target independent

2022-12-09 Thread Thomas Huth
On 07/12/2022 15.47, Bernhard Beschow wrote: Am 6. Dezember 2022 20:06:41 UTC schrieb Thomas Huth : The only code that is really, really target dependent is the apic-related code in rtc_policy_slew_deliver_irq(). By moving this code into the hw/i386/ folder (renamed to rtc_apic_policy_slew_del

Re: [PATCH v10 8/9] KVM: Handle page fault for private memory

2022-12-09 Thread Fuad Tabba
Hi, On Fri, Dec 2, 2022 at 6:19 AM Chao Peng wrote: > > A KVM_MEM_PRIVATE memslot can include both fd-based private memory and > hva-based shared memory. Architecture code (like TDX code) can tell > whether the on-going fault is private or not. This patch adds a > 'is_private' field to kvm_page_f

Re: [PATCH v10 9/9] KVM: Enable and expose KVM_MEM_PRIVATE

2022-12-09 Thread Fuad Tabba
Hi, On Fri, Dec 2, 2022 at 6:20 AM Chao Peng wrote: > > Register/unregister private memslot to fd-based memory backing store > restrictedmem and implement the callbacks for restrictedmem_notifier: > - invalidate_start()/invalidate_end() to zap the existing memory > mappings in the KVM page

Re: [PATCH for-8.0] hw/rtc/mc146818rtc: Make this rtc device target independent

2022-12-09 Thread Thomas Huth
On 07/12/2022 16.29, Mark Cave-Ayland wrote: On 06/12/2022 20:06, Thomas Huth wrote: The only code that is really, really target dependent is the apic-related code in rtc_policy_slew_deliver_irq(). By moving this code into the hw/i386/ folder (renamed to rtc_apic_policy_slew_deliver_irq()) and

Re: [PATCH v3 7/8] accel/tcg: Move PageDesc tree into tb-maint.c for system

2022-12-09 Thread Philippe Mathieu-Daudé
On 9/12/22 06:19, Richard Henderson wrote: Now that PageDesc is not used for user-only, and for system it is only used for tb maintenance, move the implementation into tb-main.c appropriately ifdefed. We have not yet eliminated all references to PageDesc for user-only, so retain a typedef to the

[PATCH-for-8.0 1/5] accel/tcg: Restrict cpu_io_recompile() to system emulation

2022-12-09 Thread Philippe Mathieu-Daudé
Missed in commit 6526919224 ("accel/tcg: Restrict cpu_io_recompile() from other accelerators"). Signed-off-by: Philippe Mathieu-Daudé --- accel/tcg/internal.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/accel/tcg/internal.h b/accel/tcg/internal.h index e1429a53ac..35419f3

[PATCH-for-8.0 3/5] accel/tcg: Rename tb_invalidate_phys_page_[locked_]fast()

2022-12-09 Thread Philippe Mathieu-Daudé
Emphasize this function is called with pages locked. Signed-off-by: Philippe Mathieu-Daudé --- accel/tcg/cputlb.c | 2 +- accel/tcg/internal.h | 6 +++--- accel/tcg/tb-maint.c | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/accel/tcg/cputlb.c b/accel/tcg/cputlb.c ind

[PATCH-for-8.0 2/5] accel/tcg: Remove trace events from trace-root.h

2022-12-09 Thread Philippe Mathieu-Daudé
Commit d9bb58e510 ("tcg: move tcg related files into accel/tcg/ subdirectory") introduced accel/tcg/trace-events, so we don't need to use the root trace-events anymore. Signed-off-by: Philippe Mathieu-Daudé --- accel/tcg/cputlb.c | 2 +- accel/tcg/trace-events | 4 trace-events

[PATCH-for-8.0 4/5] accel/tcg: Factor tb_invalidate_phys_range_fast() out

2022-12-09 Thread Philippe Mathieu-Daudé
Signed-off-by: Philippe Mathieu-Daudé --- accel/tcg/cputlb.c | 5 + accel/tcg/internal.h | 3 +++ accel/tcg/tb-maint.c | 21 + 3 files changed, 21 insertions(+), 8 deletions(-) diff --git a/accel/tcg/cputlb.c b/accel/tcg/cputlb.c index 6402fe11c1..03674d598f 100644 --

[PATCH-for-8.0 0/5] accel/tcg: Restrict page_collection structure to system TB maintainance

2022-12-09 Thread Philippe Mathieu-Daudé
Few cleanups noticed while reviewing Richard's "Rewrite user-only vma tracking" v3 ([*], based on top of it). - Move accel/tcg/ trace events out of trace-root.h - Refactor tb_invalidate_phys_range_fast() to restrict page_collection to sysemu. [*] https://lore.kernel.org/qemu-devel/202212090519

[PATCH-for-8.0 5/5] accel/tcg: Restrict page_collection structure to system TB maintainance

2022-12-09 Thread Philippe Mathieu-Daudé
Only the system emulation part of TB maintainance uses the page_collection structure. Restrict its declaration (and the functions requiring it) to tb-maint.c. Convert the 'len' argument of tb_invalidate_phys_page_locked_fast() from signed to unsigned. Signed-off-by: Philippe Mathieu-Daudé --- a

[RFC PATCH v2 08/22] xen_platform: exclude vfio-pci from the PCI platform unplug

2022-12-09 Thread David Woodhouse
From: Joao Martins Such that PCI passthrough devices work for Xen emulated guests. Signed-off-by: Joao Martins Signed-off-by: David Woodhouse --- hw/i386/xen/xen_platform.c | 18 +++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/hw/i386/xen/xen_platform.c b/hw/

[RFC PATCH v2 06/22] hw/xen_backend: refactor xen_be_init()

2022-12-09 Thread David Woodhouse
From: Joao Martins Signed-off-by: Joao Martins Signed-off-by: David Woodhouse --- hw/xen/xen-legacy-backend.c | 40 + include/hw/xen/xen-legacy-backend.h | 3 +++ 2 files changed, 32 insertions(+), 11 deletions(-) diff --git a/hw/xen/xen-legacy-backend.c b

[RFC PATCH v2 05/22] xen-platform-pci: allow its creation with XEN_EMULATE mode

2022-12-09 Thread David Woodhouse
From: Joao Martins The only thing we need to handle on KVM side is to change the pfn from R/W to R/O. Signed-off-by: Joao Martins Signed-off-by: David Woodhouse --- hw/i386/xen/xen_platform.c | 11 --- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/hw/i386/xen/xen_platf

[RFC PATCH v2 20/22] i386/xen: HVMOP_set_param / HVM_PARAM_CALLBACK_IRQ

2022-12-09 Thread David Woodhouse
From: Ankur Arora The HVM_PARAM_CALLBACK_IRQ parameter controls the system-wide event channel upcall method. The vector support is handled by KVM internally, when the evtchn_upcall_pending field in the vcpu_info is set. The GSI and PCI_INTX delivery methods are not supported. yet; those need to

[RFC PATCH v2 22/22] i386/xen: implement HYPERVISOR_sched_op

2022-12-09 Thread David Woodhouse
From: Joao Martins It allows to shutdown itself via hypercall with any of the 3 reasons: 1) self-reboot 2) shutdown 3) crash Implementing SCHEDOP_shutdown sub op let us handle crashes gracefully rather than leading to triple faults if it remains unimplemented. Signed-off-by: Joao Martins

[RFC PATCH v2 03/22] i386/xen: Add xen-version machine property and init KVM Xen support

2022-12-09 Thread David Woodhouse
From: David Woodhouse This is a machine property for two main reasons. One is that it allows us to set it in default_machine_opts for the xenfv platform when not running on actual Xen. The other is that theoretically we *could* do this with TCG too; we'd just have to implement a bunch of the stuf

[RFC PATCH v2 10/22] i386/xen: handle guest hypercalls

2022-12-09 Thread David Woodhouse
From: Joao Martins This means handling the new exit reason for Xen but still crashing on purpose. As we implement each of the hypercalls we will then return the right return code. Signed-off-by: Joao Martins [dwmw2: Add CPL to hypercall tracing, disallow hypercalls from CPL > 0] Signed-off-by:

[RFC PATCH v2 14/22] i386/xen: implement HYPERVISOR_hvm_op

2022-12-09 Thread David Woodhouse
From: Joao Martins This is when guest queries for support for HVMOP_pagetable_dying. Signed-off-by: Joao Martins Signed-off-by: David Woodhouse --- target/i386/xen.c | 17 + 1 file changed, 17 insertions(+) diff --git a/target/i386/xen.c b/target/i386/xen.c index ddd144039a..

[RFC PATCH v2 02/22] xen: add CONFIG_XENFV_MACHINE and CONFIG_XEN_EMU options for Xen emulation

2022-12-09 Thread David Woodhouse
From: David Woodhouse The XEN_EMU option will cover core Xen support in target/, which exists only for x86 with KVM today but could theoretically also be implemented on Arm/Aarch64 and with TCG or other accelerators. It will also cover the support for architecture-independent grant table and even

[RFC PATCH v2 21/22] i386/xen: implement HYPERVISOR_event_channel_op

2022-12-09 Thread David Woodhouse
From: Joao Martins Additionally set XEN_INTERFACE_VERSION to most recent in order to exercise both event_channel_op and event_channel_op_compat. Signed-off-by: Joao Martins Signed-off-by: David Woodhouse --- target/i386/xen.c | 45 + 1 file changed,

[RFC PATCH v2 00/22] Xen HVM support under KVM

2022-12-09 Thread David Woodhouse
Continuing the revival of Oracle's work at https://github.com/jpemartins/qemu/commits/xen-shim-rfc to work against the Xen guest support as it was finally merged into the kernel, and updated to today's QEMU. When complete, this will allow us to run native Xen guests on top of Linux/KVM without them

[RFC PATCH v2 16/22] i386/xen: handle VCPUOP_register_vcpu_info

2022-12-09 Thread David Woodhouse
From: Joao Martins Handle the hypercall to set a per vcpu info, and also wire up the default vcpu_info in the shared_info page for the first 32 vCPUs. To avoid deadlock within KVM a vCPU thread must set its *own* vcpu_info rather than it being set from the context in which the hypercall is invok

[RFC PATCH v2 04/22] i386/kvm: handle Xen HVM cpuid leaves

2022-12-09 Thread David Woodhouse
From: Joao Martins Introduce support for emulating CPUID for Xen HVM guests. It doesn't make sense to advertise the KVM leaves to a Xen guest, so do it unconditionally when the xen-version machine property is set. Signed-off-by: Joao Martins [dwmw2: Obtain xen_version from machine property, mak

[RFC PATCH v2 07/22] pc_piix: handle XEN_EMULATE backend init

2022-12-09 Thread David Woodhouse
From: Joao Martins And use newly added xen_emulated_machine_init() to iniitalize the xenstore and the sysdev bus for future emulated devices. Signed-off-by: Joao Martins [dwmw2: Move it to xen-legacy-backend.c] Signed-off-by: David Woodhouse --- hw/i386/pc_piix.c | 5 +

[RFC PATCH v2 11/22] i386/xen: implement HYPERCALL_xen_version

2022-12-09 Thread David Woodhouse
From: Joao Martins This is just meant to serve as an example on how we can implement hypercalls. xen_version specifically since Qemu does all kind of feature controllability. So handling that here seems appropriate. Signed-off-by: Joao Martins [dwmw2: Implement kvm_gva_rw() safely] Signed-off-b

[RFC PATCH v2 18/22] i386/xen: handle VCPUOP_register_runstate_memory_area

2022-12-09 Thread David Woodhouse
From: Joao Martins Allow guest to setup the vcpu runstates which is used as steal clock. Signed-off-by: Joao Martins Signed-off-by: David Woodhouse --- target/i386/cpu.h | 1 + target/i386/kvm/kvm.c | 9 + target/i386/machine.c | 4 +++- target/i386/xen.c | 35 +

[RFC PATCH v2 09/22] pc_piix: allow xenfv machine with XEN_EMULATE

2022-12-09 Thread David Woodhouse
From: Joao Martins This allows -machine xenfv to work with Xen emulated guests. Signed-off-by: Joao Martins Signed-off-by: David Woodhouse --- hw/i386/pc_piix.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c index 3dcac2f4b6..d112

[RFC PATCH v2 19/22] i386/xen: implement HVMOP_set_evtchn_upcall_vector

2022-12-09 Thread David Woodhouse
From: Ankur Arora The HVMOP_set_evtchn_upcall_vector hypercall sets the per-vCPU upcall vector, to be delivered to the local APIC just like an MSI (with an EOI). This takes precedence over the system-wide delivery method set by the HVMOP_set_param hypercall with HVM_PARAM_CALLBACK_IRQ. It's used

[RFC PATCH v2 15/22] i386/xen: implement HYPERVISOR_vcpu_op

2022-12-09 Thread David Woodhouse
From: Joao Martins This is simply when guest tries to register a vcpu_info and since vcpu_info placement is optional in the minimum ABI therefore we can just fail with -ENOSYS Signed-off-by: Joao Martins Signed-off-by: David Woodhouse --- target/i386/xen.c | 25 + 1 fi

[RFC PATCH v2 12/22] hw/xen: Add xen_overlay device for emulating shared xenheap pages

2022-12-09 Thread David Woodhouse
From: David Woodhouse For the shared info page and for grant tables, Xen shares its own pages from the "Xen heap" to the guest. The guest requests that a given page from a certain address space (XENMAPSPACE_shared_info, etc.) be mapped to a given GPA using the XENMEM_add_to_physmap hypercall. To

[RFC PATCH v2 13/22] i386/xen: implement HYPERVISOR_memory_op

2022-12-09 Thread David Woodhouse
From: Joao Martins Specifically XENMEM_add_to_physmap with space XENMAPSPACE_shared_info to allow the guest to set its shared_info page. Signed-off-by: Joao Martins [dwmw2: Use the xen_overlay device] Signed-off-by: David Woodhouse --- target/i386/trace-events | 1 + target/i386/xen.c

[RFC PATCH v2 17/22] i386/xen: handle VCPUOP_register_vcpu_time_info

2022-12-09 Thread David Woodhouse
From: Joao Martins In order to support Linux vdso in Xen. Signed-off-by: Joao Martins Signed-off-by: David Woodhouse --- target/i386/cpu.h | 1 + target/i386/kvm/kvm.c | 9 ++ target/i386/machine.c | 4 ++- target/i386/xen.c | 70 --- 4 f

Re: [PATCH] target/i386: Fix wrong XSAVE feature names

2022-12-09 Thread Yang Zhong
In fact, one month ago, I have sent out V2 for this issue. thanks! https://lists.nongnu.org/archive/html/qemu-devel/2022-10/msg04825.html Yang On Wed, Dec 07, 2022 at 09:47:47PM -0500, Xiaocheng Dong wrote: > The previous patch changes the name from FEAT_XSAVE_COMP_{LO|HI} > to FEAT_XSAVE_XCR0_{

[PATCH] linux-user: Enhance strace output for various syscalls

2022-12-09 Thread Helge Deller
Add appropriate strace printf formats for various Linux syscalls. Signed-off-by: Helge Deller --- linux-user/strace.list | 43 ++ 1 file changed, 23 insertions(+), 20 deletions(-) diff --git a/linux-user/strace.list b/linux-user/strace.list index 3a898e25

Re: [PATCH qemu.git 0/1] hw/arm/virt: add 2x sp804 timer

2022-12-09 Thread Peter Maydell
On Thu, 8 Dec 2022 at 17:25, Axel Heider wrote: > >> For the seL4 specific case, this is currently not possible in > >> the standard configuration. It's only exposed for a special > >> debug and benchmarking configuration. > >> > > It's not clear to me what you mean here -- the generic > > timer i

Re: [PATCH v3 1/2] hw/nvme: Implement shadow doorbell buffer support

2022-12-09 Thread Guenter Roeck
On Thu, Dec 08, 2022 at 12:39:57PM -0800, Guenter Roeck wrote: > On Thu, Dec 08, 2022 at 12:13:55PM -0800, Guenter Roeck wrote: > > On Thu, Dec 08, 2022 at 10:47:42AM -0800, Guenter Roeck wrote: > > > > > > > > A cq head doorbell mmio is skipped... And it is not the fault of the > > > > kernel. Th

[PATCH-for-8.0 v3 0/2] physmem: Remove trace events from trace-root.h

2022-12-09 Thread Philippe Mathieu-Daudé
Trivial housekeeping patches. Philippe Mathieu-Daudé (2): physmem: Remove unused "exec/translate-all.h" physmem: Remove trace events from trace-root.h softmmu/physmem.c| 3 +-- softmmu/trace-events | 5 + trace-events | 5 - 3 files changed, 6 insertions(+), 7 deletions(-

[PATCH-for-8.0 v3 1/2] physmem: Remove unused "exec/translate-all.h"

2022-12-09 Thread Philippe Mathieu-Daudé
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 1b606a3002..d562c0bb93 100644 --- a/softmmu/physmem.c +++ b/softmmu/physmem.c @@ -58,7 +58,6 @@ #include "qemu/rcu_queue.h" #include "qemu

[PATCH-for-8.0 v3 2/2] physmem: Remove trace events from trace-root.h

2022-12-09 Thread Philippe Mathieu-Daudé
Missed in d9f24bf572 ("exec: split out non-softmmu-specific parts"). Signed-off-by: Philippe Mathieu-Daudé --- softmmu/physmem.c| 2 +- softmmu/trace-events | 5 + trace-events | 5 - 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/softmmu/physmem.c b/softmmu/p

[PATCH-for-8.0] target/arm: Restrict arm_cpu_exec_interrupt() to TCG accelerator

2022-12-09 Thread Philippe Mathieu-Daudé
When building with --disable-tcg on Darwin we get: target/arm/cpu.c:725:16: error: incomplete definition of type 'struct TCGCPUOps' cc->tcg_ops->do_interrupt(cs); ~~~^ Commit 083afd18a9 ("target/arm: Restrict cpu_exec_interrupt() handler to sysemu") limited this block to system

[PATCH v2 for-8.0] hw/rtc/mc146818rtc: Make this rtc device target independent

2022-12-09 Thread Thomas Huth
The only reason for this code being target dependent is the apic-related code in rtc_policy_slew_deliver_irq(). Since these apic functions are rather simple, we can easily move them into a new, separate file (apic_irqcount.c) which will always be compiled and linked if either APIC or the mc146818 d

[RFC PATCH-for-8.0] target/arm: Keep "internals.h" internal to target/arm/

2022-12-09 Thread Philippe Mathieu-Daudé
"target/arm/internals.h" is supposed to be *internal* to target/arm/. hw/arm/virt.c includes it to get arm_pamax() declaration. Move this declaration to "cpu.h" which can be included out of target/arm/, and move the implementation in machine.c which is always built with system emulation. Signed-of

[PATCH 02/30] configure: remove dead function

2022-12-09 Thread Paolo Bonzini
Signed-off-by: Paolo Bonzini --- configure | 4 1 file changed, 4 deletions(-) diff --git a/configure b/configure index e31d4522ea63..543fd5a48bf0 100755 --- a/configure +++ b/configure @@ -210,10 +210,6 @@ version_ge () { done } -glob() { -eval test -z '"${1#'"$2"'}"' -} - if

[PATCH for-8.0 00/30] Meson changes for QEMU 8.0

2022-12-09 Thread Paolo Bonzini
The final bout of conversions removes the remaining compiler tests for emulators, applies a few cleanups that are enabled by version 0.63 of Meson, and updates the documentation. Committing this however requires first a libvirt-ci update, in order to enable using Python 3.8/3.9 on CentOS 8 and SLE

[PATCH 03/30] configure: remove useless test

2022-12-09 Thread Paolo Bonzini
$cpu is derived from preprocessor defines rather than uname these days, so do not bother using isainfo on Solaris. Likewise do not recognize BeOS's uname -m output. Signed-off-by: Paolo Bonzini --- configure | 12 +--- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/config

[PATCH 08/30] meson: require 0.63.0

2022-12-09 Thread Paolo Bonzini
This allows cleanups cleanups in modinfo collection and supports the equivalent of QEMU's --static option to configure. Signed-off-by: Paolo Bonzini --- configure | 2 +- meson | 2 +- meson.build | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/configure b/configur

[PATCH 16/30] build: move glib detection and workarounds to meson

2022-12-09 Thread Paolo Bonzini
QEMU adds the path to glib.h is added to all compilation commands. This is simpler due to the pervasive use of static_library, and was grandfathered in from the previous Make-based build system. Until Meson 0.63 the only way to do this was to detect glib in configure and use add_project_arguments,

[PATCH 04/30] configure: preserve qemu-ga variables

2022-12-09 Thread Paolo Bonzini
Ensure that qemu-ga variables set at configure time are kept later when the script is rerun. For preserve_env to work, the variables need to be empty so move the default values to config-host.mak generation. Signed-off-by: Paolo Bonzini --- configure | 23 ++- 1 file changed

[PATCH 13/30] configure: remove backwards-compatibility code

2022-12-09 Thread Paolo Bonzini
The cmd_line.txt mangling is only needed when rebuilding from very old trees and is kept mostly as an example of how to extend it. However, Meson 0.63 introduces a deprecation mechanism for meson_options.txt that can be used instead, so get rid of our home-grown hack. Signed-off-by: Paolo Bonzini

[PATCH 28/30] docs: update build system docs

2022-12-09 Thread Paolo Bonzini
Now that configure is only doing compiler and host setup, adjust the relevant documentation. It is also possible to build emulators with ninja directly if one is so inclined. Signed-off-by: Paolo Bonzini --- docs/devel/build-system.rst | 275 +--- 1 file changed,

[PATCH 14/30] configure: test all warnings

2022-12-09 Thread Paolo Bonzini
Some warnings are hardcoded in QEMU_CFLAGS and not tested. There is no particular reason to single out these five, as many more -W flags are present on all the supported compilers. For homogeneity when moving the detection to meson, make them use the same warn_flags infrastructure. Signed-off-by

[PATCH 10/30] meson: remove static_kwargs

2022-12-09 Thread Paolo Bonzini
After static_kwargs has been changed to an empty dictionary, it has no functional effect and can be removed. Signed-off-by: Paolo Bonzini --- meson.build | 212 +++- tcg/meson.build | 2 +- 2 files changed, 84 insertions(+), 130 deletions(-) dif

[PATCH 30/30] meson: always log qemu-iotests verbosely

2022-12-09 Thread Paolo Bonzini
--- tests/qemu-iotests/meson.build | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/qemu-iotests/meson.build b/tests/qemu-iotests/meson.build index 583468c5b9b3..3d8637c8f2b6 100644 --- a/tests/qemu-iotests/meson.build +++ b/tests/qemu-iotests/meson.build @@ -43,5 +43,6 @@ foreach format,

[PATCH 15/30] meson: cleanup compiler detection

2022-12-09 Thread Paolo Bonzini
Detect all compilers at the beginning of meson.build, and store the available languages in an array. Signed-off-by: Paolo Bonzini --- meson.build | 62 ++--- 1 file changed, 35 insertions(+), 27 deletions(-) diff --git a/meson.build b/meson.build

[PATCH 20/30] meson: prepare move of QEMU_CFLAGS to meson

2022-12-09 Thread Paolo Bonzini
Clean up the handling of compiler flags in meson.build, splitting the general flags that should be included in subprojects as well, from warning flags that only apply to QEMU itself. The two were mixed in both configure tests and meson tests. This split makes it easier to move the compiler tests

[PATCH 07/30] meson: support meson 0.64 -Doptimization=plain

2022-12-09 Thread Paolo Bonzini
In Meson 0.64, the optimization built-in option now accepts the "plain" value, which will not set any optimization flags. While QEMU does not check the contents of the option and therefore does not suffer any ill effect from the new value, it uses get_option to print the optimization flags in the

[PATCH 06/30] meson: tweak hardening options for Windows

2022-12-09 Thread Paolo Bonzini
-Wl,--dynamicbase has been enabled for DLLs upstream for roughly 2 years (https://sourceware.org/bugzilla/show_bug.cgi?id=19011), and also by some distros including Debian for 6 years even (https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=836365), so just enable it unconditionally. Also add -Wl,-

[PATCH 23/30] build: move coroutine backend selection to meson

2022-12-09 Thread Paolo Bonzini
To simplify the code, rename coroutine-win32.c to match the option passed to configure. Signed-off-by: Paolo Bonzini --- configure | 62 --- meson.build | 32 +- meson_options.txt

[PATCH 17/30] configure: remove pkg-config functions

2022-12-09 Thread Paolo Bonzini
All uses of pkg-config have been moved to Meson. Signed-off-by: Paolo Bonzini --- configure | 19 +++ docs/devel/build-system.rst | 4 2 files changed, 3 insertions(+), 20 deletions(-) diff --git a/configure b/configure index fb28dd3963bd..9c336203d8d9 10

[PATCH 26/30] build: move remaining compiler flag tests to meson

2022-12-09 Thread Paolo Bonzini
Remove the only remaining uses of QEMU_CFLAGS. Now that no feature tests are done in configure, it is possible to remove CONFIGURE_CFLAGS and CONFIGURE_LDFLAGS as well. Signed-off-by: Paolo Bonzini --- configure | 79 - meson.build | 49

[PATCH 22/30] build: move SafeStack tests to meson

2022-12-09 Thread Paolo Bonzini
This disables the old behavior of detecting SafeStack from environment CFLAGS. SafeStack is now enabled purely based on the configure arguments. Signed-off-by: Paolo Bonzini --- configure | 73 --- meson.build | 26 ++

[PATCH 21/30] build: move sanitizer tests to meson

2022-12-09 Thread Paolo Bonzini
Signed-off-by: Paolo Bonzini --- configure | 151 - docs/devel/build-system.rst| 4 - meson.build| 63 +- meson_options.txt | 4 + scripts/meson-buildoptions.sh | 6 ++ tests/qemu-iotests

[PATCH 09/30] meson: use prefer_static option

2022-12-09 Thread Paolo Bonzini
The option is new in Meson 0.63 and removes the need to pass "static: true" to all dependency and find_library invocation. Actually cleaning up the invocations is left for a separate patch. Signed-off-by: Paolo Bonzini --- configure | 4 +--- docs/devel/build-system.rst | 3

[PATCH 27/30] build: move compiler version check to meson

2022-12-09 Thread Paolo Bonzini
Instead of checking with preprocessor defines, use the Meson compiler object. Because of the mess Apple does with its versioning scheme, check for an option that was added in clang 6.0 instead of looking at the version number. Signed-off-by: Paolo Bonzini --- configure | 25 ---

Re: [RFC PATCH-for-8.0] target/arm: Keep "internals.h" internal to target/arm/

2022-12-09 Thread Peter Maydell
On Fri, 9 Dec 2022 at 11:17, Philippe Mathieu-Daudé wrote: > > "target/arm/internals.h" is supposed to be *internal* to > target/arm/. hw/arm/virt.c includes it to get arm_pamax() > declaration. Move this declaration to "cpu.h" which can > be included out of target/arm/, and move the implementatio

[PATCH v2] scripts/archive-source: Use GNU tar on Darwin

2022-12-09 Thread Philippe Mathieu-Daudé
When using the archive-source.sh script on Darwin we get: tar: Option --concatenate is not supported Usage: List:tar -tf Extract: tar -xf Create: tar -cf [filenames...] Help:tar --help 'tar' default to the BSD implementation: $ tar --version bsdtar 3.5.3 - lib

[PATCH 12/30] modinfo: lookup compile_commands.json by object

2022-12-09 Thread Paolo Bonzini
With Meson 0.63 having fixed various issues with extract_objects, the compile_commands.json lookups can be simplified. If the lookup uses the object file as key, there is no need to use the command line to distinguish among all entries for a given source. Cc: Gerd Hoffmann Signed-off-by: Paolo B

Re: [PATCH 02/30] configure: remove dead function

2022-12-09 Thread Peter Maydell
On Fri, 9 Dec 2022 at 11:25, Paolo Bonzini wrote: > > Signed-off-by: Paolo Bonzini > --- > configure | 4 > 1 file changed, 4 deletions(-) > > diff --git a/configure b/configure > index e31d4522ea63..543fd5a48bf0 100755 > --- a/configure > +++ b/configure > @@ -210,10 +210,6 @@ version_ge (

Re: [PATCH 03/30] configure: remove useless test

2022-12-09 Thread Peter Maydell
On Fri, 9 Dec 2022 at 11:25, Paolo Bonzini wrote: > > $cpu is derived from preprocessor defines rather than uname these days, > so do not bother using isainfo on Solaris. Likewise do not recognize > BeOS's uname -m output. > > Signed-off-by: Paolo Bonzini > --- > configure | 12 +--- >

Re: [PATCH 01/30] configure: remove useless write_c_skeleton

2022-12-09 Thread Peter Maydell
On Fri, 9 Dec 2022 at 11:26, Paolo Bonzini wrote: > > This is not needed ever since QEMU stopped detecting -liberty; this > happened with the Meson switch but it is quite likely that the > library was not really necessary years before. > > Signed-off-by: Paolo Bonzini > --- > configure | 1 - >

[PATCH 24/30] build: move stack protector flag selection to meson

2022-12-09 Thread Paolo Bonzini
Signed-off-by: Paolo Bonzini --- configure | 44 ++- meson.build | 28 +- meson_options.txt | 2 ++ scripts/meson-buildoptions.sh | 3 +++ 4 files changed, 34 insertions(+), 43 deletions(-) di

[PATCH 29/30] configure: do not rerun the tests with -Werror

2022-12-09 Thread Paolo Bonzini
Tests run in configure are pretty trivial at this point, so do not bother with the extra complication of running tests both with and without -Werror. Signed-off-by: Paolo Bonzini --- configure | 35 +-- 1 file changed, 1 insertion(+), 34 deletions(-) diff --git a

[PATCH 05/30] configure: remove backwards-compatibility and obsolete options

2022-12-09 Thread Paolo Bonzini
Signed-off-by: Paolo Bonzini --- configure | 20 1 file changed, 20 deletions(-) diff --git a/configure b/configure index 4d14ff9c319c..adfff30a6204 100755 --- a/configure +++ b/configure @@ -838,17 +838,6 @@ for opt do ;; --with-coroutine=*) coroutine="$optarg" ;;

[PATCH 19/30] configure, meson: move --enable-debug-info to Meson

2022-12-09 Thread Paolo Bonzini
Older versions of Meson had an unclear description of the -Ddebug option, but this is fixed in 0.63.0 that is required now. Signed-off-by: Paolo Bonzini --- configure | 5 - scripts/meson-buildoptions.py | 2 ++ scripts/meson-buildoptions.sh | 3 +++ 3 files changed, 5 in

[PATCH 18/30] configure, meson: move --enable-modules to Meson

2022-12-09 Thread Paolo Bonzini
Signed-off-by: Paolo Bonzini --- configure | 21 + meson.build | 7 ++- meson_options.txt | 2 ++ scripts/meson-buildoptions.sh | 3 +++ 4 files changed, 12 insertions(+), 21 deletions(-) diff --git a/configure b/config

[PATCH 25/30] build: move warning flag selection to meson

2022-12-09 Thread Paolo Bonzini
Meson already knows to test with the positive form of the flag, which simplifies the test. Warnings are now tested explicitly for the C++ compiler, instead of hardcoding those that are only available for the C language. At this point all compiler flags in QEMU_CFLAGS are global and only depend on

[PATCH 11/30] meson: cleanup dummy-cpus.c rules

2022-12-09 Thread Paolo Bonzini
Now that qtest is available on all targets including Windows, dummy-cpus.c is included unconditionally in the build. Signed-off-by: Paolo Bonzini --- accel/meson.build | 9 ++--- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/accel/meson.build b/accel/meson.build index 259c35c

[PATCH 01/30] configure: remove useless write_c_skeleton

2022-12-09 Thread Paolo Bonzini
This is not needed ever since QEMU stopped detecting -liberty; this happened with the Meson switch but it is quite likely that the library was not really necessary years before. Signed-off-by: Paolo Bonzini --- configure | 1 - 1 file changed, 1 deletion(-) diff --git a/configure b/configure in

Re: [PATCH-for-8.0 v3 1/2] physmem: Remove unused "exec/translate-all.h"

2022-12-09 Thread Peter Maydell
On Fri, 9 Dec 2022 at 11:07, Philippe Mathieu-Daudé wrote: > > 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 1b606a3002..d562c0bb93 100644 > --- a/softmmu/physmem.c > +++ b/sof

Re: [SeaBIOS] Re: [PATCH 4/4] be less conservative with the 64bit pci io window

2022-12-09 Thread Gerd Hoffmann
Hi, > > Well, the idea is to adapt to the world moving forward. Running a > > 64-bit capable OS is standard these days, and the resources needed > > by devices (especially GPUs) are becoming larger and larger. > > > > Yes, there is the risk that (old) guests are unhappy with their > > PCI bars

Re: [PATCH 27/30] build: move compiler version check to meson

2022-12-09 Thread Peter Maydell
On Fri, 9 Dec 2022 at 11:40, Paolo Bonzini wrote: > > Instead of checking with preprocessor defines, use the Meson compiler object. > Because of the mess Apple does with its versioning scheme, check for an > option that was added in clang 6.0 instead of looking at the version number. > -# Check w

Re: [RFC PATCH] test-bdrv-drain: keep graph manipulations out of coroutines

2022-12-09 Thread Emanuele Giuseppe Esposito
Am 05/12/2022 um 14:01 schrieb Kevin Wolf: > Am 02.12.2022 um 18:22 hat Paolo Bonzini geschrieben: >> On 12/2/22 14:42, Emanuele Giuseppe Esposito wrote: >>> >>> >>> Am 02/12/2022 um 14:27 schrieb Paolo Bonzini: Changes to the BlockDriverState graph will have to take the corresponding

Re: [RFC PATCH] test-bdrv-drain: keep graph manipulations out of coroutines

2022-12-09 Thread Emanuele Giuseppe Esposito
Am 09/12/2022 um 13:18 schrieb Emanuele Giuseppe Esposito: > > > Am 05/12/2022 um 14:01 schrieb Kevin Wolf: >> Am 02.12.2022 um 18:22 hat Paolo Bonzini geschrieben: >>> On 12/2/22 14:42, Emanuele Giuseppe Esposito wrote: Am 02/12/2022 um 14:27 schrieb Paolo Bonzini: > Change

[PATCH] target/mips: Add nanoMIPS ISA support in QEMU

2022-12-09 Thread Milica Lazarevic
nanoMIPS ISA support is planned to be maintained. Signed-off-by: Milica Lazarevic --- MAINTAINERS | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/MAINTAINERS b/MAINTAINERS index 6966490c94..66e083b455 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -237,10 +237,16 @@ R:

Re: [PATCH 14/30] configure: test all warnings

2022-12-09 Thread Philippe Mathieu-Daudé
On 9/12/22 12:23, Paolo Bonzini wrote: Some warnings are hardcoded in QEMU_CFLAGS and not tested. There is no particular reason to single out these five, as many more -W flags are present on all the supported compilers. For homogeneity when moving the detection to meson, make them use the same

Re: [PATCH-for-8.0] target/arm: Restrict arm_cpu_exec_interrupt() to TCG accelerator

2022-12-09 Thread Fabiano Rosas
Philippe Mathieu-Daudé writes: > When building with --disable-tcg on Darwin we get: > > target/arm/cpu.c:725:16: error: incomplete definition of type 'struct > TCGCPUOps' > cc->tcg_ops->do_interrupt(cs); > ~~~^ > > Commit 083afd18a9 ("target/arm: Restrict cpu_exec_interrupt() >

Re: [PATCH 16/30] build: move glib detection and workarounds to meson

2022-12-09 Thread Philippe Mathieu-Daudé
On 9/12/22 12:23, Paolo Bonzini wrote: QEMU adds the path to glib.h is added to all compilation commands. add/add/ not clear... Otherwise: Reviewed-by: Philippe Mathieu-Daudé This is simpler due to the pervasive use of static_library, and was grandfathered in from the previous Make-based b

Re: [PATCH 19/30] configure, meson: move --enable-debug-info to Meson

2022-12-09 Thread Philippe Mathieu-Daudé
On 9/12/22 12:23, Paolo Bonzini wrote: Older versions of Meson had an unclear description of the -Ddebug option, but this is fixed in 0.63.0 that is required now. Signed-off-by: Paolo Bonzini --- configure | 5 - scripts/meson-buildoptions.py | 2 ++ scripts/meson-bu

Re: [PATCH 22/30] build: move SafeStack tests to meson

2022-12-09 Thread Philippe Mathieu-Daudé
On 9/12/22 12:24, Paolo Bonzini wrote: This disables the old behavior of detecting SafeStack from environment CFLAGS. SafeStack is now enabled purely based on the configure arguments. Signed-off-by: Paolo Bonzini --- configure | 73 --- me

[PATCH v12 0/1] vhost-vdpa: add support for vIOMMU

2022-12-09 Thread Cindy Lu
These patches are to support vIOMMU in vdpa device Verified in vp_vdpa/vdpa_sim_net driverand intel_iommu virtio-iommu device changes in V3 1. Move function vfio_get_xlat_addr to memory.c 2. Use the existing memory listener, while the MR is iommu MR then call the function iommu_region_add/ iommu_r

[PATCH v12 1/1] vhost-vdpa: add support for vIOMMU

2022-12-09 Thread Cindy Lu
1.Skip the check in vhost_vdpa_listener_skipped_section() while MR is IOMMU, Move this check to vhost_vdpa_iommu_map_notify() 2.Add support for vIOMMU. Add the new function to deal with iommu MR. - during iommu_region_add register a specific IOMMU notifier, and store all notifiers in a list. - du

Re: How to best make include/hw/pci/pcie_sriov.h self-contained

2022-12-09 Thread Markus Armbruster
"Michael S. Tsirkin" writes: > On Wed, Dec 07, 2022 at 07:25:49AM +0100, Markus Armbruster wrote: >> pcie_sriov.h needs PCI_NUM_REGIONS from pci.h, but doesn't include it. >> pci.h must be included before pcie_sriov.h or else compile fails. >> >> Adding #include "pci/pci.h" to pcie_sriov would b

[PATCH] migration/rdma: fix return value for qio_channel_rdma_{readv, writev}

2022-12-09 Thread Fiona Ebner
upon errors. As the documentation in include/io/channel.h states, only -1 and QIO_CHANNEL_ERR_BLOCK should be returned upon error. Other values have the potential to confuse the call sites. error_setg is used rather than error_setg_errno, because there are certain code paths where -1 (as a non-err

  1   2   >