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

Re: [Xen-devel] [PATCH v19 11/14] x86/VPMU: Handle PMU interrupts for PV guests



>>> On 24.03.15 at 16:47, <boris.ostrovsky@xxxxxxxxxx> wrote:
> On 03/24/2015 11:36 AM, Jan Beulich wrote:
>>>>> On 24.03.15 at 16:13, <boris.ostrovsky@xxxxxxxxxx> wrote:
>>> On 03/24/2015 10:28 AM, Jan Beulich wrote:
>>>>>>> On 17.03.15 at 15:54, <boris.ostrovsky@xxxxxxxxxx> wrote:
>>>>> Changes in v19:
>>>>> * Adjusted for new ops interfaces (passing vcpu vs. vpmu)
>>>>> * Test for domain->max_cpu in choose_hwdom_vcpu() instead of
>>>>> 'domain->vcpu!=NULL'
>>>> I suppose that's something that then should also be done in patch 7?
>>> We only need this routine during interrupt handling (for PV(H)) and this
>>> is the patch that introduces this functionality.
>>>
>>> And if you are asking about the test specifically --- this is also the
>>> first patch where we refer to hardware_domain->vcpu[], which is what the
>>> test is really for.
>>>
>>> Or is it something else that you had in mind?
>> Yes - following Andrew's cleanup I believe the d->vcpu != NULL
>> check is redundant with having (perhaps indirectly)
>> checked d->max_vcpus > 0.
> 
> Then I am not sure I understand what you are asking me to do for patch 
> 7, sorry.

There you have

+static int pvpmu_init(struct domain *d, xen_pmu_params_t *params)
+{
+    struct vcpu *v;
+    struct vpmu_struct *vpmu;
+    struct page_info *page;
+    uint64_t gfn = params->val;
+
+    if ( vpmu_mode == XENPMU_MODE_OFF )
+        return -EINVAL;
+
+    if ( (params->vcpu >= d->max_vcpus) || (d->vcpu == NULL) ||
+         (d->vcpu[params->vcpu] == NULL) )
+        return -EINVAL;

This conditional checks both ->max_vcpus and ->vcpu, when
the former check passes you already know ->max_vcpus > 0.

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