[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[RFC PATCH v4 26/47] i386/xen: implement HVMOP_set_param
From: |
David Woodhouse |
Subject: |
[RFC PATCH v4 26/47] i386/xen: implement HVMOP_set_param |
Date: |
Wed, 21 Dec 2022 01:06:02 +0000 |
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>
---
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 9f0ade9325..cb2c243629 100644
--- a/target/i386/kvm/xen-emu.c
+++ b/target/i386/kvm/xen-emu.c
@@ -488,6 +488,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 = -EINVAL;
+ 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)
{
@@ -529,6 +559,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.35.3
- [RFC PATCH v4 36/47] hw/xen: Implement EVTCHNOP_bind_interdomain, (continued)
- [RFC PATCH v4 36/47] hw/xen: Implement EVTCHNOP_bind_interdomain, David Woodhouse, 2022/12/20
- [RFC PATCH v4 07/47] xen-platform: exclude vfio-pci from the PCI platform unplug, David Woodhouse, 2022/12/20
- [RFC PATCH v4 10/47] i386/xen: handle guest hypercalls, David Woodhouse, 2022/12/20
- [RFC PATCH v4 42/47] kvm/i386: Add xen-gnttab-max-frames property, David Woodhouse, 2022/12/20
- [RFC PATCH v4 28/47] i386/xen: Add support for Xen event channel delivery to vCPU, David Woodhouse, 2022/12/20
- [RFC PATCH v4 18/47] i386/xen: implement XENMEM_add_to_physmap_batch, David Woodhouse, 2022/12/20
- [RFC PATCH v4 09/47] hw/xen_backend: refactor xen_be_init(), David Woodhouse, 2022/12/20
- [RFC PATCH v4 04/47] i386/kvm: Add xen-version KVM accelerator property and init KVM Xen support, David Woodhouse, 2022/12/20
- [RFC PATCH v4 23/47] i386/xen: handle VCPUOP_register_runstate_memory_area, David Woodhouse, 2022/12/20
- [RFC PATCH v4 16/47] i386/xen: manage and save/restore Xen guest long_mode setting, David Woodhouse, 2022/12/20
- [RFC PATCH v4 26/47] i386/xen: implement HVMOP_set_param,
David Woodhouse <=
- [RFC PATCH v4 17/47] i386/xen: implement HYPERVISOR_memory_op, David Woodhouse, 2022/12/20
- [RFC PATCH v4 08/47] xen-platform: allow its creation with XEN_EMULATE mode, David Woodhouse, 2022/12/20
- [RFC PATCH v4 32/47] hw/xen: Implement EVTCHNOP_bind_virq, David Woodhouse, 2022/12/20
- [RFC PATCH v4 29/47] hw/xen: Implement EVTCHNOP_status, David Woodhouse, 2022/12/20
- [RFC PATCH v4 45/47] i386/xen: Implement HYPERVISOR_grant_table_op and GNTTABOP_[gs]et_verson, David Woodhouse, 2022/12/20
- [RFC PATCH v4 38/47] hw/xen: Implement EVTCHNOP_reset, David Woodhouse, 2022/12/20