From: Ian Campbell Subject: Re: [PATCH 7/7] mini-os: Moved force_evtchn_callback to header Date: Fri, 6 Jun 2014 15:17:34 +0100 Message-ID: <1402064254.1313.64.camel@kazak.uk.xensource.com> References: <538D9161.6090402@linaro.org> <1401897998-29569-1-git-send-email-talex5@gmail.com> <1401897998-29569-8-git-send-email-talex5@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1Wsuy4-0007Ve-KX for xen-devel@lists.xenproject.org; Fri, 06 Jun 2014 14:18:04 +0000 In-Reply-To: <1401897998-29569-8-git-send-email-talex5@gmail.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: Thomas Leonard Cc: xen-devel@lists.xenproject.org List-Id: xen-devel@lists.xenproject.org On Wed, 2014-06-04 at 17:06 +0100, Thomas Leonard wrote: > From: Karim Raslan Why is this being done? > > Signed-off-by: Karim Allah Ahmed > [talex5@gmail.com: separated from big ARM commit] > Signed-off-by: Thomas Leonard > --- > extras/mini-os/hypervisor.c | 20 +------------------- > extras/mini-os/include/hypervisor.h | 1 - > extras/mini-os/include/x86/os.h | 17 +++++++++++++++++ > 3 files changed, 18 insertions(+), 20 deletions(-) > > diff --git a/extras/mini-os/hypervisor.c b/extras/mini-os/hypervisor.c > index b4688a0..9c79d5d 100644 > --- a/extras/mini-os/hypervisor.c > +++ b/extras/mini-os/hypervisor.c > @@ -71,23 +71,6 @@ void do_hypervisor_callback(struct pt_regs *regs) > in_callback = 0; > } > > -void force_evtchn_callback(void) > -{ > - int save; > - vcpu_info_t *vcpu; > - vcpu = &HYPERVISOR_shared_info->vcpu_info[smp_processor_id()]; > - save = vcpu->evtchn_upcall_mask; > - > - while (vcpu->evtchn_upcall_pending) { > - vcpu->evtchn_upcall_mask = 1; > - barrier(); > - do_hypervisor_callback(NULL); > - barrier(); > - vcpu->evtchn_upcall_mask = save; > - barrier(); > - }; > -} > - > inline void mask_evtchn(uint32_t port) > { > shared_info_t *s = HYPERVISOR_shared_info; > @@ -110,8 +93,7 @@ inline void unmask_evtchn(uint32_t port) > &vcpu_info->evtchn_pending_sel) ) > { > vcpu_info->evtchn_upcall_pending = 1; > - if ( !vcpu_info->evtchn_upcall_mask ) > - force_evtchn_callback(); > + force_evtchn_callback(); If this is something to do with the code motion then I'm not sure what, it certainly needs to be explained somewhere. > } > } > > diff --git a/extras/mini-os/include/hypervisor.h b/extras/mini-os/include/hypervisor.h > index a62cb78..9e9cac8 100644 > --- a/extras/mini-os/include/hypervisor.h > +++ b/extras/mini-os/include/hypervisor.h > @@ -35,7 +35,6 @@ extern union start_info_union start_info_union; > #define start_info (start_info_union.start_info) > > /* hypervisor.c */ > -void force_evtchn_callback(void); > void do_hypervisor_callback(struct pt_regs *regs); > void mask_evtchn(uint32_t port); > void unmask_evtchn(uint32_t port); > diff --git a/extras/mini-os/include/x86/os.h b/extras/mini-os/include/x86/os.h > index 73b8297..8eea1be 100644 > --- a/extras/mini-os/include/x86/os.h > +++ b/extras/mini-os/include/x86/os.h > @@ -160,6 +160,23 @@ do { \ > */ > typedef struct { volatile int counter; } atomic_t; > > +static inline void force_evtchn_callback(void) > +{ > + int save; > + vcpu_info_t *vcpu; > + vcpu = &HYPERVISOR_shared_info->vcpu_info[smp_processor_id()]; > + save = vcpu->evtchn_upcall_mask; > + > + while (vcpu->evtchn_upcall_pending) { > + vcpu->evtchn_upcall_mask = 1; > + barrier(); > + do_hypervisor_callback(NULL); > + barrier(); > + vcpu->evtchn_upcall_mask = save; > + barrier(); > + }; > +} > + > > /************************** i386 *******************************/ > #ifdef __INSIDE_MINIOS__