Re: svn commit: r284215 - in head/sys: amd64/linux32 compat/linux compat/svr4 dev/drm2/i915 fs/fdescfs i386/ibcs2 i386/linux kern ofed/drivers/infiniband/core ofed/drivers/infiniband/hw/mthca sys vm

2015-06-10 Thread Ivan Klymenko
Wed, 10 Jun 2015 10:48:13 + (UTC)
Mateusz Guzik m...@freebsd.org написав:

 Author: mjg
 Date: Wed Jun 10 10:48:12 2015
 New Revision: 284215
 URL: https://svnweb.freebsd.org/changeset/base/284215
 
 Log:
   Implement lockless resource limits.
   
   Use the same scheme implemented to manage credentials.
   
   Code needing to look at process's credentials (as opposed to
 thred's) is provided with *_proc variants of relevant functions.
   
   Places which possibly had to take the proc lock anyway still use
 the proc pointer to access limits.
 
 Modified:
   head/sys/amd64/linux32/linux32_machdep.c
   head/sys/compat/linux/linux_misc.c
   head/sys/compat/svr4/imgact_svr4.c
   head/sys/compat/svr4/svr4_misc.c
   head/sys/compat/svr4/svr4_resource.c
   head/sys/dev/drm2/i915/i915_gem.c
   head/sys/fs/fdescfs/fdesc_vfsops.c
   head/sys/i386/ibcs2/ibcs2_misc.c
   head/sys/i386/linux/imgact_linux.c
   head/sys/i386/linux/linux_machdep.c
   head/sys/kern/imgact_aout.c
   head/sys/kern/imgact_elf.c
   head/sys/kern/imgact_gzip.c
   head/sys/kern/kern_descrip.c
   head/sys/kern/kern_event.c
   head/sys/kern/kern_exec.c
   head/sys/kern/kern_fork.c
   head/sys/kern/kern_proc.c
   head/sys/kern/kern_resource.c
   head/sys/kern/kern_sig.c
   head/sys/kern/kern_syscalls.c
   head/sys/kern/kern_thread.c
   head/sys/kern/subr_uio.c
   head/sys/kern/sysv_shm.c
   head/sys/kern/tty_pts.c
   head/sys/kern/uipc_sockbuf.c
   head/sys/kern/vfs_vnops.c
   head/sys/ofed/drivers/infiniband/core/umem.c
   head/sys/ofed/drivers/infiniband/hw/mthca/mthca_memfree.c
   head/sys/sys/proc.h
   head/sys/sys/resourcevar.h
   head/sys/sys/vnode.h
   head/sys/vm/swap_pager.c
   head/sys/vm/vm_map.c
   head/sys/vm/vm_mmap.c
   head/sys/vm/vm_pageout.c
   head/sys/vm/vm_unix.c
 
 ...

/head/sys/amd64/linux/linux_machdep.c
--- linux_machdep.c.orig2015-06-10 14:57:12.171984000 +0300
+++ linux_machdep.c 2015-06-10 14:57:22.662331000 +0300
@@ -251,7 +251,7 @@
 */
PROC_LOCK(p);
p-p_vmspace-vm_maxsaddr = (char *)USRSTACK -
-   lim_cur(p, RLIMIT_STACK);
+   lim_cur_proc(p, RLIMIT_STACK);
PROC_UNLOCK(p);
}

must also change because:
...
--- linux_stats.o ---
/usr/local/libexec/ccache/world/cc -target x86_64-unknown-freebsd11.0 
--sysroot=/media/da0s1/obj/usr/src/tmp -B/media/da0s1/obj/usr/src/tmp/usr/bin 
-O2 -pipe  -fno-strict-aliasing -Werror -D_KERNEL -DKLD_MODULE -nostdinc   
-DHAVE_KERNEL_OPTION_HEADERS -include 
/media/da0s1/obj/usr/src/sys/mk11/opt_global.h -I. -I/usr/src/sys -fno-common 
-g -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer 
-I/media/da0s1/obj/usr/src/sys/mk11  -mcmodel=kernel -mno-red-zone -mno-mmx 
-mno-sse -msoft-float  -fno-asynchronous-unwind-tables -ffreestanding -fwrapv 
-fstack-protector -gdwarf-2 -Wall -Wredundant-decls -Wnested-externs 
-Wstrict-prototypes  -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual  
-Wundef -Wno-pointer-sign -D__printf__=__freebsd_kprintf__  
-Wmissing-include-dirs -fdiagnostics-show-option  -Wno-unknown-pragmas  
-Wno-error-tautological-compare -Wno-error-empty-body  
-Wno-error-parentheses-equality -Wno-error-unused-function  
-Wno-error-pointer-sign  -mno-aes -mno-avx  -std=iso9899:1999 -c 
/usr/src/sys/modules/linux64/../../compat/linux/linux_stats.c -o linux_stats.o
--- linux_machdep.o ---
distcc[26181] ERROR: compile 
/usr/src/sys/modules/linux64/../../amd64/linux/linux_machdep.c on localhost 
failed
/usr/src/sys/modules/linux64/../../amd64/linux/linux_machdep.c:254:16: error: 
incompatible pointer types passing 'struct proc *' to parameter of type 'struct 
thread *' [-Werror,-Wincompatible-pointer-types]
lim_cur(p, RLIMIT_STACK);
^
/usr/src/sys/sys/resourcevar.h:133:32: note: passing argument to parameter 'td' 
here
rlim_t   lim_cur(struct thread *td, int which);
^
1 error generated.
*** [linux_machdep.o] Error code 1

make[4]: stopped in /usr/src/sys/modules/linux64
--- linux_stats.o ---
ctfconvert -L VERSION -g linux_stats.o
--- linux_file.o ---
ctfconvert -L VERSION -g linux_file.o
--- linux_misc.o ---
ctfconvert -L VERSION -g linux_misc.o
1 error

make[4]: stopped in /usr/src/sys/modules/linux64
*** [all_subdir_linux64] Error code 2

make[3]: stopped in /usr/src/sys/modules
--- all_subdir_mac_lomac ---
ctfconvert -L VERSION -g mac_lomac.o
A failure has been detected in another branch of the parallel make

make[4]: stopped in /usr/src/sys/modules/mac_lomac
*** [all_subdir_mac_lomac] Error code 2

make[3]: stopped in /usr/src/sys/modules
2 errors

make[3]: stopped in /usr/src/sys/modules
*** [modules-all] Error code 2

make[2]: stopped in /media/da0s1/obj/usr/src/sys/mk11
1 error

make[2]: stopped in /media/da0s1/obj/usr/src/sys/mk11
*** [buildkernel] Error code 2

make[1]: stopped in /usr/src
1 error


Re: svn commit: r284215 - in head/sys: amd64/linux32 compat/linux compat/svr4 dev/drm2/i915 fs/fdescfs i386/ibcs2 i386/linux kern ofed/drivers/infiniband/core ofed/drivers/infiniband/hw/mthca sys vm

2015-06-10 Thread Ivan Klymenko
Wed, 10 Jun 2015 15:16:13 +0300
Ivan Klymenko fi...@ukr.net написав:

 Wed, 10 Jun 2015 10:48:13 + (UTC)
 Mateusz Guzik m...@freebsd.org написав:
 
  Author: mjg
  Date: Wed Jun 10 10:48:12 2015
  New Revision: 284215
  URL: https://svnweb.freebsd.org/changeset/base/284215
  
  Log:
Implement lockless resource limits.

Use the same scheme implemented to manage credentials.

Code needing to look at process's credentials (as opposed to
  thred's) is provided with *_proc variants of relevant functions.

