[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 26/62] i386/xen: implement HVMOP_set_param
From: |
Paolo Bonzini |
Subject: |
[PULL 26/62] i386/xen: implement HVMOP_set_param |
Date: |
Thu, 2 Mar 2023 13:29:53 +0100 |
From: Ankur Arora <ankur.a.arora@oracle.com>
This is the hook for adding the HVM_PARAM_CALLBACK_IRQ parameter in a
subsequent commit.
Signed-off-by: Ankur Arora <ankur.a.arora@oracle.com>
Signed-off-by: Joao Martins <joao.m.martins@oracle.com>
[dwmw2: Split out from another commit]
Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
Reviewed-by: Paul Durrant <paul@xen.org>
---
target/i386/kvm/xen-emu.c | 33 +++++++++++++++++++++++++++++++++
1 file changed, 33 insertions(+)
diff --git a/target/i386/kvm/xen-emu.c b/target/i386/kvm/xen-emu.c
index e9a4422d93f0..ce858ac63ce1 100644
--- a/target/i386/kvm/xen-emu.c
+++ b/target/i386/kvm/xen-emu.c
@@ -489,6 +489,36 @@ static bool kvm_xen_hcall_memory_op(struct kvm_xen_exit
*exit, X86CPU *cpu,
return true;
}
+static bool handle_set_param(struct kvm_xen_exit *exit, X86CPU *cpu,
+ uint64_t arg)
+{
+ CPUState *cs = CPU(cpu);
+ struct xen_hvm_param hp;
+ int err = 0;
+
+ /* No need for 32/64 compat handling */
+ qemu_build_assert(sizeof(hp) == 16);
+
+ if (kvm_copy_from_gva(cs, arg, &hp, sizeof(hp))) {
+ err = -EFAULT;
+ goto out;
+ }
+
+ if (hp.domid != DOMID_SELF && hp.domid != xen_domid) {
+ err = -ESRCH;
+ goto out;
+ }
+
+ switch (hp.index) {
+ default:
+ return false;
+ }
+
+out:
+ exit->u.hcall.result = err;
+ return true;
+}
+
static int kvm_xen_hcall_evtchn_upcall_vector(struct kvm_xen_exit *exit,
X86CPU *cpu, uint64_t arg)
{
@@ -530,6 +560,9 @@ static bool kvm_xen_hcall_hvm_op(struct kvm_xen_exit *exit,
X86CPU *cpu,
ret = -ENOSYS;
break;
+ case HVMOP_set_param:
+ return handle_set_param(exit, cpu, arg);
+
default:
return false;
}
--
2.39.1
- [PULL 10/62] i386/xen: implement HYPERVISOR_xen_version, (continued)
- [PULL 10/62] i386/xen: implement HYPERVISOR_xen_version, Paolo Bonzini, 2023/03/02
- [PULL 11/62] i386/xen: implement HYPERVISOR_sched_op, SCHEDOP_shutdown, Paolo Bonzini, 2023/03/02
- [PULL 12/62] i386/xen: Implement SCHEDOP_poll and SCHEDOP_yield, Paolo Bonzini, 2023/03/02
- [PULL 13/62] hw/xen: Add xen_overlay device for emulating shared xenheap pages, Paolo Bonzini, 2023/03/02
- [PULL 15/62] i386/xen: add pc_machine_kvm_type to initialize XEN_EMULATE mode, Paolo Bonzini, 2023/03/02
- [PULL 14/62] xen: Permit --xen-domid argument when accel is KVM, Paolo Bonzini, 2023/03/02
- [PULL 16/62] i386/xen: manage and save/restore Xen guest long_mode setting, Paolo Bonzini, 2023/03/02
- [PULL 19/62] i386/xen: implement HYPERVISOR_hvm_op, Paolo Bonzini, 2023/03/02
- [PULL 21/62] i386/xen: handle VCPUOP_register_vcpu_info, Paolo Bonzini, 2023/03/02
- [PULL 25/62] i386/xen: implement HVMOP_set_evtchn_upcall_vector, Paolo Bonzini, 2023/03/02
- [PULL 26/62] i386/xen: implement HVMOP_set_param,
Paolo Bonzini <=
- [PULL 18/62] i386/xen: implement XENMEM_add_to_physmap_batch, Paolo Bonzini, 2023/03/02
- [PULL 20/62] i386/xen: implement HYPERVISOR_vcpu_op, Paolo Bonzini, 2023/03/02
- [PULL 17/62] i386/xen: implement HYPERVISOR_memory_op, Paolo Bonzini, 2023/03/02
- [PULL 36/62] hw/xen: Implement EVTCHNOP_bind_interdomain, Paolo Bonzini, 2023/03/02
- [PULL 32/62] hw/xen: Implement EVTCHNOP_bind_virq, Paolo Bonzini, 2023/03/02
- [PULL 27/62] hw/xen: Add xen_evtchn device for event channel emulation, Paolo Bonzini, 2023/03/02
- [PULL 28/62] i386/xen: Add support for Xen event channel delivery to vCPU, Paolo Bonzini, 2023/03/02
- [PULL 31/62] hw/xen: Implement EVTCHNOP_unmask, Paolo Bonzini, 2023/03/02
- [PULL 38/62] hw/xen: Implement EVTCHNOP_reset, Paolo Bonzini, 2023/03/02
- [PULL 39/62] i386/xen: add monitor commands to test event injection, Paolo Bonzini, 2023/03/02