* [PATCH] patch's for vmware 2.0.4 for use with linux-2.4.8 kernel
@ 2001-08-16 8:49 Jason Thomas
0 siblings, 0 replies; 2+ messages in thread
From: Jason Thomas @ 2001-08-16 8:49 UTC (permalink / raw)
To: linux-kernel
[-- Attachment #1.1: Type: text/plain, Size: 466 bytes --]
attached are two very small patches for those that want them. they make
vmware's kernel modules compile with 2.4.8. Its not all my work, its a
combination of what was posted a while back and my work.
--
Jason Thomas Phone: +61 2 6257 7111
System Administrator - UID 0 Fax: +61 2 6257 7311
tSA Consulting Group Pty. Ltd. Mobile: 0418 29 66 81
1 Hall Street Lyneham ACT 2602 http://www.topic.com.au/
[-- Attachment #1.2: vmnet-only-2.4.8.patch --]
[-- Type: text/plain, Size: 4633 bytes --]
diff -ru vmnet-only.orig/bridge.c vmnet-only/bridge.c
--- vmnet-only.orig/bridge.c Thu May 10 11:33:58 2001
+++ vmnet-only/bridge.c Thu Aug 16 17:33:07 2001
@@ -19,7 +19,7 @@
#include <linux/kernel.h>
#include <linux/version.h>
#include <linux/sched.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
#ifdef KERNEL_2_1
#include <linux/poll.h>
#include <asm/uaccess.h>
@@ -44,7 +44,7 @@
#include "vnetInt.h"
-#define VNET_BRIDGE_HISTORY 8
+#define VNET_BRIDGE_HISTORY 48
typedef struct VNetBridge VNetBridge;
@@ -58,6 +58,7 @@
Bool savedPromisc;
struct sk_buff *history[VNET_BRIDGE_HISTORY];
VNetPort port;
+ spinlock_t historyLock;
};
@@ -130,6 +131,7 @@
goto out;
}
memset(bridge, 0, sizeof *bridge);
+ spin_lock_init(&bridge->historyLock);
memcpy(bridge->name, devName, sizeof bridge->name);
/*
@@ -391,6 +393,8 @@
unsigned long flags;
int i;
SKB_INCREF(clone);
+
+ spin_lock_irqsave(&bridge->historyLock, flags);
// XXX need to lock history
for (i = 0; i < VNET_BRIDGE_HISTORY; i++) {
if (bridge->history[i] == NULL) {
@@ -417,11 +421,15 @@
for (i = 0; i < VNET_BRIDGE_HISTORY; i++) {
struct sk_buff *s = bridge->history[i];
bridge->history[i] = NULL;
- KFREE_SKB(s, FREE_WRITE);
+ if (s) {
+ spin_unlock_irqrestore(&bridge->historyLock, flags);
+ KFREE_SKB(s, FREE_WRITE);
+ spin_lock_irqsave(&bridge->historyLock, flags);
+ }
}
bridge->history[0] = clone;
}
-
+ spin_unlock_irqrestore(&bridge->historyLock, flags);
clone->dev = dev;
clone->protocol = eth_type_trans(clone, dev);
save_flags(flags);
@@ -773,6 +781,7 @@
{
VNetBridge *bridge = *(VNetBridge**)&((struct sock *)pt->data)->protinfo;
int i;
+ unsigned long flags;
if (bridge->dev == NULL) {
LOG(3, (KERN_DEBUG "bridge-%s: received %d closed\n",
@@ -782,11 +791,13 @@
}
// XXX need to lock history
+ spin_lock_irqsave(&bridge->historyLock, flags);
for (i = 0; i < VNET_BRIDGE_HISTORY; i++) {
struct sk_buff *s = bridge->history[i];
if (s != NULL &&
(s == skb || SKB_IS_CLONE_OF(skb, s))) {
bridge->history[i] = NULL;
+ spin_unlock_irqrestore(&bridge->historyLock, flags);
KFREE_SKB(s, FREE_WRITE);
LOG(3, (KERN_DEBUG "bridge-%s: receive %d self %d\n",
bridge->name, (int) skb->len, i));
@@ -795,6 +806,7 @@
return 0;
}
}
+ spin_unlock_irqrestore(&bridge->historyLock, flags);
# if LOGLEVEL >= 4
{
diff -ru vmnet-only.orig/driver.c vmnet-only/driver.c
--- vmnet-only.orig/driver.c Thu May 10 11:33:58 2001
+++ vmnet-only/driver.c Thu Aug 16 17:33:13 2001
@@ -20,7 +20,7 @@
#include <linux/module.h>
#include <linux/version.h>
#include <linux/sched.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
#ifdef KERNEL_2_1
#include <linux/poll.h>
#include <asm/uaccess.h>
diff -ru vmnet-only.orig/hub.c vmnet-only/hub.c
--- vmnet-only.orig/hub.c Thu May 10 11:33:58 2001
+++ vmnet-only/hub.c Thu Aug 16 17:33:57 2001
@@ -19,7 +19,7 @@
#include <linux/kernel.h>
#include <linux/version.h>
#include <linux/sched.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
#ifdef KERNEL_2_1
#include <linux/poll.h>
#include <asm/uaccess.h>
diff -ru vmnet-only.orig/netif.c vmnet-only/netif.c
--- vmnet-only.orig/netif.c Thu May 10 11:33:58 2001
+++ vmnet-only/netif.c Thu Aug 16 17:33:21 2001
@@ -19,7 +19,7 @@
#include <linux/kernel.h>
#include <linux/version.h>
#include <linux/sched.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
#ifdef KERNEL_2_1
#include <linux/poll.h>
#include <asm/uaccess.h>
diff -ru vmnet-only.orig/procfs.c vmnet-only/procfs.c
--- vmnet-only.orig/procfs.c Thu May 10 11:33:58 2001
+++ vmnet-only/procfs.c Thu Aug 16 17:33:27 2001
@@ -19,7 +19,7 @@
#include <linux/kernel.h>
#include <linux/version.h>
#include <linux/sched.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
#ifdef KERNEL_2_1
#include <linux/poll.h>
#include <asm/uaccess.h>
diff -ru vmnet-only.orig/userif.c vmnet-only/userif.c
--- vmnet-only.orig/userif.c Thu May 10 11:33:58 2001
+++ vmnet-only/userif.c Thu Aug 16 17:33:33 2001
@@ -19,7 +19,7 @@
#include <linux/kernel.h>
#include <linux/version.h>
#include <linux/sched.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
#ifdef KERNEL_2_1
#include <linux/poll.h>
#include <asm/uaccess.h>
[-- Attachment #1.3: vmmon-only-2.4.8.patch --]
[-- Type: text/plain, Size: 1126 bytes --]
diff -ru vmmon-only.orig/linux/driver.c vmmon-only/linux/driver.c
--- vmmon-only.orig/linux/driver.c Thu May 10 11:33:58 2001
+++ vmmon-only/linux/driver.c Thu Aug 16 17:55:29 2001
@@ -9,6 +9,7 @@
#endif
#include "driver-config.h"
+#include "hostif.h"
#ifdef KERNEL_2_1
#define EXPORT_SYMTAB
@@ -19,7 +20,7 @@
#include <linux/module.h>
#include <linux/version.h>
#include <linux/sched.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
#ifdef __SMP__
#include <linux/smp.h>
@@ -925,7 +926,7 @@
current->fsuid == current->uid &&
current->egid == current->gid &&
current->fsgid == current->gid) {
- current->dumpable = 1;
+ current->mm->dumpable = 1;
}
break;
diff -ru vmmon-only.orig/linux/hostif.c vmmon-only/linux/hostif.c
--- vmmon-only.orig/linux/hostif.c Thu May 10 11:33:58 2001
+++ vmmon-only/linux/hostif.c Thu Aug 16 17:35:37 2001
@@ -22,7 +22,7 @@
#include <linux/binfmts.h>
#include <linux/fs.h>
#include <linux/mm.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
#ifdef KERNEL_2_1
# ifdef KERNEL_2_3_25
[-- Attachment #2: Type: application/pgp-signature, Size: 232 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] patch's for vmware 2.0.4 for use with linux-2.4.8 kernel
@ 2001-08-17 13:12 Martin Knoblauch
0 siblings, 0 replies; 2+ messages in thread
From: Martin Knoblauch @ 2001-08-17 13:12 UTC (permalink / raw)
To: jason, linux-kernel@vger.kernel.org
[-- Attachment #1: Type: text/plain, Size: 846 bytes --]
> [PATCH] patch's for vmware 2.0.4 for use with linux-2.4.8 kernel
>
> From: Jason Thomas (jason@topic.com.au)
> Date: Thu Aug 16 2001 - 03:49:38 EST
>
>
> attached are two very small patches for those that want them. they make
> vmware's kernel modules compile with 2.4.8. Its not all my work, its a
> combination of what was posted a while back and my work.
>
Jason,
a small gotcha in your vmmon patch. You moved up hostif.h in driver.c,
but you forgot to remove the original include. See my attached new
version of the patch.
Martin
--
------------------------------------------------------------------
Martin Knoblauch | email: Martin.Knoblauch@TeraPort.de
TeraPort GmbH | Phone: +49-89-510857-309
C+ITS | Fax: +49-89-510857-111
http://www.teraport.de | Mobile: +49-170-4904759
[-- Attachment #2: vmmon-248.patch --]
[-- Type: text/plain, Size: 1255 bytes --]
diff -ur vmmon-only.orig/linux/driver.c vmmon-only/linux/driver.c
--- vmmon-only.orig/linux/driver.c Thu May 10 03:46:42 2001
+++ vmmon-only/linux/driver.c Fri Aug 17 14:03:30 2001
@@ -9,6 +9,7 @@
#endif
#include "driver-config.h"
+#include "hostif.h"
#ifdef KERNEL_2_1
#define EXPORT_SYMTAB
@@ -19,7 +20,7 @@
#include <linux/module.h>
#include <linux/version.h>
#include <linux/sched.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
#ifdef __SMP__
#include <linux/smp.h>
@@ -54,7 +55,6 @@
#include "vmx86.h"
#include "initblock.h"
#include "task.h"
-#include "hostif.h"
#include "driver.h"
#include "speaker_reg.h"
#include "vtrace.h"
@@ -925,7 +925,7 @@
current->fsuid == current->uid &&
current->egid == current->gid &&
current->fsgid == current->gid) {
- current->dumpable = 1;
+ current->mm->dumpable = 1;
}
break;
diff -ur vmmon-only.orig/linux/hostif.c vmmon-only/linux/hostif.c
--- vmmon-only.orig/linux/hostif.c Thu May 10 03:46:42 2001
+++ vmmon-only/linux/hostif.c Fri Aug 17 11:11:00 2001
@@ -22,7 +22,7 @@
#include <linux/binfmts.h>
#include <linux/fs.h>
#include <linux/mm.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
#ifdef KERNEL_2_1
# ifdef KERNEL_2_3_25
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2001-08-17 13:12 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-08-16 8:49 [PATCH] patch's for vmware 2.0.4 for use with linux-2.4.8 kernel Jason Thomas
-- strict thread matches above, loose matches on Subject: below --
2001-08-17 13:12 Martin Knoblauch
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox