Re: [PATCH] meson: Clean up some dependencies regarding qemu-system

2022-12-20 Thread Michael Tokarev
20.12.2022 23:56, Helge Deller wrote: .. Given that info, would it then make sense to keep as is:    --enable-system    --enable-user    --enable-tools -> qemu-bridge-helper, vhost-user-gpu, virtfs-proxy-helper, virtiofsd    --enable-guest-agent -> guest agents  (option is there already, but

[[PATCH]--edit 5/6] tests/docker: use prebuilt toolchain for debian-hexagon-cross

2022-12-20 Thread Alex Bennée
From: Mukilan Thiyagarajan The current docker image for cross compiling hexagon guests is manually built since it takes >2 hours to build from source. This patch: 1. Solves the above issue by using the prebuilt clang toolchain hosted on CodeLinaro [1] and maintained by QUIC [2]. 2. The doc

[[PATCH]--edit 6/6] gitlab-ci: Disable docs and GUIs for the build-tci and build-tcg-disabled jobs

2022-12-20 Thread Alex Bennée
From: Thomas Huth These jobs use their own "script:" section and thus do not profit from the global "--disable-docs" from the template. While we're at it, disable also some GUI front ends here since we do not gain any additional test coverage by compiling those here again. Signed-off-by: Thomas

[[PATCH]--edit 2/6] gitlab: turn off verbose logging for make check on custom runners

2022-12-20 Thread Alex Bennée
The verbosity adds a lot of unnecessary output to the CI logs which end up getting truncated anyway. We can always extract information from the meson test logs on a failure and for the custom runners its generally easier to re-create failures anyway. Signed-off-by: Alex Bennée Reviewed-by: Thomas

[[PATCH]--edit 4/6] tests/tcg: fix unused variable in linux-test

2022-12-20 Thread Alex Bennée
The latest hexagon compiler picks up that we never consume wcount. Given the name of the #define that rcount checks against is WCOUNT_MAX I figured the check just got missed. Signed-off-by: Alex Bennée --- tests/tcg/multiarch/linux/linux-test.c | 6 +- 1 file changed, 5 insertions(+), 1 dele

[[PATCH]--edit 3/6] configure: repeat ourselves for the benefit of CI

2022-12-20 Thread Alex Bennée
Our CI system echos the lines it executes but not the expansions. For the sake of a line of extra verbosity during the configure phase lets echo the invocation of script to stdout as well as the log when on CI. Signed-off-by: Alex Bennée Message-Id: <20221202174746.1218017-1-alex.ben...@linaro.or

[[PATCH]--edit 1/6] configure: Fix check-tcg not executing any tests

2022-12-20 Thread Alex Bennée
From: Mukilan Thiyagarajan After configuring with --target-list=hexagon-linux-user running `make check-tcg` just prints the following: ``` make: Nothing to be done for 'check-tcg' ``` In the probe_target_compiler function, the 'break' command is used incorrectly. There are no lexically enclosin

[[PATCH]--edit 0/6] current status of testing/next

2022-12-20 Thread Alex Bennée
Hi, Here is the current state of my testing/next tree. Nothing particularly out of the ordinary but we do now have a binary release of the hexagon tools. The following still need review: - tests/tcg: fix unused variable in linux-test - configure: repeat ourselves for the benefit of CI Alex Be

Re: [PATCH] hw/net: Fix read of uninitialized memory in ftgmac100

2022-12-20 Thread Cédric Le Goater
On 12/20/22 23:14, Stephen Longfield wrote: With the `size += 4` before the call to `crc32`, the CRC calculation would overrun the buffer. Size is used in the while loop starting on line 1009 to determine how much data to write back, with the last four bytes coming from `crc_ptr`, so do need to i

Re: [PATCH v2 0/3] Decouple INTx-to-LNKx routing from south bridges

2022-12-20 Thread Philippe Mathieu-Daudé
On 20/11/22 16:05, Bernhard Beschow wrote: Bernhard Beschow (3): hw/pci/pci: Factor out pci_bus_map_irqs() from pci_bus_irqs() hw/isa/piix3: Decouple INTx-to-LNKx routing which is board-specific hw/isa/piix4: Decouple INTx-to-LNKx routing which is board-specific Thanks, series queued

Re: [PATCH 3/3] hw/arm/nseries: Silent -Wmissing-field-initializers warning

2022-12-20 Thread Philippe Mathieu-Daudé
On 21/12/22 02:01, Richard Henderson wrote: On 12/20/22 06:25, Philippe Mathieu-Daudé wrote: Silent when compiling with -Wextra:    ../hw/arm/nseries.c:1081:12: warning: missing field 'line' initializer [-Wmissing-field-initializers]    { NULL }   ^ Signed-off-by: Philippe Ma

Re: [PATCH-for-8.0 v2 00/11] hw/mips/malta: Generate nanoMIPS bootloader with bootloader generator API

2022-12-20 Thread Philippe Mathieu-Daudé
On 11/12/22 21:45, Philippe Mathieu-Daudé wrote: hw/mips/bootloader: Handle buffers as opaque arrays hw/mips/bootloader: Implement nanoMIPS NOP opcode generator hw/mips/bootloader: Implement nanoMIPS SW opcode generator hw/mips/bootloader: Implement nanoMIPS LI (LUI+ORI) opcode gener

Re: [PATCH v2 0/7] hw/mips: Make gt64xxx_pci.c endian-agnostic

2022-12-20 Thread Philippe Mathieu-Daudé
On 20/12/22 12:34, Philippe Mathieu-Daudé wrote: hw/mips/Kconfig: Introduce CONFIG_GT64120 to select gt64xxx_pci.c hw/mips/gt64xxx_pci: Let the GT64120 manage the lower 512MiB hole hw/mips/gt64xxx_pci: Manage endian bits with the RegisterFields API hw/mips/gt64xxx_pci: Add a 'cpu-lit

Re: [PATCH v2 4/5] coroutine: Split qemu/coroutine-core.h off qemu/coroutine.h

2022-12-20 Thread Markus Armbruster
Markus Armbruster writes: > qemu/coroutine.h and qemu/lockable.h include each other. > > They need each other only in macro expansions, so we could simply drop > both inclusions to break the loop, and add suitable includes to files > that expand the macros. > > Instead, move a part of qemu/corout

Re: [PATCH v2 0/3] Decouple INTx-to-LNKx routing from south bridges

2022-12-20 Thread Michael S. Tsirkin
On Tue, Dec 20, 2022 at 11:26:42PM +, Bernhard Beschow wrote: > > > Am 20. Dezember 2022 23:10:45 UTC schrieb "Michael S. Tsirkin" > : > >On Sun, Dec 18, 2022 at 10:21:49AM +, Bernhard Beschow wrote: > >> > >> > >> Am 9. Dezember 2022 15:23:59 UTC schrieb "Philippe Mathieu-Daudé" > >>

Re: [PATCH v2 0/3] Decouple INTx-to-LNKx routing from south bridges

2022-12-20 Thread Michael S. Tsirkin
On Sun, Nov 20, 2022 at 04:05:47PM +0100, Bernhard Beschow wrote: > v1: > === > > During my PIIX consolidation work [1] I've noticed that both PIIX models have > quite different pci_slot_get_pirq() implementations. These functions seem to > map PCI INTx pins to input pins of a programmable interru

Re: [PATCH v4 0/6] Only generate cluster node in PPTT when specified

2022-12-20 Thread Michael S. Tsirkin
On Tue, Nov 01, 2022 at 03:10:42PM +0800, Yicong Yang wrote: > From: Yicong Yang > > This series mainly change the policy for building a cluster topology node > in PPTT. Previously we'll always build a cluster node in PPTT without > asking the user, after this set the cluster node will be built o

Re: [PATCH] target/riscv: Set pc_succ_insn for !rvc illegal insn

2022-12-20 Thread Alistair Francis
On Sun, Dec 4, 2022 at 3:58 AM Richard Henderson wrote: > > Failure to set pc_succ_insn may result in a TB covering zero bytes, > which triggers an assert within the code generator. > > Cc: qemu-sta...@nongnu.org > Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1224 > Signed-off-by: Richa

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

2022-12-20 Thread Cindy Lu
On Tue, 20 Dec 2022 at 22:33, Michael S. Tsirkin wrote: > > On Fri, Dec 09, 2022 at 09:08:04PM +0800, Cindy Lu wrote: > > These patches are to support vIOMMU in vdpa device > > Verified in vp_vdpa/vdpa_sim_net driverand intel_iommu > > virtio-iommu device > > Pls address comments and repost. > Hi

[PULL v2 08/14] accel/tcg: Move PageDesc tree into tb-maint.c for system

2022-12-20 Thread Richard Henderson
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 structure without definition. Signed-off-by

[PULL v2 13/14] accel/tcg: Factor tb_invalidate_phys_range_fast() out

2022-12-20 Thread Richard Henderson
From: Philippe Mathieu-Daudé Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Alex Bennée Message-Id: <20221209093649.43738-5-phi...@linaro.org> Signed-off-by: Richard Henderson --- accel/tcg/internal.h | 3 +++ accel/tcg/cputlb.c | 5 + accel/tcg/tb-maint.c | 21 +--

[PULL v2 11/14] accel/tcg: Remove trace events from trace-root.h

2022-12-20 Thread Richard Henderson
From: 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é Reviewed-by: Alex Bennée Message-Id: <20221209093649.43738

[PULL v2 03/14] accel/tcg: Use interval tree for TBs in user-only mode

2022-12-20 Thread Richard Henderson
Begin weaning user-only away from PageDesc. Since, for user-only, all TB (and page) manipulation is done with a single mutex, and there is no virtual/physical discontinuity to split a TB across discontinuous pages, place all of the TBs into a single IntervalTree. This makes it trivial to find all

[PULL v2 12/14] accel/tcg: Rename tb_invalidate_phys_page_fast{, __locked}()

2022-12-20 Thread Richard Henderson
From: Philippe Mathieu-Daudé Emphasize this function is called with pages locked. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Alex Bennée Message-Id: <20221209093649.43738-4-phi...@linaro.org> [rth: Use "__locked" suffix, to match other instances.] Signed-off-by: Richard Henderson ---

[PULL v2 07/14] accel/tcg: Use interval tree for user-only page tracking

2022-12-20 Thread Richard Henderson
Finish weaning user-only away from PageDesc. Using an interval tree to track page permissions means that we can represent very large regions efficiently. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/290 Resolves: https://gitlab.com/qemu-project/qemu/-/issues/967 Resolves: https://gitla

[PULL v2 06/14] accel/tcg: Move page_{get,set}_flags to user-exec.c

2022-12-20 Thread Richard Henderson
This page tracking implementation is specific to user-only, since the system softmmu version is in cputlb.c. Move it out of translate-all.c to user-exec.c. Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Alex Bennée Signed-off-by: Richard Henderson --- accel/tcg/internal.h | 17 ++ acc

[PULL v2 05/14] accel/tcg: Drop PAGE_RESERVED for CONFIG_BSD

2022-12-20 Thread Richard Henderson
Make bsd-user match linux-user in not marking host pages as reserved. This isn't especially effective anyway, as it doesn't take into account any heap memory that qemu may allocate after startup. Reviewed-by: Warner Losh Tested-by: Warner Losh Reviewed-by: Alex Bennée Tested-by: Alex Bennée R

[PULL v2 04/14] accel/tcg: Use interval tree for TARGET_PAGE_DATA_SIZE

2022-12-20 Thread Richard Henderson
Continue weaning user-only away from PageDesc. Use an interval tree to record target data. Chunk the data, to minimize allocation overhead. Reviewed-by: Alex Bennée Signed-off-by: Richard Henderson --- accel/tcg/internal.h | 1 - accel/tcg/user-exec.c | 99 ---

[PULL v2 10/14] accel/tcg: Restrict cpu_io_recompile() to system emulation

2022-12-20 Thread Richard Henderson
From: Philippe Mathieu-Daudé Missed in commit 6526919224 ("accel/tcg: Restrict cpu_io_recompile() from other accelerators"). Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Alex Bennée Message-Id: <20221209093649.43738-2-phi...@linaro.org> Signed-off-by: Richard Henderson --- accel/tcg/in

[PULL v2 01/14] util: Add interval-tree.c

2022-12-20 Thread Richard Henderson
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 util/interval-tree.c| 882 +

[PULL v2 00/14] accel/tcg: Rewrite user-only vma tracking

2022-12-20 Thread Richard Henderson
s/pull-tcg-20221220 for you to fetch changes up to 811242654934bd4613634235ef6a8219792ab088: accel/tcg: Restrict page_collection structure to system TB maintainance (2022-12-20 17:11:12 -0800) Use interval trees for user-only vm

[PULL v2 09/14] accel/tcg: Move remainder of page locking to tb-maint.c

2022-12-20 Thread Richard Henderson
The only thing that still touches PageDesc in translate-all.c are some locking routines related to tb-maint.c which have not yet been moved. Do so now. Move some code up in tb-maint.c as well, to untangle the maze of ifdefs, and allow a sensible final ordering. Move some declarations from exec/t

[PULL v2 14/14] accel/tcg: Restrict page_collection structure to system TB maintainance

2022-12-20 Thread Richard Henderson
From: 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_fast__locked() from signed to unsigned. Signed-off-by

[PULL v2 02/14] accel/tcg: Rename page_flush_tb

2022-12-20 Thread Richard Henderson
Rename to tb_remove_all, to remove the PageDesc "page" from the name, and to avoid suggesting a "flush" in the icache sense. Reviewed-by: Alex Bennée Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- accel/tcg/tb-maint.c | 10 +- 1 file changed, 5 insertions(+),

Re: [RFC v5 2/3] virtio-blk: add zoned storage emulation for zoned devices

2022-12-20 Thread Sam Li
Stefan Hajnoczi 于2022年12月21日周三 05:37写道: > > On Mon, Dec 19, 2022 at 04:16:43PM +0800, Sam Li wrote: > > This patch extends virtio-blk emulation to handle zoned device commands > > by calling the new block layer APIs to perform zoned device I/O on > > behalf of the guest. It supports Report Zone, f

Re: [PATCH 0/5] cpus: Remove system reset() API from user emulation

2022-12-20 Thread Wilfred Mallawa
On Tue, 2022-12-20 at 15:56 +0100, Philippe Mathieu-Daudé wrote: > In user emulation, threads -- implemented as CPU -- are > created/destroyed, but never reset. There is no point in > allowing the user emulation access the sysemu/reset API. > > Philippe Mathieu-Daudé (5): >   target/i386: Restrict

Re: [PATCH 1/2] hw/arm/virt: Consolidate GIC finalize logic

2022-12-20 Thread Zenghui Yu via
On 2022/12/21 7:04, Alexander Graf wrote: diff --git a/include/hw/arm/virt.h b/include/hw/arm/virt.h index c7dd59d7f1..365d19f7a3 100644 --- a/include/hw/arm/virt.h +++ b/include/hw/arm/virt.h @@ -109,12 +109,12 @@ typedef enum VirtMSIControllerType { } VirtMSIControllerType; typedef enum Vir

Re: [PATCH 0/2] hw/arm/virt: Handle HVF in finalize_gic_version()

2022-12-20 Thread Zenghui Yu via
[ +Eric who wrote finalize_gic_version() ] On 2022/12/21 7:04, Alexander Graf wrote: The finalize_gic_version() function tries to determine which GIC version the current accelerator / host combination supports. During the initial HVF porting efforts, I didn't realize that I also had to touch thi

Re: [PATCH 0/3] Fix UNMAP notifier for intel-iommu

2022-12-20 Thread Jason Wang
On Tue, Dec 20, 2022 at 9:53 PM Michael S. Tsirkin wrote: > > On Tue, Nov 29, 2022 at 04:10:34PM +0800, Jason Wang wrote: > > Hi All: > > > > According to ATS, device should work if ATS is disabled. This is not > > correctly implemented in the current intel-iommu since it doesn't > > handle the UN

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

2022-12-20 Thread David Woodhouse
On Mon, 2022-12-12 at 16:16 +, Paul Durrant wrote: > > > @@ -287,24 +289,53 @@ static bool kvm_xen_hcall_memory_op(struct > > kvm_xen_exit *exit, > >   return true; > >   } > >   > > +static int handle_set_param(struct kvm_xen_exit *exit, X86CPU *cpu, > > +    uin

Re: [RFC PATCH-for-8.0 2/3] hw/ppc/spapr: Replace tswap64(HPTE) by cpu_to_be64(HPTE)

2022-12-20 Thread David Gibson
On Mon, Dec 19, 2022 at 10:39:40AM +, Peter Maydell wrote: > On Mon, 19 Dec 2022 at 06:35, David Gibson > wrote: > > > > On Fri, Dec 16, 2022 at 09:39:19PM +, Peter Maydell wrote: > > > On Fri, 16 Dec 2022 at 19:11, Daniel Henrique Barboza > > > wrote: > > > > > > > > > > > > > > > > On

Re: [PATCH v2 5/5] target/arm: only perform TCG cpu and machine inits if TCG enabled

2022-12-20 Thread Richard Henderson
On 12/20/22 14:04, Fabiano Rosas wrote: From: Claudio Fontana of note, cpreg lists were previously initialized by TCG first, and then thrown away and replaced with the data coming from KVM. Now we just initialize once, either for TCG or for KVM. Signed-off-by: Claudio Fontana [moved arm_cpu_re

[RFC PATCH v4 35/47] hw/xen: Implement EVTCHNOP_alloc_unbound

2022-12-20 Thread David Woodhouse
From: David Woodhouse Signed-off-by: David Woodhouse --- hw/i386/kvm/xen_evtchn.c | 32 hw/i386/kvm/xen_evtchn.h | 2 ++ target/i386/kvm/xen-emu.c | 15 +++ 3 files changed, 49 insertions(+) diff --git a/hw/i386/kvm/xen_evtchn.c b/hw/i386/kvm/xen

[RFC PATCH v4 28/47] i386/xen: Add support for Xen event channel delivery to vCPU

2022-12-20 Thread David Woodhouse
From: David Woodhouse The kvm_xen_inject_vcpu_callback_vector() function will either deliver the per-vCPU local APIC vector (as an MSI), or just kick the vCPU out of the kernel to trigger KVM's automatic delivery of the global vector. In either of those cases, it returns true to indicate that the

[RFC PATCH v4 20/47] i386/xen: implement HYPERVISOR_vcpu_op

2022-12-20 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/kvm/xen-emu.c | 25 +++

[RFC PATCH v4 18/47] i386/xen: implement XENMEM_add_to_physmap_batch

2022-12-20 Thread David Woodhouse
From: David Woodhouse Signed-off-by: David Woodhouse --- target/i386/kvm/xen-compat.h | 24 + target/i386/kvm/xen-emu.c| 69 2 files changed, 93 insertions(+) diff --git a/target/i386/kvm/xen-compat.h b/target/i386/kvm/xen-compat.h index 0b7

[RFC PATCH v4 32/47] hw/xen: Implement EVTCHNOP_bind_virq

2022-12-20 Thread David Woodhouse
From: David Woodhouse Add the array of virq ports to each vCPU so that we can deliver timers, debug ports, etc. Global virqs are allocated against vCPU 0 initially, but can be migrated to other vCPUs (when we implement that). The kernel needs to know about VIRQ_TIMER in order to accelerate timer

[RFC PATCH v4 30/47] hw/xen: Implement EVTCHNOP_close

2022-12-20 Thread David Woodhouse
From: David Woodhouse It calls an internal close_port() helper which will also be used from EVTCHNOP_reset and will actually do the work to disconnect/unbind a port once any of that is actually implemented in the first place. That in turn calls a free_port() internal function which will be in er

[RFC PATCH v4 31/47] hw/xen: Implement EVTCHNOP_unmask

2022-12-20 Thread David Woodhouse
From: David Woodhouse This finally comes with a mechanism for actually injecting events into the guest vCPU, with all the atomic-test-and-set that's involved in setting the bit in the shinfo, then the index in the vcpu_info, and injecting either the lapic vector as MSI, or letting KVM inject the

[RFC PATCH v4 15/47] i386/xen: add pc_machine_kvm_type to initialize XEN_EMULATE mode

2022-12-20 Thread David Woodhouse
From: David Woodhouse The xen_overlay device (and later similar devices for event channels and grant tables) need to be instantiated. Do this from a kvm_type method on the PC machine derivatives, since KVM is only way to support Xen emulation for now. Signed-off-by: David Woodhouse --- hw/i386

[RFC PATCH v4 27/47] hw/xen: Add xen_evtchn device for event channel emulation

2022-12-20 Thread David Woodhouse
From: David Woodhouse Include basic support for setting HVM_PARAM_CALLBACK_IRQ to the global vector method HVM_PARAM_CALLBACK_TYPE_VECTOR, which is handled in-kernel by raising the vector whenever the vCPU's vcpu_info->evtchn_upcall_pending flag is set. Signed-off-by: David Woodhouse --- hw/i3

[RFC PATCH v4 03/47] xen: Add XEN_DISABLED mode and make it default

2022-12-20 Thread David Woodhouse
From: David Woodhouse Also set XEN_ATTACH mode in xen_init() to reflect the truth; not that anyone ever cared before. It was *only* ever checked in xen_init_pv() before. Suggested-by: Paolo Bonzini Signed-off-by: David Woodhouse --- accel/xen/xen-all.c | 2 ++ include/hw/xen/xen.h | 5 +++--

[RFC PATCH v4 46/47] hw/xen: Implement GNTTABOP_query_size

2022-12-20 Thread David Woodhouse
From: David Woodhouse Signed-off-by: David Woodhouse --- hw/i386/kvm/xen_gnttab.c | 19 +++ hw/i386/kvm/xen_gnttab.h | 2 ++ target/i386/kvm/xen-emu.c | 16 +++- 3 files changed, 36 insertions(+), 1 deletion(-) diff --git a/hw/i386/kvm/xen_gnttab.c b/hw/i386/kvm/

[RFC PATCH v4 24/47] i386/xen: implement HYPERVISOR_event_channel_op

2022-12-20 Thread David Woodhouse
From: Joao Martins Additionally set XEN_INTERFACE_VERSION to most recent in order to exercise the "new" event_channel_op. Signed-off-by: Joao Martins [dwmw2: Ditch event_channel_op_compat which was never available to HVM guests] Signed-off-by: David Woodhouse --- target/i386/kvm/xen-emu.c | 2

[RFC PATCH v4 39/47] i386/xen: add monitor commands to test event injection

2022-12-20 Thread David Woodhouse
From: Joao Martins Specifically add listing, injection of event channels. Signed-off-by: Joao Martins Signed-off-by: David Woodhouse --- hmp-commands.hx | 29 ++ hw/i386/kvm/xen_evtchn.c | 83 hw/i386/kvm/xen_evtchn.h | 3 ++ moni

[RFC PATCH v4 42/47] kvm/i386: Add xen-gnttab-max-frames property

2022-12-20 Thread David Woodhouse
From: David Woodhouse Signed-off-by: David Woodhouse --- accel/kvm/kvm-all.c | 1 + include/sysemu/kvm_int.h | 1 + include/sysemu/kvm_xen.h | 1 + target/i386/kvm/kvm.c | 34 ++ target/i386/kvm/xen-emu.c | 6 ++ 5 files changed, 43 insertions

[RFC PATCH v4 21/47] i386/xen: handle VCPUOP_register_vcpu_info

2022-12-20 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

Re: [PATCH 0/5] cpus: Remove system reset() API from user emulation

2022-12-20 Thread Richard Henderson
On 12/20/22 06:56, Philippe Mathieu-Daudé wrote: In user emulation, threads -- implemented as CPU -- are created/destroyed, but never reset. There is no point in allowing the user emulation access the sysemu/reset API. Philippe Mathieu-Daudé (5): target/i386: Restrict qapi/qapi-events-run-sta

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

2022-12-20 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

Re: [PATCH v2 4/5] target/arm: Move PC alignment check

2022-12-20 Thread Richard Henderson
On 12/20/22 14:04, Fabiano Rosas wrote: Move this earlier to make the next patch diff cleaner. While here update the comment slightly to not give the impression that the misalignment affects only TCG. Signed-off-by: Fabiano Rosas --- target/arm/machine.c | 18 +- 1 file change

[RFC PATCH v4 36/47] hw/xen: Implement EVTCHNOP_bind_interdomain

2022-12-20 Thread David Woodhouse
From: David Woodhouse Signed-off-by: David Woodhouse --- hw/i386/kvm/xen_evtchn.c | 78 +++ hw/i386/kvm/xen_evtchn.h | 2 + target/i386/kvm/xen-emu.c | 16 3 files changed, 96 insertions(+) diff --git a/hw/i386/kvm/xen_evtchn.c b/hw/i386/kvm/xen_

[RFC PATCH v4 26/47] i386/xen: implement HVMOP_set_param

2022-12-20 Thread David Woodhouse
From: Ankur Arora This is the hook for adding the HVM_PARAM_CALLBACK_IRQ parameter in a subsequent commit. Signed-off-by: Ankur Arora Signed-off-by: Joao Martins [dwmw2: Split out from another commit] Signed-off-by: David Woodhouse --- target/i386/kvm/xen-emu.c | 33 +

[RFC PATCH v4 06/47] i386/hvm: Set Xen vCPU ID in KVM

2022-12-20 Thread David Woodhouse
From: David Woodhouse There are (at least) three different vCPU ID number spaces. One is the internal KVM vCPU index, based purely on which vCPU was chronologically created in the kernel first. If userspace threads are all spawned and create their KVM vCPUs in essentially random order, then the K

[RFC PATCH v4 12/47] i386/xen: implement HYPERVISOR_sched_op, SCHEDOP_shutdown

2022-12-20 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. In addition, the SHUTDOWN_so

[RFC PATCH v4 41/47] hw/xen: Support HVM_PARAM_CALLBACK_TYPE_PCI_INTX callback

2022-12-20 Thread David Woodhouse
From: David Woodhouse The guest is permitted to specify an arbitrary domain/bus/device/function and INTX pin from which the callback IRQ shall appear to have come. In QEMU we can only easily do this for devices that actually exist, and even that requires us "knowing" that it's a PCMachine in ord

[RFC PATCH v4 17/47] i386/xen: implement HYPERVISOR_memory_op

2022-12-20 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, add compat support] Signed-off-by: David Woodhouse --- target/i386/kvm/trace-events | 1 +

[RFC PATCH v4 25/47] i386/xen: implement HVMOP_set_evtchn_upcall_vector

2022-12-20 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 v4 04/47] i386/kvm: Add xen-version KVM accelerator property and init KVM Xen support

2022-12-20 Thread David Woodhouse
From: David Woodhouse This just initializes the basic Xen support in KVM for now. Only permitted on TYPE_PC_MACHINE because that's where the sysbus devices for Xen heap overlay, event channel, grant tables and other stuff will exist. There's no point having the basic hypercall support if nothing

[RFC PATCH v4 01/47] Xen HVM support under KVM

2022-12-20 Thread David Woodhouse
Round 4, and it might even be almost time to drop the 'RFC'. The basic platform support is working here, soft reset (for kexec) is implemented. We have the start of grant tables, and timers are working both using the in-kernel support and the userspace version. Everything should be surviving mi

[RFC PATCH v4 16/47] i386/xen: manage and save/restore Xen guest long_mode setting

2022-12-20 Thread David Woodhouse
From: David Woodhouse Xen will "latch" the guest's 32-bit or 64-bit ("long mode") setting when the guest writes the MSR to fill in the hypercall page, or when the guest sets the event channel callback in HVM_PARAM_CALLBACK_IRQ. KVM handles the former and sets the kernel's long_mode flag accordin

[RFC PATCH v4 10/47] i386/xen: handle guest hypercalls

2022-12-20 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 v4 40/47] hw/xen: Support HVM_PARAM_CALLBACK_TYPE_GSI callback

