Christoph Egger
2008-Jul-28 11:46 UTC
[Xen-devel] [PATCH][XEN] PV blk backend: Make 32bit PV guests work on 64bit PV Dom0
Hi, Attached patch makes the PV block driver for 32bit PV guests working on 64bit PV Dom0. In the io/blkif.h, the ''id'' field of struct blkif_request is 64bit, but on a LP32 system it''s aligned on 32bits, while it''ll be aligned to 64bits on a LP64 system. So on LP64 there''ll be 4 bytes of padding between handle and id. The same is true for struct blkif_response: it''s 11 bytes long, so will be aligned differently in the ring between a 32 and 64bit systems. In order to fix this, attached patch introduces in the public headers, blkif_request/blkif_response, blkif_x86_32_request/blkif_x86_32_response and blkif_x86_64_request/blkif_x86_64_response. NetBSD is doing so io/blkif.h in the public headers, while Linux does so in include/xen/blkif.h in the linux sources. But the result is the same ... Successfully tested with the combinations: 64bit Dom0 32bit PAE PV guest NetBSD Linux Linux NetBSD The combinations 64bit Dom0, 64bit PV DomU works with and without this patch. Signed-off-by: Christoph Egger <Christoph.Egger@amd.com> -- AMD Saxony, Dresden, Germany Operating System Research Center Legal Information: AMD Saxony Limited Liability Company & Co. KG Sitz (Geschäftsanschrift): Wilschdorfer Landstr. 101, 01109 Dresden, Deutschland Registergericht Dresden: HRA 4896 vertretungsberechtigter Komplementär: AMD Saxony LLC (Sitz Wilmington, Delaware, USA) Geschäftsführer der AMD Saxony LLC: Dr. Hans-R. Deppe, Thomas McCoy _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Keir Fraser
2008-Jul-28 12:23 UTC
Re: [Xen-devel] [PATCH][XEN] PV blk backend: Make 32bit PV guests work on 64bit PV Dom0
Just do the same as we do in Linux and put these defs in your NetBSD private header space. -- Keir On 28/7/08 12:46, "Christoph Egger" <Christoph.Egger@amd.com> wrote:> > Hi, > > Attached patch makes the PV block driver for 32bit PV guests working on > 64bit PV Dom0. > > In the io/blkif.h, the ''id'' field of > struct blkif_request is 64bit, but on a LP32 system it''s aligned on > 32bits, while it''ll be aligned to 64bits on a LP64 system. So on LP64 there''ll > be 4 bytes of padding between handle and id. The same is true for > struct blkif_response: it''s 11 bytes long, so will be aligned differently > in the ring between a 32 and 64bit systems. > > In order to fix this, attached patch introduces in the public headers, > blkif_request/blkif_response, blkif_x86_32_request/blkif_x86_32_response > and blkif_x86_64_request/blkif_x86_64_response. > NetBSD is doing so io/blkif.h in the public headers, while Linux > does so in include/xen/blkif.h in the linux sources. But the result is > the same ... > > Successfully tested with the combinations: > > 64bit Dom0 32bit PAE PV guest > NetBSD Linux > Linux NetBSD > > The combinations 64bit Dom0, 64bit PV DomU works with and without this patch. > > Signed-off-by: Christoph Egger <Christoph.Egger@amd.com> >_______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Christoph Egger
2008-Jul-28 12:31 UTC
Re: [Xen-devel] [PATCH][XEN] PV blk backend: Make 32bit PV guests work on 64bit PV Dom0
On Monday 28 July 2008 14:23:00 Keir Fraser wrote:> Just do the same as we do in Linux and put these defs in your NetBSD > private header space.That sounds like "All OS''s have to go the Linux way" (which also includes Xen''s Minios (stubdom)) instead of "fix it once and for all". Christoph> > -- Keir > > On 28/7/08 12:46, "Christoph Egger" <Christoph.Egger@amd.com> wrote: > > Hi, > > > > Attached patch makes the PV block driver for 32bit PV guests working on > > 64bit PV Dom0. > > > > In the io/blkif.h, the ''id'' field of > > struct blkif_request is 64bit, but on a LP32 system it''s aligned on > > 32bits, while it''ll be aligned to 64bits on a LP64 system. So on LP64 > > there''ll be 4 bytes of padding between handle and id. The same is true > > for struct blkif_response: it''s 11 bytes long, so will be aligned > > differently in the ring between a 32 and 64bit systems. > > > > In order to fix this, attached patch introduces in the public headers, > > blkif_request/blkif_response, blkif_x86_32_request/blkif_x86_32_response > > and blkif_x86_64_request/blkif_x86_64_response. > > NetBSD is doing so io/blkif.h in the public headers, while Linux > > does so in include/xen/blkif.h in the linux sources. But the result is > > the same ... > > > > Successfully tested with the combinations: > > > > 64bit Dom0 32bit PAE PV guest > > NetBSD Linux > > Linux NetBSD > > > > The combinations 64bit Dom0, 64bit PV DomU works with and without this > > patch. > > > > Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>-- AMD Saxony, Dresden, Germany Operating System Research Center Legal Information: AMD Saxony Limited Liability Company & Co. KG Sitz (Geschäftsanschrift): Wilschdorfer Landstr. 101, 01109 Dresden, Deutschland Registergericht Dresden: HRA 4896 vertretungsberechtigter Komplementär: AMD Saxony LLC (Sitz Wilmington, Delaware, USA) Geschäftsführer der AMD Saxony LLC: Dr. Hans-R. Deppe, Thomas McCoy _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Keir Fraser
2008-Jul-28 12:36 UTC
Re: [Xen-devel] [PATCH][XEN] PV blk backend: Make 32bit PV guests work on 64bit PV Dom0
On 28/7/08 13:31, "Christoph Egger" <Christoph.Egger@amd.com> wrote:> On Monday 28 July 2008 14:23:00 Keir Fraser wrote: >> Just do the same as we do in Linux and put these defs in your NetBSD >> private header space. > > That sounds like "All OS''s have to go the Linux way" (which also includes > Xen''s Minios (stubdom)) instead of "fix it once and for all".Quite the opposite. By doing it in your own header files you can specify the structure names and so on exactly how you would like them to be for the particular OS concerned. -- Keir _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Christoph Egger
2008-Jul-28 12:52 UTC
Re: [Xen-devel] [PATCH][XEN] PV blk backend: Make 32bit PV guests work on 64bit PV Dom0
On Monday 28 July 2008 14:36:49 Keir Fraser wrote:> On 28/7/08 13:31, "Christoph Egger" <Christoph.Egger@amd.com> wrote: > > On Monday 28 July 2008 14:23:00 Keir Fraser wrote: > >> Just do the same as we do in Linux and put these defs in your NetBSD > >> private header space. > > > > That sounds like "All OS''s have to go the Linux way" (which also includes > > Xen''s Minios (stubdom)) instead of "fix it once and for all". > > Quite the opposite. By doing it in your own header files you can specify > the structure names and so on exactly how you would like them to be for the > particular OS concerned.I''m concerned about having/keeping the API/ABI the same between all OS''s and not about their implementation. Christoph -- AMD Saxony, Dresden, Germany Operating System Research Center Legal Information: AMD Saxony Limited Liability Company & Co. KG Sitz (Geschäftsanschrift): Wilschdorfer Landstr. 101, 01109 Dresden, Deutschland Registergericht Dresden: HRA 4896 vertretungsberechtigter Komplementär: AMD Saxony LLC (Sitz Wilmington, Delaware, USA) Geschäftsführer der AMD Saxony LLC: Dr. Hans-R. Deppe, Thomas McCoy _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Keir Fraser
2008-Jul-28 13:00 UTC
Re: [Xen-devel] [PATCH][XEN] PV blk backend: Make 32bit PV guests work on 64bit PV Dom0
On 28/7/08 13:52, "Christoph Egger" <Christoph.Egger@amd.com> wrote:>> Quite the opposite. By doing it in your own header files you can specify >> the structure names and so on exactly how you would like them to be for the >> particular OS concerned. > > I''m concerned about having/keeping the API/ABI the same between all OS''s and > not about their implementation.The interfaces (both the API exposed by public/ headers; and the ABI they describe) won''t change. At least not in a way that isn''t backward compatible. Or we''d be breaking old OSes all the time! -- Keir _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Keir Fraser
2008-Jul-28 13:04 UTC
Re: [Xen-devel] [PATCH][XEN] PV blk backend: Make 32bit PV guests work on 64bit PV Dom0
On 28/7/08 14:00, "Keir Fraser" <keir.fraser@eu.citrix.com> wrote:>>> Quite the opposite. By doing it in your own header files you can specify >>> the structure names and so on exactly how you would like them to be for the >>> particular OS concerned. >> >> I''m concerned about having/keeping the API/ABI the same between all OS''s and >> not about their implementation. > > The interfaces (both the API exposed by public/ headers; and the ABI they > describe) won''t change. At least not in a way that isn''t backward > compatible. Or we''d be breaking old OSes all the time!I might add: why would placing those extra struct definitions in the public headers make it any more or less likely that we''ll break compatibility in future? That makes no sense to me. -- Keir _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Christoph Egger
2008-Jul-28 13:08 UTC
Re: [Xen-devel] [PATCH][XEN] PV blk backend: Make 32bit PV guests work on 64bit PV Dom0
On Monday 28 July 2008 15:00:35 Keir Fraser wrote:> On 28/7/08 13:52, "Christoph Egger" <Christoph.Egger@amd.com> wrote: > >> Quite the opposite. By doing it in your own header files you can specify > >> the structure names and so on exactly how you would like them to be for > >> the particular OS concerned. > > > > I''m concerned about having/keeping the API/ABI the same between all OS''s > > and not about their implementation. > > The interfaces (both the API exposed by public/ headers; and the ABI they > describe) won''t change. At least not in a way that isn''t backward > compatible. Or we''d be breaking old OSes all the time!Haven''t those got broken with the removal of non-PAE support? :) Christoph -- AMD Saxony, Dresden, Germany Operating System Research Center Legal Information: AMD Saxony Limited Liability Company & Co. KG Sitz (Geschäftsanschrift): Wilschdorfer Landstr. 101, 01109 Dresden, Deutschland Registergericht Dresden: HRA 4896 vertretungsberechtigter Komplementär: AMD Saxony LLC (Sitz Wilmington, Delaware, USA) Geschäftsführer der AMD Saxony LLC: Dr. Hans-R. Deppe, Thomas McCoy _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel