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

Re: [Xen-devel] [PATCH v8 08/24] x86: refactor psr: set value: implement framework.



On 17-03-10 02:09:55, Jan Beulich wrote:
> >>> On 10.03.17 at 03:54, <yi.y.sun@xxxxxxxxxxxxxxx> wrote:
> > On 17-03-08 09:07:10, Jan Beulich wrote:
> >> >>> On 15.02.17 at 09:49, <yi.y.sun@xxxxxxxxxxxxxxx> wrote:
> >> > +static int write_psr_msr(unsigned int socket, unsigned int cos,
> >> > +                         const uint64_t *val)
> >> > +{
> >> > +    return -ENOENT;
> >> > +}
> >> 
> >> Is this function intended you write just one MSR, or potentially many?
> >> In the latter case the name would perhaps better be "write_psr_msrs()".
> >> 
> > For one feature, it does set one MSR.
> 
> In which case - why is the value being passed by pointer?
>  
Will change it. My original meaning is, for example, when setting L3 CAT, only
one MSR is set.

> >> > +    ref[old_cos]--;
> >> > +    spin_unlock(&info->ref_lock);
> >> > +
> >> > +    /*
> >> > +     * Step 6:
> >> > +     * Save the COS ID into current domain's psr_cos_ids[] so that we 
> >> > can know
> >> > +     * which COS the domain is using on the socket. One domain can only 
> >> > use
> >> > +     * one COS ID at same time on each socket.
> >> > +     */
> >> > +    d->arch.psr_cos_ids[socket] = cos;
> >> 
> >> So the domain has not been paused, i.e. some of its vCPU-s may
> >> be running on other pCPU-s (including ones on the socket in
> >> question). How come it is safe to update this value here?
> >> 
> > This is a domctl operation. It is protected by domctl_lock which is locked 
> > in
> > do_domctl().
> 
> But that lock doesn't keep the subject domain's vCPU-s from
> running on other pCPU-s at the same time.
> 
Yes, you are right. But only 'psr_ctxt_switch_to()' can access
psr_cos_ids[socket] when psr_cos_ids[socket] is being set. 
'psr_ctxt_switch_to()'
read the cos and set it to ASSOC register. Context switch is short so that the
correct cos can be set to ASSOC register in a short time.

BRs,
Sun Yi

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

 


Rackspace

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