2022-12-20 Thread David Woodhouse
From: David Woodhouse The GSI callback (and later PCI_INTX) is a level triggered interrupt. It is asserted when an event channel is delivered to vCPU0, and is supposed to be cleared when the vcpu_info->evtchn_upcall_pending field for vCPU0 is cleared again. Thankfully, Xen does *not* assert the

[RFC PATCH v4 07/47] xen-platform: exclude vfio-pci from the PCI platform unplug

2022-12-20 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 Reviewed-by: Paul Durrant --- hw/i386/xen/xen_platform.c | 18 +++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/hw/i3

[RFC PATCH v4 29/47] hw/xen: Implement EVTCHNOP_status

2022-12-20 Thread David Woodhouse
From: David Woodhouse This adds the basic structure for maintaining the port table and reporting the status of ports therein. Signed-off-by: David Woodhouse --- hw/i386/kvm/xen_evtchn.c | 106 ++ hw/i386/kvm/xen_evtchn.h | 3 ++ target/i386/kvm/xen-emu.c

[RFC PATCH v4 13/47] i386/xen: Implement SCHEDOP_poll and SCHEDOP_yield

2022-12-20 Thread David Woodhouse
From: David Woodhouse They both do the same thing and just call sched_yield. This is enough to stop the Linux guest panicking when running on a host kernel which doesn't intercept SCHEDOP_poll and lets it reach userspace. Signed-off-by: David Woodhouse --- target/i386/kvm/xen-emu.c | 12 ++

