Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 477270 - app-emulation/vmware-modules-271.2 with sys-devel/gcc-4.8.1 - .../work/vmmon-only/linux/driver.c:1252:4: error: too many arguments to function 'smp_call_function'
Summary: app-emulation/vmware-modules-271.2 with sys-devel/gcc-4.8.1 - .../work/vmmon-...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Library (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo VMWare Bug Squashers [disabled]
URL:
Whiteboard:
Keywords:
: 490568 493030 (view as bug list)
Depends on:
Blocks:
 
Reported: 2013-07-18 06:36 UTC by Sergey Ilinykh
Modified: 2015-09-19 18:55 UTC (History)
4 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
build.log.gz (build.log.gz,8.90 KB, application/x-gzip)
2013-07-18 06:38 UTC, Sergey Ilinykh
Details
Patch from Comment 2 in File form (compatsmp.patch,2.42 KB, patch)
2014-02-07 01:59 UTC, Brandon Penglase
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Sergey Ilinykh 2013-07-18 06:36:30 UTC
as far as I understand vm_check_build fails for some reason and so invalid number arguments detected.

no problems with gcc-4.7.3

emerge --info vmware-modules
Portage 2.2.0_alpha188 (default/linux/amd64/13.0/developer, gcc-4.8.1, glibc-2.17, 3.9.10-gentoo x86_64)
=================================================================
                        System Settings
=================================================================
System uname: Linux-3.9.10-gentoo-x86_64-Intel-R-_Core-TM-_i7-3610QM_CPU_@_2.30GHz-with-gentoo-2.2
KiB Mem:    16309972 total,  14214396 free
KiB Swap:          0 total,         0 free
Timestamp of tree: Thu, 18 Jul 2013 06:00:01 +0000
ld GNU ld (GNU Binutils) 2.23.1
distcc 3.1 x86_64-pc-linux-gnu [disabled]
ccache version 3.1.9 [enabled]
app-shells/bash:          4.2_p45
dev-java/java-config:     2.2.0
dev-lang/python:          2.7.5-r1, 3.2.5-r1, 3.3.2-r1
dev-util/ccache:          3.1.9
dev-util/cmake:           2.8.11.1
dev-util/pkgconfig:       0.28
sys-apps/baselayout:      2.2
sys-apps/openrc:          0.11.8
sys-apps/sandbox:         2.6-r1
sys-devel/autoconf:       2.13, 2.69
sys-devel/automake:       1.9.6-r3, 1.11.6, 1.12.6, 1.13.4, 1.14
sys-devel/binutils:       2.23.1
sys-devel/gcc:            4.7.3, 4.8.1
sys-devel/gcc-config:     1.8
sys-devel/libtool:        2.4.2
sys-devel/make:           3.82-r4
sys-kernel/linux-headers: 3.9 (virtual/os-headers)
sys-libs/glibc:           2.17
Repositories: gentoo rion sunrise Armageddon mate-overlay qt test
Installed sets: @system
ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="*"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=corei7-avx -O2 -pipe -ftree-vectorize -fgraphite-identity -maes -floop-parallelize-all -floop-interchange -floop-block -fira-loop-pressure"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php5.4/ext-active/ /etc/php/apache2-php5.5/ext-active/ /etc/php/cgi-php5.4/ext-active/ /etc/php/cgi-php5.5/ext-active/ /etc/php/cli-php5.4/ext-active/ /etc/php/cli-php5.5/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-march=corei7-avx -O2 -pipe -ftree-vectorize -fgraphite-identity -maes -floop-parallelize-all -floop-interchange -floop-block -fira-loop-pressure"
DISTDIR="/home/portage/distfiles"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs ccache config-protect-if-modified digest distlocks ebuild-locks fixlafiles merge-sync news parallel-fetch preserve-libs protect-owned sandbox sfperms sign splitdebug strict test-fail-continue unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LANG="ru_RU.UTF-8"
LDFLAGS="-Wl,--hash-style=gnu -Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j9"
PKGDIR="/home/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/home/portage/build"
PORTDIR="/home/portage/portage"
PORTDIR_OVERLAY="/var/lib/layman/rion /var/lib/layman/sunrise /var/lib/layman/Armageddon /var/lib/layman/mate /var/lib/layman/qt /home/rion/projects/test-overlay"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="X a52 aac acl acpi alsa amd64 avahi avx bash-completion berkdb bluetooth branding bzip2 cairo cdda cddb cdio cdr cli consolekit cracklib crypt cups custom-optimization cxx dbus dri dts dv dvb dvd dvdr emboss encode exif faac faad fam ffmpeg firefox flac fuse gallium gif glamor glitz gnome-keyring gphoto2 gpm gsm gstreamer gtk gtk3 h323 iconv idn ipv6 jabber java6 jingle jpeg jpeg2k lcms libcanberra libnotify mad mate mmx mng modplug modules mp3 mp4 mpeg mtp mudflap multilib ncurses networkmanager nls nptl ogg opengl openmp pam pango pch pcmcia pcre pdf png policykit ppds qt4 readline rtmp samba schroedinger sdl session sip smp snmp speex spell sse sse2 sse3 ssl ssse3 startup-notification subversion svg symlink tcpd theora threads thunar tiff tokenizer truetype udev udisks unicode upnp upower usb v4l v4l2 vaapi vdpau vhosts vnc vorbis vpx webkit wifi x264 xcb xcomposite xml xv xvid xvmc zlib" ABI_X86="64" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" APACHE2_MODULES="dav dav_fs authn_file auth_basic auth_digest authz_groupfile authz_host dir mime log_config" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump author" CAMERAS="ptp2 canon" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" DRACUT_MODULES="plymouth" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ubx" GRUB_PLATFORMS="pc" INPUT_DEVICES="evdev synaptics" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LINGUAS="ru ru_RU en" NETBEANS_MODULES="apisupport harness ide nb websvccommon php profiler webcommon cnd ergonomics dlight" NGINX_MODULES_HTTP="dav fastcgi flv access auth_basic autoindex charset browser empty_gif gzip map memcached rewrite userid" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-5" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7 python3_2" QEMU_SOFTMMU_TARGETS="i386 x86_64" QEMU_USER_TARGETS="i386 x86_64" RUBY_TARGETS="ruby19 ruby18" USERLAND="GNU" VIDEO_CARDS="vesa intel i965 fglrx" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, USE_PYTHON

=================================================================
                        Package Settings
=================================================================

app-emulation/vmware-modules-271.2 was built with the following:
USE="(multilib) -pax_kernel" ABI_X86="64"
CFLAGS="-march=corei7-avx -O2 -pipe -maes"
CXXFLAGS="-march=corei7-avx -O2 -pipe -maes"

Reproducible: Always
Comment 1 Sergey Ilinykh 2013-07-18 06:38:38 UTC
Created attachment 353560 [details]
build.log.gz
Comment 2 Jason A. Donenfeld gentoo-dev 2013-08-26 18:19:28 UTC
thinkpad ~ # cat /etc/portage/patches/app-emulation/vmware-modules/vmmon-hack.patch 
diff -ru vmmon-only-orig/linux/hostif.c vmmon-only/linux/hostif.c
--- vmmon-only-orig/linux/hostif.c      2013-07-09 15:14:01.771435826 +0200
+++ vmmon-only/linux/hostif.c   2013-07-09 15:14:49.625436089 +0200
@@ -2704,22 +2704,12 @@
       targetHostCpu = vm->currentHostCpu[v];
       if (targetHostCpu != INVALID_PCPU) {
          ASSERT(targetHostCpu < MAX_PCPUS);
-
-#if defined(VMMON_USE_CALL_FUNC)
-         /* older kernels IPI broadcast; use async when possible */
-         (void) compat_smp_call_function(LinuxDriverIPIHandler,
-                                         NULL, VMMON_CALL_FUNC_SYNC);
-
-        mode = IPI_BROADCAST;
-        break;
-#else
          /* Newer kernels have (async) IPI targetting */
          arch_send_call_function_single_ipi(targetHostCpu);
         mode = IPI_UNICAST;
          if (!all) {
            break;
          }
-#endif
       }
       ipiTargets = VCPUSet_Remove(ipiTargets, v);
    }
