qemu-devel
[Top][All Lists]
Advanced

[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...

Attachment: smime.p7s
Description: S/MIME cryptographic signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]