[RFC PATCH v4 37/47] hw/xen: Implement EVTCHNOP_bind_vcpu

2022-12-20 Thread David Woodhouse
From: David Woodhouse Signed-off-by: David Woodhouse --- hw/i386/kvm/xen_evtchn.c | 40 +++ hw/i386/kvm/xen_evtchn.h | 2 ++ target/i386/kvm/xen-emu.c | 12 3 files changed, 54 insertions(+) diff --git a/hw/i386/kvm/xen_evtchn.c b/hw/i386/kvm

[RFC PATCH v4 45/47] i386/xen: Implement HYPERVISOR_grant_table_op and GNTTABOP_[gs]et_verson

2022-12-20 Thread David Woodhouse
From: David Woodhouse Signed-off-by: David Woodhouse --- hw/i386/kvm/xen_gnttab.c | 31 hw/i386/kvm/xen_gnttab.h | 5 target/i386/kvm/xen-emu.c | 60 +++ 3 files changed, 96 insertions(+) diff --git a/hw/i386/kvm/xen_gnttab.c b/h

[RFC PATCH v4 38/47] hw/xen: Implement EVTCHNOP_reset

2022-12-20 Thread David Woodhouse
From: David Woodhouse Signed-off-by: David Woodhouse --- hw/i386/kvm/xen_evtchn.c | 29 + hw/i386/kvm/xen_evtchn.h | 3 +++ target/i386/kvm/xen-emu.c | 17 + 3 files changed, 49 insertions(+) diff --git a/hw/i386/kvm/xen_evtchn.c b/hw/i386/kvm/xen

