[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v7 27/51] i386/xen: Add support for Xen event channel deliver
From: |
David Woodhouse |
Subject: |
Re: [PATCH v7 27/51] i386/xen: Add support for Xen event channel delivery to vCPU |
Date: |
Tue, 17 Jan 2023 12:31:43 +0000 |
User-agent: |
Evolution 3.44.4-0ubuntu1 |
On Tue, 2023-01-17 at 11:11 +0000, Paul Durrant wrote:
>
> Ick. Do we really want cross-block gotos? For me it would look a lot
> nicer if you did a forward jump here and later and put the label+code
> after the `return 0`.
How's this?
static int set_vcpu_info(CPUState *cs, uint64_t gpa)
{
X86CPU *cpu = X86_CPU(cs);
CPUX86State *env = &cpu->env;
MemoryRegionSection mrs = { .mr = NULL };
void *vcpu_info_hva = NULL;
int ret;
ret = kvm_xen_set_vcpu_attr(cs, KVM_XEN_VCPU_ATTR_TYPE_VCPU_INFO, gpa);
if (ret || gpa == INVALID_GPA) {
goto out;
}
mrs = memory_region_find(get_system_memory(), gpa, sizeof(struct
vcpu_info));
if (!mrs.mr) {
ret = -EINVAL;
} else if (!mrs.mr->ram_block || mrs.size < sizeof(struct vcpu_info) ||
!(vcpu_info_hva = qemu_map_ram_ptr(mrs.mr->ram_block,
mrs.offset_within_region))) {
ret = -EINVAL;
memory_region_unref(mrs.mr);
mrs.mr = NULL;
}
out:
if (env->xen_vcpu_info_mr) {
memory_region_unref(env->xen_vcpu_info_mr);
}
env->xen_vcpu_info_hva = vcpu_info_hva;
env->xen_vcpu_info_mr = mrs.mr;
return ret;
}
smime.p7s
Description: S/MIME cryptographic signature
- [PATCH v7 21/51] i386/xen: handle VCPUOP_register_vcpu_time_info, (continued)
- [PATCH v7 21/51] i386/xen: handle VCPUOP_register_vcpu_time_info, David Woodhouse, 2023/01/16
- [PATCH v7 11/51] i386/xen: implement HYPERVISOR_sched_op, SCHEDOP_shutdown, David Woodhouse, 2023/01/16
- [PATCH v7 13/51] hw/xen: Add xen_overlay device for emulating shared xenheap pages, David Woodhouse, 2023/01/16
- [PATCH v7 44/51] i386/xen: Implement HYPERVISOR_grant_table_op and GNTTABOP_[gs]et_verson, David Woodhouse, 2023/01/16
- [PATCH v7 48/51] i386/xen: handle HVMOP_get_param, David Woodhouse, 2023/01/16
- [PATCH v7 34/51] hw/xen: Implement EVTCHNOP_alloc_unbound, David Woodhouse, 2023/01/16
- [PATCH v7 10/51] i386/xen: implement HYPERVISOR_xen_version, David Woodhouse, 2023/01/16
- [PATCH v7 46/51] i386/xen: handle PV timer hypercalls, David Woodhouse, 2023/01/16
- [PATCH v7 27/51] i386/xen: Add support for Xen event channel delivery to vCPU, David Woodhouse, 2023/01/16
- Re: [PATCH v7 27/51] i386/xen: Add support for Xen event channel delivery to vCPU, Paul Durrant, 2023/01/17
- [PATCH v7 03/51] xen: Add XEN_DISABLED mode and make it default, David Woodhouse, 2023/01/16
- [PATCH v7 14/51] i386/xen: add pc_machine_kvm_type to initialize XEN_EMULATE mode, David Woodhouse, 2023/01/16
- [PATCH v7 32/51] hw/xen: Implement EVTCHNOP_bind_ipi, David Woodhouse, 2023/01/16
- [PATCH v7 26/51] hw/xen: Add xen_evtchn device for event channel emulation, David Woodhouse, 2023/01/16