diff -ru vmmon-only-orig/linux/vmmonInt.h vmmon-only/linux/vmmonInt.h
--- vmmon-only-orig/linux/vmmonInt.h    2013-07-09 15:14:01.771435826 +0200
+++ vmmon-only/linux/vmmonInt.h 2013-07-09 15:16:19.912436585 +0200
@@ -28,11 +28,7 @@
  * Hide all kernel compatibility stuff in these macros and functions.
  */
 
-#ifdef VMW_HAVE_SMP_CALL_3ARG
 #define compat_smp_call_function(fn, info, wait) smp_call_function(fn, info, wait)
-#else
-#define compat_smp_call_function(fn, info, wait) smp_call_function(fn, info, 1, wait)
-#endif
 
 /*
  * Although this is not really related to kernel-compatibility, I put this
Comment 3 Jeroen Roovers (RETIRED) gentoo-dev 2013-12-02 12:22:12 UTC
*** Bug 493030 has been marked as a duplicate of this bug. ***
Comment 4 Jeroen Roovers (RETIRED) gentoo-dev 2013-12-02 12:22:40 UTC
*** Bug 490568 has been marked as a duplicate of this bug. ***
Comment 5 Brandon Penglase 2014-02-07 01:59:14 UTC
Created attachment 369742 [details, diff]
Patch from Comment 2 in File form

This is the patch listed in Comment 2, plus some other work, as mine was still erroring out compiling with some more calls to the same function. I did the same, and just removed/commented out. Compiled fine, I'll find out shortly if my VMs still work :)
Comment 6 Brandon Penglase 2014-02-07 02:06:45 UTC
So it isn't perfect... Kernel 3.12.9, starting a VM I now get:

VMWare Workstation has detected that your host system contains a mix of processors with incompatible VT-x feature sets. Click Cancel to cancel or OK to continue without using VT-x.
Comment 7 Brandon Penglase 2014-02-07 02:18:36 UTC
Ok... Ignore that patch.. it isn't needed, and broken (it gives the error, then just sits there, doing nothing)... 
See bug 488072 and forums: http://forums.gentoo.org/viewtopic-p-7470234.html
It's CFLAGS.
I removed the patch, then created /etc/portage/env/app-emulation/vmware-modules, and put in it:
CFLAGS="-O2 -pipe -march=corei7-avx -mtune=corei7-avx"

My /etc/portage/make.conf CFLAGS (probably overkill, just haven't cleaned it up yet):
CFLAGS="-Os -pipe -march=corei7-avx -mcx16 -msahf -mno-movbe -maes -mpclmul -mpopcnt -mno-abm
-mno-lwp -mno-fma -mno-fma4 -mno-xop -mno-bmi -mno-tbm -mavx -msse4.2 -msse4.1
--param l1-cache-size=32 --param l1-cache-line-size=64 --param l2-cache-size=6144
-mtune=corei7-avx -fforce-addr -fomit-frame-pointer"
Comment 8 Sergey Ilinykh 2014-07-15 04:18:01 UTC
I can confirm. changing CFLAGS does the trick.

for me success with CFLAGS="-march=core-avx-i -O2 -pipe"

and failed with -march=native
Comment 9 Martin Mokrejš 2015-03-18 19:51:27 UTC
The error:

vmmon-only/linux/hostif.c:2851:4: error: too many arguments to function 'smp_call_function'

  happens for me with any of the following in CFLAGS:

-mpclmul or -maes or -mavx


If I drop them then I can compile all modules. There is one warning in the output related to Comment #2:

  CC [M]  /mnt/1TB/var/tmp/portage/app-emulation/vmware-modules-279.3/work/vmmon-only/linux/hostif.o
/mnt/1TB/var/tmp/portage/app-emulation/vmware-modules-279.3/work/vmmon-only/linux/driver.c:1342:1: warning: always_inline function might not be inlinable [-Wattributes]
 LinuxDriverSyncReadTSCs(uint64 *delta) // OUT: TSC max - TSC min
 ^



--- vmware-modules-279.3.ebuild.old     2015-03-18 20:42:10.000000000 +0100
+++ vmware-modules-279.3.ebuild 2015-03-18 20:42:12.000000000 +0100
@@ -58,7 +58,7 @@
        BUILD_TARGETS="auto-build KERNEL_DIR=${KERNEL_DIR} KBUILD_OUTPUT=${KV_OUT_DIR}"
 
        enewgroup "${VMWARE_GROUP}"
-       filter-flags -mfpmath=sse
+       filter-flags -mfpmath=sse -mavx -mpclmul -maes
 
        for mod in ${VMWARE_MODULE_LIST}; do
                MODULE_NAMES="${MODULE_NAMES} ${mod}(misc:${S}/${mod}-only)"



# gcc --version
gcc (Gentoo 4.8.3 p1.1, pie-0.5.9) 4.8.3
Comment 10 Martin Mokrejš 2015-03-18 19:53:05 UTC
(In reply to Martin Mokrejš from comment #9)
> The error:
> 
> vmmon-only/linux/hostif.c:2851:4: error: too many arguments to function
> 'smp_call_function'
> 
>   happens for me with any of the following in CFLAGS:
> 
> -mpclmul or -maes or -mavx
> 
> 
> If I drop them then I can compile all modules.

Tested against vanilla 3.10.12 kernel.
Comment 11 Andreas K. Hüttel archtester gentoo-dev 2015-09-19 18:55:12 UTC
Not sure if this is still really needed but it should not hurt. Added. 

> --- vmware-modules-279.3.ebuild.old     2015-03-18 20:42:10.000000000 +0100
> +++ vmware-modules-279.3.ebuild 2015-03-18 20:42:12.000000000 +0100
> @@ -58,7 +58,7 @@
>         BUILD_TARGETS="auto-build KERNEL_DIR=${KERNEL_DIR}
> KBUILD_OUTPUT=${KV_OUT_DIR}"
>  
>         enewgroup "${VMWARE_GROUP}"
> -       filter-flags -mfpmath=sse
> +       filter-flags -mfpmath=sse -mavx -mpclmul -maes
>  
>         for mod in ${VMWARE_MODULE_LIST}; do
>                 MODULE_NAMES="${MODULE_NAMES} ${mod}(misc:${S}/${mod}-only)"
> 
> 
> 
> # gcc --version
> gcc (Gentoo 4.8.3 p1.1, pie-0.5.9) 4.8.3