Places which possibly had to take the proc lock anyway still use
  the proc pointer to access limits.
  
  Modified:
head/sys/amd64/linux32/linux32_machdep.c
head/sys/compat/linux/linux_misc.c
head/sys/compat/svr4/imgact_svr4.c
head/sys/compat/svr4/svr4_misc.c
head/sys/compat/svr4/svr4_resource.c
head/sys/dev/drm2/i915/i915_gem.c
head/sys/fs/fdescfs/fdesc_vfsops.c
head/sys/i386/ibcs2/ibcs2_misc.c
head/sys/i386/linux/imgact_linux.c
head/sys/i386/linux/linux_machdep.c
head/sys/kern/imgact_aout.c
head/sys/kern/imgact_elf.c
head/sys/kern/imgact_gzip.c
head/sys/kern/kern_descrip.c
head/sys/kern/kern_event.c
head/sys/kern/kern_exec.c
head/sys/kern/kern_fork.c
head/sys/kern/kern_proc.c
head/sys/kern/kern_resource.c
head/sys/kern/kern_sig.c
head/sys/kern/kern_syscalls.c
head/sys/kern/kern_thread.c
head/sys/kern/subr_uio.c
head/sys/kern/sysv_shm.c
head/sys/kern/tty_pts.c
head/sys/kern/uipc_sockbuf.c
head/sys/kern/vfs_vnops.c
head/sys/ofed/drivers/infiniband/core/umem.c
head/sys/ofed/drivers/infiniband/hw/mthca/mthca_memfree.c
head/sys/sys/proc.h
head/sys/sys/resourcevar.h
head/sys/sys/vnode.h
head/sys/vm/swap_pager.c
head/sys/vm/vm_map.c
head/sys/vm/vm_mmap.c
head/sys/vm/vm_pageout.c
head/sys/vm/vm_unix.c
  
  ...
 
 /head/sys/amd64/linux/linux_machdep.c
 --- linux_machdep.c.orig2015-06-10 14:57:12.171984000 +0300
 +++ linux_machdep.c 2015-06-10 14:57:22.662331000 +0300
 @@ -251,7 +251,7 @@
  */
 PROC_LOCK(p);
 p-p_vmspace-vm_maxsaddr = (char *)USRSTACK -
 -   lim_cur(p, RLIMIT_STACK);
 +   lim_cur_proc(p, RLIMIT_STACK);
 PROC_UNLOCK(p);
 }
 
 must also change because:
 ...
 --- linux_stats.o ---
 /usr/local/libexec/ccache/world/cc -target x86_64-unknown-freebsd11.0
 --sysroot=/media/da0s1/obj/usr/src/tmp
 -B/media/da0s1/obj/usr/src/tmp/usr/bin -O2 -pipe
 -fno-strict-aliasing -Werror -D_KERNEL -DKLD_MODULE -nostdinc
 -DHAVE_KERNEL_OPTION_HEADERS
 -include /media/da0s1/obj/usr/src/sys/mk11/opt_global.h -I.
 -I/usr/src/sys -fno-common -g -fno-omit-frame-pointer
 -mno-omit-leaf-frame-pointer -I/media/da0s1/obj/usr/src/sys/mk11
 -mcmodel=kernel -mno-red-zone -mno-mmx -mno-sse -msoft-float
 -fno-asynchronous-unwind-tables -ffreestanding -fwrapv
 -fstack-protector -gdwarf-2 -Wall -Wredundant-decls -Wnested-externs
 -Wstrict-prototypes  -Wmissing-prototypes -Wpointer-arith -Winline
 -Wcast-qual  -Wundef -Wno-pointer-sign
 -D__printf__=__freebsd_kprintf__  -Wmissing-include-dirs
 -fdiagnostics-show-option  -Wno-unknown-pragmas
 -Wno-error-tautological-compare -Wno-error-empty-body
 -Wno-error-parentheses-equality -Wno-error-unused-function
 -Wno-error-pointer-sign  -mno-aes -mno-avx  -std=iso9899:1999
 -c /usr/src/sys/modules/linux64/../../compat/linux/linux_stats.c -o
 linux_stats.o --- linux_machdep.o --- distcc[26181] ERROR:
 compile /usr/src/sys/modules/linux64/../../amd64/linux/linux_machdep.c
 on localhost
 failed /usr/src/sys/modules/linux64/../../amd64/linux/linux_machdep.c:254:16:
 error: incompatible pointer types passing 'struct proc *' to
 parameter of type 'struct thread
 *' [-Werror,-Wincompatible-pointer-types] lim_cur(p, RLIMIT_STACK);
 ^ /usr/src/sys/sys/resourcevar.h:133:32: note: passing argument to
 parameter 'td' here rlim_t   lim_cur(struct thread *td, int which); ^
 1 error generated. *** [linux_machdep.o] Error code 1
 
 make[4]: stopped in /usr/src/sys/modules/linux64
 --- linux_stats.o ---
 ctfconvert -L VERSION -g linux_stats.o
 --- linux_file.o ---
 ctfconvert -L VERSION -g linux_file.o
 --- linux_misc.o ---
 ctfconvert -L VERSION -g linux_misc.o
 1 error
 
 make[4]: stopped in /usr/src/sys/modules/linux64
 *** [all_subdir_linux64] Error code 2
 
 make[3]: stopped in /usr/src/sys/modules
 --- all_subdir_mac_lomac ---
 ctfconvert -L VERSION -g mac_lomac.o
 A failure has been detected in another branch of the parallel make
 
 make[4]: stopped in /usr/src/sys/modules/mac_lomac
 *** [all_subdir_mac_lomac] Error code 2
 
 make[3]: stopped in /usr/src/sys/modules
 2 errors
 
 make[3]: stopped in /usr/src/sys/modules
 *** [modules-all] Error code 2
 
 make[2]: stopped in /media/da0s1/obj/usr/src/sys/mk11
 1 error
 
 make[2]: stopped in 

Re: svn commit: r284215 - in head/sys: amd64/linux32 compat/linux compat/svr4 dev/drm2/i915 fs/fdescfs i386/ibcs2 i386/linux kern ofed/drivers/infiniband/core ofed/drivers/infiniband/hw/mthca sys vm

2015-06-10 Thread Mateusz Guzik
On Wed, Jun 10, 2015 at 03:16:13PM +0300, Ivan Klymenko wrote:
 Wed, 10 Jun 2015 10:48:13 + (UTC)
 Mateusz Guzik m...@freebsd.org написав:
 
  Author: mjg
  Date: Wed Jun 10 10:48:12 2015
  New Revision: 284215
  URL: https://svnweb.freebsd.org/changeset/base/284215
  
  Log:
Implement lockless resource limits.

Use the same scheme implemented to manage credentials.

Code needing to look at process's credentials (as opposed to
  thred's) is provided with *_proc variants of relevant functions.

Places which possibly had to take the proc lock anyway still use
  the proc pointer to access limits.
  
 /usr/src/sys/modules/linux64/../../amd64/linux/linux_machdep.c:254:16: error: 
 incompatible pointer types passing 'struct proc *' to parameter of type 
 'struct thread *' [-Werror,-Wincompatible-pointer-types]
 lim_cur(p, RLIMIT_STACK);
 ^
 /usr/src/sys/sys/resourcevar.h:133:32: note: passing argument to parameter 
 'td' here
 rlim_t   lim_cur(struct thread *td, int which);
 ^

Oops, thanks. Fixed in r284217.

-- 
Mateusz Guzik mjguzik gmail.com
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org

