[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v6 25/51] i386/xen: implement HVMOP_set_param
From: |
David Woodhouse |
Subject: |
[PATCH v6 25/51] i386/xen: implement HVMOP_set_param |
Date: |
Tue, 10 Jan 2023 12:20:16 +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 d56d63b02e..a27facb90f 100644
--- a/target/i386/kvm/xen-emu.c
+++ b/target/i386/kvm/xen-emu.c
@@ -486,6 +486,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)
{
@@ -527,6 +557,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
- Re: [PATCH v6 08/51] xen-platform: allow its creation with XEN_EMULATE mode, (continued)
- [PATCH v6 27/51] i386/xen: Add support for Xen event channel delivery to vCPU, David Woodhouse, 2023/01/10
- [PATCH v6 20/51] i386/xen: handle VCPUOP_register_vcpu_info, David Woodhouse, 2023/01/10
- [PATCH v6 22/51] i386/xen: handle VCPUOP_register_runstate_memory_area, David Woodhouse, 2023/01/10
- [PATCH v6 35/51] hw/xen: Implement EVTCHNOP_bind_interdomain, David Woodhouse, 2023/01/10
- [PATCH v6 29/51] hw/xen: Implement EVTCHNOP_close, David Woodhouse, 2023/01/10
- [PATCH v6 02/51] xen: add CONFIG_XENFV_MACHINE and CONFIG_XEN_EMU options for Xen emulation, David Woodhouse, 2023/01/10
- [PATCH v6 25/51] i386/xen: implement HVMOP_set_param,
David Woodhouse <=
- [PATCH v6 41/51] kvm/i386: Add xen-gnttab-max-frames property, David Woodhouse, 2023/01/10
- [PATCH v6 38/51] i386/xen: add monitor commands to test event injection, David Woodhouse, 2023/01/10
- [PATCH v6 43/51] hw/xen: Support mapping grant frames, David Woodhouse, 2023/01/10
- [PATCH v6 45/51] hw/xen: Implement GNTTABOP_query_size, David Woodhouse, 2023/01/10
- [PATCH v6 47/51] i386/xen: Reserve Xen special pages for console, xenstore rings, David Woodhouse, 2023/01/10
- [PATCH v6 10/51] i386/xen: implement HYPERVISOR_xen_version, David Woodhouse, 2023/01/10
- [PATCH v6 32/51] hw/xen: Implement EVTCHNOP_bind_ipi, David Woodhouse, 2023/01/10