[RFC PATCH v4 23/47] i386/xen: handle VCPUOP_register_runstate_memory_area

2022-12-20 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/xen-emu.c | 57 +++ target/i386/machine.c | 1 + 3

[RFC PATCH v4 22/47] i386/xen: handle VCPUOP_register_vcpu_time_info

2022-12-20 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/xen-emu.c | 100 +- target/i386/machine.c | 1 + 3 files changed, 90 insertions

[RFC PATCH v4 08/47] xen-platform: allow its creation with XEN_EMULATE mode

2022-12-20 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/meson.build| 5 - hw/i386/xen/xen_platform.c | 39 +- 2 files changed,

[RFC PATCH v4 43/47] hw/xen: Add xen_gnttab device for grant table emulation

2022-12-20 Thread David Woodhouse
From: David Woodhouse Signed-off-by: David Woodhouse --- hw/i386/kvm/meson.build | 1 + hw/i386/kvm/xen_gnttab.c | 110 ++ hw/i386/kvm/xen_gnttab.h | 18 +++ hw/i386/pc.c | 2 + target/i386/kvm/xen-emu.c | 3 ++ 5 files changed, 13

[RFC PATCH v4 47/47] i386/xen: handle PV timer hypercalls

2022-12-20 Thread David Woodhouse
From: Joao Martins Introduce support for one shot and periodic mode of Xen PV timers, whereby timer interrupts come through a special virq event channel with deadlines being set through: 1) set_timer_op hypercall (only oneshot) 2) vcpu_op hypercall for {set,stop}_{singleshot,periodic}_timer hype

