Re: [RFC v3 14/18] backends/iommufd: Introduce the iommufd object

2023-02-15 Thread Eric Auger
Hi Nicolin, On 2/16/23 00:48, Nicolin Chen wrote: > Hi Eric, > > On Tue, Jan 31, 2023 at 09:53:01PM +0100, Eric Auger wrote: > >> diff --git a/include/sysemu/iommufd.h b/include/sysemu/iommufd.h >> new file mode 100644 >> index 00..06a866d1bd >> --- /dev/null >> +++

Re: [PATCH 07/12] testing: update ubuntu2004 to ubuntu2204

2023-02-15 Thread Thomas Huth
On 15/02/2023 20.25, Alex Bennée wrote: The 22.04 LTS release has been out for almost a year now so its time to update all the remaining images to the current LTS. We can also drop some hacks we need for older clang TSAN support. Signed-off-by: Alex Bennée --- docs/devel/testing.rst

Re: [PATCH v2 05/15] linux-user/sparc: Tidy window spill/fill traps

2023-02-15 Thread Philippe Mathieu-Daudé
On 16/2/23 06:45, Richard Henderson wrote: Add some macros to localize the hw difference between v9 and pre-v9. Signed-off-by: Richard Henderson --- linux-user/sparc/cpu_loop.c | 23 +-- 1 file changed, 13 insertions(+), 10 deletions(-) Reviewed-by: Philippe

Re: [PATCH v2 04/15] linux-user/sparc: Use TT_TRAP for flush windows

2023-02-15 Thread Philippe Mathieu-Daudé
On 16/2/23 06:45, Richard Henderson wrote: The v9 and pre-v9 code can be unified with this macro. Signed-off-by: Richard Henderson --- linux-user/sparc/cpu_loop.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) Reviewed-by: Philippe Mathieu-Daudé

Re: [PATCH v2 02/15] linux-user/sparc: Tidy syscall trap

2023-02-15 Thread Philippe Mathieu-Daudé
On 16/2/23 06:45, Richard Henderson wrote: Use TT_TRAP. For sparc32, 0x88 is the "Slowaris" system call, currently BAD_TRAP in the kernel's ttable_32.S. For sparc64, 0x110 is tl0_linux32, the sparc32 trap, now folded into the TARGET_ABI32 case via TT_TRAP. For sparc64, there does still exist

Re: [PATCH 0/4] target/arm: Cache ARMVAParameters

2023-02-15 Thread Philippe Mathieu-Daudé
Hi Richard, On 2/2/23 08:52, Richard Henderson wrote: Richard Henderson (4): target/arm: Flush only required tlbs for TCR_EL[12] target/arm: Store tbi for both insns and data in ARMVAParameters target/arm: Use FIELD for ARMVAParameters target/arm: Cache ARMVAParameters Applying:

Re: [PATCH 06/12] gitlab: extend custom runners with base_job_template

2023-02-15 Thread Thomas Huth
On 15/02/2023 20.25, Alex Bennée wrote: The base job template is responsible for controlling how we kick off testing on our various branches. Rename and extend the custom_runner_template so we can take advantage of all that control. Signed-off-by: Alex Bennée ---

Re: [PATCH 05/12] gitlab: reduce default verbosity of cirrus run

2023-02-15 Thread Thomas Huth
On 15/02/2023 20.25, Alex Bennée wrote: We also truncate the echoing of the test log if we fail. Ideally we would want the build aretefact to be available to gitlab but so far how to do this eludes me. Signed-off-by: Alex Bennée Cc: Daniel P. Berrangé --- .gitlab-ci.d/cirrus/build.yml | 4

Re: [PATCH v2 01/13] vdpa net: move iova tree creation from init to start

2023-02-15 Thread Eugenio Perez Martin
On Thu, Feb 16, 2023 at 3:15 AM Si-Wei Liu wrote: > > > > On 2/14/2023 11:07 AM, Eugenio Perez Martin wrote: > > On Tue, Feb 14, 2023 at 2:45 AM Si-Wei Liu wrote: > >> > >> > >> On 2/13/2023 3:14 AM, Eugenio Perez Martin wrote: > >>> On Mon, Feb 13, 2023 at 7:51 AM Si-Wei Liu wrote: > >

