[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 02/24] i386/xen: fix per-vCPU upcall vector for Xen emulation
From: |
David Woodhouse |
Subject: |
[PATCH v2 02/24] i386/xen: fix per-vCPU upcall vector for Xen emulation |
Date: |
Thu, 19 Oct 2023 16:39:58 +0100 |
From: David Woodhouse <dwmw@amazon.co.uk>
The per-vCPU upcall vector support had two problems. Firstly it was
using the wrong hypercall argument and would always return -EFAULT.
And secondly it was using the wrong ioctl() to pass the vector to
the kernel and thus the *kernel* would always return -EINVAL.
Linux doesn't (yet) use this mode so it went without decent testing
for a while.
Fixes: 105b47fdf2d0 ("i386/xen: implement HVMOP_set_evtchn_upcall_vector")
Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
---
target/i386/kvm/xen-emu.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/target/i386/kvm/xen-emu.c b/target/i386/kvm/xen-emu.c
index 0055441b2e..619240398a 100644
--- a/target/i386/kvm/xen-emu.c
+++ b/target/i386/kvm/xen-emu.c
@@ -306,7 +306,7 @@ static int kvm_xen_set_vcpu_callback_vector(CPUState *cs)
trace_kvm_xen_set_vcpu_callback(cs->cpu_index, vector);
- return kvm_vcpu_ioctl(cs, KVM_XEN_HVM_SET_ATTR, &xva);
+ return kvm_vcpu_ioctl(cs, KVM_XEN_VCPU_SET_ATTR, &xva);
}
static void do_set_vcpu_callback_vector(CPUState *cs, run_on_cpu_data data)
@@ -849,8 +849,7 @@ static bool kvm_xen_hcall_hvm_op(struct kvm_xen_exit *exit,
X86CPU *cpu,
int ret = -ENOSYS;
switch (cmd) {
case HVMOP_set_evtchn_upcall_vector:
- ret = kvm_xen_hcall_evtchn_upcall_vector(exit, cpu,
- exit->u.hcall.params[0]);
+ ret = kvm_xen_hcall_evtchn_upcall_vector(exit, cpu, arg);
break;
case HVMOP_pagetable_dying:
--
2.40.1
- [PATCH v2 19/24] hw/i386/pc: support '-nic' for xen-net-device, (continued)
- [PATCH v2 19/24] hw/i386/pc: support '-nic' for xen-net-device, David Woodhouse, 2023/10/19
- [PATCH v2 11/24] hw/xen: automatically assign device index to block devices, David Woodhouse, 2023/10/19
- [PATCH v2 15/24] hw/xen: add support for Xen primary console in emulated mode, David Woodhouse, 2023/10/19
- [PATCH v2 03/24] hw/xen: select kernel mode for per-vCPU event channel upcall vector, David Woodhouse, 2023/10/19
- [PATCH v2 12/24] hw/xen: add get_frontend_path() method to XenDeviceClass, David Woodhouse, 2023/10/19
- [PATCH v2 07/24] hw/xen: Clean up event channel 'type_val' handling to use union, David Woodhouse, 2023/10/19
- [PATCH v2 04/24] hw/xen: don't clear map_track[] in xen_gnttab_reset(), David Woodhouse, 2023/10/19
- [PATCH v2 08/24] include: update Xen public headers to Xen 4.17.2 release, David Woodhouse, 2023/10/19
- [PATCH v2 13/24] hw/xen: do not repeatedly try to create a failing backend device, David Woodhouse, 2023/10/19
- [PATCH v2 09/24] i386/xen: advertise XEN_HVM_CPUID_UPCALL_VECTOR in CPUID, David Woodhouse, 2023/10/19
- [PATCH v2 02/24] i386/xen: fix per-vCPU upcall vector for Xen emulation,
David Woodhouse <=
- [PATCH v2 24/24] docs: update Xen-on-KVM documentation, David Woodhouse, 2023/10/19
- [PATCH v2 18/24] hw/xen: update Xen PV NIC to XenDevice model, David Woodhouse, 2023/10/19
- [PATCH v2 22/24] tests/avocado: switch to using xen-net-device for Xen guest tests, David Woodhouse, 2023/10/19
- [PATCH v2 17/24] hw/xen: only remove peers of PCI NICs on unplug, David Woodhouse, 2023/10/19
- [PATCH v2 06/24] i386/xen: Ignore VCPU_SSHOTTMR_future flag in set_singleshot_timer(), David Woodhouse, 2023/10/19
- [PATCH v2 14/24] hw/xen: update Xen console to XenDevice model, David Woodhouse, 2023/10/19
- [PATCH v2 23/24] xen-platform: unplug AHCI disks, David Woodhouse, 2023/10/19