From: "Ivan Kelly" Subject: Re: Clock Interrupt not occurring. hypervisor_callback not being called. (more info) Date: Wed, 1 Mar 2006 22:29:57 +0000 Message-ID: References: <4406010C.4080303@virtualiron.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Return-path: In-Reply-To: <4406010C.4080303@virtualiron.com> Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Dave Winchell Cc: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org how would one create a memory barrier? I think the xchg asm instruction should be a natural barrier in any case. -Ivan On 3/1/06, Dave Winchell wrote: > Ivan, > > How about a memory barrier right before the call to evtchn_notify > in evtchn_set_pending and one before l1 =3D > x86_atomic_xchg(&s->evtchn_pending_sel, 0) > in do_hypervisor_callback? > > Regards, > Dave > > > Ivan Kelly wrote: > > >Some more info on this problem. > >The problem seems to be that evtchn_pending[0] is not being updated > >fast enough after the callback is made. Therefore the callback is > >running and seeing nothing as pending and discarding anything that > >happens. > >If i put in something that delays before the start of the inner loop > >somewhere, it will work fine. It doesn't have to be a printf, can be a > >for(i=3D0;i<100000;i++) or something similar. > >evtchn_pending is set as volatile. Im not sure if this is actually > >helping at all though, since I have to use the ACK compiler which is > >the only thing that minix will compile with. > > > >Does anyone have any idea on how i can get evtchn_pending to update on t= ime? > >Regards > >Ivan > > > > > > > >> > >>PUBLIC void > >>do_hypervisor_callback(struct stackframe_s *regs) > >>{ > >> unsigned long l1, l2; > >> unsigned int l1i, l2i, port; > >> int irq; > >> shared_info_t *s =3D hypervisor_shared_info; > >> > >> s->vcpu_data[0].evtchn_upcall_pending =3D 0; > >> > >> l1 =3D x86_atomic_xchg(&s->evtchn_pending_sel, 0); > >> > >> while ( l1 !=3D 0 ) > >> { > >>/* kprintf("l1: %x\n");*/ > >> l1i =3D x86_scan_forward(l1); > >> l1 &=3D ~(1 << l1i); > >> > >> l2 =3D s->evtchn_pending[l1i] & ~s->evtchn_mask[l1i]; > >> while ( l2 !=3D 0 ) > >> { > >> kprintf("l2: %x\n", l2); > >> l2i =3D x86_scan_forward(l2); > >> l2 &=3D ~(1 << l2i); > >> > >> port =3D (l1i << 5) + l2i; > >> > >> if ( (irq =3D event_to_action[port]) !=3D -1 ) = { > >> do_event(irq, regs); > >> } > >> } > >> } > >>} > >> > >> > >> > >> > > > >_______________________________________________ > >Xen-devel mailing list > >Xen-devel@lists.xensource.com > >http://lists.xensource.com/xen-devel > > > > > >