[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v11 47/59] i386/xen: handle PV timer hypercalls
From: |
David Woodhouse |
Subject: |
Re: [PATCH v11 47/59] i386/xen: handle PV timer hypercalls |
Date: |
Mon, 20 Feb 2023 15:49:34 +0000 |
User-agent: |
Evolution 3.44.4-0ubuntu1 |
On Mon, 2023-02-20 at 14:29 +0000, Paul Durrant wrote:
> [snip]
> > static bool kvm_xen_hcall_vcpu_op(struct kvm_xen_exit *exit, X86CPU *cpu,
> > int cmd, int vcpu_id, uint64_t arg)
> > {
> > - CPUState *dest = qemu_get_cpu(vcpu_id);
> > CPUState *cs = CPU(cpu);
> > + CPUState *dest = cs->cpu_index == vcpu_id ? cs : qemu_get_cpu(vcpu_id);
> > int err;
> >
> > + if (!dest) {
> > + return -ENOENT;
> > + }
> > +
>
> I thought the patch format was catching me out somehow but I don't think
> so...
>
> The function declaration says 'static bool kvm_xen_hcall_vcpu_op(...)'
> but that return value doesn't look very boolean to me. I think you also
> have the same issue...
Ah, good catch. Thanks! Those additional checks were added later.
But why in $DEITY's name did the compiler not catch that? That almost
makes me reconsider my life choices in having that as the function
API... but this is basically never going to need to change so I think
it's OK. I'll fix it and move on. There are plenty of other choices
I've made in my life which are far more worthy of second-guessing...
smime.p7s
Description: S/MIME cryptographic signature
- [PATCH v11 19/59] i386/xen: implement HYPERVISOR_hvm_op, (continued)
- [PATCH v11 19/59] i386/xen: implement HYPERVISOR_hvm_op, David Woodhouse, 2023/02/16
- [PATCH v11 46/59] hw/xen: Implement GNTTABOP_query_size, David Woodhouse, 2023/02/16
- [PATCH v11 10/59] i386/xen: implement HYPERVISOR_xen_version, David Woodhouse, 2023/02/16
- [PATCH v11 45/59] i386/xen: Implement HYPERVISOR_grant_table_op and GNTTABOP_[gs]et_verson, David Woodhouse, 2023/02/16
- [PATCH v11 50/59] hw/xen: Add backend implementation of interdomain event channel support, David Woodhouse, 2023/02/16
- [PATCH v11 30/59] hw/xen: Implement EVTCHNOP_close, David Woodhouse, 2023/02/16
- [PATCH v11 24/59] i386/xen: implement HYPERVISOR_event_channel_op, David Woodhouse, 2023/02/16
- [PATCH v11 31/59] hw/xen: Implement EVTCHNOP_unmask, David Woodhouse, 2023/02/16
- [PATCH v11 47/59] i386/xen: handle PV timer hypercalls, David Woodhouse, 2023/02/16
- [PATCH v11 39/59] i386/xen: add monitor commands to test event injection, David Woodhouse, 2023/02/16
- [PATCH v11 57/59] hw/xen: Support MSI mapping to PIRQ, David Woodhouse, 2023/02/16
- [PATCH v11 23/59] i386/xen: handle VCPUOP_register_runstate_memory_area, David Woodhouse, 2023/02/16
- [PATCH v11 06/59] i386/hvm: Set Xen vCPU ID in KVM, David Woodhouse, 2023/02/16
- [PATCH v11 21/59] i386/xen: handle VCPUOP_register_vcpu_info, David Woodhouse, 2023/02/16
- [PATCH v11 27/59] hw/xen: Add xen_evtchn device for event channel emulation, David Woodhouse, 2023/02/16
- [PATCH v11 02/59] xen: add CONFIG_XEN_BUS and CONFIG_XEN_EMU options for Xen emulation, David Woodhouse, 2023/02/16
- [PATCH v11 14/59] xen: Permit --xen-domid argument when accel is KVM, David Woodhouse, 2023/02/16
- [PATCH v11 20/59] i386/xen: implement HYPERVISOR_vcpu_op, David Woodhouse, 2023/02/16
- [PATCH v11 41/59] hw/xen: Support HVM_PARAM_CALLBACK_TYPE_PCI_INTX callback, David Woodhouse, 2023/02/16