Re: svn commit: r284215 - in head/sys: amd64/linux32 compat/linux compat/svr4 dev/drm2/i915 fs/fdescfs i386/ibcs2 i386/linux kern ofed/drivers/infiniband/core ofed/drivers/infiniband/hw/mthca sys vm

2015-06-10 Thread Mateusz Guzik
On Wed, Jun 10, 2015 at 04:33:26PM +0300, Ivan Klymenko wrote:
 Wed, 10 Jun 2015 10:48:13 + (UTC)
 Mateusz Guzik m...@freebsd.org написав:
 
  Author: mjg
  Date: Wed Jun 10 10:48:12 2015
  New Revision: 284215
  URL: https://svnweb.freebsd.org/changeset/base/284215
  
  Log:
Implement lockless resource limits.

Use the same scheme implemented to manage credentials.

Code needing to look at process's credentials (as opposed to
  thred's) is provided with *_proc variants of relevant functions.

Places which possibly had to take the proc lock anyway still use
  the proc pointer to access limits.
  
  
 
 I have panic.
 I not sure that it refers to a specific commit.
 
 Fatal trap 12: page fault while in kernel mode
 cpuid = 0; apic id = 00
 fault virtual address = 0x80
 fault code= supervisor read data, page not present
 instruction pointer   = 0x20:0x809cfbfa
 stack pointer = 0x28:0xfe01aa4906c0
 frame pointer = 0x28:0xfe01aa4906e0
 code segment  = base 0x0, limit 0xf, type 0x1b
   = DPL 0, pres 1, long 1, def32 0, gran 1
 processor eflags  = interrupt enabled, resume, IOPL = 0
 current process   = 4091 (npviewer.bin)
 trap number   = 12
 panic: page fault
 cpuid = 0
 KDB: stack backtrace:
 #0 0x80a17c27 at kdb_backtrace+0x67
 #1 0x809d3f79 at vpanic+0x189
 #2 0x809d3de3 at panic+0x43
 #3 0x80e73b35 at trap_fatal+0x355
 #4 0x80e73e6e at trap_pfault+0x31e
 #5 0x80e734d4 at trap+0x464
 #6 0x80e57422 at calltrap+0x8
 #7 0x8097c942 at fdalloc+0x32
 #8 0x8097cf95 at finstall+0x95
 #9 0x80a99844 at kern_openat+0x3c4
 #10 0x8229fe93 at linux_common_open+0xc3
 #11 0x822a0068 at linux_open+0x58
 #12 0x80f7408b at ia32_syscall+0x41b
 #13 0x80e57a05 at Xint0x80_syscall+0x95
 Uptime: 29m1s
 Dumping 854 out of 6047 MB:..2%..12%..21%..32%..42%..51%..62%..72%..81%..92%
 
 221   pcpu.h: No such file or directory.
   in pcpu.h
 (kgdb) #0  doadump (textdump=value optimized out) at pcpu.h:221
 #1  0x809d3a7d in kern_reboot (howto=260)
 at /usr/src/sys/kern/kern_shutdown.c:447
 #2  0x809d3fb8 in vpanic (fmt=value optimized out, 
 ap=value optimized out) at /usr/src/sys/kern/kern_shutdown.c:744
 #3  0x809d3de3 in panic (fmt=0x0)
 at /usr/src/sys/kern/kern_shutdown.c:675
 #4  0x80e73b35 in trap_fatal (frame=value optimized out, 
 eva=value optimized out) at /usr/src/sys/amd64/amd64/trap.c:853
 #5  0x80e73e6e in trap_pfault (frame=0xfe01aa490610, 
 usermode=value optimized out) at /usr/src/sys/amd64/amd64/trap.c:676
 #6  0x80e734d4 in trap (frame=0xfe01aa490610)
 at /usr/src/sys/amd64/amd64/trap.c:426
 #7  0x80e57422 in calltrap ()
 at /usr/src/sys/amd64/amd64/exception.S:235
 #8  0x809cfbfa in lim_cur (td=0xf8010185e4c0, which=8)
 at /usr/src/sys/kern/kern_resource.c:1209
 #9  0x8097c942 in fdalloc (td=0xf8010185e4c0, 
 minfd=value optimized out, result=0xfe01aa4907dc)
 at /usr/src/sys/kern/kern_descrip.c:790
 #10 0x8097cf95 in finstall (td=0xf8010185e4c0, 
 fp=0xf80139e89870, fd=0xfe01aa4907dc, flags=1, fcaps=0x0)
 at /usr/src/sys/kern/kern_descrip.c:1768
 #11 0x80a99844 in kern_openat (td=0xf8010185e4c0, fd=-100, 
 path=0xf80016832400 /compat/linux/proc/stat, pathseg=UIO_SYSSPACE, 
 flags=value optimized out, mode=value optimized out)
 at /usr/src/sys/kern/vfs_syscalls.c:1158
 #12 0x8229fe93 in linux_common_open (td=0xf8010185e4c0, dirfd=8, 
 path=0xf80016832400 /compat/linux/proc/stat, 
 l_flags=value optimized out, mode=51)
 at /usr/src/sys/modules/linux/../../compat/linux/linux_file.c:134
 #13 0x822a0068 in linux_open (td=value optimized out, 
 args=value optimized out)
 at /usr/src/sys/modules/linux/../../compat/linux/linux_file.c:211
 #14 0x80f7408b in ia32_syscall (frame=0xfe01aa490ac0)
 at subr_syscall.c:133
 #15 0x80e57a05 in Xint0x80_syscall () at ia32_exception.S:73
 #16 0xe452 in ?? ()
 Previous frame inner to this frame (corrupt stack?)
 Current language:  auto; currently minimal
 (kgdb) 
 

The following should fix it:
diff --git a/sys/compat/linux/linux_fork.c b/sys/compat/linux/linux_fork.c
index 0fd47fd..394c26f 100644
--- a/sys/compat/linux/linux_fork.c
+++ b/sys/compat/linux/linux_fork.c
@@ -298,7 +298,7 @@ linux_clone_thread(struct thread *td, struct 
linux_clone_args *args)
__rangeof(struct thread, td_startcopy, td_endcopy));
 
newtd-td_proc = p;
-   newtd-td_ucred = crhold(td-td_ucred);
+   thread_cow_get(newtd, td);
 
/* create the emuldata */
linux_proc_init(td, newtd, args-flags);

Still, it seems a bug that linux_clone_thread replicates so much of 

Re: svn commit: r284215 - in head/sys: amd64/linux32 compat/linux compat/svr4 dev/drm2/i915 fs/fdescfs i386/ibcs2 i386/linux kern ofed/drivers/infiniband/core ofed/drivers/infiniband/hw/mthca sys vm

2015-06-10 Thread Ivan Klymenko
Wed, 10 Jun 2015 10:48:13 + (UTC)
Mateusz Guzik m...@freebsd.org написав:

 Author: mjg
 Date: Wed Jun 10 10:48:12 2015
 New Revision: 284215
 URL: https://svnweb.freebsd.org/changeset/base/284215
 
 Log:
   Implement lockless resource limits.
   
   Use the same scheme implemented to manage credentials.
   
   Code needing to look at process's credentials (as opposed to
 thred's) is provided with *_proc variants of relevant functions.
   
   Places which possibly had to take the proc lock anyway still use
 the proc pointer to access limits.
 
 Modified:
   head/sys/amd64/linux32/linux32_machdep.c
   head/sys/compat/linux/linux_misc.c
   head/sys/compat/svr4/imgact_svr4.c
   head/sys/compat/svr4/svr4_misc.c
   head/sys/compat/svr4/svr4_resource.c
   head/sys/dev/drm2/i915/i915_gem.c
   head/sys/fs/fdescfs/fdesc_vfsops.c
   head/sys/i386/ibcs2/ibcs2_misc.c
   head/sys/i386/linux/imgact_linux.c
   head/sys/i386/linux/linux_machdep.c
   head/sys/kern/imgact_aout.c
   head/sys/kern/imgact_elf.c
   head/sys/kern/imgact_gzip.c
   head/sys/kern/kern_descrip.c
   head/sys/kern/kern_event.c
   head/sys/kern/kern_exec.c
   head/sys/kern/kern_fork.c
   head/sys/kern/kern_proc.c
   head/sys/kern/kern_resource.c
   head/sys/kern/kern_sig.c
   head/sys/kern/kern_syscalls.c
   head/sys/kern/kern_thread.c
   head/sys/kern/subr_uio.c
   head/sys/kern/sysv_shm.c
   head/sys/kern/tty_pts.c
   head/sys/kern/uipc_sockbuf.c
   head/sys/kern/vfs_vnops.c
   head/sys/ofed/drivers/infiniband/core/umem.c
   head/sys/ofed/drivers/infiniband/hw/mthca/mthca_memfree.c
   head/sys/sys/proc.h
   head/sys/sys/resourcevar.h
   head/sys/sys/vnode.h
   head/sys/vm/swap_pager.c
   head/sys/vm/vm_map.c
   head/sys/vm/vm_mmap.c
   head/sys/vm/vm_pageout.c
   head/sys/vm/vm_unix.c
 

I have panic.
I not sure that it refers to a specific commit.

FreeBSD nonamehost.local 11.0-CURRENT FreeBSD 11.0-CURRENT #0 r284215M: Wed Jun 
10 15:38:11 EEST 2015 
ivan@nonamehost.local:/media/da0s1/obj/usr/src/sys/mk11  amd64

panic: page fault

GNU gdb 6.1.1 [FreeBSD]
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type show copying to see the conditions.
There is absolutely no warranty for GDB.  Type show warranty for details.
This GDB was configured as amd64-marcel-freebsd...

Unread portion of the kernel message buffer:


Fatal trap 12: page fault while in kernel mode
cpuid = 0; apic id = 00
fault virtual address   = 0x80
fault code  = supervisor read data, page not present
instruction pointer = 0x20:0x809cfbfa
stack pointer   = 0x28:0xfe01aa4906c0
frame pointer   = 0x28:0xfe01aa4906e0
code segment= base 0x0, limit 0xf, type 0x1b
= DPL 0, pres 1, long 1, def32 0, gran 1
processor eflags= interrupt enabled, resume, IOPL = 0
current process = 4091 (npviewer.bin)
trap number = 12
panic: page fault
cpuid = 0
KDB: stack backtrace:
#0 0x80a17c27 at kdb_backtrace+0x67
#1 0x809d3f79 at vpanic+0x189
#2 0x809d3de3 at panic+0x43
#3 0x80e73b35 at trap_fatal+0x355
#4 0x80e73e6e at trap_pfault+0x31e
#5 0x80e734d4 at trap+0x464
#6 0x80e57422 at calltrap+0x8
#7 0x8097c942 at fdalloc+0x32
#8 0x8097cf95 at finstall+0x95
#9 0x80a99844 at kern_openat+0x3c4
#10 0x8229fe93 at linux_common_open+0xc3
#11 0x822a0068 at linux_open+0x58
#12 0x80f7408b at ia32_syscall+0x41b
#13 0x80e57a05 at Xint0x80_syscall+0x95
Uptime: 29m1s
Dumping 854 out of 6047 MB:..2%..12%..21%..32%..42%..51%..62%..72%..81%..92%

Reading symbols from /bootpool/boot/kernel/fdescfs.ko.symbols...done.
Loaded symbols for /bootpool/boot/kernel/fdescfs.ko.symbols
Reading symbols from /bootpool/boot/kernel/linprocfs.ko.symbols...done.
Loaded symbols for /bootpool/boot/kernel/linprocfs.ko.symbols
Reading symbols from /bootpool/boot/kernel/linux_common.ko.symbols...done.
Loaded symbols for /bootpool/boot/kernel/linux_common.ko.symbols
Reading symbols from /bootpool/boot/kernel/linsysfs.ko.symbols...done.
Loaded symbols for /bootpool/boot/kernel/linsysfs.ko.symbols
Reading symbols from /bootpool/boot/kernel/zfs.ko.symbols...done.
Loaded symbols for /bootpool/boot/kernel/zfs.ko.symbols
Reading symbols from /bootpool/boot/kernel/opensolaris.ko.symbols...done.
Loaded symbols for /bootpool/boot/kernel/opensolaris.ko.symbols
Reading symbols from /bootpool/boot/kernel/coretemp.ko.symbols...done.
Loaded symbols for /bootpool/boot/kernel/coretemp.ko.symbols
Reading symbols from /bootpool/boot/kernel/ichwd.ko.symbols...done.
Loaded symbols for /bootpool/boot/kernel/ichwd.ko.symbols
Reading symbols from /bootpool/boot/kernel/cpuctl.ko.symbols...done.
Loaded symbols for /bootpool/boot/kernel/cpuctl.ko.symbols
Reading symbols from 

Re: svn commit: r284215 - in head/sys: amd64/linux32 compat/linux compat/svr4 dev/drm2/i915 fs/fdescfs i386/ibcs2 i386/linux kern ofed/drivers/infiniband/core ofed/drivers/infiniband/hw/mthca sys vm

2015-06-10 Thread Ivan Klymenko
Wed, 10 Jun 2015 21:29:38 +0200
Mateusz Guzik mjgu...@gmail.com написав:

 On Wed, Jun 10, 2015 at 10:13:17PM +0300, Ivan Klymenko wrote:
  Wed, 10 Jun 2015 21:09:25 +0200
  Mateusz Guzik mjgu...@gmail.com написав:
  
   On Wed, Jun 10, 2015 at 09:47:57PM +0300, Ivan Klymenko wrote:
Wed, 10 Jun 2015 10:48:13 + (UTC)
Mateusz Guzik m...@freebsd.org написав:

 kern_resource.c

I get another panic - this time with VirtualBox:

  
   
   Have you recompiled the module after you updated the kernel?
   
  
  Of course.
  
 
 So how have you patched the source? If you have updated headers in
 place, the compilation should fail due to parameter type mismatch.
 

Unfortunately no patches I have, except that r284222 + patch from
r284226

 Can you go to the frame with the thread and dump it's content?


if I understood correctly
http://pastebin.com/wim7jM7i
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org

Re: svn commit: r284215 - in head/sys: amd64/linux32 compat/linux compat/svr4 dev/drm2/i915 fs/fdescfs i386/ibcs2 i386/linux kern ofed/drivers/infiniband/core ofed/drivers/infiniband/hw/mthca sys vm

2015-06-10 Thread Mateusz Guzik
On Wed, Jun 10, 2015 at 11:08:14PM +0300, Ivan Klymenko wrote:
 Wed, 10 Jun 2015 21:29:38 +0200
 Mateusz Guzik mjgu...@gmail.com написав:
 
  On Wed, Jun 10, 2015 at 10:13:17PM +0300, Ivan Klymenko wrote:
   Wed, 10 Jun 2015 21:09:25 +0200
   Mateusz Guzik mjgu...@gmail.com написав:
   
On Wed, Jun 10, 2015 at 09:47:57PM +0300, Ivan Klymenko wrote:
 Wed, 10 Jun 2015 10:48:13 + (UTC)
 Mateusz Guzik m...@freebsd.org написав:
 
  kern_resource.c
 
 I get another panic - this time with VirtualBox:
 
   

