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

Re: [Xen-devel] [PATCH v20 06/13] x86/VPMU: Initialize PMU for PV(H) guests



>>> On 09.04.15 at 17:44, <boris.ostrovsky@xxxxxxxxxx> wrote:
> +static void pvpmu_finish(struct domain *d, xen_pmu_params_t *params)
> +{
> +    struct vcpu *v;
> +    struct vpmu_struct *vpmu;
> +    uint64_t mfn;
> +    void *xenpmu_data;
> +
> +    if ( (params->vcpu >= d->max_vcpus) || (d->vcpu[params->vcpu] == NULL) )
> +        return;
> +
> +    v = d->vcpu[params->vcpu];
> +    if ( v != current )
> +        vcpu_pause(v);
> +
> +    vpmu = vcpu_vpmu(v);
> +    spin_lock(&vpmu->vpmu_lock);
> +
> +    vpmu_destroy(v);
> +    xenpmu_data = vpmu->xenpmu_data;
> +    vpmu->xenpmu_data = NULL;
> +
> +    spin_unlock(&vpmu->vpmu_lock);
> +
> +    if ( xenpmu_data )
> +    {
> +        mfn = domain_page_map_to_mfn(xenpmu_data);
> +        ASSERT(mfn != 0);

Perhaps better mfn_valid()?

With this (or an explanation why that would be worse/wrong)
Acked-by: Jan Beulich <jbeulich@xxxxxxxx>

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