From: Steven Smith Subject: Re: Re: [Xen-changelog] [xen-unstable] Introduce a grant_entry_v2 structure. Date: Thu, 8 Oct 2009 19:01:27 +0100 Message-ID: <20091008180127.GA3938@weybridge.uk.xensource.com> References: <20091007175547.GA15683@weybridge.uk.xensource.com> <20091008120111.GA12400@weybridge.uk.xensource.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1677214721==" Return-path: In-Reply-To: <20091008120111.GA12400@weybridge.uk.xensource.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Keir Fraser Cc: Steven Smith , "yamahata@valinux.co.jp" , "xen-devel@lists.xensource.com" List-Id: xen-devel@lists.xenproject.org --===============1677214721== Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="32u276st3Jlj2kUU" Content-Disposition: inline --32u276st3Jlj2kUU Content-Type: multipart/mixed; boundary="f2QGlHpHGjS2mn6Y" Content-Disposition: inline --f2QGlHpHGjS2mn6Y Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable > > >>>>>> Introduce a grant_entry_v2 structure. > > >>>>>>=20 > > >>>>>> Signed-off-by: Steven Smith > > >>>>> This patch breaks my build: > > >>>>=20 > > >>>> Should be fixed by c/s 20288. > > >>>=20 > > >>> Build still not okay: > > >> Fixed by c/s 20291. > > > Oops; sorry about that. I completely forgot about the non-Linux dom0 > > > OSes. > > Could you have a stab at fixing the IA64 gnttab hooks? Either that or > > solicit help from the ia64 devs (cc'ing Isaku). > I don't have an IA64 build environment set up right now. Do you know > if there are any Citrix (or other) ones which I could borrow for a > bit, please? After some fiddling, I managed to get an IA64 cross toolchain set up, and the attached patch fixes the IA64 build of the hypervisor. I don't have any IA64 test boxes, so I've no idea whether it actually works, but it does build. I've not looked at the changes to libxc, because my cross-compiler doesn't seem to be able to cope with userspace stuff, but I'd guess they'll probably be okay. Sorry about the mess. Steven. --f2QGlHpHGjS2mn6Y Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="fix-ia64-build.diff" Content-Transfer-Encoding: quoted-printable Fix the IA64 build of the hypervisor. This is completely untested, beyond confirming that it compiles. Signed-off-by: Steven Smith diff -r 1d7221667204 xen/arch/ia64/xen/mm.c --- a/xen/arch/ia64/xen/mm.c Thu Oct 08 09:24:32 2009 +0100 +++ b/xen/arch/ia64/xen/mm.c Thu Oct 08 18:55:38 2009 +0100 @@ -3335,7 +3335,7 @@ gnttab_grow_table(d, xatp.idx + 1); =20 if (xatp.idx < nr_grant_frames(d->grant_table)) - mfn =3D virt_to_mfn(d->grant_table->shared[xatp.idx]); + mfn =3D virt_to_mfn(d->grant_table->shared_raw[xatp.idx]); =20 spin_unlock(&d->grant_table->lock); break; diff -r 1d7221667204 xen/common/grant_table.c --- a/xen/common/grant_table.c Thu Oct 08 09:24:32 2009 +0100 +++ b/xen/common/grant_table.c Thu Oct 08 18:55:38 2009 +0100 @@ -1754,7 +1754,7 @@ blocks mappings of transitive grants. */ is_sub_page =3D 1; *owning_domain =3D rrd; - act->gfn =3D INVALID_GFN; + act->gfn =3D -1ul; } else if ( sha1 ) { diff -r 1d7221667204 xen/include/asm-ia64/grant_table.h --- a/xen/include/asm-ia64/grant_table.h Thu Oct 08 09:24:32 2009 +0100 +++ b/xen/include/asm-ia64/grant_table.h Thu Oct 08 18:55:38 2009 +0100 @@ -31,8 +31,12 @@ /* Guest physical address of the grant table. */ #define IA64_GRANT_TABLE_PADDR IA64_XMAPPEDREGS_PADDR(NR_CPUS) =20 -#define gnttab_shared_maddr(t, i) (virt_to_maddr((t)->shared[(i)])) -#define gnttab_shared_page(t, i) (virt_to_page((t)->shared[(i)])) +#define gnttab_shared_maddr(t, i) (virt_to_maddr((t)->shared_raw[(i)= ])) +#define gnttab_shared_page(t, i) (virt_to_page((t)->shared_raw[(i)]= )) + +#define gnttab_status_maddr(t, i) (virt_to_maddr((t)->status[(i)])) +#define gnttab_status_mfn(t, i) (virt_to_maddr((t)->status[(i)]) >> = PAGE_SHIFT) +#define gnttab_status_page(t, i) (virt_to_page((t)->status[(i)])) =20 #define ia64_gnttab_create_shared_page(d, t, i) \ do { \ @@ -55,8 +59,26 @@ ia64_gnttab_create_shared_page((d), (t), (i)); \ } while (0) =20 +#define ia64_gnttab_create_status_page(d, t, i) \ + do { \ + BUG_ON((d)->arch.mm.pgd =3D=3D NULL); = \ + assign_domain_page((d), \ + IA64_GRANT_TABLE_PADDR + ((i) << PAGE_SHIFT), \ + gnttab_status_maddr((t), (i))); \ + } while (0) + +#define gnttab_create_status_page(d, t, i) \ + do { \ + share_xen_page_with_guest(gnttab_status_page((t), (i)), \ + (d), XENSHARE_writable); \ + if ((d)->arch.mm.pgd) \ + ia64_gnttab_create_status_page((d), (t), (i)); \ + } while (0) + #define gnttab_shared_gmfn(d, t, i) \ ((IA64_GRANT_TABLE_PADDR >> PAGE_SHIFT) + (i)) +#define gnttab_status_gmfn(d, t, i) \ + (mfn_to_gmfn(d, gnttab_status_mfn(t, i))) =20 #define gnttab_mark_dirty(d, f) ((void)f) =20 diff -r 1d7221667204 xen/include/asm-x86/grant_table.h --- a/xen/include/asm-x86/grant_table.h Thu Oct 08 09:24:32 2009 +0100 +++ b/xen/include/asm-x86/grant_table.h Thu Oct 08 18:55:38 2009 +0100 @@ -44,7 +44,7 @@ ((virt_to_maddr((t)->status[i]) >> PAGE_SHIFT)) =20 #define gnttab_status_gmfn(d, t, i) \ - (mfn_to_gmfn(d, gnttab_status_mfn(d, t, i))) + (mfn_to_gmfn(d, gnttab_status_mfn(t, i))) =20 #define gnttab_mark_dirty(d, f) paging_mark_dirty((d), (f)) =20 --f2QGlHpHGjS2mn6Y-- --32u276st3Jlj2kUU Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) iD8DBQFKzij3vAgSWYI3DVMRAoCcAJ9LOomPvxaEvG0swYkJV6XnRG7UiwCfdA6y 8lJ1QHRl1YiqNMtXOKhVCCQ= =opg+ -----END PGP SIGNATURE----- --32u276st3Jlj2kUU-- --===============1677214721== 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.xensource.com http://lists.xensource.com/xen-devel --===============1677214721==--