Have you recompiled the module after you updated the kernel?

   
   Of course.
   
  
  So how have you patched the source? If you have updated headers in
  place, the compilation should fail due to parameter type mismatch.
  
 
 Unfortunately no patches I have, except that r284222 + patch from
 r284226
 
  Can you go to the frame with the thread and dump it's content?
 
 
 if I understood correctly
 http://pastebin.com/wim7jM7i

Well this does not look like a valid thread and that's expected.

Apparently virtualbox is compiled with '-w', which disables warnings and
then they enable only a small subset. Information about pointer mismatch
is amongst suppressed warnings.

As noted earlier the issue can be trivially fixed:
--- ./src/VBox/Runtime/r0drv/freebsd/memobj-r0drv-freebsd.c.orig
2015-06-10 19:30:28.355276494 +
+++ ./src/VBox/Runtime/r0drv/freebsd/memobj-r0drv-freebsd.c 2015-06-10 
19:30:41.280304985 +
@@ -747,7 +747,7 @@
 {
 /** @todo: is this needed?. */
 PROC_LOCK(pProc);
-AddrR3 = round_page((vm_offset_t)pProc-p_vmspace-vm_daddr + 
lim_max(pProc, RLIMIT_DATA));
+AddrR3 = round_page((vm_offset_t)pProc-p_vmspace-vm_daddr + 
lim_max_proc(pProc, RLIMIT_DATA));
 PROC_UNLOCK(pProc);
 }
 else

-- 
Mateusz Guzik mjguzik gmail.com
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org

Re: svn commit: r284215 - in head/sys: amd64/linux32 compat/linux compat/svr4 dev/drm2/i915 fs/fdescfs i386/ibcs2 i386/linux kern ofed/drivers/infiniband/core ofed/drivers/infiniband/hw/mthca sys vm

2015-06-10 Thread Ivan Klymenko
Wed, 10 Jun 2015 22:29:11 +0200
Mateusz Guzik mjgu...@gmail.com написав:

 On Wed, Jun 10, 2015 at 11:08:14PM +0300, Ivan Klymenko wrote:
  Wed, 10 Jun 2015 21:29:38 +0200
  Mateusz Guzik mjgu...@gmail.com написав:
  
   On Wed, Jun 10, 2015 at 10:13:17PM +0300, Ivan Klymenko wrote:
Wed, 10 Jun 2015 21:09:25 +0200
Mateusz Guzik mjgu...@gmail.com написав:

 On Wed, Jun 10, 2015 at 09:47:57PM +0300, Ivan Klymenko wrote:
  Wed, 10 Jun 2015 10:48:13 + (UTC)
  Mateusz Guzik m...@freebsd.org написав:
  
   kern_resource.c
  
  I get another panic - this time with VirtualBox:
  

 
 Have you recompiled the module after you updated the kernel?
 

Of course.

   
   So how have you patched the source? If you have updated headers in
   place, the compilation should fail due to parameter type mismatch.
   
  
  Unfortunately no patches I have, except that r284222 + patch from
  r284226
  
   Can you go to the frame with the thread and dump it's content?
  
  
  if I understood correctly
  http://pastebin.com/wim7jM7i
 
 Well this does not look like a valid thread and that's expected.
 
 Apparently virtualbox is compiled with '-w', which disables warnings
 and then they enable only a small subset. Information about pointer
 mismatch is amongst suppressed warnings.
 
 As noted earlier the issue can be trivially fixed:
 --- ./src/VBox/Runtime/r0drv/freebsd/memobj-r0drv-freebsd.c.orig
 2015-06-10 19:30:28.355276494 +
 +++ ./src/VBox/Runtime/r0drv/freebsd/memobj-r0drv-freebsd.c
 2015-06-10 19:30:41.280304985 + @@ -747,7 +747,7 @@ {
  /** @todo: is this needed?. */
  PROC_LOCK(pProc);
 -AddrR3 = round_page((vm_offset_t)pProc-p_vmspace-vm_daddr
 + lim_max(pProc, RLIMIT_DATA));
 +AddrR3 = round_page((vm_offset_t)pProc-p_vmspace-vm_daddr
 + lim_max_proc(pProc, RLIMIT_DATA)); PROC_UNLOCK(pProc);
  }
  else
 

Cool! It works.
Thank you very much.
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org

Re: svn commit: r284215 - in head/sys: amd64/linux32 compat/linux compat/svr4 dev/drm2/i915 fs/fdescfs i386/ibcs2 i386/linux kern ofed/drivers/infiniband/core ofed/drivers/infiniband/hw/mthca sys vm

2015-06-10 Thread Ivan Klymenko
Wed, 10 Jun 2015 21:09:25 +0200
Mateusz Guzik mjgu...@gmail.com написав:

 On Wed, Jun 10, 2015 at 09:47:57PM +0300, Ivan Klymenko wrote:
  Wed, 10 Jun 2015 10:48:13 + (UTC)
  Mateusz Guzik m...@freebsd.org написав:
  
   kern_resource.c
  
  I get another panic - this time with VirtualBox:
  

 
 Have you recompiled the module after you updated the kernel?
 

Of course.

 Quick guess suggests that the passed pointer is to struct proc, while
 the function in question now expects struct thread.
 
 lim_max_proc can be used instead if thread pointer is not suitable.
 
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org

Re: svn commit: r284215 - in head/sys: amd64/linux32 compat/linux compat/svr4 dev/drm2/i915 fs/fdescfs i386/ibcs2 i386/linux kern ofed/drivers/infiniband/core ofed/drivers/infiniband/hw/mthca sys vm