[RFC PATCH v4 11/47] i386/xen: implement HYPERVISOR_xen_version

2022-12-20 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 v4 14/47] hw/xen: Add xen_overlay device for emulating shared xenheap pages

2022-12-20 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 v4 19/47] i386/xen: implement HYPERVISOR_hvm_op

2022-12-20 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/kvm/xen-emu.c | 17 + 1 file changed, 17 insertions(+) diff --git a/target/i386/kvm/xen-emu.c b/target/i386/kvm/xen-

[RFC PATCH v4 33/47] hw/xen: Implement EVTCHNOP_bind_ipi

2022-12-20 Thread David Woodhouse
From: David Woodhouse Signed-off-by: David Woodhouse --- hw/i386/kvm/xen_evtchn.c | 69 +++ hw/i386/kvm/xen_evtchn.h | 2 ++ target/i386/kvm/xen-emu.c | 15 + 3 files changed, 86 insertions(+) diff --git a/hw/i386/kvm/xen_evtchn.c b/hw/i386/kvm/xe

[RFC PATCH v4 34/47] hw/xen: Implement EVTCHNOP_send

2022-12-20 Thread David Woodhouse
From: David Woodhouse Signed-off-by: David Woodhouse --- hw/i386/kvm/xen_evtchn.c | 180 ++ hw/i386/kvm/xen_evtchn.h | 2 + target/i386/kvm/xen-emu.c | 12 +++ 3 files changed, 194 insertions(+) diff --git a/hw/i386/kvm/xen_evtchn.c b/hw/i386/kvm/xen_ev

