diff options
author | Vadim Kuznetsov <vadimk@gentoo.org> | 2009-09-22 17:56:22 +0000 |
---|---|---|
committer | Vadim Kuznetsov <vadimk@gentoo.org> | 2009-09-22 17:56:22 +0000 |
commit | a21b406a28b25c6fb635482765119ff73c80474d (patch) | |
tree | ca43c981c2f7f9732467108bdecde7e507678d43 /app-emulation | |
parent | Version bump (diff) | |
download | gentoo-2-a21b406a28b25c6fb635482765119ff73c80474d.tar.gz gentoo-2-a21b406a28b25c6fb635482765119ff73c80474d.tar.bz2 gentoo-2-a21b406a28b25c6fb635482765119ff73c80474d.zip |
vmnet patch for 2.6.31 kernel. Bug 274173, comment 15.
(Portage version: 2.2_rc41/cvs/Linux x86_64)
Diffstat (limited to 'app-emulation')
3 files changed, 559 insertions, 1 deletions
diff --git a/app-emulation/vmware-modules/ChangeLog b/app-emulation/vmware-modules/ChangeLog index 62499732a95b..660e414f5048 100644 --- a/app-emulation/vmware-modules/ChangeLog +++ b/app-emulation/vmware-modules/ChangeLog @@ -1,6 +1,12 @@ # ChangeLog for app-emulation/vmware-modules # Copyright 1999-2009 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/app-emulation/vmware-modules/ChangeLog,v 1.49 2009/09/02 02:13:31 vadimk Exp $ +# $Header: /var/cvsroot/gentoo-x86/app-emulation/vmware-modules/ChangeLog,v 1.50 2009/09/22 17:56:21 vadimk Exp $ + +*vmware-modules-1.0.0.24-r1 (22 Sep 2009) + + 22 Sep 2009; Vadim Kuznetsov vadimk@gentoo.org + +vmware-modules-1.0.0.24-r1.ebuild, +files/1.0.0.24-vmnet-2.6.31.patch: + vmnet patch for 2.6.31 kernel. Bug 274173, comment 15. 02 Sep 2009; Vadim Kuznetsov vadimk@gentoo.org -files/patches/vmmon/050_all_kernel-2.6.29.patch, diff --git a/app-emulation/vmware-modules/files/1.0.0.24-vmnet-2.6.31.patch b/app-emulation/vmware-modules/files/1.0.0.24-vmnet-2.6.31.patch new file mode 100644 index 000000000000..a15e8ec1907e --- /dev/null +++ b/app-emulation/vmware-modules/files/1.0.0.24-vmnet-2.6.31.patch @@ -0,0 +1,477 @@ +diff -uh vmnet-only.old/bridge.c vmnet-only/bridge.c +--- vmnet-only.old/bridge.c 2009-03-27 01:34:28.000000000 -0400 ++++ vmnet-only/bridge.c 2009-08-14 22:55:21.000000000 -0400 +@@ -645,9 +645,7 @@ + if (clone == NULL) { + dev_unlock_list(); + } else { +- struct sock *sk = bridge->sk; +- atomic_add(skb->truesize, &sk->sk_wmem_alloc); +- clone->sk = sk; ++ skb_set_owner_w(clone, bridge->sk); + clone->protocol = ((struct ethhdr *)skb->data)->h_proto; // XXX + if ((dev->flags & IFF_UP) != 0) { + dev_unlock_list(); +@@ -987,6 +985,7 @@ + retval = -ENOMEM; + goto out; + } ++ sock_init_data(NULL, bridge->sk); + SET_SK_DEAD(bridge->sk); + + bridge->wirelessAdapter = VNetBridgeIsDeviceWireless(bridge->dev); +diff -uh vmnet-only.old/compat_netdevice.h vmnet-only/compat_netdevice.h +--- vmnet-only.old/compat_netdevice.h 2009-03-27 01:34:28.000000000 -0400 ++++ vmnet-only/compat_netdevice.h 2009-08-14 22:55:21.000000000 -0400 +@@ -178,6 +178,23 @@ + # define compat_netdev_priv(netdev) netdev_priv(netdev) + #endif + ++/* ++ * All compat_* business is good but when we can we should just provide ++ * missing implementation to ease upstreaming task. ++ */ ++#ifndef HAVE_ALLOC_NETDEV ++#define alloc_netdev(sz, name, setup) compat_alloc_netdev(sz, name, setup) ++#define alloc_etherdev(sz) compat_alloc_etherdev(sz) ++#endif ++ ++#ifndef HAVE_FREE_NETDEV ++#define free_netdev(dev) kfree(dev) ++#endif ++ ++#ifndef HAVE_NETDEV_PRIV ++#define netdev_priv(dev) ((dev)->priv) ++#endif ++ + #if defined(NETDEV_TX_OK) + # define COMPAT_NETDEV_TX_OK NETDEV_TX_OK + # define COMPAT_NETDEV_TX_BUSY NETDEV_TX_BUSY +@@ -186,55 +203,56 @@ + # define COMPAT_NETDEV_TX_BUSY 1 + #endif + +-#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,3,43)) ++#ifndef HAVE_NETIF_QUEUE + static inline void +-compat_netif_start_queue(struct device *dev) ++netif_start_queue(struct device *dev) + { + clear_bit(0, &dev->tbusy); + } + + static inline void +-compat_netif_stop_queue(struct device *dev) ++netif_stop_queue(struct device *dev) + { + set_bit(0, &dev->tbusy); + } + + static inline int +-compat_netif_queue_stopped(struct device *dev) ++netif_queue_stopped(struct device *dev) + { + return test_bit(0, &dev->tbusy); + } + + static inline void +-compat_netif_wake_queue(struct device *dev) ++netif_wake_queue(struct device *dev) + { + clear_bit(0, &dev->tbusy); + mark_bh(NET_BH); + } + + static inline int +-compat_netif_running(struct device *dev) ++netif_running(struct device *dev) + { + return dev->start == 0; + } + + static inline int +-compat_netif_carrier_ok(struct device *dev) ++netif_carrier_ok(struct device *dev) + { + return 1; + } + + static inline void +-compat_netif_carrier_on(struct device *dev) ++netif_carrier_on(struct device *dev) + { + } + + static inline void +-compat_netif_carrier_off(struct device *dev) ++netif_carrier_off(struct device *dev) + { + } ++#endif + +-#else ++/* Keep compat_* defines for now */ + #define compat_netif_start_queue(dev) netif_start_queue(dev) + #define compat_netif_stop_queue(dev) netif_stop_queue(dev) + #define compat_netif_queue_stopped(dev) netif_queue_stopped(dev) +@@ -243,7 +261,6 @@ + #define compat_netif_carrier_ok(dev) netif_carrier_ok(dev) + #define compat_netif_carrier_on(dev) netif_carrier_on(dev) + #define compat_netif_carrier_off(dev) netif_carrier_off(dev) +-#endif + + /* unregister_netdevice_notifier was not safe prior to 2.6.17 */ + #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 17) && \ +diff -uh vmnet-only.old/compat_sched.h vmnet-only/compat_sched.h +--- vmnet-only.old/compat_sched.h 2009-03-27 01:34:28.000000000 -0400 ++++ vmnet-only/compat_sched.h 2009-08-14 22:55:21.000000000 -0400 +@@ -272,6 +272,20 @@ + #endif + + /* ++ * Around 2.6.27 kernel stopped sending signals to kernel ++ * threads being frozen, instead threads have to check ++ * freezing() or use wait_event_freezable(). Unfortunately ++ * wait_event_freezable() completely hides the fact that ++ * thread was frozen from calling code and sometimes we do ++ * want to know that. ++ */ ++#ifdef PF_FREEZER_NOSIG ++#define compat_wait_check_freezing() freezing(current) ++#else ++#define compat_wait_check_freezing() (0) ++#endif ++ ++/* + * Since 2.6.27-rc2 kill_proc() is gone... Replacement (GPL-only!) + * API is available since 2.6.19. Use them from 2.6.27-rc1 up. + */ +diff -uh vmnet-only.old/compat_sock.h vmnet-only/compat_sock.h +--- vmnet-only.old/compat_sock.h 2009-03-27 01:34:28.000000000 -0400 ++++ vmnet-only/compat_sock.h 2009-08-14 22:55:21.000000000 -0400 +@@ -22,21 +22,9 @@ + #include <linux/stddef.h> /* for NULL */ + #include <net/sock.h> + +- + /* + * Between 2.5.70 and 2.5.71 all sock members were renamed from XXX to sk_XXX. +- * +- * VMW_HAVE_SK_WMEM_ALLOC is defined in module Makefile if kernel's struct sock +- * has sk_wmem_alloc member. See vmnet's Makefile.kernel for details. +- * It also means that all modules including this file should do +- * +- * EXTRA_CFLAGS += $(call vm_check_build, $(SRCROOT)/socket.c, -DVMW_HAVE_SK_WMEM_ALLOC, ) +- * +- * in their Makefiles. + */ +-#ifndef VMW_HAVE_SK_WMEM_ALLOC +-# define sk_wmem_alloc wmem_alloc +-#endif + + #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 5, 71) + # define compat_sk_backlog_rcv backlog_rcv +diff -uh vmnet-only.old/Makefile vmnet-only/Makefile +--- vmnet-only.old/Makefile 2009-09-13 07:39:55.000000000 -0400 ++++ vmnet-only/Makefile 2009-09-13 07:40:10.000000000 -0400 +@@ -106,9 +106,10 @@ + postbuild:: ; + + $(DRIVER_KO): prebuild +- make -C $(BUILD_DIR) SUBDIRS=$$PWD SRCROOT=$$PWD/$(SRCROOT) modules +- make -C $$PWD SRCROOT=$$PWD/$(SRCROOT) postbuild +- ++ make -C $(BUILD_DIR) SUBDIRS=$$PWD SRCROOT=$$PWD/$(SRCROOT) \ ++ MODULEBUILDDIR=$(MODULEBUILDDIR) modules ++ make -C $$PWD SRCROOT=$$PWD/$(SRCROOT) \ ++ MODULEBUILDDIR=$(MODULEBUILDDIR) postbuild + else + + ifneq ($(VM_CCVER), $(VMCCVER)) +@@ -121,7 +122,7 @@ + endif + + vm_check_build = $(shell if $(CC) $(KBUILD_CPPFLAGS) $(KBUILD_CFLAGS) \ +- $(CPPFLAGS) $(CFLAGS) $(CFLAGS_KERNEL) \ ++ $(CPPFLAGS) $(CFLAGS) $(CFLAGS_KERNEL) $(LINUXINCLUDE) \ + $(EXTRA_CFLAGS) -Iinclude2/asm/mach-default \ + -DKBUILD_BASENAME=\"$(DRIVER)\" \ + -Werror -S -o /dev/null -xc $(1) \ +diff -uh vmnet-only.old/Makefile.kernel vmnet-only/Makefile.kernel +--- vmnet-only.old/Makefile.kernel 2009-09-13 07:39:55.000000000 -0400 ++++ vmnet-only/Makefile.kernel 2009-09-13 07:40:10.000000000 -0400 +@@ -21,7 +21,6 @@ + + EXTRA_CFLAGS := $(CC_OPTS) $(INCLUDE) $(LINUXINCLUDE) + EXTRA_CFLAGS += $(call vm_check_build, $(SRCROOT)/epoll.c, -DVMW_HAVE_EPOLL, ) +-EXTRA_CFLAGS += $(call vm_check_build, $(SRCROOT)/socket.c, -DVMW_HAVE_SK_WMEM_ALLOC, ) + EXTRA_CFLAGS += $(call vm_check_build, $(SRCROOT)/sk_alloc.c,-DVMW_HAVE_SK_ALLOC_WITH_PROTO, ) + EXTRA_CFLAGS += $(call vm_check_build, $(SRCROOT)/netdev_has_net.c,-DVMW_NETDEV_HAS_NET, ) + EXTRA_CFLAGS += $(call vm_check_build, $(SRCROOT)/netdev_has_dev_net.c,-DVMW_NETDEV_HAS_DEV_NET, ) +diff -uh vmnet-only.old/Makefile.normal vmnet-only/Makefile.normal +--- vmnet-only.old/Makefile.normal 2009-03-27 01:34:28.000000000 -0400 ++++ vmnet-only/Makefile.normal 2009-08-14 22:55:22.000000000 -0400 +@@ -47,7 +47,6 @@ + | sed -n -e 's!^APATH!-I$(HEADER_DIR)/asm!p') + + CC_OPTS += $(call vm_check_build, $(SRCROOT)/epoll.c, -DVMW_HAVE_EPOLL, ) +-CC_OPTS += $(call vm_check_build, $(SRCROOT)/socket.c, -DVMW_HAVE_SK_WMEM_ALLOC, ) + CC_OPTS += $(call vm_check_build, $(SRCROOT)/sk_alloc.c,-DVMW_HAVE_SK_ALLOC_WITH_PROTO, ) + CC_OPTS += $(call vm_check_build, $(SRCROOT)/netdev_has_net.c,-DVMW_NETDEV_HAS_NET, ) + CC_OPTS += $(call vm_check_build, $(SRCROOT)/netdev_has_dev_net.c,-DVMW_NETDEV_HAS_DEV_NET, ) +diff -uh vmnet-only.old/netif.c vmnet-only/netif.c +--- vmnet-only.old/netif.c 2009-09-13 07:39:55.000000000 -0400 ++++ vmnet-only/netif.c 2009-08-14 22:55:21.000000000 -0400 +@@ -55,30 +55,6 @@ + struct net_device_stats stats; + } VNetNetIF; + +-#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 29) +-/* +- Prior to KERNEL_VERSION(2, 6, 29) "struct net_device" had "void +- *priv" field which was used as pointer to "VNetNetIF". +-*/ +- +-#define VNetNetIF_netdev_priv_size 0 +- +-#define VNetNetIF_netdev_netIf(dev) (*(VNetNetIF**)&((dev)->priv)) +- +-#else +-/* +- Since KERNEL_VERSION(2, 6, 29) pointer to "VNetNetIF" is stored in +- explicitly allocated private area. +-*/ +-typedef struct { +- VNetNetIF *netIf; +-} VNetNetIF_netdev_priv; +- +-#define VNetNetIF_netdev_priv_size sizeof(VNetNetIF_netdev_priv) +- +-#define VNetNetIF_netdev_netIf(dev) (((VNetNetIF_netdev_priv *)compat_netdev_priv(dev))->netIf) +- +-#endif + + static void VNetNetIfFree(VNetJack *this); + static void VNetNetIfReceive(VNetJack *this, struct sk_buff *skb); +@@ -100,73 +76,6 @@ + static int VNetNetIfProcRead(char *page, char **start, off_t off, + int count, int *eof, void *data); + +-#ifndef KERNEL_2_3_43 +-/* softnet API emulation */ +- +- +-/* +- *---------------------------------------------------------------------- +- * +- * netif_stop_queue -- +- * +- * Stops queue processing. +- * +- * Results: +- * None. +- * +- *---------------------------------------------------------------------- +- */ +- +-static inline void +-netif_stop_queue(struct net_device *dev) // IN: +-{ +- dev->tbusy = 1; +-} +- +- +-/* +- *---------------------------------------------------------------------- +- * +- * netif_start_queue -- +- * +- * Enables queue processing. It does not try to start received +- * frames processing. +- * +- * Results: +- * None. +- * +- *---------------------------------------------------------------------- +- */ +- +-static inline void +-netif_start_queue(struct net_device *dev) // IN: +-{ +- dev->tbusy = 0; +-} +- +- +-/* +- *---------------------------------------------------------------------- +- * +- * netif_wake_queue -- +- * +- * Enables queue processing. It schedules receive queue processing. +- * +- * Results: +- * None. +- * +- *---------------------------------------------------------------------- +- */ +- +-static inline void +-netif_wake_queue(struct net_device *dev) // IN: +-{ +- dev->tbusy = 0; +- mark_bh(NET_BH); +-} +-#endif +- +- + #if 0 + #ifdef KERNEL_2_3_43 + /* +@@ -221,7 +130,29 @@ + static void + VNetNetIfSetup(struct net_device *dev) // IN: + { ++#ifdef HAVE_NET_DEVICE_OPS ++ static const struct net_device_ops vnetNetifOps = { ++ .ndo_init = VNetNetifProbe, ++ .ndo_open = VNetNetifOpen, ++ .ndo_start_xmit = VNetNetifStartXmit, ++ .ndo_stop = VNetNetifClose, ++ .ndo_get_stats = VNetNetifGetStats, ++ .ndo_set_mac_address = VNetNetifSetMAC, ++ .ndo_set_multicast_list = VNetNetifSetMulticast, ++ /* ++ * We cannot stuck... If someone will report problems under ++ * low memory conditions or some such, we should enable it. ++ */ ++#if 0 ++ .ndo_tx_timeout = VNetNetifTxTimeout, ++#endif ++ }; ++#endif /* HAVE_NET_DEVICE_OPS */ ++ + ether_setup(dev); // turns on IFF_BROADCAST, IFF_MULTICAST ++#ifdef HAVE_NET_DEVICE_OPS ++ dev->netdev_ops = &vnetNetifOps; ++#else + dev->init = VNetNetifProbe; + dev->open = VNetNetifOpen; + dev->hard_start_xmit = VNetNetifStartXmit; +@@ -236,9 +167,43 @@ + */ + #if 0 + dev->tx_timeout = VNetNetifTxTimeout; ++#endif ++#endif ++#endif /* HAVE_NET_DEVICE_OPS */ ++ ++#if 0 ++ /* Only necessary if tx_timeout is set. See above. */ + dev->watchdog_timeo = TX_TIMEOUT; + #endif +-#endif ++} ++ ++ ++/* ++ *---------------------------------------------------------------------- ++ * ++ * VNetNetIfNetDeviceToNetIf -- ++ * ++ * Converts net_device to netIf. ++ * ++ * Results: ++ * Converted pointer. ++ * ++ * Side effects: ++ * None. ++ * ++ *---------------------------------------------------------------------- ++ */ ++ ++static INLINE VNetNetIF * ++VNetNetIfNetDeviceToNetIf(struct net_device *dev) ++{ ++#ifdef HAVE_NETDEV_PRIV ++ VNetNetIF** devPriv = netdev_priv(dev); ++ ++ return *devPriv; ++#else ++ return dev->priv; ++#endif + } + + +@@ -342,13 +307,21 @@ + memcpy(netIf->devName, devName, sizeof netIf->devName); + NULL_TERMINATE_STRING(netIf->devName); + +- dev = compat_alloc_netdev(VNetNetIF_netdev_priv_size, netIf->devName, VNetNetIfSetup); ++#ifdef HAVE_NETDEV_PRIV ++ dev = compat_alloc_netdev(sizeof(VNetNetIF *), netIf->devName, VNetNetIfSetup); + if (!dev) { + retval = -ENOMEM; + goto out; + } +- +- VNetNetIF_netdev_netIf(dev) = netIf; ++ *(VNetNetIF**)netdev_priv(dev) = netIf; ++#else ++ dev = compat_alloc_netdev(0, netIf->devName, VNetNetIfSetup); ++ if (!dev) { ++ retval = -ENOMEM; ++ goto out; ++ } ++ dev->priv = netIf; ++#endif + netIf->dev = dev; + + memcpy(dev->dev_addr, netIf->port.paddr, sizeof netIf->port.paddr); +@@ -590,12 +563,14 @@ + VNetNetifStartXmit(struct sk_buff *skb, // IN: + struct net_device *dev) // IN: + { +- VNetNetIF *netIf = VNetNetIF_netdev_netIf(dev); ++ VNetNetIF *netIf; + + if(skb == NULL) { + return 0; + } + ++ netIf = VNetNetIfNetDeviceToNetIf(dev); ++ + /* + * Block a timer-based transmit from overlapping. This could better be + * done with atomic_swap(1, dev->tbusy), but set_bit() works as well. +@@ -642,11 +617,13 @@ + VNetNetifSetMAC(struct net_device *dev, // IN: + void *p) // IN: + { +- VNetNetIF *netIf = VNetNetIF_netdev_netIf(dev); ++ VNetNetIF *netIf; + struct sockaddr const *addr = p; ++ + if (!VMX86_IS_STATIC_MAC(addr->sa_data)) { + return -EINVAL; + } ++ netIf = VNetNetIfNetDeviceToNetIf(dev); + memcpy(netIf->port.paddr, addr->sa_data, dev->addr_len); + memcpy(dev->dev_addr, addr->sa_data, dev->addr_len); + return 0; +@@ -696,11 +673,12 @@ + *---------------------------------------------------------------------- + */ + +-struct net_device_stats * ++static struct net_device_stats * + VNetNetifGetStats(struct net_device *dev) // IN: + { +- VNetNetIF *netIf = VNetNetIF_netdev_netIf(dev); +- return &(netIf->stats); ++ VNetNetIF *netIf = VNetNetIfNetDeviceToNetIf(dev); ++ ++ return &netIf->stats; + } + + +Only in vmnet-only.old: socket.c diff --git a/app-emulation/vmware-modules/vmware-modules-1.0.0.24-r1.ebuild b/app-emulation/vmware-modules/vmware-modules-1.0.0.24-r1.ebuild new file mode 100644 index 000000000000..e7ef1b7af8a8 --- /dev/null +++ b/app-emulation/vmware-modules/vmware-modules-1.0.0.24-r1.ebuild @@ -0,0 +1,75 @@ +# Copyright 1999-2009 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/app-emulation/vmware-modules/vmware-modules-1.0.0.24-r1.ebuild,v 1.1 2009/09/22 17:56:21 vadimk Exp $ + +EAPI="2" + +inherit eutils flag-o-matic linux-mod + +DESCRIPTION="VMware kernel modules" +HOMEPAGE="http://www.vmware.com/" + +SRC_URI="x86? ( + mirror://gentoo/${P}.x86.tar.bz2 + http://dev.gentoo.org/~vadimk/${P}.x86.tar.bz2 + ) + amd64? ( + mirror://gentoo/${P}.amd64.tar.bz2 + http://dev.gentoo.org/~vadimk/${P}.amd64.tar.bz2 + )" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~amd64 ~x86" +IUSE="" + +DEPEND="" +RDEPEND="${DEPEND}" + +S="${WORKDIR}" + +pkg_setup() { + linux-mod_pkg_setup + + VMWARE_VER="VME_V65" # THIS VALUE IS JUST A PLACE HOLDER + VMWARE_GROUP=${VMWARE_GROUP:-vmware} + + VMWARE_MODULE_LIST="vmblock vmci vmmon vmnet vsock" + VMWARE_MOD_DIR="${PN}-${PVR}" + + BUILD_TARGETS="auto-build VMWARE_VER=${VMWARE_VER} KERNEL_DIR=${KERNEL_DIR} KBUILD_OUTPUT=${KV_OUT_DIR}" + + enewgroup "${VMWARE_GROUP}" + filter-flags -mfpmath=sse + + for mod in ${VMWARE_MODULE_LIST}; do + MODULE_NAMES="${MODULE_NAMES} ${mod}(misc:${S}/${mod}-only)" + done +} + +src_unpack() { + unpack ${A} + cd "${S}" + for mod in ${VMWARE_MODULE_LIST}; do + unpack ./"${P}"/${mod}.tar + done +} + +src_prepare() { + epatch "${FILESDIR}/${PV}-makefile-kernel-dir.patch" + epatch "${FILESDIR}/${PV}-kernel-2.6.29.patch" + epatch "${FILESDIR}/${PV}-kernel-2.6.30.patch" + epatch "${FILESDIR}/${PV}-vmnet-2.6.31.patch" +} + +src_install() { + # this adds udev rules for vmmon* + if [[ -n "`echo ${VMWARE_MODULE_LIST} | grep vmmon`" ]]; + then + dodir /etc/udev/rules.d + echo 'KERNEL=="vmmon*", GROUP="'$VMWARE_GROUP'" MODE=660' >> "${D}/etc/udev/rules.d/60-vmware.rules" || die + echo 'KERNEL=="vmnet*", GROUP="'$VMWARE_GROUP'" MODE=660' >> "${D}/etc/udev/rules.d/60-vmware.rules" || die + fi + + linux-mod_src_install +} |