* [PATCH] xen: make (set|get)_xen_guest_handle available
@ 2009-07-30 9:12 Christoph Egger
2009-07-30 10:06 ` Keir Fraser
2009-07-30 10:14 ` Keir Fraser
0 siblings, 2 replies; 9+ messages in thread
From: Christoph Egger @ 2009-07-30 9:12 UTC (permalink / raw)
To: xen-devel
[-- Attachment #1: Type: text/plain, Size: 727 bytes --]
Hi!
Make (set|get)_xen_guest_handle() always available.
This avoids code snippets in the guest like this:
#if __XEN_ITNERFACE_VERSION__ >= 0x00030201
set_xen_guest_handle(hnd, val);
#else
hnd = val;
#endif
Also make get_xen_guest_handle() available for the guest.
It is useful for the guest, too.
Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
P.S.: Keir: Please apply this patch also in xen-3.4-testing and
xen-3.3-testing tree.
--
---to satisfy European Law for business letters:
Advanced Micro Devices GmbH
Karl-Hammerschmidt-Str. 34, 85609 Dornach b. Muenchen
Geschaeftsfuehrer: Thomas M. McCoy, Giuliano Meroni
Sitz: Dornach, Gemeinde Aschheim, Landkreis Muenchen
Registergericht Muenchen, HRB Nr. 43632
[-- Attachment #2: xen_public.diff --]
[-- Type: text/x-diff, Size: 787 bytes --]
diff -r 41b2c4e4f674 xen/include/public/arch-x86/xen.h
--- a/xen/include/public/arch-x86/xen.h Wed Jul 29 09:20:46 2009 +0100
+++ b/xen/include/public/arch-x86/xen.h Thu Jul 30 11:08:01 2009 +0200
@@ -44,9 +44,13 @@
#define DEFINE_XEN_GUEST_HANDLE(name) __DEFINE_XEN_GUEST_HANDLE(name, name)
#define __XEN_GUEST_HANDLE(name) __guest_handle_ ## name
#define XEN_GUEST_HANDLE(name) __XEN_GUEST_HANDLE(name)
+
+#if __XEN_INTERFACE_VERSION__ >= 0x00030201
#define set_xen_guest_handle(hnd, val) do { (hnd).p = val; } while (0)
-#ifdef __XEN_TOOLS__
#define get_xen_guest_handle(val, hnd) do { val = (hnd).p; } while (0)
+#else
+#define set_xen_guest_handle(hnd, val) (hnd) = val
+#define get_xen_guest_handle(val, hnd) val = (hnd)
#endif
#if defined(__i386__)
[-- Attachment #3: Type: text/plain, Size: 138 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel
^ permalink raw reply [flat|nested] 9+ messages in thread* Re: [PATCH] xen: make (set|get)_xen_guest_handle available 2009-07-30 9:12 [PATCH] xen: make (set|get)_xen_guest_handle available Christoph Egger @ 2009-07-30 10:06 ` Keir Fraser 2009-07-30 10:14 ` Keir Fraser 1 sibling, 0 replies; 9+ messages in thread From: Keir Fraser @ 2009-07-30 10:06 UTC (permalink / raw) To: Christoph Egger, xen-devel@lists.xensource.com On 30/07/2009 10:12, "Christoph Egger" <Christoph.Egger@amd.com> wrote: > P.S.: Keir: Please apply this patch also in xen-3.4-testing and > xen-3.3-testing tree. No more nice-to-have backports. The trees are closed to ship next week. -- Keir ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] xen: make (set|get)_xen_guest_handle available 2009-07-30 9:12 [PATCH] xen: make (set|get)_xen_guest_handle available Christoph Egger 2009-07-30 10:06 ` Keir Fraser @ 2009-07-30 10:14 ` Keir Fraser 2009-07-30 10:34 ` Christoph Egger 1 sibling, 1 reply; 9+ messages in thread From: Keir Fraser @ 2009-07-30 10:14 UTC (permalink / raw) To: Christoph Egger, xen-devel@lists.xensource.com On 30/07/2009 10:12, "Christoph Egger" <Christoph.Egger@amd.com> wrote: > Make (set|get)_xen_guest_handle() always available. > This avoids code snippets in the guest like this: > > #if __XEN_ITNERFACE_VERSION__ >= 0x00030201 > set_xen_guest_handle(hnd, val); > #else > hnd = val; > #endif Actually I don't see why you'd have code like this. *You*, the guest, gets to specify __XEN_INTERFACE_VERSION__ -- that is the point of it -- so ifdef'ing based on it in the guest is stupid. Just specify __XEN_INTERFACE_VERSION__ to be recent enough to have the guest handles, and then remove your ifdefs. Simple. -- Keir ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] xen: make (set|get)_xen_guest_handle available 2009-07-30 10:14 ` Keir Fraser @ 2009-07-30 10:34 ` Christoph Egger 2009-07-30 11:16 ` Boris Derzhavets 2009-07-30 13:24 ` Keir Fraser 0 siblings, 2 replies; 9+ messages in thread From: Christoph Egger @ 2009-07-30 10:34 UTC (permalink / raw) To: Keir Fraser; +Cc: xen-devel@lists.xensource.com On Thursday 30 July 2009 12:14:04 Keir Fraser wrote: > On 30/07/2009 10:12, "Christoph Egger" <Christoph.Egger@amd.com> wrote: > > Make (set|get)_xen_guest_handle() always available. > > This avoids code snippets in the guest like this: > > > > #if __XEN_ITNERFACE_VERSION__ >= 0x00030201 > > set_xen_guest_handle(hnd, val); > > #else > > hnd = val; > > #endif > > Actually I don't see why you'd have code like this. *You*, the guest, gets > to specify __XEN_INTERFACE_VERSION__ -- that is the point of it -- so > ifdef'ing based on it in the guest is stupid. > > Just specify __XEN_INTERFACE_VERSION__ to be recent enough to have the > guest handles, and then remove your ifdefs. Simple. The point is to keep backward compatibility. The patch makes Xen more friendly with using the old non-structured guest handler if the user wants. NetBSD offers both way to build & run it with either using the old or new interface. This allows a smooth migration. Christoph -- ---to satisfy European Law for business letters: Advanced Micro Devices GmbH Karl-Hammerschmidt-Str. 34, 85609 Dornach b. Muenchen Geschaeftsfuehrer: Thomas M. McCoy, Giuliano Meroni Sitz: Dornach, Gemeinde Aschheim, Landkreis Muenchen Registergericht Muenchen, HRB Nr. 43632 ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] xen: make (set|get)_xen_guest_handle available 2009-07-30 10:34 ` Christoph Egger @ 2009-07-30 11:16 ` Boris Derzhavets 2009-07-30 11:55 ` Christoph Egger 2009-07-30 13:24 ` Keir Fraser 1 sibling, 1 reply; 9+ messages in thread From: Boris Derzhavets @ 2009-07-30 11:16 UTC (permalink / raw) To: Keir Fraser, Christoph Egger; +Cc: xen-devel@lists.xensource.com [-- Attachment #1.1: Type: text/plain, Size: 1836 bytes --] May the recent version of NetBSD run as PV guest ? Sorry, for stupid question. Boris. --- On Thu, 7/30/09, Christoph Egger <Christoph.Egger@amd.com> wrote: From: Christoph Egger <Christoph.Egger@amd.com> Subject: Re: [Xen-devel] [PATCH] xen: make (set|get)_xen_guest_handle available To: "Keir Fraser" <keir.fraser@eu.citrix.com> Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com> Date: Thursday, July 30, 2009, 6:34 AM On Thursday 30 July 2009 12:14:04 Keir Fraser wrote: > On 30/07/2009 10:12, "Christoph Egger" <Christoph.Egger@amd.com> wrote: > > Make (set|get)_xen_guest_handle() always available. > > This avoids code snippets in the guest like this: > > > > #if __XEN_ITNERFACE_VERSION__ >= 0x00030201 > > set_xen_guest_handle(hnd, val); > > #else > > hnd = val; > > #endif > > Actually I don't see why you'd have code like this. *You*, the guest, gets > to specify __XEN_INTERFACE_VERSION__ -- that is the point of it -- so > ifdef'ing based on it in the guest is stupid. > > Just specify __XEN_INTERFACE_VERSION__ to be recent enough to have the > guest handles, and then remove your ifdefs. Simple. The point is to keep backward compatibility. The patch makes Xen more friendly with using the old non-structured guest handler if the user wants. NetBSD offers both way to build & run it with either using the old or new interface. This allows a smooth migration. Christoph -- ---to satisfy European Law for business letters: Advanced Micro Devices GmbH Karl-Hammerschmidt-Str. 34, 85609 Dornach b. Muenchen Geschaeftsfuehrer: Thomas M. McCoy, Giuliano Meroni Sitz: Dornach, Gemeinde Aschheim, Landkreis Muenchen Registergericht Muenchen, HRB Nr. 43632 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel [-- Attachment #1.2: Type: text/html, Size: 2644 bytes --] [-- Attachment #2: Type: text/plain, Size: 138 bytes --] _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] xen: make (set|get)_xen_guest_handle available 2009-07-30 11:16 ` Boris Derzhavets @ 2009-07-30 11:55 ` Christoph Egger 2009-07-30 12:41 ` Boris Derzhavets 0 siblings, 1 reply; 9+ messages in thread From: Christoph Egger @ 2009-07-30 11:55 UTC (permalink / raw) To: Boris Derzhavets; +Cc: xen-devel@lists.xensource.com, Keir Fraser Hi Boris, this is the history: NetBSD 2.0 got Xen 1.2 support (both Dom0 and DomU) NetBSD 3.0 got Xen 2 support, dropped Xen 1.2 support (both Dom0 and DomU) NetBSD 4.0 got Xen 3.0/3.1 support 32bit only, kept Xen 2 support (both Dom0 and DomU) NetBSD 5.0 got Xen 3.x support (both 32bit and 64bit), kept Xen 2 support (both Dom0 and DomU) NetBSD-current dropped Xen 2 support, about to move to new interface. Christoph On Thursday 30 July 2009 13:16:00 Boris Derzhavets wrote: > May the recent version of NetBSD run as PV guest ? > Sorry, for stupid question. > Boris. > > --- On Thu, 7/30/09, Christoph Egger <Christoph.Egger@amd.com> wrote: > > From: Christoph Egger <Christoph.Egger@amd.com> > Subject: Re: [Xen-devel] [PATCH] xen: make (set|get)_xen_guest_handle > available To: "Keir Fraser" <keir.fraser@eu.citrix.com> > Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com> > Date: Thursday, July 30, 2009, 6:34 AM > > On Thursday 30 July 2009 12:14:04 Keir Fraser wrote: > > On 30/07/2009 10:12, "Christoph Egger" <Christoph.Egger@amd.com> wrote: > > > Make (set|get)_xen_guest_handle() always available. > > > This avoids code snippets in the guest like this: > > > > > > #if __XEN_ITNERFACE_VERSION__ >= 0x00030201 > > > set_xen_guest_handle(hnd, val); > > > #else > > > hnd = val; > > > #endif > > > > Actually I don't see why you'd have code like this. *You*, the guest, > > gets to specify __XEN_INTERFACE_VERSION__ -- that is the point of it -- > > so ifdef'ing based on it in the guest is stupid. > > > > Just specify __XEN_INTERFACE_VERSION__ to be recent enough to have the > > guest handles, and then remove your ifdefs. Simple. > > The point is to keep backward compatibility. The patch makes Xen more > friendly with using the old non-structured guest handler if the user wants. > > NetBSD offers both way to build & run it with either using the old or new > interface. This allows a smooth migration. > > Christoph -- ---to satisfy European Law for business letters: Advanced Micro Devices GmbH Karl-Hammerschmidt-Str. 34, 85609 Dornach b. Muenchen Geschaeftsfuehrer: Thomas M. McCoy, Giuliano Meroni Sitz: Dornach, Gemeinde Aschheim, Landkreis Muenchen Registergericht Muenchen, HRB Nr. 43632 ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] xen: make (set|get)_xen_guest_handle available 2009-07-30 11:55 ` Christoph Egger @ 2009-07-30 12:41 ` Boris Derzhavets 2009-07-30 12:53 ` Christoph Egger 0 siblings, 1 reply; 9+ messages in thread From: Boris Derzhavets @ 2009-07-30 12:41 UTC (permalink / raw) To: Christoph Egger; +Cc: xen-devel@lists.xensource.com, Keir Fraser [-- Attachment #1.1: Type: text/plain, Size: 3337 bytes --] Hi Christoph, > NetBSD 5.0 got Xen 3.x support (both 32bit and 64bit), kept Xen 2 support Sounds a bit strange for me. Like only 3.X Xen Hypervisor could be connected via hypercalls from NetBSD 5.0 DomU xenified kernel. ( For instance Solaris Nevada until build 84(5) ( or so) required patch to work with Xen 3.2 and higher Linux Dom0 ) Would NetBSD 5.0 understand Xen 3.4.1 Dom0 on top of Ubuntu 9.04 or F11 (64-bit environment) ? Thanks. Boris. --- On Thu, 7/30/09, Christoph Egger <Christoph.Egger@amd.com> wrote: From: Christoph Egger <Christoph.Egger@amd.com> Subject: Re: [Xen-devel] [PATCH] xen: make (set|get)_xen_guest_handle available To: "Boris Derzhavets" <bderzhavets@yahoo.com> Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>, "Keir Fraser" <keir.fraser@eu.citrix.com> Date: Thursday, July 30, 2009, 7:55 AM Hi Boris, this is the history: NetBSD 2.0 got Xen 1.2 support (both Dom0 and DomU) NetBSD 3.0 got Xen 2 support, dropped Xen 1.2 support (both Dom0 and DomU) NetBSD 4.0 got Xen 3.0/3.1 support 32bit only, kept Xen 2 support (both Dom0 and DomU) NetBSD 5.0 got Xen 3.x support (both 32bit and 64bit), kept Xen 2 support (both Dom0 and DomU) NetBSD-current dropped Xen 2 support, about to move to new interface. Christoph On Thursday 30 July 2009 13:16:00 Boris Derzhavets wrote: > May the recent version of NetBSD run as PV guest ? > Sorry, for stupid question. > Boris. > > --- On Thu, 7/30/09, Christoph Egger <Christoph.Egger@amd.com> wrote: > > From: Christoph Egger <Christoph.Egger@amd.com> > Subject: Re: [Xen-devel] [PATCH] xen: make (set|get)_xen_guest_handle > available To: "Keir Fraser" <keir.fraser@eu.citrix.com> > Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com> > Date: Thursday, July 30, 2009, 6:34 AM > > On Thursday 30 July 2009 12:14:04 Keir Fraser wrote: > > On 30/07/2009 10:12, "Christoph Egger" <Christoph.Egger@amd.com> wrote: > > > Make (set|get)_xen_guest_handle() always available. > > > This avoids code snippets in the guest like this: > > > > > > #if __XEN_ITNERFACE_VERSION__ >= 0x00030201 > > > set_xen_guest_handle(hnd, val); > > > #else > > > hnd = val; > > > #endif > > > > Actually I don't see why you'd have code like this. *You*, the guest, > > gets to specify __XEN_INTERFACE_VERSION__ -- that is the point of it -- > > so ifdef'ing based on it in the guest is stupid. > > > > Just specify __XEN_INTERFACE_VERSION__ to be recent enough to have the > > guest handles, and then remove your ifdefs. Simple. > > The point is to keep backward compatibility. The patch makes Xen more > friendly with using the old non-structured guest handler if the user wants. > > NetBSD offers both way to build & run it with either using the old or new > interface. This allows a smooth migration. > > Christoph -- ---to satisfy European Law for business letters: Advanced Micro Devices GmbH Karl-Hammerschmidt-Str. 34, 85609 Dornach b. Muenchen Geschaeftsfuehrer: Thomas M. McCoy, Giuliano Meroni Sitz: Dornach, Gemeinde Aschheim, Landkreis Muenchen Registergericht Muenchen, HRB Nr. 43632 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel [-- Attachment #1.2: Type: text/html, Size: 4829 bytes --] [-- Attachment #2: Type: text/plain, Size: 138 bytes --] _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] xen: make (set|get)_xen_guest_handle available 2009-07-30 12:41 ` Boris Derzhavets @ 2009-07-30 12:53 ` Christoph Egger 0 siblings, 0 replies; 9+ messages in thread From: Christoph Egger @ 2009-07-30 12:53 UTC (permalink / raw) To: Boris Derzhavets; +Cc: xen-devel@lists.xensource.com, Keir Fraser On Thursday 30 July 2009 14:41:33 Boris Derzhavets wrote: > Hi Christoph, > > > NetBSD 5.0 got Xen 3.x support (both 32bit and 64bit), kept Xen 2 support > > Sounds a bit strange for me. Like only 3.X Xen Hypervisor could be > connected via hypercalls from NetBSD 5.0 DomU xenified kernel. ( For > instance Solaris Nevada until build 84(5) ( or so) required patch to work > with Xen 3.2 and higher Linux Dom0 ) Patches for NetBSD are maintained in NetBSD's package management (likewise Gentoo or Debian have their own patches in their packages). Most of them break non-NetBSD totally, that's why I can't just submit them at once. xen-unstable is in a very good shape though. patch queue is very small now. > Would NetBSD 5.0 understand Xen 3.4.1 Dom0 on top > of Ubuntu 9.04 or F11 (64-bit environment) ? Yes. > > Thanks. > Boris. > > --- On Thu, 7/30/09, Christoph Egger <Christoph.Egger@amd.com> wrote: > > From: Christoph Egger <Christoph.Egger@amd.com> > Subject: Re: [Xen-devel] [PATCH] xen: make (set|get)_xen_guest_handle > available To: "Boris Derzhavets" <bderzhavets@yahoo.com> > Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>, "Keir > Fraser" <keir.fraser@eu.citrix.com> Date: Thursday, July 30, 2009, 7:55 AM > > > Hi Boris, > > this is the history: > > NetBSD 2.0 got Xen 1.2 support (both Dom0 and DomU) > NetBSD 3.0 got Xen 2 support, dropped Xen 1.2 support (both Dom0 and DomU) > NetBSD 4.0 got Xen 3.0/3.1 support 32bit only, kept Xen 2 support (both > Dom0 and DomU) > NetBSD 5.0 got Xen 3.x support (both 32bit and 64bit), kept Xen 2 support > (both Dom0 and DomU) > NetBSD-current dropped Xen 2 support, about to move to new interface. > > Christoph > > On Thursday 30 July 2009 13:16:00 Boris Derzhavets wrote: > > May the recent version of NetBSD run as PV guest ? > > Sorry, for stupid question. > > Boris. > > > > --- On Thu, 7/30/09, Christoph Egger <Christoph.Egger@amd.com> wrote: > > > > From: Christoph Egger <Christoph.Egger@amd.com> > > Subject: Re: [Xen-devel] [PATCH] xen: make (set|get)_xen_guest_handle > > available To: "Keir Fraser" <keir.fraser@eu.citrix.com> > > Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com> > > Date: Thursday, July 30, 2009, 6:34 AM > > > > On Thursday 30 July 2009 12:14:04 Keir Fraser wrote: > > > On 30/07/2009 10:12, "Christoph Egger" <Christoph.Egger@amd.com> wrote: > > > > Make (set|get)_xen_guest_handle() always available. > > > > This avoids code snippets in the guest like this: > > > > > > > > #if __XEN_ITNERFACE_VERSION__ >= 0x00030201 > > > > set_xen_guest_handle(hnd, val); > > > > #else > > > > hnd = val; > > > > #endif > > > > > > Actually I don't see why you'd have code like this. *You*, the guest, > > > gets to specify __XEN_INTERFACE_VERSION__ -- that is the point of it -- > > > so ifdef'ing based on it in the guest is stupid. > > > > > > Just specify __XEN_INTERFACE_VERSION__ to be recent enough to have the > > > guest handles, and then remove your ifdefs. Simple. > > > > The point is to keep backward compatibility. The patch makes Xen more > > friendly with using the old non-structured guest handler if the user > > wants. > > > > NetBSD offers both way to build & run it with either using the old or new > > interface. This allows a smooth migration. > > > > Christoph -- ---to satisfy European Law for business letters: Advanced Micro Devices GmbH Karl-Hammerschmidt-Str. 34, 85609 Dornach b. Muenchen Geschaeftsfuehrer: Thomas M. McCoy, Giuliano Meroni Sitz: Dornach, Gemeinde Aschheim, Landkreis Muenchen Registergericht Muenchen, HRB Nr. 43632 ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] xen: make (set|get)_xen_guest_handle available 2009-07-30 10:34 ` Christoph Egger 2009-07-30 11:16 ` Boris Derzhavets @ 2009-07-30 13:24 ` Keir Fraser 1 sibling, 0 replies; 9+ messages in thread From: Keir Fraser @ 2009-07-30 13:24 UTC (permalink / raw) To: Christoph Egger; +Cc: xen-devel@lists.xensource.com On 30/07/2009 11:34, "Christoph Egger" <Christoph.Egger@amd.com> wrote: >> Actually I don't see why you'd have code like this. *You*, the guest, gets >> to specify __XEN_INTERFACE_VERSION__ -- that is the point of it -- so >> ifdef'ing based on it in the guest is stupid. >> >> Just specify __XEN_INTERFACE_VERSION__ to be recent enough to have the >> guest handles, and then remove your ifdefs. Simple. > > The point is to keep backward compatibility. The patch makes Xen more friendly > with using the old non-structured guest handler if the user wants. > > NetBSD offers both way to build & run it with either using the old or new > interface. This allows a smooth migration. Am I going to regret asking: Why? You only need to pick one API version (__XEN_INTERFACE_VERSION__) -- the resulting binaries will work with any Xen 3.x (since we guarantee ABI compatibility). -- Keir ^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2009-07-30 13:24 UTC | newest] Thread overview: 9+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2009-07-30 9:12 [PATCH] xen: make (set|get)_xen_guest_handle available Christoph Egger 2009-07-30 10:06 ` Keir Fraser 2009-07-30 10:14 ` Keir Fraser 2009-07-30 10:34 ` Christoph Egger 2009-07-30 11:16 ` Boris Derzhavets 2009-07-30 11:55 ` Christoph Egger 2009-07-30 12:41 ` Boris Derzhavets 2009-07-30 12:53 ` Christoph Egger 2009-07-30 13:24 ` Keir Fraser
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.