Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 22 Aug 2018 00:10:11 -0500
From:      Alan Cox <alc@rice.edu>
To:        Manfred Antar <manfredantar@gmail.com>, Alexey Dokuchaev <danfe@freebsd.org>
Cc:        "Alex V. Petrov" <alexvpetrov@gmail.com>, freebsd-current <freebsd-current@freebsd.org>, alc@freebsd.org
Subject:   Re: nvidia-driver build error (last ports, FreeBSD-HEAD)
Message-ID:  <86b09a54-9394-675e-3722-7007fa66c9c1@rice.edu>
In-Reply-To: <4925AAFC-0D43-4DC3-9E41-61F44359255A@gmail.com>
References:  <cc4a8291-b6a1-f014-ac9b-57721d0e2d98@gmail.com> <db1f1411-a3db-f0cb-8207-2957b45d206f@gmail.com> <20180822022343.GA60855@FreeBSD.org> <4925AAFC-0D43-4DC3-9E41-61F44359255A@gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On 08/21/2018 23:29, Manfred Antar wrote:
>
>> On Aug 21, 2018, at 7:23 PM, Alexey Dokuchaev <danfe@freebsd.org> wrot=
e:
>>
>> On Tue, Aug 21, 2018 at 11:22:56PM +0700, Alex V. Petrov wrote:
>>> -------- =D0=9F=D0=B5=D1=80=D0=B5=D0=BD=D0=B0=D0=BF=D1=80=D0=B0=D0=B2=
=D0=BB=D0=B5=D0=BD=D0=BD=D0=BE=D0=B5 =D1=81=D0=BE=D0=BE=D0=B1=D1=89=D0=B5=
=D0=BD=D0=B8=D0=B5 --------
>>> =D0=A2=D0=B5=D0=BC=D0=B0: nvidia-driver build error (last ports, Free=
BSD-HEAD)
>>> =D0=94=D0=B0=D1=82=D0=B0: Tue, 21 Aug 2018 16:41:42 +0700
>>> =D0=9E=D1=82: Alex V. Petrov <alexvpetrov@gmail.com>
>>> =D0=9A=D0=BE=D0=BC=D1=83: FreeBSD Ports <freebsd-ports@freebsd.org>
>> Should be fixed as of r477761.
>>
>> ./danfe
> emulators/open-vm-tools is also broken from the recent changes to sys/v=
m:
> cc  -O2 -pipe -isystem /usr/local/include -fno-strict-aliasing  -Werror=
 -D_KERNEL -DKLD_MODULE -nostdinc  -I/usr/ports/emulators/open-vm-tools/w=
ork/open-vm-tools-stable-10.2.5/open-vm-tools/lib/include -I/usr/ports/em=
ulators/open-vm-tools/work/open-vm-tools-stable-10.2.5/open-vm-tools/modu=
les/shared/vmxnet -I. -I/usr/src/sys -I/usr/src/sys/contrib/ck/include -f=
no-common  -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer   -MD  -M=
F.depend.if_vxn.o -MTif_vxn.o -mcmodel=3Dkernel -mno-red-zone -mno-mmx -m=
no-sse -msoft-float  -fno-asynchronous-unwind-tables -ffreestanding -fwra=
pv -fstack-protector -Wall -Wredundant-decls -Wnested-externs -Wstrict-pr=
ototypes -Wmissing-prototypes -Wpointer-arith -Wcast-qual -Wundef -Wno-po=
inter-sign -D__printf__=3D__freebsd_kprintf__ -Wmissing-include-dirs -fdi=
agnostics-show-option -Wno-unknown-pragmas -Wno-error-tautological-compar=
e -Wno-error-empty-body -Wno-error-parentheses-equality -Wno-error-unused=
-function -Wno-error-pointer-sign -Wno-error-shift-negative-value -Wno-ad=
dress-of-packed-member  -mno-aes -mno-avx  -std=3Diso9899:1999 -c if_vxn.=
c -o if_vxn.o
> --- vmmemctl ---
> os.c:410:68: error: too many arguments to function call, expected 2, ha=
ve 3
>    p->bitmap =3D (unsigned long *)kmem_malloc(kernel_arena, p->size, M_=
WAITOK | M_ZERO);
>                                 ~~~~~~~~~~~                        ^~~~=
~~~~~~~~~~~~~
> /usr/src/sys/sys/malloc.h:55:18: note: expanded from macro 'M_WAITOK'
> #define M_WAITOK        0x0002          /* ok to block */
>                         ^
> /usr/src/sys/vm/vm_extern.h:67:1: note: 'kmem_malloc' declared here
> vm_offset_t kmem_malloc(vm_size_t size, int flags);
> ^
> 1 error generated.
>
> I also had to rebuild kde-workspace-kde4 and xorg-server before i could=
 start x without open-vm-tools.
> This is on a FreeBSD-12-Alpha2-current as of today.the old open-vm-tool=
s/modules/freebsd/vmmemctl
> will hang,so i needed to uninstall it to get x.
>
> if these lines are removed from open-vm-tools/modules/freebsd/vmmemctl/=
os.h open-vm-tools will compile and work:
>
> 407,411d406
> < #if __FreeBSD_version < 1000000
> <    p->bitmap =3D (unsigned long *)kmem_alloc(kernel_map, p->size);
> < #else
> <    p->bitmap =3D (unsigned long *)kmem_malloc(kernel_arena, p->size, =
M_WAITOK | M_ZERO);
> < #endif
>
> Not sure if this is the right fix but it enabled me to use the vm-tools=
 again and the associated modules

Change this to

#if __FreeBSD_version < 1000000
    p->bitmap =3D (unsigned long *)kmem_alloc(kernel_map, p->size);
#elif  __FreeBSD_version < 1200080
    p->bitmap =3D (unsigned long *)kmem_malloc(kernel_arena, p->size,
M_WAITOK | M_ZERO);
#else
    p->bitmap =3D (unsigned long *)kmem_malloc(p->size, M_WAITOK | M_ZERO=
);
#endif

That said, it's not clear to me why this allocation doesn't use
malloc(9), then no #if's would be required across different versions of
FreeBSD.




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?86b09a54-9394-675e-3722-7007fa66c9c1>