2015-06-10 Thread Mateusz Guzik
On Wed, Jun 10, 2015 at 09:47:57PM +0300, Ivan Klymenko wrote:
 Wed, 10 Jun 2015 10:48:13 + (UTC)
 Mateusz Guzik m...@freebsd.org написав:
 
  kern_resource.c
 
 I get another panic - this time with VirtualBox:
 
 nonamehost.local dumped core - see /var/crash/vmcore.0
 
 Wed Jun 10 21:38:13 EEST 2015
 
 FreeBSD nonamehost.local 11.0-CURRENT FreeBSD 11.0-CURRENT #0 r284222M: Wed 
 Jun 10 17:58:54 EEST 2015 
 ivan@nonamehost.local:/media/da0s1/obj/usr/src/sys/mk11  amd64
 
 panic: page fault
 
 GNU gdb 6.1.1 [FreeBSD]
 Copyright 2004 Free Software Foundation, Inc.
 GDB is free software, covered by the GNU General Public License, and you are
 welcome to change it and/or distribute copies of it under certain conditions.
 Type show copying to see the conditions.
 There is absolutely no warranty for GDB.  Type show warranty for details.
 This GDB was configured as amd64-marcel-freebsd...
 
 Unread portion of the kernel message buffer:
 
 
 Fatal trap 12: page fault while in kernel mode
 cpuid = 3; apic id = 03
 fault virtual address = 0x20030020
 fault code= supervisor read data, page not present
 instruction pointer   = 0x20:0x809cfb1a
 stack pointer = 0x28:0xfe01aa0f95c0
 frame pointer = 0x28:0xfe01aa0f95e0
 code segment  = base 0x0, limit 0xf, type 0x1b
   = DPL 0, pres 1, long 1, def32 0, gran 1
 processor eflags  = interrupt enabled, resume, IOPL = 0
 current process   = 8647 (VirtualBox)
 trap number   = 12
 panic: page fault
 cpuid = 3
 KDB: stack backtrace:
 #0 0x80a17c27 at kdb_backtrace+0x67
 #1 0x809d3f79 at vpanic+0x189
 #2 0x809d3de3 at panic+0x43
 #3 0x80e73b35 at trap_fatal+0x355
 #4 0x80e73e6e at trap_pfault+0x31e
 #5 0x80e734d4 at trap+0x464
 #6 0x80e57422 at calltrap+0x8
 #7 0x8244eb94 at rtR0MemObjNativeMapUser+0xa4
 #8 0x8244d935 at RTR0MemObjMapUserTag+0x135
 #9 0x82435382 at SUPR0GipMap+0x152
 #10 0x82431311 at supdrvIOCtlInnerUnrestricted+0xa11
 #11 0x8243b515 at VBoxDrvFreeBSDIOCtl+0x1b5
 #12 0x80897dab at devfs_ioctl_f+0x13b
 #13 0x80a35ee1 at kern_ioctl+0x401
 #14 0x80a35a33 at sys_ioctl+0x153
 #15 0x80e74579 at amd64_syscall+0x3e9
 #16 0x80e5770b at Xfast_syscall+0xfb
 Uptime: 3h23m47s
 Dumping 998 out of 6047 MB:..2%..12%..21%..31%..41%..52%..61%..71%..81%..92%
 
 221   pcpu.h: No such file or directory.
   in pcpu.h
 (kgdb) #0  doadump (textdump=value optimized out) at pcpu.h:221
 #1  0x809d3a7d in kern_reboot (howto=260)
 at /usr/src/sys/kern/kern_shutdown.c:447
 #2  0x809d3fb8 in vpanic (fmt=value optimized out, 
 ap=value optimized out) at /usr/src/sys/kern/kern_shutdown.c:744
 #3  0x809d3de3 in panic (fmt=0x0)
 at /usr/src/sys/kern/kern_shutdown.c:675
 #4  0x80e73b35 in trap_fatal (frame=value optimized out, 
 eva=value optimized out) at /usr/src/sys/amd64/amd64/trap.c:853
 #5  0x80e73e6e in trap_pfault (frame=0xfe01aa0f9510, 
 usermode=value optimized out) at /usr/src/sys/amd64/amd64/trap.c:676
 #6  0x80e734d4 in trap (frame=0xfe01aa0f9510)
 at /usr/src/sys/amd64/amd64/trap.c:426
 #7  0x80e57422 in calltrap ()
 at /usr/src/sys/amd64/amd64/exception.S:235
 #8  0x809cfb1a in lim_max (td=0xf8008e3b4a70, which=2)
 at /usr/src/sys/kern/kern_resource.c:1209
 #9  0x8244eb94 in rtR0MemObjNativeMapUser ()
from /boot/modules/vboxdrv.ko
 #10 0x8244d935 in RTR0MemObjMapUserTag ()
from /boot/modules/vboxdrv.ko
 #11 0x82435382 in SUPR0GipMap () from /boot/modules/vboxdrv.ko
 #12 0x82431311 in supdrvIOCtlInnerUnrestricted ()
from /boot/modules/vboxdrv.ko
 #13 0x8243b515 in VBoxDrvFreeBSDIOCtl () from /boot/modules/vboxdrv.ko
 #14 0x80897dab in devfs_ioctl_f (fp=0xf8008e3b4a70, 
 com=18446744073709551615, data=0x1, cred=value optimized out, 
 td=0xf80027d64000) at /usr/src/sys/fs/devfs/devfs_vnops.c:806
 #15 0x80a35ee1 in kern_ioctl (td=0xf8005dedc980, 
 fd=value optimized out, com=2, data=value optimized out) at file.h:326
 #16 0x80a35a33 in sys_ioctl (td=0xf8005dedc980, 
 uap=0xfe01aa0f9a40) at /usr/src/sys/kern/sys_generic.c:722
 #17 0x80e74579 in amd64_syscall (td=0xf8005dedc980, traced=0)
 at subr_syscall.c:133
 #18 0x80e5770b in Xfast_syscall ()
 at /usr/src/sys/amd64/amd64/exception.S:395
 #19 0x00080129b6ca in ?? ()
 Previous frame inner to this frame (corrupt stack?)
 Current language:  auto; currently minimal
 (kgdb) 

Have you recompiled the module after you updated the kernel?

Quick guess suggests that the passed pointer is to struct proc, while
the function in question now expects struct thread.

lim_max_proc can be used instead if thread pointer is not suitable.

-- 
Mateusz Guzik mjguzik 

Re: svn commit: r284215 - in head/sys: amd64/linux32 compat/linux compat/svr4 dev/drm2/i915 fs/fdescfs i386/ibcs2 i386/linux kern ofed/drivers/infiniband/core ofed/drivers/infiniband/hw/mthca sys vm

2015-06-10 Thread Mateusz Guzik
On Wed, Jun 10, 2015 at 10:13:17PM +0300, Ivan Klymenko wrote:
 Wed, 10 Jun 2015 21:09:25 +0200
 Mateusz Guzik mjgu...@gmail.com написав:
 
  On Wed, Jun 10, 2015 at 09:47:57PM +0300, Ivan Klymenko wrote:
   Wed, 10 Jun 2015 10:48:13 + (UTC)
   Mateusz Guzik m...@freebsd.org написав:
   
kern_resource.c
   
   I get another panic - this time with VirtualBox:
   
 
  
  Have you recompiled the module after you updated the kernel?
  
 
 Of course.
 

So how have you patched the source? If you have updated headers in
place, the compilation should fail due to parameter type mismatch.

Can you go to the frame with the thread and dump it's content?
-- 
Mateusz Guzik mjguzik gmail.com
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org

Re: svn commit: r284215 - in head/sys: amd64/linux32 compat/linux compat/svr4 dev/drm2/i915 fs/fdescfs i386/ibcs2 i386/linux kern ofed/drivers/infiniband/core ofed/drivers/infiniband/hw/mthca sys vm

2015-06-10 Thread Ivan Klymenko
Wed, 10 Jun 2015 10:48:13 + (UTC)
Mateusz Guzik m...@freebsd.org написав:

 kern_resource.c

I get another panic - this time with VirtualBox:

nonamehost.local dumped core - see /var/crash/vmcore.0

Wed Jun 10 21:38:13 EEST 2015

FreeBSD nonamehost.local 11.0-CURRENT FreeBSD 11.0-CURRENT #0 r284222M: Wed Jun 
10 17:58:54 EEST 2015 
ivan@nonamehost.local:/media/da0s1/obj/usr/src/sys/mk11  amd64

panic: page fault

GNU gdb 6.1.1 [FreeBSD]
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type show copying to see the conditions.
There is absolutely no warranty for GDB.  Type show warranty for details.
This GDB was configured as amd64-marcel-freebsd...

Unread portion of the kernel message buffer:


Fatal trap 12: page fault while in kernel mode
cpuid = 3; apic id = 03
fault virtual address   = 0x20030020
fault code  = supervisor read data, page not present
instruction pointer = 0x20:0x809cfb1a
stack pointer   = 0x28:0xfe01aa0f95c0
frame pointer   = 0x28:0xfe01aa0f95e0
code segment= base 0x0, limit 0xf, type 0x1b
= DPL 0, pres 1, long 1, def32 0, gran 1
processor eflags= interrupt enabled, resume, IOPL = 0
current process = 8647 (VirtualBox)
trap number = 12
panic: page fault
cpuid = 3
KDB: stack backtrace:
#0 0x80a17c27 at kdb_backtrace+0x67
#1 0x809d3f79 at vpanic+0x189
#2 0x809d3de3 at panic+0x43
#3 0x80e73b35 at trap_fatal+0x355
#4 0x80e73e6e at trap_pfault+0x31e
#5 0x80e734d4 at trap+0x464
#6 0x80e57422 at calltrap+0x8
#7 0x8244eb94 at rtR0MemObjNativeMapUser+0xa4
#8 0x8244d935 at RTR0MemObjMapUserTag+0x135
#9 0x82435382 at SUPR0GipMap+0x152
#10 0x82431311 at supdrvIOCtlInnerUnrestricted+0xa11
#11 0x8243b515 at VBoxDrvFreeBSDIOCtl+0x1b5
#12 0x80897dab at devfs_ioctl_f+0x13b
#13 0x80a35ee1 at kern_ioctl+0x401
#14 0x80a35a33 at sys_ioctl+0x153
#15 0x80e74579 at amd64_syscall+0x3e9
#16 0x80e5770b at Xfast_syscall+0xfb
Uptime: 3h23m47s
Dumping 998 out of 6047 MB:..2%..12%..21%..31%..41%..52%..61%..71%..81%..92%

Reading symbols from /bootpool/boot/kernel/fdescfs.ko.symbols...done.
Loaded symbols for /bootpool/boot/kernel/fdescfs.ko.symbols
Reading symbols from /bootpool/boot/kernel/linprocfs.ko.symbols...done.
Loaded symbols for /bootpool/boot/kernel/linprocfs.ko.symbols
Reading symbols from /bootpool/boot/kernel/linux_common.ko.symbols...done.
Loaded symbols for /bootpool/boot/kernel/linux_common.ko.symbols
Reading symbols from /bootpool/boot/kernel/linsysfs.ko.symbols...done.
Loaded symbols for /bootpool/boot/kernel/linsysfs.ko.symbols
Reading symbols from /bootpool/boot/kernel/zfs.ko.symbols...done.
Loaded symbols for /bootpool/boot/kernel/zfs.ko.symbols
Reading symbols from /bootpool/boot/kernel/opensolaris.ko.symbols...done.
Loaded symbols for /bootpool/boot/kernel/opensolaris.ko.symbols
Reading symbols from /bootpool/boot/kernel/coretemp.ko.symbols...done.
Loaded symbols for /bootpool/boot/kernel/coretemp.ko.symbols
Reading symbols from /bootpool/boot/kernel/ichwd.ko.symbols...done.
Loaded symbols for /bootpool/boot/kernel/ichwd.ko.symbols
Reading symbols from /bootpool/boot/kernel/cpuctl.ko.symbols...done.
Loaded symbols for /bootpool/boot/kernel/cpuctl.ko.symbols
Reading symbols from /bootpool/boot/kernel/aesni.ko.symbols...done.
Loaded symbols for /bootpool/boot/kernel/aesni.ko.symbols
Reading symbols from /bootpool/boot/kernel/crypto.ko.symbols...done.
Loaded symbols for /bootpool/boot/kernel/crypto.ko.symbols
Reading symbols from /bootpool/boot/kernel/cryptodev.ko.symbols...done.
Loaded symbols for /bootpool/boot/kernel/cryptodev.ko.symbols
Reading symbols from /bootpool/boot/kernel/sem.ko.symbols...done.
Loaded symbols for /bootpool/boot/kernel/sem.ko.symbols
Reading symbols from /bootpool/boot/kernel/accf_data.ko.symbols...done.
Loaded symbols for /bootpool/boot/kernel/accf_data.ko.symbols
Reading symbols from /bootpool/boot/kernel/accf_http.ko.symbols...done.
Loaded symbols for /bootpool/boot/kernel/accf_http.ko.symbols
Reading symbols from /bootpool/boot/kernel/accf_dns.ko.symbols...done.
Loaded symbols for /bootpool/boot/kernel/accf_dns.ko.symbols
Reading symbols from /bootpool/boot/kernel/h_ertt.ko.symbols...done.
Loaded symbols for /bootpool/boot/kernel/h_ertt.ko.symbols
Reading symbols from /bootpool/boot/kernel/cc_cdg.ko.symbols...done.
Loaded symbols for /bootpool/boot/kernel/cc_cdg.ko.symbols
Reading symbols from /bootpool/boot/kernel/cc_chd.ko.symbols...done.
Loaded symbols for /bootpool/boot/kernel/cc_chd.ko.symbols
Reading symbols from /bootpool/boot/kernel/cc_cubic.ko.symbols...done.
Loaded symbols for /bootpool/boot/kernel/cc_cubic.ko.symbols
Reading symbols from 

Re: svn commit: r284215 - in head/sys: amd64/linux32 compat/linux compat/svr4 dev/drm2/i915 fs/fdescfs i386/ibcs2 i386/linux kern ofed/drivers/infiniband/core ofed/drivers/infiniband/hw/mthca sys vm

2015-06-10 Thread Jung-uk Kim
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

On 06/10/2015 16:42, Ivan Klymenko wrote:
 Wed, 10 Jun 2015 22:29:11 +0200 Mateusz Guzik mjgu...@gmail.com 
 написав:
 
 On Wed, Jun 10, 2015 at 11:08:14PM +0300, Ivan Klymenko wrote:
 Wed, 10 Jun 2015 21:29:38 +0200 Mateusz Guzik 
 mjgu...@gmail.com написав:
 
 On Wed, Jun 10, 2015 at 10:13:17PM +0300, Ivan Klymenko 
 wrote:
 Wed, 10 Jun 2015 21:09:25 +0200 Mateusz Guzik 
 mjgu...@gmail.com написав:
 
 On Wed, Jun 10, 2015 at 09:47:57PM +0300, Ivan Klymenko 
 wrote:
 Wed, 10 Jun 2015 10:48:13 + (UTC) Mateusz Guzik 
 m...@freebsd.org написав:
 
 kern_resource.c
 
 I get another panic - this time with VirtualBox:
 
 
 
 Have you recompiled the module after you updated the 
 kernel?
 
 
 Of course.
 
 
 So how have you patched the source? If you have updated 
 headers in place, the compilation should fail due to 
 parameter type mismatch.
 
 
 Unfortunately no patches I have, except that r284222 + patch 
 from r284226
 
 Can you go to the frame with the thread and dump it's 
 content?
 
 
 if I understood correctly http://pastebin.com/wim7jM7i
 
 Well this does not look like a valid thread and that's expected.
 
 Apparently virtualbox is compiled with '-w', which disables 
 warnings and then they enable only a small subset. Information 
 about pointer mismatch is amongst suppressed warnings.
 
 As noted earlier the issue can be trivially fixed: --- 
 ./src/VBox/Runtime/r0drv/freebsd/memobj-r0drv-freebsd.c.orig 
 2015-06-10 19:30:28.355276494 + +++ 
 ./src/VBox/Runtime/r0drv/freebsd/memobj-r0drv-freebsd.c 
 2015-06-10 19:30:41.280304985 + @@ -747,7 +747,7 @@ { /** 
 @todo: is this needed?. */ PROC_LOCK(pProc); -AddrR3 = 
 round_page((vm_offset_t)pProc-p_vmspace-vm_daddr + 
 lim_max(pProc, RLIMIT_DATA)); +AddrR3 = 
 round_page((vm_offset_t)pProc-p_vmspace-vm_daddr + 
 lim_max_proc(pProc, RLIMIT_DATA)); PROC_UNLOCK(pProc); } else
 
 
 Cool! It works. Thank you very much.

Committed.

