[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH v5] x86/hvm/viridian: flush remote tlbs by hypercall



>>> On 20.11.15 at 10:55, <paul.durrant@xxxxxxxxxx> wrote:
> +        /*
> +         * For each specified virtual CPU flush all ASIDs to invalidate
> +         * TLB entries the next time it is scheduled and then, if it
> +         * is currently running, add its physical CPU to a mask of
> +         * those which need to be interrupted to force a flush.
> +         */
> +        for_each_vcpu ( currd, v )
> +        {
> +            if ( v->vcpu_id >= (sizeof(input_params.vcpu_mask) * 8) )
> +                break;
> +
> +            if ( !(input_params.vcpu_mask & (1ul << v->vcpu_id)) )
> +                continue;

The code is correct as is (for the time being at least, i.e. no strict
need for a v6), but I'd nevertheless like to note that range check
and shift still aren't in line with one another: You'd need to use
(typeof(input_params.vcpu_mask))1 instead of 1ul for there to be
a full match (or

            if ( !((input_params.vcpu_mask >> v->vcpu_id) & 1) )

).

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.