From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tamas K Lengyel Subject: Re: [PATCH for-4.5 v8 04/19] xen: Relocate p2m_mem_access_resume to mem_access common Date: Tue, 23 Sep 2014 16:15:39 +0200 Message-ID: References: <1411478070-13836-1-git-send-email-tklengyel@sec.in.tum.de> <1411478070-13836-5-git-send-email-tklengyel@sec.in.tum.de> <542191B40200007800037B8D@mail.emea.novell.com> <54219B1B0200007800037C05@mail.emea.novell.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============5008558528516888152==" Return-path: In-Reply-To: <54219B1B0200007800037C05@mail.emea.novell.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Jan Beulich Cc: Ian Campbell , Tim Deegan , Julien Grall , Ian Jackson , "xen-devel@lists.xen.org" , Stefano Stabellini , Andres Lagar-Cavilla , Daniel De Graaf , Tamas K Lengyel List-Id: xen-devel@lists.xenproject.org --===============5008558528516888152== Content-Type: multipart/alternative; boundary=001a11c30308ac0d6c0503bc331f --001a11c30308ac0d6c0503bc331f Content-Type: text/plain; charset=ISO-8859-1 On Tue, Sep 23, 2014 at 4:08 PM, Jan Beulich wrote: > >>> On 23.09.14 at 16:04, wrote: > > On Tue, Sep 23, 2014 at 3:28 PM, Jan Beulich wrote: > >> >>> On 23.09.14 at 15:14, 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 --001a11c30308ac0d6c0503bc331f Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable


On Tue, Sep 23, 2014 at 4:08 PM, Jan Beulich <JBeulich@suse.com>= ; wrote:
>>= > On 23.09.14 at 16:04, <tamas.lengyel@zentific.com> wrote:
> On Tue, Sep 23, 2014 at 3:28 PM, Jan Beulich <JBeulich@suse.com> wrote:
>> >>> On 23.09.14 at 15:14, <tklengyel@sec.in.tum.de> wrote:
>> > +void p2m_mem_event_emulate_che= ck(struct domain *d, const mem_event_response_t *rsp)
>> > +{
>> > +=A0 =A0 /* Mark vcpu for skipping one instruction upon resch= eduling. */
>> > +=A0 =A0 if ( rsp->flags & MEM_EVENT_FLAG_EMULATE ) >> > +=A0 =A0 {
>> > +=A0 =A0 =A0 =A0 struct vcpu *v =3D current;
>>
>> Compare this with ...
>>
>> > -void p2m_mem_access_resume(struct domain *d)
>> > -{
>> > -=A0 =A0 mem_event_response_t rsp;
>> > -
>> > -=A0 =A0 /* Pull all responses off the ring */
>> > -=A0 =A0 while( mem_event_get_response(d, &d->mem_even= t->access, &rsp) )
>> > -=A0 =A0 {
>> > -=A0 =A0 =A0 =A0 struct vcpu *v;
>> > -
>> > -=A0 =A0 =A0 =A0 if ( rsp.flags & MEM_EVENT_FLAG_DUMMY )<= br> >> > -=A0 =A0 =A0 =A0 =A0 =A0 continue;
>> > -
>> > -=A0 =A0 =A0 =A0 /* Validate the vcpu_id in the response. */<= br> >> > -=A0 =A0 =A0 =A0 if ( (rsp.vcpu_id >=3D d->max_vcpus) |= | !d->vcpu[rsp.vcpu_id] )
>> > -=A0 =A0 =A0 =A0 =A0 =A0 continue;
>> > -
>> > -=A0 =A0 =A0 =A0 v =3D 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 =3D d->vcpu[rsp.vcpu_id] inste= ad 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

--001a11c30308ac0d6c0503bc331f-- --===============5008558528516888152== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel --===============5008558528516888152==--