Re: [PATCH 2/4] target/arm: Store tbi for both insns and data in ARMVAParameters

2023-02-15 Thread Philippe Mathieu-Daudé
On 2/2/23 08:52, Richard Henderson wrote: This is slightly more work on the consumer side, but means we will be able to compute this once for multiple uses. Signed-off-by: Richard Henderson --- target/arm/internals.h| 5 +++-- target/arm/helper.c | 18 +-

Re: [PATCH 04/12] tests: be a bit more strict cleaning up fifos

2023-02-15 Thread Thomas Huth
On 15/02/2023 20.25, Alex Bennée wrote: When we re-factored we dropped the unlink() step which turns out to be required for rmdir to do its thing. If we had been checking the return value we would have noticed so lets do that with this fix. Fixes: 68406d1085 (tests/unit: cleanups for

Re: [PATCH 01/12] gitlab: tweak and filter ninja output to reduce build noise

2023-02-15 Thread Thomas Huth
On 15/02/2023 20.25, Alex Bennée wrote: A significant portion of our CI logs are just enumerating each successfully built object file. The current widespread versions of ninja don't have a quiet option so we use NINJA_STATUS to add a fixed string to the ninja output which we then filter with

Re: [PATCH] target/i386: Fix 32-bit AD[CO]X insns in 64-bit mode

2023-02-15 Thread Philippe Mathieu-Daudé
On 15/1/23 02:21, Richard Henderson wrote: Failure to truncate the inputs results in garbage for the carry-out. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1373 Signed-off-by: Richard Henderson --- tests/tcg/x86_64/adox.c | 69

Re: [PATCH 02/27] accel/tcg: Pass max_insn to gen_intermediate_code by pointer

2023-02-15 Thread Philippe Mathieu-Daudé
On 30/1/23 21:59, Richard Henderson wrote: In preparation for returning the number of insns generated via the same pointer. Adjust only the prototypes so far. Signed-off-by: Richard Henderson --- include/exec/translator.h | 4 ++-- accel/tcg/translate-all.c | 2 +-

Re: [PATCH 12/27] accel/tcg/plugin: Use tcg_temp_ebb_*

2023-02-15 Thread Philippe Mathieu-Daudé
On 30/1/23 21:59, Richard Henderson wrote: All of these uses have quite local scope. Avoid tcg_const_*, because we haven't added a corresponding interface for TEMP_EBB. Use explicit tcg_gen_movi_* instead. Signed-off-by: Richard Henderson --- accel/tcg/plugin-gen.c | 24

Re: [PATCH 10/27] tcg: Add tcg_gen_movi_ptr

2023-02-15 Thread Philippe Mathieu-Daudé
On 30/1/23 21:59, Richard Henderson wrote: Signed-off-by: Richard Henderson --- include/tcg/tcg-op.h | 5 + 1 file changed, 5 insertions(+) Reviewed-by: Philippe Mathieu-Daudé

Re: [PATCH 21/27] target/i386: Don't use tcg_temp_local_new

2023-02-15 Thread Philippe Mathieu-Daudé
On 30/1/23 21:59, Richard Henderson wrote: Since tcg_temp_new is now identical, use that. In some cases we can avoid a copy from A0 or T0. Signed-off-by: Richard Henderson --- target/i386/tcg/translate.c | 27 +-- 1 file changed, 9 insertions(+), 18 deletions(-)

Re: [PATCH] target/microblaze: Add gdbstub xml

2023-02-15 Thread Edgar E. Iglesias
On Thu, Feb 16, 2023 at 12:56 AM Richard Henderson < richard.hender...@linaro.org> wrote: > Alex, Edgar, this has been reviewed. Will either of you take it with your > trees, or shall > I just queue it through tcg-next? > > Hi Richard, yeah if you don't mind, please take it through your tree!

Re: [PATCH] target/microblaze: Add gdbstub xml

2023-02-15 Thread Richard Henderson
Alex, Edgar, this has been reviewed. Will either of you take it with your trees, or shall I just queue it through tcg-next? r~ On 12/30/22 06:24, Richard Henderson wrote: Mirroring the upstream gdb xml files, the two stack boundary registers are separated out. Signed-off-by: Richard

Re: [PATCH 0/4] target/arm: Cache ARMVAParameters

2023-02-15 Thread Richard Henderson
Ping. r~ On 2/1/23 21:52, Richard Henderson wrote: Hi Anders, I'm not well versed on tuxrun, and how to make that work with a qemu binary outside of the container, so I'm not sure if I'm comparing apples to bananas. Can you look and see if this fixes the kselftest slowdown you reported?

Re: [PATCH 0/1] accel/tcg: Allow the second page of an instruction to be MMIO

2023-02-15 Thread Richard Henderson
On 2/6/23 09:38, Richard Henderson wrote: Curious but true: two independent reports of the same issue within 24 hours, one with an x86 guest and one with an arm guest. Neither report included instructions for reproduction (and both seem to be with complex setup), therefore this is untested, but

Re: [PATCH] target/i386: Fix 32-bit AD[CO]X insns in 64-bit mode

2023-02-15 Thread Richard Henderson
Ping. Paolo, I see you've queued a fix for a different ADCOX bug in your latest pull. You could probably adjust your new test for this case, but this problem is exclusively x86_64. r~ On 1/14/23 15:21, Richard Henderson wrote: Failure to truncate the inputs results in garbage for the

Re: [PATCH] target/i386: Fix BZHI instruction

2023-02-15 Thread Richard Henderson
Ping. r~ On 1/14/23 13:32, Richard Henderson wrote: We did not correctly handle N >= operand size. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1374 Signed-off-by: Richard Henderson --- tests/tcg/i386/test-i386-bmi2.c | 3 +++ target/i386/tcg/emit.c.inc | 14

[PATCH v11 31/59] hw/xen: Implement EVTCHNOP_unmask

2023-02-15 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

[PATCH v11 54/59] i386/xen: Implement HYPERVISOR_physdev_op

2023-02-15 Thread David Woodhouse
From: David Woodhouse Just hook up the basic hypercalls to stubs in xen_evtchn.c for now. Signed-off-by: David Woodhouse Reviewed-by: Paul Durrant --- hw/i386/kvm/xen_evtchn.c | 25 hw/i386/kvm/xen_evtchn.h | 11 target/i386/kvm/xen-compat.h | 19 ++

[PATCH v11 07/59] xen-platform: exclude vfio-pci from the PCI platform unplug

2023-02-15 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

[PATCH v11 38/59] hw/xen: Implement EVTCHNOP_reset

2023-02-15 Thread David Woodhouse
From: David Woodhouse Signed-off-by: David Woodhouse Reviewed-by: Paul Durrant --- hw/i386/kvm/xen_evtchn.c | 30 ++ hw/i386/kvm/xen_evtchn.h | 3 +++ target/i386/kvm/xen-emu.c | 17 + 3 files changed, 50 insertions(+) diff --git

[PATCH v11 08/59] xen-platform: allow its creation with XEN_EMULATE mode

2023-02-15 Thread David Woodhouse
From: Joao Martins The only thing we need to fix to make this build is the PIO hack which sets the BIOS memory areas to R/W v.s. R/O. Theoretically we could hook that up to the PAM registers on the emulated PIIX, but in practice nobody cares, so just leave it doing nothing. Now it builds

[PATCH v11 09/59] i386/xen: handle guest hypercalls

2023-02-15 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:

[PATCH v11 12/59] i386/xen: Implement SCHEDOP_poll and SCHEDOP_yield

2023-02-15 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 Reviewed-by: Paul Durrant ---

[PATCH v11 02/59] xen: add CONFIG_XEN_BUS and CONFIG_XEN_EMU options for Xen emulation

2023-02-15 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 (if anyone wants to run the gauntlet of struct layout compatibility, errno

[PATCH v11 23/59] i386/xen: handle VCPUOP_register_runstate_memory_area

2023-02-15 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 Reviewed-by: Paul Durrant --- target/i386/cpu.h | 1 + target/i386/kvm/xen-emu.c | 57 +++

[PATCH v11 29/59] hw/xen: Implement EVTCHNOP_status

2023-02-15 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 Reviewed-by: Paul Durrant --- hw/i386/kvm/xen_evtchn.c | 104 ++ hw/i386/kvm/xen_evtchn.h | 3

[PATCH v11 40/59] hw/xen: Support HVM_PARAM_CALLBACK_TYPE_GSI callback

2023-02-15 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

[PATCH v11 33/59] hw/xen: Implement EVTCHNOP_bind_ipi

2023-02-15 Thread David Woodhouse
From: David Woodhouse Signed-off-by: David Woodhouse Reviewed-by: Paul Durrant --- 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

[PATCH v11 06/59] i386/hvm: Set Xen vCPU ID in KVM

2023-02-15 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

[PATCH v11 51/59] hw/xen: Add xen_xenstore device for xenstore emulation

2023-02-15 Thread David Woodhouse
From: David Woodhouse Just the basic shell, with the event channel hookup. It only dumps the buffer for now; a real ring implmentation will come in a subsequent patch. Signed-off-by: David Woodhouse Reviewed-by: Paul Durrant --- hw/i386/kvm/meson.build| 1 + hw/i386/kvm/xen_evtchn.c

[PATCH v11 39/59] i386/xen: add monitor commands to test event injection

2023-02-15 Thread David Woodhouse
From: Joao Martins Specifically add listing, injection of event channels. Signed-off-by: Joao Martins Signed-off-by: David Woodhouse Acked-by: Dr. David Alan Gilbert Reviewed-by: Paul Durrant --- hmp-commands.hx | 29 + hw/i386/kvm/xen_evtchn.c | 137

[PATCH v11 44/59] hw/xen: Support mapping grant frames

2023-02-15 Thread David Woodhouse
From: David Woodhouse Signed-off-by: David Woodhouse --- hw/i386/kvm/xen_gnttab.c | 73 ++- hw/i386/kvm/xen_overlay.c | 2 +- hw/i386/kvm/xen_overlay.h | 2 ++ 3 files changed, 75 insertions(+), 2 deletions(-) diff --git a/hw/i386/kvm/xen_gnttab.c

[PATCH v11 26/59] i386/xen: implement HVMOP_set_param

2023-02-15 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 Reviewed-by: Paul Durrant --- target/i386/kvm/xen-emu.c |

[PATCH v11 58/59] kvm/i386: Add xen-evtchn-max-pirq property

2023-02-15 Thread David Woodhouse
From: David Woodhouse The default number of PIRQs is set to 256 to avoid issues with 32-bit MSI devices. Allow it to be increased if the user desires. Signed-off-by: David Woodhouse Reviewed-by: Paul Durrant --- accel/kvm/kvm-all.c | 1 + hw/i386/kvm/xen_evtchn.c | 21

[PATCH v11 45/59] i386/xen: Implement HYPERVISOR_grant_table_op and GNTTABOP_[gs]et_verson

2023-02-15 Thread David Woodhouse
From: David Woodhouse Signed-off-by: David Woodhouse Reviewed-by: Paul Durrant --- 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

[PATCH v11 35/59] hw/xen: Implement EVTCHNOP_alloc_unbound

2023-02-15 Thread David Woodhouse
From: David Woodhouse Signed-off-by: David Woodhouse Reviewed-by: Paul Durrant --- 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

[PATCH v11 21/59] i386/xen: handle VCPUOP_register_vcpu_info

2023-02-15 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

[PATCH v11 43/59] hw/xen: Add xen_gnttab device for grant table emulation

2023-02-15 Thread David Woodhouse
From: David Woodhouse Signed-off-by: David Woodhouse Reviewed-by: Paul Durrant --- hw/i386/kvm/meson.build | 1 + hw/i386/kvm/xen_gnttab.c | 111 ++ hw/i386/kvm/xen_gnttab.h | 18 +++ hw/i386/pc.c | 2 + target/i386/kvm/xen-emu.c |

[PATCH v11 15/59] i386/xen: add pc_machine_kvm_type to initialize XEN_EMULATE mode

2023-02-15 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

[PATCH v11 30/59] hw/xen: Implement EVTCHNOP_close

2023-02-15 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

[PATCH v11 00/59] Xen HVM support under KVM

2023-02-15 Thread David Woodhouse
Updated to base it on the incoming Arm Xen PVH support which at least yesterday was in the staging branch, and a couple of tweaks from Paul's review feedback. Most of the changes we've actually been making are in the XenStore part which we're keeping out of this patch set as it's large enough

[PATCH v11 57/59] hw/xen: Support MSI mapping to PIRQ

2023-02-15 Thread David Woodhouse
From: David Woodhouse The way that Xen handles MSI PIRQs is kind of awful. There is a special MSI message which targets a PIRQ. The vector in the low bits of data must be zero. The low 8 bits of the PIRQ# are in the destination ID field, the extended destination ID field is unused, and instead

[PATCH v11 55/59] hw/xen: Implement emulated PIRQ hypercall support

2023-02-15 Thread David Woodhouse
From: David Woodhouse This wires up the basic infrastructure but the actual interrupts aren't there yet, so don't advertise it to the guest. Signed-off-by: David Woodhouse Reviewed-by: Paul Durrant --- hw/i386/kvm/trace-events | 4 + hw/i386/kvm/trace.h | 1 +

[PATCH v11 52/59] hw/xen: Add basic ring handling to xenstore

2023-02-15 Thread David Woodhouse
From: David Woodhouse Extract requests, return ENOSYS to all of them. This is enough to allow older Linux guests to boot, as they need *something* back but it doesn't matter much what. A full implementation of a single-tentant internal XenStore copy-on-write tree with transactions and watches

[PATCH v11 36/59] hw/xen: Implement EVTCHNOP_bind_interdomain

2023-02-15 Thread David Woodhouse
From: David Woodhouse Signed-off-by: David Woodhouse Reviewed-by: Paul Durrant --- 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

[PATCH v11 47/59] i386/xen: handle PV timer hypercalls

2023-02-15 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

[PATCH v11 42/59] kvm/i386: Add xen-gnttab-max-frames property

2023-02-15 Thread David Woodhouse
From: David Woodhouse Signed-off-by: David Woodhouse Reviewed-by: Paul Durrant --- 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

[PATCH v11 48/59] i386/xen: Reserve Xen special pages for console, xenstore rings

2023-02-15 Thread David Woodhouse
From: David Woodhouse Xen has eight frames at 0xfeff8000 for this; we only really need two for now and KVM puts the identity map at 0xfeffc000, so limit ourselves to four. Signed-off-by: David Woodhouse Reviewed-by: Paul Durrant --- include/sysemu/kvm_xen.h | 8

[PATCH v11 17/59] i386/xen: implement HYPERVISOR_memory_op

2023-02-15 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 Reviewed-by: Paul Durrant ---

[PATCH v11 37/59] hw/xen: Implement EVTCHNOP_bind_vcpu

2023-02-15 Thread David Woodhouse
From: David Woodhouse Signed-off-by: David Woodhouse Reviewed-by: Paul Durrant --- 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

[PATCH v11 34/59] hw/xen: Implement EVTCHNOP_send

2023-02-15 Thread David Woodhouse
From: David Woodhouse Signed-off-by: David Woodhouse Reviewed-by: Paul Durrant --- 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

[PATCH v11 16/59] i386/xen: manage and save/restore Xen guest long_mode setting

2023-02-15 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

[PATCH v11 20/59] i386/xen: implement HYPERVISOR_vcpu_op

2023-02-15 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 Reviewed-by: Paul Durrant --- target/i386/kvm/xen-emu.c

[PATCH v11 27/59] hw/xen: Add xen_evtchn device for event channel emulation

2023-02-15 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

[PATCH v11 03/59] xen: Add XEN_DISABLED mode and make it default

2023-02-15 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 Reviewed-by: Paul Durrant --- accel/xen/xen-all.c | 2 ++

[PATCH v11 25/59] i386/xen: implement HVMOP_set_evtchn_upcall_vector

2023-02-15 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

[PATCH v11 13/59] hw/xen: Add xen_overlay device for emulating shared xenheap pages

2023-02-15 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.

[PATCH v11 14/59] xen: Permit --xen-domid argument when accel is KVM

2023-02-15 Thread David Woodhouse
From: Paul Durrant Signed-off-by: Paul Durrant Signed-off-by: David Wooodhouse --- softmmu/vl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/softmmu/vl.c b/softmmu/vl.c index b2ee3fee3f..2b071159c5 100644 --- a/softmmu/vl.c +++ b/softmmu/vl.c @@ -3359,7 +3359,7 @@ void

[PATCH v11 49/59] i386/xen: handle HVMOP_get_param

2023-02-15 Thread David Woodhouse
From: Joao Martins Which is used to fetch xenstore PFN and port to be used by the guest. This is preallocated by the toolstack when guest will just read those and use it straight away. Signed-off-by: Joao Martins Signed-off-by: David Woodhouse Reviewed-by: Paul Durrant ---

[PATCH v11 18/59] i386/xen: implement XENMEM_add_to_physmap_batch

2023-02-15 Thread David Woodhouse
From: David Woodhouse Signed-off-by: David Woodhouse Reviewed-by: Paul Durrant --- 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

[PATCH v11 04/59] i386/kvm: Add xen-version KVM accelerator property and init KVM Xen support

2023-02-15 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

[PATCH v11 28/59] i386/xen: Add support for Xen event channel delivery to vCPU

2023-02-15 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. Support for asserting the GSI/PCI_INTX callbacks will come

[PATCH v11 32/59] hw/xen: Implement EVTCHNOP_bind_virq

2023-02-15 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

[PATCH v11 05/59] i386/kvm: handle Xen HVM cpuid leaves

2023-02-15 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

[PATCH v11 59/59] i386/xen: Document Xen HVM emulation

2023-02-15 Thread David Woodhouse
From: David Woodhouse Signed-off-by: David Woodhouse Reviewed-by: Paul Durrant --- docs/system/i386/xen.rst| 76 + docs/system/target-i386.rst | 1 + 2 files changed, 77 insertions(+) create mode 100644 docs/system/i386/xen.rst diff --git

[PATCH v11 56/59] hw/xen: Support GSI mapping to PIRQ

2023-02-15 Thread David Woodhouse
From: David Woodhouse If I advertise XENFEAT_hvm_pirqs then a guest now boots successfully as long as I tell it 'pci=nomsi'. [root@localhost ~]# cat /proc/interrupts CPU0 0: 52 IO-APIC 2-edge timer 1: 16 xen-pirq 1-ioapic-edge i8042 4: 1534

[PATCH v11 53/59] hw/xen: Automatically add xen-platform PCI device for emulated Xen guests

2023-02-15 Thread David Woodhouse
From: David Woodhouse It isn't strictly mandatory but Linux guests at least will only map their grant tables over the dummy BAR that it provides, and don't have sufficient wit to map them in any other unused part of their guest address space. So include it by default for minimal surprise factor.

[PATCH v11 24/59] i386/xen: implement HYPERVISOR_event_channel_op

2023-02-15 Thread David Woodhouse
From: Joao Martins Signed-off-by: Joao Martins [dwmw2: Ditch event_channel_op_compat which was never available to HVM guests] Signed-off-by: David Woodhouse Reviewed-by: Paul Durrant --- target/i386/kvm/xen-emu.c | 25 + 1 file changed, 25 insertions(+) diff --git

[PATCH v11 50/59] hw/xen: Add backend implementation of interdomain event channel support

2023-02-15 Thread David Woodhouse
From: David Woodhouse The provides the QEMU side of interdomain event channels, allowing events to be sent to/from the guest. The API mirrors libxenevtchn, and in time both this and the real Xen one will be available through ops structures so that the PV backend drivers can use the correct one

[PATCH v11 10/59] i386/xen: implement HYPERVISOR_xen_version

2023-02-15 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]

[PATCH v11 19/59] i386/xen: implement HYPERVISOR_hvm_op

2023-02-15 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 Reviewed-by: Paul Durrant --- target/i386/kvm/xen-emu.c | 17 + 1 file changed, 17 insertions(+) diff --git

[PATCH v11 22/59] i386/xen: handle VCPUOP_register_vcpu_time_info

2023-02-15 Thread David Woodhouse
From: Joao Martins In order to support Linux vdso in Xen. Signed-off-by: Joao Martins Signed-off-by: David Woodhouse Reviewed-by: Paul Durrant --- target/i386/cpu.h | 1 + target/i386/kvm/xen-emu.c | 100 +- target/i386/machine.c | 1 + 3

[PATCH v11 41/59] hw/xen: Support HVM_PARAM_CALLBACK_TYPE_PCI_INTX callback

2023-02-15 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

[PATCH v11 11/59] i386/xen: implement HYPERVISOR_sched_op, SCHEDOP_shutdown

2023-02-15 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

[PATCH v11 46/59] hw/xen: Implement GNTTABOP_query_size

2023-02-15 Thread David Woodhouse
From: David Woodhouse Signed-off-by: David Woodhouse Reviewed-by: Paul Durrant --- 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

Re: [PATCH 00/27] tcg: Simplify temporary usage

2023-02-15 Thread Richard Henderson
On 2/10/23 02:35, Emilio Cota wrote: I ran yesterday linux-user SPEC06 benchmarks from your tcg-life branch. I do see perf regressions for two workloads (sjeng and xalancbmk). With perf(1) I see liveness_pass* are at 0.00%, so I wonder: is it possible that the emitted code isn't quite the same?

Re: [PATCH 00/27] tcg: Simplify temporary usage

2023-02-15 Thread Richard Henderson
Ping for the 9 patches lacking review. r~ On 1/30/23 10:59, Richard Henderson wrote: Based-on: 20230126043824.54819-1-richard.hender...@linaro.org ("[PATCH v5 00/36] tcg: Support for Int128 with helpers") The biggest pitfall for new users of TCG is the fact that "normal" temporaries die at

Re: [PATCH v4 0/4] Fix deadlock when dying because of a signal

2023-02-15 Thread Richard Henderson
On 2/14/23 04:08, Ilya Leoshkevich wrote: Based-on:<20230202005204.2055899-1-richard.hender...@linaro.org> ("[PATCH 00/14] linux-user/sparc: Handle missing traps") v3:https://lists.gnu.org/archive/html/qemu-devel/2023-02/msg03534.html v3 -> v4: Add printfs to the test in order to make the

Re: [PATCH v2 01/15] linux-user/sparc: Raise SIGILL for all unhandled software traps

2023-02-15 Thread Richard Henderson
On 2/15/23 19:45, Richard Henderson wrote: The linux kernel's trap tables vector all unassigned trap numbers to BAD_TRAP, which then raises SIGILL. Tested-by: Ilya Leoshkevich Reported-by: Ilya Leoshkevich Signed-off-by: Richard Henderson --- linux-user/sparc/cpu_loop.c | 8 1

Re: [PATCH v1 RFC Zisslpcfi 7/9] target/riscv: Tracking indirect branches (fcfi) using TCG

2023-02-15 Thread Richard Henderson
On 2/8/23 20:24, Deepak Gupta wrote: +if (cpu->cfg.ext_cfi) { +/* + * For Forward CFI, only the expectation of a lpcll at + * the start of the block is tracked (which can only happen + * when FCFI is enabled for the current processor mode). A jump + *

RE: [PATCH] Adding ability to change disassembler syntax in TCG plugins

2023-02-15 Thread Mikhail Tyutin
> On 2/15/23 19:04, Mikhail Tyutin wrote: > >> On 2/15/23 18:17, Mikhail Tyutin wrote: > >>> ping > >>> > >>> patchew link: > >>> https://patchew.org/QEMU/7d17f0cbb5ed4c90bbadd39924290...@yadro.com/ > >>> > >>> 10.02.2023 18:24, Mikhail Tyutin wrote: > This patch adds new function

[PATCH v2 09/15] linux-user/sparc: Handle getcc, setcc, getpsr traps

2023-02-15 Thread Richard Henderson
These are really only meaningful for sparc32, but they're still present for backward compatibility for sparc64. Signed-off-by: Richard Henderson --- linux-user/sparc/cpu_loop.c | 62 +++-- 1 file changed, 59 insertions(+), 3 deletions(-) diff --git

[PATCH v2 15/15] linux-user/sparc: Handle tag overflow traps

2023-02-15 Thread Richard Henderson
This trap is raised by taddcctv and tsubcctv insns. Signed-off-by: Richard Henderson --- linux-user/sparc/target_signal.h | 2 +- linux-user/syscall_defs.h| 5 + linux-user/sparc/cpu_loop.c | 3 +++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git

[PATCH v2 14/15] linux-user/sparc: Handle floating-point exceptions

2023-02-15 Thread Richard Henderson
Raise SIGFPE for ieee exceptions. The other types, such as FSR_FTT_UNIMPFPOP, should not appear, because we enable normal emulation of missing insns at the start of sparc_cpu_realizefn(). Signed-off-by: Richard Henderson --- target/sparc/cpu.h | 3 +-- linux-user/sparc/cpu_loop.c |

[PATCH v2 04/15] linux-user/sparc: Use TT_TRAP for flush windows

2023-02-15 Thread Richard Henderson
The v9 and pre-v9 code can be unified with this macro. Signed-off-by: Richard Henderson --- linux-user/sparc/cpu_loop.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/linux-user/sparc/cpu_loop.c b/linux-user/sparc/cpu_loop.c index 051a292ce5..e1d08ff204 100644 ---

Re: [PATCH 1/2] configure: Add 'mkdir build' check

2023-02-15 Thread Dinah B
*ping* Patch series: https://lore.kernel.org/qemu-devel/20230208233111.398577-1-dinahbaum...@gmail.com/ -Dinah On Wed, Feb 8, 2023 at 6:31 PM Dinah Baum wrote: > QEMU configure script goes into an infinite error printing loop > when in read only directory due to 'build' dir never being

[PATCH v2 05/15] linux-user/sparc: Tidy window spill/fill traps

2023-02-15 Thread Richard Henderson
Add some macros to localize the hw difference between v9 and pre-v9. Signed-off-by: Richard Henderson --- linux-user/sparc/cpu_loop.c | 23 +-- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/linux-user/sparc/cpu_loop.c b/linux-user/sparc/cpu_loop.c index

[PATCH v2 13/15] linux-user/sparc: Handle unimplemented flush trap

2023-02-15 Thread Richard Henderson
For sparc64, TT_UNIMP_FLUSH == TT_ILL_INSN, so this is already handled. For sparc32, the kernel uses SKIP_TRAP. Signed-off-by: Richard Henderson --- linux-user/sparc/cpu_loop.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/linux-user/sparc/cpu_loop.c b/linux-user/sparc/cpu_loop.c

[PATCH v2 07/15] linux-user/sparc: Handle software breakpoint trap

2023-02-15 Thread Richard Henderson
This is 'ta 1' for both v9 and pre-v9. Signed-off-by: Richard Henderson --- linux-user/sparc/cpu_loop.c | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/linux-user/sparc/cpu_loop.c b/linux-user/sparc/cpu_loop.c index edbc4f3bdc..c14eaea163 100644 ---

[PATCH v2 12/15] linux-user/sparc: Handle coprocessor disabled trap

2023-02-15 Thread Richard Henderson
Since qemu does not implement a sparc coprocessor, all such instructions raise this trap. Because of that, we never raise the coprocessor exception trap, which would be vector 0x28. Signed-off-by: Richard Henderson --- linux-user/sparc/cpu_loop.c | 4 1 file changed, 4 insertions(+) diff

[PATCH v2 03/15] linux-user/sparc: Tidy syscall error return

2023-02-15 Thread Richard Henderson
Reduce ifdefs with #define syscall_cc. Signed-off-by: Richard Henderson --- linux-user/sparc/cpu_loop.c | 15 +-- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/linux-user/sparc/cpu_loop.c b/linux-user/sparc/cpu_loop.c index d31ea057db..051a292ce5 100644 ---

[PATCH v2 06/15] linux-user/sparc: Fix sparc64_{get, set}_context traps

2023-02-15 Thread Richard Henderson
These traps are present for sparc64 with ilp32, aka sparc32plus. Enabling them means adjusting the defines over in signal.c, and fixing an incorrect usage of abi_ulong when we really meant the full register, target_ulong. Signed-off-by: Richard Henderson --- linux-user/sparc/cpu_loop.c | 23

[PATCH v2 08/15] linux-user/sparc: Handle division by zero traps

2023-02-15 Thread Richard Henderson
In addition to the hw trap vector, there is a software trap assigned for older sparc without hw division instructions. Signed-off-by: Richard Henderson --- linux-user/sparc/cpu_loop.c | 5 + 1 file changed, 5 insertions(+) diff --git a/linux-user/sparc/cpu_loop.c

  1   2   3   4   5   6   >