[RFC PATCH v4 05/47] i386/kvm: handle Xen HVM cpuid leaves

2022-12-20 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 Xen unconditionally when the xen-version machine property is set. Signed-off-by: Joao Martins [dwmw2: Obtain xen_version from KVM property, make i

[RFC PATCH v4 44/47] hw/xen: Support mapping grant frames

2022-12-20 Thread David Woodhouse
From: David Woodhouse Signed-off-by: David Woodhouse --- hw/i386/kvm/xen_gnttab.c | 83 ++- hw/i386/kvm/xen_overlay.c | 2 +- hw/i386/kvm/xen_overlay.h | 2 + 3 files changed, 85 insertions(+), 2 deletions(-) diff --git a/hw/i386/kvm/xen_gnttab.c b/hw/i38

[RFC PATCH v4 09/47] hw/xen_backend: refactor xen_be_init()

2022-12-20 Thread David Woodhouse
From: Joao Martins Signed-off-by: Joao Martins Signed-off-by: David Woodhouse Reviewed-by: Paul Durrant --- 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

Re: [PATCH] accel/tcg: Drop PAGE_RESERVED for CONFIG_BSD

2022-12-20 Thread Warner Losh
On Tue, Dec 20, 2022 at 4:22 PM Richard Henderson < richard.hender...@linaro.org> wrote: > On 12/20/22 14:09, Warner Losh wrote: > > > > > > On Sat, Dec 17, 2022 at 11:48 AM Richard Henderson < > richard.hender...@linaro.org > > > wrote: > > > > Make bsd-us

Re: [PATCH] trace: Do not try to include QMP commands in user emulation binaries

2022-12-20 Thread Richard Henderson
On 12/20/22 07:04, Philippe Mathieu-Daudé wrote: QMP is not available on user emulation; there is not monitor. Besides, since commit a0e61807a3 ("qapi: Remove QMP events and commands from user-mode builds") we don't generate the qapi-commands-trace.h header in a user-emulation-only build. Remove

Re: [PATCH 3/3] hw/arm/nseries: Silent -Wmissing-field-initializers warning

2022-12-20 Thread Richard Henderson
On 12/20/22 06:25, Philippe Mathieu-Daudé wrote: Silent when compiling with -Wextra: ../hw/arm/nseries.c:1081:12: warning: missing field 'line' initializer [-Wmissing-field-initializers] { NULL } ^ Signed-off-by: Philippe Mathieu-Daudé --- hw/arm/nseries.c | 10 --

Re: [PATCH 2/3] hw/arm/nseries: Constify various read-only arrays

2022-12-20 Thread Richard Henderson
On 12/20/22 06:25, Philippe Mathieu-Daudé wrote: Signed-off-by: Philippe Mathieu-Daudé --- hw/arm/nseries.c | 18 +- 1 file changed, 9 insertions(+), 9 deletions(-) Reviewed-by: Richard Henderson r~

Re: [PATCH 1/3] hw/input/tsc2xxx: Constify set_transform()'s MouseTransformInfo arg

2022-12-20 Thread Richard Henderson
On 12/20/22 06:25, Philippe Mathieu-Daudé wrote: The pointed MouseTransformInfo structure is accessed read-only. Signed-off-by: Philippe Mathieu-Daudé --- hw/input/tsc2005.c | 2 +- hw/input/tsc210x.c | 3 +-- include/hw/input/tsc2xxx.h | 4 ++-- 3 files changed, 4 insertion

Re: [PATCH] qom/object_interfaces: Fix QAPI headers included

2022-12-20 Thread Richard Henderson
On 12/20/22 03:57, Philippe Mathieu-Daudé wrote: Since commit a0e61807a3 ("qapi: Remove QMP events and commands from user-mode builds") we don't generate the "qapi-commands-qom.h" header in a user-emulation-only build. Commit f375026606 ("qom: Factor out user_creatable_process_cmdline") incorrec

Re: [PATCH v2 4/7] hw/mips/gt64xxx_pci: Add a 'cpu-little-endian' qdev property

2022-12-20 Thread Richard Henderson
On 12/20/22 03:34, Philippe Mathieu-Daudé wrote: From: Philippe Mathieu-Daudé This device does not have to be TARGET-dependent. Add a 'cpu_big_endian' property which sets the byte-swapping options if required. Signed-off-by: Philippe Mathieu-Daudé Message-Id:<20221209151533.69516-5-phi...@linar

Re: [PATCH v2 3/7] hw/mips/gt64xxx_pci: Manage endian bits with the RegisterFields API

2022-12-20 Thread Richard Henderson
On 12/20/22 03:34, Philippe Mathieu-Daudé wrote: Signed-off-by: Philippe Mathieu-Daudé Message-Id:<20221209151533.69516-4-phi...@linaro.org> --- hw/mips/gt64xxx_pci.c | 38 +++--- 1 file changed, 23 insertions(+), 15 deletions(-) Reviewed-by: Richard Henderson

Re: [Qemu-devel] [PATCH] Remove restriction that prevents bootimg elf64 images

2022-12-20 Thread David Woodhouse
On Wed, 2017-06-21 at 13:45 -0700, Anatol Pomozov wrote: > Hi Adam, thank you for your reply. > > On Mon, Jun 19, 2017 at 2:08 PM, Adam Lackorzynski > wrote: > > Hi, > > > > On Tue Jun 13, 2017 at 17:05:41 -0700, Anatol Pomozov wrote: > > > Do these arguments sound reasonable to apply the patch?

  1   2   3   4   >