* [PATCH 1/3] Do not use DEFINE_RWLOCK Macro
@ 2007-08-29 18:20 Ben Guthro
2007-08-29 18:37 ` Ian Campbell
0 siblings, 1 reply; 3+ messages in thread
From: Ben Guthro @ 2007-08-29 18:20 UTC (permalink / raw)
To: xen-devel
[-- Attachment #1: Type: text/plain, Size: 171 bytes --]
Do not use the DEFINE_RWLOCK macro, as it is not available when compiled
against
older kernels, such as SLES9's 2.6.5
Signed-off-by: Ben Guthro <bguthro@virtualron.com>
[-- Attachment #2: xen-legacy-reboot.patch --]
[-- Type: text/x-patch, Size: 733 bytes --]
diff -r ef25e071a074 unmodified_drivers/linux-2.6/platform-pci/machine_reboot.c
--- a/unmodified_drivers/linux-2.6/platform-pci/machine_reboot.c Wed Aug 29 13:38:54 2007 -0400
+++ b/unmodified_drivers/linux-2.6/platform-pci/machine_reboot.c Wed Aug 29 13:41:20 2007 -0400
@@ -15,8 +15,10 @@ struct ap_suspend_info {
/*
* Use a rwlock to protect the hypercall page from being executed in AP context
* while the BSP is re-initializing it after restore.
+ * Do not use the DEFINE_RWLOCK macro, as it is not available when compiled against
+ * older kernels
*/
-static DEFINE_RWLOCK(suspend_lock);
+static rwlock_t suspend_lock = RW_LOCK_UNLOCKED;
/*
* Spinning prevents, for example, APs touching grant table entries while
[-- 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] 3+ messages in thread
* Re: [PATCH 1/3] Do not use DEFINE_RWLOCK Macro
2007-08-29 18:20 [PATCH 1/3] Do not use DEFINE_RWLOCK Macro Ben Guthro
@ 2007-08-29 18:37 ` Ian Campbell
2007-08-29 20:31 ` Ben Guthro
0 siblings, 1 reply; 3+ messages in thread
From: Ian Campbell @ 2007-08-29 18:37 UTC (permalink / raw)
To: Ben Guthro; +Cc: xen-devel
On Wed, 2007-08-29 at 14:20 -0400, Ben Guthro wrote:
> Do not use the DEFINE_RWLOCK macro, as it is not available when compiled
> against older kernels, such as SLES9's 2.6.5
Things like this should generally be done by adding a suitably guarded
definition of DEFINE_RWLOCK to the platform-compat.h header in
unmodified_drivers/linux-2.6/compat-include/xen/platform-compat.h.
Ian.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH 1/3] Do not use DEFINE_RWLOCK Macro
2007-08-29 18:37 ` Ian Campbell
@ 2007-08-29 20:31 ` Ben Guthro
0 siblings, 0 replies; 3+ messages in thread
From: Ben Guthro @ 2007-08-29 20:31 UTC (permalink / raw)
To: Ian Campbell; +Cc: xen-devel
[-- Attachment #1: Type: text/plain, Size: 719 bytes --]
Revised patch attached.
Note that I did run into a problem with a buggy kernel in RHEL4-U3.
It seems that in this macro, rw_lock_t was used instead of rwlock_t. I
added a line to platform-compat.h to account for this.
Ben
Signed-off-by: Ben Guthro <bguthro@virtualiron.com>
Ian Campbell wrote:
> On Wed, 2007-08-29 at 14:20 -0400, Ben Guthro wrote:
>
>> Do not use the DEFINE_RWLOCK macro, as it is not available when compiled
>> against older kernels, such as SLES9's 2.6.5
>>
>
> Things like this should generally be done by adding a suitably guarded
> definition of DEFINE_RWLOCK to the platform-compat.h header in
> unmodified_drivers/linux-2.6/compat-include/xen/platform-compat.h.
>
> Ian.
>
>
[-- Attachment #2: xen-legacy-reboot.patch --]
[-- Type: text/x-patch, Size: 723 bytes --]
diff -r a381118a247a unmodified_drivers/linux-2.6/compat-include/xen/platform-compat.h
--- a/unmodified_drivers/linux-2.6/compat-include/xen/platform-compat.h Wed Aug 29 15:30:40 2007 -0400
+++ b/unmodified_drivers/linux-2.6/compat-include/xen/platform-compat.h Wed Aug 29 16:26:33 2007 -0400
@@ -116,4 +116,13 @@ extern char *kasprintf(gfp_t gfp, const
#define DEFINE_SEQLOCK(x) seqlock_t x = SEQLOCK_UNLOCKED
#endif
+#if defined(__LINUX_SPINLOCK_H) && !defined(DEFINE_RWLOCK)
+#define DEFINE_RWLOCK(x) rwlock_t x = RW_LOCK_UNLOCKED
#endif
+
+/* Bug in RHEL4-U3 rw_lock_t is mistakenly defined in this macro */
+#if defined(__LINUX_SPINLOCK_H) && defined(DEFINE_RWLOCK)
+#define rw_lock_t rwlock_t
+#endif
+
+#endif
[-- 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] 3+ messages in thread
end of thread, other threads:[~2007-08-29 20:31 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-08-29 18:20 [PATCH 1/3] Do not use DEFINE_RWLOCK Macro Ben Guthro
2007-08-29 18:37 ` Ian Campbell
2007-08-29 20:31 ` Ben Guthro
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.