https://svnweb.freebsd.org/changeset/ports/389147

Thanks!

Jung-uk Kim
-BEGIN PGP SIGNATURE-
Version: GnuPG v2

iQEcBAEBCAAGBQJVeKaWAAoJEHyflib82/FGHs4H/1ltpV+nAC7LDGZUXWps6+Gm
ERuHCkgdA4E9AiZoOKxCOFy514bkqdQAm+upTiVAFaegiCHJrLxWMR2kfqQsUoO2
C/hJ8600S0XTo879zppghJ6wk4EB2YJDc3GD8ftzM9i5ihGu1iDzxb543i7CJD70
F0f5A54SyZ1TNtuU1dF9yC6XrOHhEpNdCqLvT95mdHee/yncohrPtOVj7U/02jnc
JomlvwRUoJmFcaVK7oDZyZ3jV9QvWtg2s4tktjwgVB2E59DfaiQI72bYVUFPRPwh
/q5zy7asZOYKa0e0O9TYCm+3ob45wBv/cP5824R1fjFTZoQmGWyZQKur1gFdO/0=
=QJte
-END PGP SIGNATURE-
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org

Re: svn commit: r284215 - in head/sys: amd64/linux32 compat/linux compat/svr4 dev/drm2/i915 fs/fdescfs i386/ibcs2 i386/linux kern ofed/drivers/infiniband/core ofed/drivers/infiniband/hw/mthca sys vm

2015-06-10 Thread Ivan Klymenko
Wed, 10 Jun 2015 15:53:37 +0200
Mateusz Guzik mjgu...@gmail.com написав:

 On Wed, Jun 10, 2015 at 04:33:26PM +0300, Ivan Klymenko wrote:
  Wed, 10 Jun 2015 10:48:13 + (UTC)
  Mateusz Guzik m...@freebsd.org написав:
  
   Author: mjg
   Date: Wed Jun 10 10:48:12 2015
   New Revision: 284215
   URL: https://svnweb.freebsd.org/changeset/base/284215
   
   Log:
 Implement lockless resource limits.
 
 Use the same scheme implemented to manage credentials.
 
 Code needing to look at process's credentials (as opposed to
   thred's) is provided with *_proc variants of relevant functions.
 
 Places which possibly had to take the proc lock anyway still use
   the proc pointer to access limits.
   
   
  
  I have panic.
  I not sure that it refers to a specific commit.
  
  Fatal trap 12: page fault while in kernel mode
  cpuid = 0; apic id = 00
  fault virtual address   = 0x80
  fault code  = supervisor read data, page not present
  instruction pointer = 0x20:0x809cfbfa
  stack pointer   = 0x28:0xfe01aa4906c0
  frame pointer   = 0x28:0xfe01aa4906e0
  code segment= base 0x0, limit 0xf, type 0x1b
  = DPL 0, pres 1, long 1, def32 0, gran 1
  processor eflags= interrupt enabled, resume, IOPL = 0
  current process = 4091 (npviewer.bin)
  trap number = 12
  panic: page fault
  cpuid = 0
  KDB: stack backtrace:
  #0 0x80a17c27 at kdb_backtrace+0x67
  #1 0x809d3f79 at vpanic+0x189
  #2 0x809d3de3 at panic+0x43
  #3 0x80e73b35 at trap_fatal+0x355
  #4 0x80e73e6e at trap_pfault+0x31e
  #5 0x80e734d4 at trap+0x464
  #6 0x80e57422 at calltrap+0x8
  #7 0x8097c942 at fdalloc+0x32
  #8 0x8097cf95 at finstall+0x95
  #9 0x80a99844 at kern_openat+0x3c4
  #10 0x8229fe93 at linux_common_open+0xc3
  #11 0x822a0068 at linux_open+0x58
  #12 0x80f7408b at ia32_syscall+0x41b
  #13 0x80e57a05 at Xint0x80_syscall+0x95
  Uptime: 29m1s
  Dumping 854 out of 6047
  MB:..2%..12%..21%..32%..42%..51%..62%..72%..81%..92%
  
  221 pcpu.h: No such file or directory.
  in pcpu.h
  (kgdb) #0  doadump (textdump=value optimized out) at pcpu.h:221
  #1  0x809d3a7d in kern_reboot (howto=260)
  at /usr/src/sys/kern/kern_shutdown.c:447
  #2  0x809d3fb8 in vpanic (fmt=value optimized out, 
  ap=value optimized out)
  at /usr/src/sys/kern/kern_shutdown.c:744 #3  0x809d3de3 in
  panic (fmt=0x0) at /usr/src/sys/kern/kern_shutdown.c:675
  #4  0x80e73b35 in trap_fatal (frame=value optimized out, 
  eva=value optimized out)
  at /usr/src/sys/amd64/amd64/trap.c:853 #5  0x80e73e6e in
  trap_pfault (frame=0xfe01aa490610, usermode=value optimized
  out) at /usr/src/sys/amd64/amd64/trap.c:676 #6  0x80e734d4
  outin trap (frame=0xfe01aa490610)
  at /usr/src/sys/amd64/amd64/trap.c:426
  #7  0x80e57422 in calltrap ()
  at /usr/src/sys/amd64/amd64/exception.S:235
  #8  0x809cfbfa in lim_cur (td=0xf8010185e4c0, which=8)
  at /usr/src/sys/kern/kern_resource.c:1209
  #9  0x8097c942 in fdalloc (td=0xf8010185e4c0, 
  minfd=value optimized out, result=0xfe01aa4907dc)
  at /usr/src/sys/kern/kern_descrip.c:790
  #10 0x8097cf95 in finstall (td=0xf8010185e4c0, 
  fp=0xf80139e89870, fd=0xfe01aa4907dc, flags=1,
  fcaps=0x0) at /usr/src/sys/kern/kern_descrip.c:1768
  #11 0x80a99844 in kern_openat (td=0xf8010185e4c0,
  fd=-100, path=0xf80016832400 /compat/linux/proc/stat,
  pathseg=UIO_SYSSPACE, flags=value optimized out, mode=value
  optimized out) at /usr/src/sys/kern/vfs_syscalls.c:1158
  #12 0x8229fe93 in linux_common_open (td=0xf8010185e4c0,
  dirfd=8, path=0xf80016832400 /compat/linux/proc/stat, 
  l_flags=value optimized out, mode=51)
  at /usr/src/sys/modules/linux/../../compat/linux/linux_file.c:134
  #13 0x822a0068 in linux_open (td=value optimized out, 
  args=value optimized out)
  at /usr/src/sys/modules/linux/../../compat/linux/linux_file.c:211
  #14 0x80f7408b in ia32_syscall (frame=0xfe01aa490ac0)
  at subr_syscall.c:133
  #15 0x80e57a05 in Xint0x80_syscall () at ia32_exception.S:73
  #16 0xe452 in ?? ()
  Previous frame inner to this frame (corrupt stack?)
  Current language:  auto; currently minimal
  (kgdb) 
  
 
 The following should fix it:
 diff --git a/sys/compat/linux/linux_fork.c
 b/sys/compat/linux/linux_fork.c index 0fd47fd..394c26f 100644
 --- a/sys/compat/linux/linux_fork.c
 +++ b/sys/compat/linux/linux_fork.c
 @@ -298,7 +298,7 @@ linux_clone_thread(struct thread *td, struct
 linux_clone_args *args) __rangeof(struct thread, td_startcopy,
 td_endcopy)); 
 newtd-td_proc = p;
 -   newtd-td_ucred = crhold(td-td_ucred);
 +   thread_cow_get(newtd, td);