From mboxrd@z Thu Jan 1 00:00:00 1970 From: Samuel Thibault Subject: Re: [PATCH ARM v5 08/20] mini-os: added arch_init_gnttab Date: Thu, 26 Jun 2014 13:36:21 +0200 Message-ID: <20140626113621.GB29700@type.bordeaux.inria.fr> References: <1403782117-15125-1-git-send-email-talex5@gmail.com> <1403782117-15125-9-git-send-email-talex5@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Return-path: Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1X07ya-0007PY-Ln for xen-devel@lists.xenproject.org; Thu, 26 Jun 2014 11:36:24 +0000 Content-Disposition: inline In-Reply-To: <1403782117-15125-9-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, anil@recoil.org, Dave.Scott@eu.citrix.com, stefano.stabellini@eu.citrix.com List-Id: xen-devel@lists.xenproject.org Thomas Leonard, le Thu 26 Jun 2014 12:28:25 +0100, a =E9crit : > From: Karim Raslan > = > Moves some x86-specific code into arch/x86. > = > Signed-off-by: Karim Allah Ahmed > [talex5@gmail.com: split into multiple patches] > Signed-off-by: Thomas Leonard Acked-by: Samuel Thibault > --- > extras/mini-os/arch/x86/mm.c | 13 +++++++++++++ > extras/mini-os/gnttab.c | 9 +-------- > extras/mini-os/include/gnttab.h | 1 + > 3 files changed, 15 insertions(+), 8 deletions(-) > = > diff --git a/extras/mini-os/arch/x86/mm.c b/extras/mini-os/arch/x86/mm.c > index 35df15b..9c6d1b8 100644 > --- a/extras/mini-os/arch/x86/mm.c > +++ b/extras/mini-os/arch/x86/mm.c > @@ -942,3 +942,16 @@ void arch_init_mm(unsigned long* start_pfn_p, unsign= ed long* max_pfn_p) > *start_pfn_p =3D start_pfn; > *max_pfn_p =3D max_pfn; > } > + > +grant_entry_t *arch_init_gnttab(int nr_grant_frames) > +{ > + struct gnttab_setup_table setup; > + unsigned long frames[nr_grant_frames]; > + > + setup.dom =3D DOMID_SELF; > + setup.nr_frames =3D nr_grant_frames; > + set_xen_guest_handle(setup.frame_list, frames); > + > + HYPERVISOR_grant_table_op(GNTTABOP_setup_table, &setup, 1); > + return map_frames(frames, nr_grant_frames); > +} > diff --git a/extras/mini-os/gnttab.c b/extras/mini-os/gnttab.c > index 6f25006..f395d12 100644 > --- a/extras/mini-os/gnttab.c > +++ b/extras/mini-os/gnttab.c > @@ -172,8 +172,6 @@ gnttabop_error(int16_t status) > void > init_gnttab(void) > { > - struct gnttab_setup_table setup; > - unsigned long frames[NR_GRANT_FRAMES]; > int i; > = > #ifdef GNT_DEBUG > @@ -182,12 +180,7 @@ init_gnttab(void) > for (i =3D NR_RESERVED_ENTRIES; i < NR_GRANT_ENTRIES; i++) > put_free_entry(i); > = > - setup.dom =3D DOMID_SELF; > - setup.nr_frames =3D NR_GRANT_FRAMES; > - set_xen_guest_handle(setup.frame_list, frames); > - > - HYPERVISOR_grant_table_op(GNTTABOP_setup_table, &setup, 1); > - gnttab_table =3D map_frames(frames, NR_GRANT_FRAMES); > + gnttab_table =3D arch_init_gnttab(NR_GRANT_FRAMES); > printk("gnttab_table mapped at %p.\n", gnttab_table); > } > = > diff --git a/extras/mini-os/include/gnttab.h b/extras/mini-os/include/gnt= tab.h > index acd6c39..c43ad42 100644 > --- a/extras/mini-os/include/gnttab.h > +++ b/extras/mini-os/include/gnttab.h > @@ -12,5 +12,6 @@ unsigned long gnttab_end_transfer(grant_ref_t gref); > int gnttab_end_access(grant_ref_t ref); > const char *gnttabop_error(int16_t status); > void fini_gnttab(void); > +grant_entry_t *arch_init_gnttab(int nr_grant_frames); > = > #endif /* !__GNTTAB_H__ */ > -- = > 2.0.0 > = -- = Samuel "And the next time you consider complaining that running Lucid Emacs 19.05 via NFS from a remote Linux machine in Paraguay doesn't seem to get the background colors right, you'll know who to thank." (By Matt Welsh)