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

Re: [Xen-devel] [PATCH for-4.5 v8 04/19] xen: Relocate p2m_mem_access_resume to mem_access common





On Tue, Sep 23, 2014 at 4:08 PM, Jan Beulich <JBeulich@xxxxxxxx> wrote:
>>> On 23.09.14 at 16:04, <tamas.lengyel@xxxxxxxxxxxx> wrote:
> On Tue, Sep 23, 2014 at 3:28 PM, Jan Beulich <JBeulich@xxxxxxxx> wrote:
>> >>> On 23.09.14 at 15:14, <tklengyel@xxxxxxxxxxxxx> wrote:
>> > +void p2m_mem_event_emulate_check(struct domain *d, const mem_event_response_t *rsp)
>> > +{
>> > +    /* Mark vcpu for skipping one instruction upon rescheduling. */
>> > +    if ( rsp->flags & MEM_EVENT_FLAG_EMULATE )
>> > +    {
>> > +        struct vcpu *v = current;
>>
>> Compare this with ...
>>
>> > -void p2m_mem_access_resume(struct domain *d)
>> > -{
>> > -    mem_event_response_t rsp;
>> > -
>> > -    /* Pull all responses off the ring */
>> > -    while( mem_event_get_response(d, &d->mem_event->access, &rsp) )
>> > -    {
>> > -        struct vcpu *v;
>> > -
>> > -        if ( rsp.flags & MEM_EVENT_FLAG_DUMMY )
>> > -            continue;
>> > -
>> > -        /* Validate the vcpu_id in the response. */
>> > -        if ( (rsp.vcpu_id >= d->max_vcpus) || !d->vcpu[rsp.vcpu_id] )
>> > -            continue;
>> > -
>> > -        v = d->vcpu[rsp.vcpu_id];
>>
>> ... the original code. I.e. you should pass v instead of d into
>> p2m_mem_event_emulate_check().
>>
>
> Ah good point, but I think passing d is better (as it is also required
> further down), I just have to make v = d->vcpu[rsp.vcpu_id] instead of
> current.

No - d can simply be had from v->domain.

Jan

Ack. Would you still prefer splitting the abstraction from this patch into a separate one?

Tamas

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