From owner-svn-src-stable-9@FreeBSD.ORG Sun Apr 15 16:52:49 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4EF74106566B; Sun, 15 Apr 2012 16:52:49 +0000 (UTC) (envelope-from netchild@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 36CAC8FC0A; Sun, 15 Apr 2012 16:52:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q3FGqnQq093277; Sun, 15 Apr 2012 16:52:49 GMT (envelope-from netchild@svn.freebsd.org) Received: (from netchild@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q3FGqns5093271; Sun, 15 Apr 2012 16:52:49 GMT (envelope-from netchild@svn.freebsd.org) Message-Id: <201204151652.q3FGqns5093271@svn.freebsd.org> From: Alexander Leidinger Date: Sun, 15 Apr 2012 16:52:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r234316 - in stable/9/sys: amd64/linux32 i386/conf i386/linux kern X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Apr 2012 16:52:49 -0000 Author: netchild Date: Sun Apr 15 16:52:48 2012 New Revision: 234316 URL: http://svn.freebsd.org/changeset/base/234316 Log: MFC r232799: - add comments to syscalls.master and linux(32)_dummy about which linux kernel version introduced the sysctl (based upon a linux man-page) - add comments to syscalls.master regarding some names of sysctls which are different than the linux-names (based upon the linux unistd.h) - add some dummy sysctls - name an unimplemented sysctl Modified: stable/9/sys/amd64/linux32/linux32_dummy.c stable/9/sys/amd64/linux32/syscalls.master stable/9/sys/i386/linux/linux_dummy.c stable/9/sys/i386/linux/syscalls.master Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) stable/9/sys/fs/ (props changed) stable/9/sys/fs/ntfs/ (props changed) stable/9/sys/i386/conf/XENHVM (props changed) stable/9/sys/kern/subr_witness.c (props changed) Modified: stable/9/sys/amd64/linux32/linux32_dummy.c ============================================================================== --- stable/9/sys/amd64/linux32/linux32_dummy.c Sun Apr 15 16:00:32 2012 (r234315) +++ stable/9/sys/amd64/linux32/linux32_dummy.c Sun Apr 15 16:52:48 2012 (r234316) @@ -82,22 +82,69 @@ DUMMY(mq_notify); DUMMY(mq_getsetattr); DUMMY(kexec_load); DUMMY(waitid); +/* linux 2.6.11: */ DUMMY(add_key); DUMMY(request_key); DUMMY(keyctl); +/* linux 2.6.13: */ DUMMY(ioprio_set); DUMMY(ioprio_get); DUMMY(inotify_init); DUMMY(inotify_add_watch); DUMMY(inotify_rm_watch); +/* linux 2.6.16: */ DUMMY(migrate_pages); DUMMY(pselect6); DUMMY(ppoll); DUMMY(unshare); +/* linux 2.6.17: */ DUMMY(splice); DUMMY(sync_file_range); DUMMY(tee); DUMMY(vmsplice); +/* linux 2.6.18: */ +DUMMY(move_pages); +/* linux 2.6.19: */ +DUMMY(getcpu); +DUMMY(epoll_pwait); +/* linux 2.6.22: */ +DUMMY(utimensat); +DUMMY(signalfd); +DUMMY(timerfd_create); +DUMMY(eventfd); +/* linux 2.6.23: */ +DUMMY(fallocate); +/* linux 2.6.25: */ +DUMMY(timerfd_settime); +DUMMY(timerfd_gettime); +/* linux 2.6.27: */ +DUMMY(signalfd4); +DUMMY(eventfd2); +DUMMY(epoll_create1); +DUMMY(dup3); +DUMMY(pipe2); +DUMMY(inotify_init1); +/* linux 2.6.30: */ +DUMMY(preadv); +DUMMY(pwritev); +/* linux 2.6.31: */ +DUMMY(rt_tsigqueueinfo); +DUMMY(perf_event_open); +/* linux 2.6.33: */ +DUMMY(recvmmsg); +DUMMY(fanotify_init); +DUMMY(fanotify_mark); +/* linux 2.6.36: */ +DUMMY(prlimit64); +/* later: */ +DUMMY(name_to_handle_at); +DUMMY(open_by_handle_at); +DUMMY(clock_adjtime); +DUMMY(syncfs); +DUMMY(sendmmsg); +DUMMY(setns); +DUMMY(process_vm_readv); +DUMMY(process_vm_writev); #define DUMMY_XATTR(s) \ int \ Modified: stable/9/sys/amd64/linux32/syscalls.master ============================================================================== --- stable/9/sys/amd64/linux32/syscalls.master Sun Apr 15 16:00:32 2012 (r234315) +++ stable/9/sys/amd64/linux32/syscalls.master Sun Apr 15 16:52:48 2012 (r234316) @@ -157,6 +157,7 @@ 82 AUE_SELECT STD { int linux_old_select( \ struct l_old_select_argv *ptr); } 83 AUE_SYMLINK STD { int linux_symlink(char *path, char *to); } +; 84: oldlstat 84 AUE_LSTAT STD { int linux_lstat(char *path, struct linux_lstat *up); } 85 AUE_READLINK STD { int linux_readlink(char *name, char *buf, \ l_int count); } @@ -164,8 +165,10 @@ 87 AUE_SWAPON NOPROTO { int swapon(char *name); } 88 AUE_REBOOT STD { int linux_reboot(l_int magic1, \ l_int magic2, l_uint cmd, void *arg); } +; 89: old_readdir 89 AUE_GETDIRENTRIES STD { int linux_readdir(l_uint fd, \ struct l_dirent *dent, l_uint count); } +; 90: old_mmap 90 AUE_MMAP STD { int linux_mmap(struct l_mmap_argv *ptr); } 91 AUE_MUNMAP NOPROTO { int munmap(caddr_t addr, int len); } 92 AUE_TRUNCATE STD { int linux_truncate(char *path, \ @@ -197,6 +200,7 @@ struct l_newstat *buf); } 108 AUE_FSTAT STD { int linux_newfstat(l_uint fd, \ struct l_newstat *buf); } +; 109: olduname 109 AUE_NULL STD { int linux_uname(void); } 110 AUE_NULL STD { int linux_iopl(l_ulong level); } 111 AUE_NULL STD { int linux_vhangup(void); } @@ -244,6 +248,7 @@ l_uint whence); } 141 AUE_GETDIRENTRIES STD { int linux_getdents(l_uint fd, void *dent, \ l_uint count); } +; 142: newselect 142 AUE_SELECT STD { int linux_select(l_int nfds, \ l_fd_set *readfds, l_fd_set *writefds, \ l_fd_set *exceptfds, \ @@ -336,6 +341,7 @@ 188 AUE_GETPMSG UNIMPL getpmsg 189 AUE_PUTPMSG UNIMPL putpmsg 190 AUE_VFORK STD { int linux_vfork(void); } +; 191: ugetrlimit 191 AUE_GETRLIMIT STD { int linux_getrlimit(l_uint resource, \ struct l_rlimit *rlim); } 192 AUE_MMAP STD { int linux_mmap2(l_ulong addr, l_ulong len, \ @@ -447,10 +453,11 @@ 272 AUE_NULL STD { int linux_fadvise64_64(int fd, \ l_loff_t offset, l_loff_t len, \ int advice); } -273 AUE_NULL UNIMPL +273 AUE_NULL UNIMPL vserver 274 AUE_NULL STD { int linux_mbind(void); } 275 AUE_NULL STD { int linux_get_mempolicy(void); } 276 AUE_NULL STD { int linux_set_mempolicy(void); } +; linux 2.6.6: 277 AUE_NULL STD { int linux_mq_open(void); } 278 AUE_NULL STD { int linux_mq_unlink(void); } 279 AUE_NULL STD { int linux_mq_timedsend(void); } @@ -460,14 +467,17 @@ 283 AUE_NULL STD { int linux_kexec_load(void); } 284 AUE_NULL STD { int linux_waitid(void); } 285 AUE_NULL UNIMPL +; linux 2.6.11: 286 AUE_NULL STD { int linux_add_key(void); } 287 AUE_NULL STD { int linux_request_key(void); } 288 AUE_NULL STD { int linux_keyctl(void); } +; linux 2.6.13: 289 AUE_NULL STD { int linux_ioprio_set(void); } 290 AUE_NULL STD { int linux_ioprio_get(void); } 291 AUE_NULL STD { int linux_inotify_init(void); } 292 AUE_NULL STD { int linux_inotify_add_watch(void); } 293 AUE_NULL STD { int linux_inotify_rm_watch(void); } +; linux 2.6.16: 294 AUE_NULL STD { int linux_migrate_pages(void); } 295 AUE_OPEN_RWTC STD { int linux_openat(l_int dfd, const char *filename, \ l_int flags, l_int mode); } @@ -497,6 +507,7 @@ 308 AUE_NULL STD { int linux_pselect6(void); } 309 AUE_NULL STD { int linux_ppoll(void); } 310 AUE_NULL STD { int linux_unshare(void); } +; linux 2.6.17: 311 AUE_NULL STD { int linux_set_robust_list(struct linux_robust_list_head *head, \ l_size_t len); } 312 AUE_NULL STD { int linux_get_robust_list(l_int pid, struct linux_robust_list_head *head, \ @@ -505,3 +516,46 @@ 314 AUE_NULL STD { int linux_sync_file_range(void); } 315 AUE_NULL STD { int linux_tee(void); } 316 AUE_NULL STD { int linux_vmsplice(void); } +; linux 2.6.18: +317 AUE_NULL STD { int linux_move_pages(void); } +; linux 2.6.19: +318 AUE_NULL STD { int linux_getcpu(void); } +319 AUE_NULL STD { int linux_epoll_pwait(void); } +; linux 2.6.22: +320 AUE_NULL STD { int linux_utimensat(void); } +321 AUE_NULL STD { int linux_signalfd(void); } +322 AUE_NULL STD { int linux_timerfd_create(void); } +323 AUE_NULL STD { int linux_eventfd(void); } +; linux 2.6.23: +324 AUE_NULL STD { int linux_fallocate(void); } +; linux 2.6.25: +325 AUE_NULL STD { int linux_timerfd_settime(void); } +326 AUE_NULL STD { int linux_timerfd_gettime(void); } +; linux 2.6.27: +327 AUE_NULL STD { int linux_signalfd4(void); } +328 AUE_NULL STD { int linux_eventfd2(void); } +329 AUE_NULL STD { int linux_epoll_create1(void); } +330 AUE_NULL STD { int linux_dup3(void); } +331 AUE_NULL STD { int linux_pipe2(void); } +332 AUE_NULL STD { int linux_inotify_init1(void); } +; linux 2.6.30: +333 AUE_NULL STD { int linux_preadv(void); } +334 AUE_NULL STD { int linux_pwritev(void); } +; linux 2.6.31: +335 AUE_NULL STD { int linux_rt_tsigqueueinfo(void); } +336 AUE_NULL STD { int linux_perf_event_open(void); } +; linux 2.6.33: +337 AUE_NULL STD { int linux_recvmmsg(void); } +338 AUE_NULL STD { int linux_fanotify_init(void); } +339 AUE_NULL STD { int linux_fanotify_mark(void); } +; linux 2.6.36: +340 AUE_NULL STD { int linux_prlimit64(void); } +; later: +341 AUE_NULL STD { int linux_name_to_handle_at(void); } +342 AUE_NULL STD { int linux_open_by_handle_at(void); } +343 AUE_NULL STD { int linux_clock_adjtime(void); } +344 AUE_NULL STD { int linux_syncfs(void); } +345 AUE_NULL STD { int linux_sendmmsg(void); } +346 AUE_NULL STD { int linux_setns(void); } +347 AUE_NULL STD { int linux_process_vm_readv(void); } +348 AUE_NULL STD { int linux_process_vm_writev(void); } Modified: stable/9/sys/i386/linux/linux_dummy.c ============================================================================== --- stable/9/sys/i386/linux/linux_dummy.c Sun Apr 15 16:00:32 2012 (r234315) +++ stable/9/sys/i386/linux/linux_dummy.c Sun Apr 15 16:52:48 2012 (r234316) @@ -73,22 +73,69 @@ DUMMY(get_mempolicy); DUMMY(set_mempolicy); DUMMY(kexec_load); DUMMY(waitid); +/* linux 2.6.11: */ DUMMY(add_key); DUMMY(request_key); DUMMY(keyctl); +/* linux 2.6.13: */ DUMMY(ioprio_set); DUMMY(ioprio_get); DUMMY(inotify_init); DUMMY(inotify_add_watch); DUMMY(inotify_rm_watch); +/* linux 2.6.16: */ DUMMY(migrate_pages); DUMMY(pselect6); DUMMY(ppoll); DUMMY(unshare); +/* linux 2.6.17: */ DUMMY(splice); DUMMY(sync_file_range); DUMMY(tee); DUMMY(vmsplice); +/* linux 2.6.18: */ +DUMMY(move_pages); +/* linux 2.6.19: */ +DUMMY(getcpu); +DUMMY(epoll_pwait); +/* linux 2.6.22: */ +DUMMY(utimensat); +DUMMY(signalfd); +DUMMY(timerfd_create); +DUMMY(eventfd); +/* linux 2.6.23: */ +DUMMY(fallocate); +/* linux 2.6.25: */ +DUMMY(timerfd_settime); +DUMMY(timerfd_gettime); +/* linux 2.6.27: */ +DUMMY(signalfd4); +DUMMY(eventfd2); +DUMMY(epoll_create1); +DUMMY(dup3); +DUMMY(pipe2); +DUMMY(inotify_init1); +/* linux 2.6.30: */ +DUMMY(preadv); +DUMMY(pwritev); +/* linux 2.6.31 */ +DUMMY(rt_tsigqueueinfo); +DUMMY(perf_event_open); +/* linux 2.6.33: */ +DUMMY(recvmmsg); +DUMMY(fanotify_init); +DUMMY(fanotify_mark); +/* linux 2.6.36: */ +DUMMY(prlimit64); +/* later: */ +DUMMY(name_to_handle_at); +DUMMY(open_by_handle_at); +DUMMY(clock_adjtime); +DUMMY(syncfs); +DUMMY(sendmmsg); +DUMMY(setns); +DUMMY(process_vm_readv); +DUMMY(process_vm_writev); #define DUMMY_XATTR(s) \ int \ Modified: stable/9/sys/i386/linux/syscalls.master ============================================================================== --- stable/9/sys/i386/linux/syscalls.master Sun Apr 15 16:00:32 2012 (r234315) +++ stable/9/sys/i386/linux/syscalls.master Sun Apr 15 16:52:48 2012 (r234316) @@ -157,6 +157,7 @@ 82 AUE_SELECT STD { int linux_old_select( \ struct l_old_select_argv *ptr); } 83 AUE_SYMLINK STD { int linux_symlink(char *path, char *to); } +; 84: oldlstat 84 AUE_LSTAT STD { int linux_lstat(char *path, struct ostat *up); } 85 AUE_READLINK STD { int linux_readlink(char *name, char *buf, \ l_int count); } @@ -164,8 +165,10 @@ 87 AUE_SWAPON NOPROTO { int swapon(char *name); } 88 AUE_REBOOT STD { int linux_reboot(l_int magic1, \ l_int magic2, l_uint cmd, void *arg); } +; 89: old_readdir 89 AUE_GETDIRENTRIES STD { int linux_readdir(l_uint fd, \ struct l_dirent *dent, l_uint count); } +; 90: old_mmap 90 AUE_MMAP STD { int linux_mmap(struct l_mmap_argv *ptr); } 91 AUE_MUNMAP NOPROTO { int munmap(caddr_t addr, int len); } 92 AUE_TRUNCATE STD { int linux_truncate(char *path, \ @@ -198,6 +201,7 @@ struct l_newstat *buf); } 108 AUE_FSTAT STD { int linux_newfstat(l_uint fd, \ struct l_newstat *buf); } +; 109: olduname 109 AUE_NULL STD { int linux_uname(void); } 110 AUE_NULL STD { int linux_iopl(l_ulong level); } 111 AUE_NULL STD { int linux_vhangup(void); } @@ -246,6 +250,7 @@ l_uint whence); } 141 AUE_GETDIRENTRIES STD { int linux_getdents(l_uint fd, \ void *dent, l_uint count); } +; 142: newselect 142 AUE_SELECT STD { int linux_select(l_int nfds, \ l_fd_set *readfds, l_fd_set *writefds, \ l_fd_set *exceptfds, \ @@ -338,6 +343,7 @@ 188 AUE_GETPMSG UNIMPL getpmsg 189 AUE_PUTPMSG UNIMPL putpmsg 190 AUE_VFORK STD { int linux_vfork(void); } +; 191: ugetrlimit 191 AUE_GETRLIMIT STD { int linux_getrlimit(l_uint resource, \ struct l_rlimit *rlim); } 192 AUE_MMAP STD { int linux_mmap2(l_ulong addr, l_ulong len, \ @@ -451,10 +457,11 @@ 272 AUE_NULL STD { int linux_fadvise64_64(int fd, \ l_loff_t offset, l_loff_t len, \ int advice); } -273 AUE_NULL UNIMPL +273 AUE_NULL UNIMPL vserver 274 AUE_NULL STD { int linux_mbind(void); } 275 AUE_NULL STD { int linux_get_mempolicy(void); } 276 AUE_NULL STD { int linux_set_mempolicy(void); } +; linux 2.6.6: 277 AUE_NULL STD { int linux_mq_open(const char *name, int oflag, mode_t mode, \ struct mq_attr *attr); } 278 AUE_NULL STD { int linux_mq_unlink(const char *name); } @@ -470,14 +477,17 @@ 283 AUE_NULL STD { int linux_kexec_load(void); } 284 AUE_NULL STD { int linux_waitid(void); } 285 AUE_NULL UNIMPL +; linux 2.6.11: 286 AUE_NULL STD { int linux_add_key(void); } 287 AUE_NULL STD { int linux_request_key(void); } 288 AUE_NULL STD { int linux_keyctl(void); } +; linux 2.6.13: 289 AUE_NULL STD { int linux_ioprio_set(void); } 290 AUE_NULL STD { int linux_ioprio_get(void); } 291 AUE_NULL STD { int linux_inotify_init(void); } 292 AUE_NULL STD { int linux_inotify_add_watch(void); } 293 AUE_NULL STD { int linux_inotify_rm_watch(void); } +; linux 2.6.16: 294 AUE_NULL STD { int linux_migrate_pages(void); } 295 AUE_OPEN_RWTC STD { int linux_openat(l_int dfd, const char *filename, \ l_int flags, l_int mode); } @@ -507,6 +517,7 @@ 308 AUE_NULL STD { int linux_pselect6(void); } 309 AUE_NULL STD { int linux_ppoll(void); } 310 AUE_NULL STD { int linux_unshare(void); } +; linux 2.6.17: 311 AUE_NULL STD { int linux_set_robust_list(struct linux_robust_list_head *head, \ l_size_t len); } 312 AUE_NULL STD { int linux_get_robust_list(l_int pid, struct linux_robust_list_head **head, \ @@ -515,3 +526,46 @@ 314 AUE_NULL STD { int linux_sync_file_range(void); } 315 AUE_NULL STD { int linux_tee(void); } 316 AUE_NULL STD { int linux_vmsplice(void); } +; linux 2.6.18: +317 AUE_NULL STD { int linux_move_pages(void); } +; linux 2.6.19: +318 AUE_NULL STD { int linux_getcpu(void); } +319 AUE_NULL STD { int linux_epoll_pwait(void); } +; linux 2.6.22: +320 AUE_NULL STD { int linux_utimensat(void); } +321 AUE_NULL STD { int linux_signalfd(void); } +322 AUE_NULL STD { int linux_timerfd_create(void); } +323 AUE_NULL STD { int linux_eventfd(void); } +; linux 2.6.23: +324 AUE_NULL STD { int linux_fallocate(void); } +; linux 2.6.25: +325 AUE_NULL STD { int linux_timerfd_settime(void); } +326 AUE_NULL STD { int linux_timerfd_gettime(void); } +; linux 2.6.27: +327 AUE_NULL STD { int linux_signalfd4(void); } +328 AUE_NULL STD { int linux_eventfd2(void); } +329 AUE_NULL STD { int linux_epoll_create1(void); } +330 AUE_NULL STD { int linux_dup3(void); } +331 AUE_NULL STD { int linux_pipe2(void); } +332 AUE_NULL STD { int linux_inotify_init1(void); } +; linux 2.6.30: +333 AUE_NULL STD { int linux_preadv(void); } +334 AUE_NULL STD { int linux_pwritev(void); } +; linux 2.6.31: +335 AUE_NULL STD { int linux_rt_tsigqueueinfo(void); } +336 AUE_NULL STD { int linux_perf_event_open(void); } +; linux 2.6.33: +337 AUE_NULL STD { int linux_recvmmsg(void); } +338 AUE_NULL STD { int linux_fanotify_init(void); } +339 AUE_NULL STD { int linux_fanotify_mark(void); } +; linux 2.6.36: +340 AUE_NULL STD { int linux_prlimit64(void); } +; later: +341 AUE_NULL STD { int linux_name_to_handle_at(void); } +342 AUE_NULL STD { int linux_open_by_handle_at(void); } +343 AUE_NULL STD { int linux_clock_adjtime(void); } +344 AUE_NULL STD { int linux_syncfs(void); } +345 AUE_NULL STD { int linux_sendmmsg(void); } +346 AUE_NULL STD { int linux_setns(void); } +347 AUE_NULL STD { int linux_process_vm_readv(void); } +348 AUE_NULL STD { int linux_process_vm_writev(void); } From owner-svn-src-stable-9@FreeBSD.ORG Sun Apr 15 16:53:45 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DD77F106568D; Sun, 15 Apr 2012 16:53:45 +0000 (UTC) (envelope-from netchild@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 295AE8FC16; Sun, 15 Apr 2012 16:53:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q3FGrjT3093346; Sun, 15 Apr 2012 16:53:45 GMT (envelope-from netchild@svn.freebsd.org) Received: (from netchild@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q3FGrimL093335; Sun, 15 Apr 2012 16:53:44 GMT (envelope-from netchild@svn.freebsd.org) Message-Id: <201204151653.q3FGrimL093335@svn.freebsd.org> From: Alexander Leidinger Date: Sun, 15 Apr 2012 16:53:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r234317 - in stable/9/sys: amd64/linux32 i386/linux X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Apr 2012 16:53:46 -0000 Author: netchild Date: Sun Apr 15 16:53:44 2012 New Revision: 234317 URL: http://svn.freebsd.org/changeset/base/234317 Log: regen Modified: stable/9/sys/amd64/linux32/linux32_proto.h stable/9/sys/amd64/linux32/linux32_syscall.h stable/9/sys/amd64/linux32/linux32_syscalls.c stable/9/sys/amd64/linux32/linux32_sysent.c stable/9/sys/amd64/linux32/linux32_systrace_args.c stable/9/sys/i386/linux/linux_proto.h stable/9/sys/i386/linux/linux_syscall.h stable/9/sys/i386/linux/linux_syscalls.c stable/9/sys/i386/linux/linux_sysent.c stable/9/sys/i386/linux/linux_systrace_args.c Modified: stable/9/sys/amd64/linux32/linux32_proto.h ============================================================================== --- stable/9/sys/amd64/linux32/linux32_proto.h Sun Apr 15 16:52:48 2012 (r234316) +++ stable/9/sys/amd64/linux32/linux32_proto.h Sun Apr 15 16:53:44 2012 (r234317) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/9/sys/amd64/linux32/syscalls.master 231145 2012-02-07 19:11:54Z jhb + * created from FreeBSD: stable/9/sys/amd64/linux32/syscalls.master 234316 2012-04-15 16:52:48Z netchild */ #ifndef _LINUX_SYSPROTO_H_ @@ -1001,6 +1001,102 @@ struct linux_tee_args { struct linux_vmsplice_args { register_t dummy; }; +struct linux_move_pages_args { + register_t dummy; +}; +struct linux_getcpu_args { + register_t dummy; +}; +struct linux_epoll_pwait_args { + register_t dummy; +}; +struct linux_utimensat_args { + register_t dummy; +}; +struct linux_signalfd_args { + register_t dummy; +}; +struct linux_timerfd_create_args { + register_t dummy; +}; +struct linux_eventfd_args { + register_t dummy; +}; +struct linux_fallocate_args { + register_t dummy; +}; +struct linux_timerfd_settime_args { + register_t dummy; +}; +struct linux_timerfd_gettime_args { + register_t dummy; +}; +struct linux_signalfd4_args { + register_t dummy; +}; +struct linux_eventfd2_args { + register_t dummy; +}; +struct linux_epoll_create1_args { + register_t dummy; +}; +struct linux_dup3_args { + register_t dummy; +}; +struct linux_pipe2_args { + register_t dummy; +}; +struct linux_inotify_init1_args { + register_t dummy; +}; +struct linux_preadv_args { + register_t dummy; +}; +struct linux_pwritev_args { + register_t dummy; +}; +struct linux_rt_tsigqueueinfo_args { + register_t dummy; +}; +struct linux_perf_event_open_args { + register_t dummy; +}; +struct linux_recvmmsg_args { + register_t dummy; +}; +struct linux_fanotify_init_args { + register_t dummy; +}; +struct linux_fanotify_mark_args { + register_t dummy; +}; +struct linux_prlimit64_args { + register_t dummy; +}; +struct linux_name_to_handle_at_args { + register_t dummy; +}; +struct linux_open_by_handle_at_args { + register_t dummy; +}; +struct linux_clock_adjtime_args { + register_t dummy; +}; +struct linux_syncfs_args { + register_t dummy; +}; +struct linux_sendmmsg_args { + register_t dummy; +}; +struct linux_setns_args { + register_t dummy; +}; +struct linux_process_vm_readv_args { + register_t dummy; +}; +struct linux_process_vm_writev_args { + register_t dummy; +}; #define nosys linux_nosys int linux_fork(struct thread *, struct linux_fork_args *); int linux_open(struct thread *, struct linux_open_args *); @@ -1244,6 +1340,38 @@ int linux_splice(struct thread *, struct int linux_sync_file_range(struct thread *, struct linux_sync_file_range_args *); int linux_tee(struct thread *, struct linux_tee_args *); int linux_vmsplice(struct thread *, struct linux_vmsplice_args *); +int linux_move_pages(struct thread *, struct linux_move_pages_args *); +int linux_getcpu(struct thread *, struct linux_getcpu_args *); +int linux_epoll_pwait(struct thread *, struct linux_epoll_pwait_args *); +int linux_utimensat(struct thread *, struct linux_utimensat_args *); +int linux_signalfd(struct thread *, struct linux_signalfd_args *); +int linux_timerfd_create(struct thread *, struct linux_timerfd_create_args *); +int linux_eventfd(struct thread *, struct linux_eventfd_args *); +int linux_fallocate(struct thread *, struct linux_fallocate_args *); +int linux_timerfd_settime(struct thread *, struct linux_timerfd_settime_args *); +int linux_timerfd_gettime(struct thread *, struct linux_timerfd_gettime_args *); +int linux_signalfd4(struct thread *, struct linux_signalfd4_args *); +int linux_eventfd2(struct thread *, struct linux_eventfd2_args *); +int linux_epoll_create1(struct thread *, struct linux_epoll_create1_args *); +int linux_dup3(struct thread *, struct linux_dup3_args *); +int linux_pipe2(struct thread *, struct linux_pipe2_args *); +int linux_inotify_init1(struct thread *, struct linux_inotify_init1_args *); +int linux_preadv(struct thread *, struct linux_preadv_args *); +int linux_pwritev(struct thread *, struct linux_pwritev_args *); +int linux_rt_tsigqueueinfo(struct thread *, struct linux_rt_tsigqueueinfo_args *); +int linux_perf_event_open(struct thread *, struct linux_perf_event_open_args *); +int linux_recvmmsg(struct thread *, struct linux_recvmmsg_args *); +int linux_fanotify_init(struct thread *, struct linux_fanotify_init_args *); +int linux_fanotify_mark(struct thread *, struct linux_fanotify_mark_args *); +int linux_prlimit64(struct thread *, struct linux_prlimit64_args *); +int linux_name_to_handle_at(struct thread *, struct linux_name_to_handle_at_args *); +int linux_open_by_handle_at(struct thread *, struct linux_open_by_handle_at_args *); +int linux_clock_adjtime(struct thread *, struct linux_clock_adjtime_args *); +int linux_syncfs(struct thread *, struct linux_syncfs_args *); +int linux_sendmmsg(struct thread *, struct linux_sendmmsg_args *); +int linux_setns(struct thread *, struct linux_setns_args *); +int linux_process_vm_readv(struct thread *, struct linux_process_vm_readv_args *); +int linux_process_vm_writev(struct thread *, struct linux_process_vm_writev_args *); #ifdef COMPAT_43 @@ -1514,6 +1642,38 @@ int linux_vmsplice(struct thread *, stru #define LINUX_SYS_AUE_linux_sync_file_range AUE_NULL #define LINUX_SYS_AUE_linux_tee AUE_NULL #define LINUX_SYS_AUE_linux_vmsplice AUE_NULL +#define LINUX_SYS_AUE_linux_move_pages AUE_NULL +#define LINUX_SYS_AUE_linux_getcpu AUE_NULL +#define LINUX_SYS_AUE_linux_epoll_pwait AUE_NULL +#define LINUX_SYS_AUE_linux_utimensat AUE_NULL +#define LINUX_SYS_AUE_linux_signalfd AUE_NULL +#define LINUX_SYS_AUE_linux_timerfd_create AUE_NULL +#define LINUX_SYS_AUE_linux_eventfd AUE_NULL +#define LINUX_SYS_AUE_linux_fallocate AUE_NULL +#define LINUX_SYS_AUE_linux_timerfd_settime AUE_NULL +#define LINUX_SYS_AUE_linux_timerfd_gettime AUE_NULL +#define LINUX_SYS_AUE_linux_signalfd4 AUE_NULL +#define LINUX_SYS_AUE_linux_eventfd2 AUE_NULL +#define LINUX_SYS_AUE_linux_epoll_create1 AUE_NULL +#define LINUX_SYS_AUE_linux_dup3 AUE_NULL +#define LINUX_SYS_AUE_linux_pipe2 AUE_NULL +#define LINUX_SYS_AUE_linux_inotify_init1 AUE_NULL +#define LINUX_SYS_AUE_linux_preadv AUE_NULL +#define LINUX_SYS_AUE_linux_pwritev AUE_NULL +#define LINUX_SYS_AUE_linux_rt_tsigqueueinfo AUE_NULL +#define LINUX_SYS_AUE_linux_perf_event_open AUE_NULL +#define LINUX_SYS_AUE_linux_recvmmsg AUE_NULL +#define LINUX_SYS_AUE_linux_fanotify_init AUE_NULL +#define LINUX_SYS_AUE_linux_fanotify_mark AUE_NULL +#define LINUX_SYS_AUE_linux_prlimit64 AUE_NULL +#define LINUX_SYS_AUE_linux_name_to_handle_at AUE_NULL +#define LINUX_SYS_AUE_linux_open_by_handle_at AUE_NULL +#define LINUX_SYS_AUE_linux_clock_adjtime AUE_NULL +#define LINUX_SYS_AUE_linux_syncfs AUE_NULL +#define LINUX_SYS_AUE_linux_sendmmsg AUE_NULL +#define LINUX_SYS_AUE_linux_setns AUE_NULL +#define LINUX_SYS_AUE_linux_process_vm_readv AUE_NULL +#define LINUX_SYS_AUE_linux_process_vm_writev AUE_NULL #undef PAD_ #undef PADL_ Modified: stable/9/sys/amd64/linux32/linux32_syscall.h ============================================================================== --- stable/9/sys/amd64/linux32/linux32_syscall.h Sun Apr 15 16:52:48 2012 (r234316) +++ stable/9/sys/amd64/linux32/linux32_syscall.h Sun Apr 15 16:53:44 2012 (r234317) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/9/sys/amd64/linux32/syscalls.master 231145 2012-02-07 19:11:54Z jhb + * created from FreeBSD: stable/9/sys/amd64/linux32/syscalls.master 234316 2012-04-15 16:52:48Z netchild */ #define LINUX_SYS_exit 1 @@ -289,4 +289,36 @@ #define LINUX_SYS_linux_sync_file_range 314 #define LINUX_SYS_linux_tee 315 #define LINUX_SYS_linux_vmsplice 316 -#define LINUX_SYS_MAXSYSCALL 317 +#define LINUX_SYS_linux_move_pages 317 +#define LINUX_SYS_linux_getcpu 318 +#define LINUX_SYS_linux_epoll_pwait 319 +#define LINUX_SYS_linux_utimensat 320 +#define LINUX_SYS_linux_signalfd 321 +#define LINUX_SYS_linux_timerfd_create 322 +#define LINUX_SYS_linux_eventfd 323 +#define LINUX_SYS_linux_fallocate 324 +#define LINUX_SYS_linux_timerfd_settime 325 +#define LINUX_SYS_linux_timerfd_gettime 326 +#define LINUX_SYS_linux_signalfd4 327 +#define LINUX_SYS_linux_eventfd2 328 +#define LINUX_SYS_linux_epoll_create1 329 +#define LINUX_SYS_linux_dup3 330 +#define LINUX_SYS_linux_pipe2 331 +#define LINUX_SYS_linux_inotify_init1 332 +#define LINUX_SYS_linux_preadv 333 +#define LINUX_SYS_linux_pwritev 334 +#define LINUX_SYS_linux_rt_tsigqueueinfo 335 +#define LINUX_SYS_linux_perf_event_open 336 +#define LINUX_SYS_linux_recvmmsg 337 +#define LINUX_SYS_linux_fanotify_init 338 +#define LINUX_SYS_linux_fanotify_mark 339 +#define LINUX_SYS_linux_prlimit64 340 +#define LINUX_SYS_linux_name_to_handle_at 341 +#define LINUX_SYS_linux_open_by_handle_at 342 +#define LINUX_SYS_linux_clock_adjtime 343 +#define LINUX_SYS_linux_syncfs 344 +#define LINUX_SYS_linux_sendmmsg 345 +#define LINUX_SYS_linux_setns 346 +#define LINUX_SYS_linux_process_vm_readv 347 +#define LINUX_SYS_linux_process_vm_writev 348 +#define LINUX_SYS_MAXSYSCALL 349 Modified: stable/9/sys/amd64/linux32/linux32_syscalls.c ============================================================================== --- stable/9/sys/amd64/linux32/linux32_syscalls.c Sun Apr 15 16:52:48 2012 (r234316) +++ stable/9/sys/amd64/linux32/linux32_syscalls.c Sun Apr 15 16:53:44 2012 (r234317) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/9/sys/amd64/linux32/syscalls.master 231145 2012-02-07 19:11:54Z jhb + * created from FreeBSD: stable/9/sys/amd64/linux32/syscalls.master 234316 2012-04-15 16:52:48Z netchild */ const char *linux_syscallnames[] = { @@ -281,7 +281,7 @@ const char *linux_syscallnames[] = { "linux_tgkill", /* 270 = linux_tgkill */ "linux_utimes", /* 271 = linux_utimes */ "linux_fadvise64_64", /* 272 = linux_fadvise64_64 */ - "#273", /* 273 = */ + "#273", /* 273 = vserver */ "linux_mbind", /* 274 = linux_mbind */ "linux_get_mempolicy", /* 275 = linux_get_mempolicy */ "linux_set_mempolicy", /* 276 = linux_set_mempolicy */ @@ -325,4 +325,36 @@ const char *linux_syscallnames[] = { "linux_sync_file_range", /* 314 = linux_sync_file_range */ "linux_tee", /* 315 = linux_tee */ "linux_vmsplice", /* 316 = linux_vmsplice */ + "linux_move_pages", /* 317 = linux_move_pages */ + "linux_getcpu", /* 318 = linux_getcpu */ + "linux_epoll_pwait", /* 319 = linux_epoll_pwait */ + "linux_utimensat", /* 320 = linux_utimensat */ + "linux_signalfd", /* 321 = linux_signalfd */ + "linux_timerfd_create", /* 322 = linux_timerfd_create */ + "linux_eventfd", /* 323 = linux_eventfd */ + "linux_fallocate", /* 324 = linux_fallocate */ + "linux_timerfd_settime", /* 325 = linux_timerfd_settime */ + "linux_timerfd_gettime", /* 326 = linux_timerfd_gettime */ + "linux_signalfd4", /* 327 = linux_signalfd4 */ + "linux_eventfd2", /* 328 = linux_eventfd2 */ + "linux_epoll_create1", /* 329 = linux_epoll_create1 */ + "linux_dup3", /* 330 = linux_dup3 */ + "linux_pipe2", /* 331 = linux_pipe2 */ + "linux_inotify_init1", /* 332 = linux_inotify_init1 */ + "linux_preadv", /* 333 = linux_preadv */ + "linux_pwritev", /* 334 = linux_pwritev */ + "linux_rt_tsigqueueinfo", /* 335 = linux_rt_tsigqueueinfo */ + "linux_perf_event_open", /* 336 = linux_perf_event_open */ + "linux_recvmmsg", /* 337 = linux_recvmmsg */ + "linux_fanotify_init", /* 338 = linux_fanotify_init */ + "linux_fanotify_mark", /* 339 = linux_fanotify_mark */ + "linux_prlimit64", /* 340 = linux_prlimit64 */ + "linux_name_to_handle_at", /* 341 = linux_name_to_handle_at */ + "linux_open_by_handle_at", /* 342 = linux_open_by_handle_at */ + "linux_clock_adjtime", /* 343 = linux_clock_adjtime */ + "linux_syncfs", /* 344 = linux_syncfs */ + "linux_sendmmsg", /* 345 = linux_sendmmsg */ + "linux_setns", /* 346 = linux_setns */ + "linux_process_vm_readv", /* 347 = linux_process_vm_readv */ + "linux_process_vm_writev", /* 348 = linux_process_vm_writev */ }; Modified: stable/9/sys/amd64/linux32/linux32_sysent.c ============================================================================== --- stable/9/sys/amd64/linux32/linux32_sysent.c Sun Apr 15 16:52:48 2012 (r234316) +++ stable/9/sys/amd64/linux32/linux32_sysent.c Sun Apr 15 16:53:44 2012 (r234317) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/9/sys/amd64/linux32/syscalls.master 231145 2012-02-07 19:11:54Z jhb + * created from FreeBSD: stable/9/sys/amd64/linux32/syscalls.master 234316 2012-04-15 16:52:48Z netchild */ #include "opt_compat.h" @@ -292,7 +292,7 @@ struct sysent linux_sysent[] = { { AS(linux_tgkill_args), (sy_call_t *)linux_tgkill, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 270 = linux_tgkill */ { AS(linux_utimes_args), (sy_call_t *)linux_utimes, AUE_UTIMES, NULL, 0, 0, 0, SY_THR_STATIC }, /* 271 = linux_utimes */ { AS(linux_fadvise64_64_args), (sy_call_t *)linux_fadvise64_64, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 272 = linux_fadvise64_64 */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 273 = */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 273 = vserver */ { 0, (sy_call_t *)linux_mbind, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 274 = linux_mbind */ { 0, (sy_call_t *)linux_get_mempolicy, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 275 = linux_get_mempolicy */ { 0, (sy_call_t *)linux_set_mempolicy, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 276 = linux_set_mempolicy */ @@ -336,4 +336,36 @@ struct sysent linux_sysent[] = { { 0, (sy_call_t *)linux_sync_file_range, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 314 = linux_sync_file_range */ { 0, (sy_call_t *)linux_tee, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 315 = linux_tee */ { 0, (sy_call_t *)linux_vmsplice, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 316 = linux_vmsplice */ + { 0, (sy_call_t *)linux_move_pages, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 317 = linux_move_pages */ + { 0, (sy_call_t *)linux_getcpu, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 318 = linux_getcpu */ + { 0, (sy_call_t *)linux_epoll_pwait, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 319 = linux_epoll_pwait */ + { 0, (sy_call_t *)linux_utimensat, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 320 = linux_utimensat */ + { 0, (sy_call_t *)linux_signalfd, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 321 = linux_signalfd */ + { 0, (sy_call_t *)linux_timerfd_create, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 322 = linux_timerfd_create */ + { 0, (sy_call_t *)linux_eventfd, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 323 = linux_eventfd */ + { 0, (sy_call_t *)linux_fallocate, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 324 = linux_fallocate */ + { 0, (sy_call_t *)linux_timerfd_settime, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 325 = linux_timerfd_settime */ + { 0, (sy_call_t *)linux_timerfd_gettime, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 326 = linux_timerfd_gettime */ + { 0, (sy_call_t *)linux_signalfd4, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 327 = linux_signalfd4 */ + { 0, (sy_call_t *)linux_eventfd2, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 328 = linux_eventfd2 */ + { 0, (sy_call_t *)linux_epoll_create1, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 329 = linux_epoll_create1 */ + { 0, (sy_call_t *)linux_dup3, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 330 = linux_dup3 */ + { 0, (sy_call_t *)linux_pipe2, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 331 = linux_pipe2 */ + { 0, (sy_call_t *)linux_inotify_init1, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 332 = linux_inotify_init1 */ + { 0, (sy_call_t *)linux_preadv, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 333 = linux_preadv */ + { 0, (sy_call_t *)linux_pwritev, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 334 = linux_pwritev */ + { 0, (sy_call_t *)linux_rt_tsigqueueinfo, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 335 = linux_rt_tsigqueueinfo */ + { 0, (sy_call_t *)linux_perf_event_open, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 336 = linux_perf_event_open */ + { 0, (sy_call_t *)linux_recvmmsg, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 337 = linux_recvmmsg */ + { 0, (sy_call_t *)linux_fanotify_init, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 338 = linux_fanotify_init */ + { 0, (sy_call_t *)linux_fanotify_mark, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 339 = linux_fanotify_mark */ + { 0, (sy_call_t *)linux_prlimit64, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 340 = linux_prlimit64 */ + { 0, (sy_call_t *)linux_name_to_handle_at, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 341 = linux_name_to_handle_at */ + { 0, (sy_call_t *)linux_open_by_handle_at, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 342 = linux_open_by_handle_at */ + { 0, (sy_call_t *)linux_clock_adjtime, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 343 = linux_clock_adjtime */ + { 0, (sy_call_t *)linux_syncfs, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 344 = linux_syncfs */ + { 0, (sy_call_t *)linux_sendmmsg, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 345 = linux_sendmmsg */ + { 0, (sy_call_t *)linux_setns, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 346 = linux_setns */ + { 0, (sy_call_t *)linux_process_vm_readv, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 347 = linux_process_vm_readv */ + { 0, (sy_call_t *)linux_process_vm_writev, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 348 = linux_process_vm_writev */ }; Modified: stable/9/sys/amd64/linux32/linux32_systrace_args.c ============================================================================== --- stable/9/sys/amd64/linux32/linux32_systrace_args.c Sun Apr 15 16:52:48 2012 (r234316) +++ stable/9/sys/amd64/linux32/linux32_systrace_args.c Sun Apr 15 16:53:44 2012 (r234317) @@ -2099,6 +2099,166 @@ systrace_args(int sysnum, void *params, *n_args = 0; break; } + /* linux_move_pages */ + case 317: { + *n_args = 0; + break; + } + /* linux_getcpu */ + case 318: { + *n_args = 0; + break; + } + /* linux_epoll_pwait */ + case 319: { + *n_args = 0; + break; + } + /* linux_utimensat */ + case 320: { + *n_args = 0; + break; + } + /* linux_signalfd */ + case 321: { + *n_args = 0; + break; + } + /* linux_timerfd_create */ + case 322: { + *n_args = 0; + break; + } + /* linux_eventfd */ + case 323: { + *n_args = 0; + break; + } + /* linux_fallocate */ + case 324: { + *n_args = 0; + break; + } + /* linux_timerfd_settime */ + case 325: { + *n_args = 0; + break; + } + /* linux_timerfd_gettime */ + case 326: { + *n_args = 0; + break; + } + /* linux_signalfd4 */ + case 327: { + *n_args = 0; + break; + } + /* linux_eventfd2 */ + case 328: { + *n_args = 0; + break; + } + /* linux_epoll_create1 */ + case 329: { + *n_args = 0; + break; + } + /* linux_dup3 */ + case 330: { + *n_args = 0; + break; + } + /* linux_pipe2 */ + case 331: { + *n_args = 0; + break; + } + /* linux_inotify_init1 */ + case 332: { + *n_args = 0; + break; + } + /* linux_preadv */ + case 333: { + *n_args = 0; + break; + } + /* linux_pwritev */ + case 334: { + *n_args = 0; + break; + } + /* linux_rt_tsigqueueinfo */ + case 335: { + *n_args = 0; + break; + } + /* linux_perf_event_open */ + case 336: { + *n_args = 0; + break; + } + /* linux_recvmmsg */ + case 337: { + *n_args = 0; + break; + } + /* linux_fanotify_init */ + case 338: { + *n_args = 0; + break; + } + /* linux_fanotify_mark */ + case 339: { + *n_args = 0; + break; + } + /* linux_prlimit64 */ + case 340: { + *n_args = 0; + break; + } + /* linux_name_to_handle_at */ + case 341: { + *n_args = 0; + break; + } + /* linux_open_by_handle_at */ + case 342: { + *n_args = 0; + break; + } + /* linux_clock_adjtime */ + case 343: { + *n_args = 0; + break; + } + /* linux_syncfs */ + case 344: { + *n_args = 0; + break; + } + /* linux_sendmmsg */ + case 345: { + *n_args = 0; + break; + } + /* linux_setns */ + case 346: { + *n_args = 0; + break; + } + /* linux_process_vm_readv */ + case 347: { + *n_args = 0; + break; + } + /* linux_process_vm_writev */ + case 348: { + *n_args = 0; + break; + } default: *n_args = 0; break; @@ -5160,6 +5320,102 @@ systrace_setargdesc(int sysnum, int ndx, /* linux_vmsplice */ case 316: break; + /* linux_move_pages */ + case 317: + break; + /* linux_getcpu */ + case 318: + break; + /* linux_epoll_pwait */ + case 319: + break; + /* linux_utimensat */ + case 320: + break; + /* linux_signalfd */ + case 321: + break; + /* linux_timerfd_create */ + case 322: + break; + /* linux_eventfd */ + case 323: + break; + /* linux_fallocate */ + case 324: + break; + /* linux_timerfd_settime */ + case 325: + break; + /* linux_timerfd_gettime */ + case 326: + break; + /* linux_signalfd4 */ + case 327: + break; + /* linux_eventfd2 */ + case 328: + break; + /* linux_epoll_create1 */ + case 329: + break; + /* linux_dup3 */ + case 330: + break; + /* linux_pipe2 */ + case 331: + break; + /* linux_inotify_init1 */ + case 332: + break; + /* linux_preadv */ + case 333: + break; + /* linux_pwritev */ + case 334: + break; + /* linux_rt_tsigqueueinfo */ + case 335: + break; + /* linux_perf_event_open */ + case 336: + break; + /* linux_recvmmsg */ + case 337: + break; + /* linux_fanotify_init */ + case 338: + break; + /* linux_fanotify_mark */ + case 339: + break; + /* linux_prlimit64 */ + case 340: + break; + /* linux_name_to_handle_at */ + case 341: + break; + /* linux_open_by_handle_at */ + case 342: + break; + /* linux_clock_adjtime */ + case 343: + break; + /* linux_syncfs */ + case 344: + break; + /* linux_sendmmsg */ + case 345: + break; + /* linux_setns */ + case 346: + break; + /* linux_process_vm_readv */ + case 347: + break; + /* linux_process_vm_writev */ + case 348: + break; default: break; }; Modified: stable/9/sys/i386/linux/linux_proto.h ============================================================================== --- stable/9/sys/i386/linux/linux_proto.h Sun Apr 15 16:52:48 2012 (r234316) +++ stable/9/sys/i386/linux/linux_proto.h Sun Apr 15 16:53:44 2012 (r234317) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/9/sys/i386/linux/syscalls.master 231145 2012-02-07 19:11:54Z jhb + * created from FreeBSD: stable/9/sys/i386/linux/syscalls.master 234316 2012-04-15 16:52:48Z netchild */ #ifndef _LINUX_SYSPROTO_H_ @@ -1020,6 +1020,102 @@ struct linux_tee_args { struct linux_vmsplice_args { register_t dummy; }; +struct linux_move_pages_args { + register_t dummy; +}; +struct linux_getcpu_args { + register_t dummy; +}; +struct linux_epoll_pwait_args { + register_t dummy; +}; +struct linux_utimensat_args { + register_t dummy; +}; +struct linux_signalfd_args { + register_t dummy; +}; +struct linux_timerfd_create_args { + register_t dummy; +}; +struct linux_eventfd_args { + register_t dummy; +}; +struct linux_fallocate_args { + register_t dummy; +}; +struct linux_timerfd_settime_args { + register_t dummy; +}; +struct linux_timerfd_gettime_args { + register_t dummy; +}; +struct linux_signalfd4_args { + register_t dummy; +}; +struct linux_eventfd2_args { + register_t dummy; +}; +struct linux_epoll_create1_args { + register_t dummy; +}; +struct linux_dup3_args { + register_t dummy; +}; +struct linux_pipe2_args { + register_t dummy; +}; +struct linux_inotify_init1_args { + register_t dummy; +}; +struct linux_preadv_args { + register_t dummy; +}; +struct linux_pwritev_args { + register_t dummy; +}; +struct linux_rt_tsigqueueinfo_args { + register_t dummy; +}; +struct linux_perf_event_open_args { + register_t dummy; +}; +struct linux_recvmmsg_args { + register_t dummy; +}; +struct linux_fanotify_init_args { + register_t dummy; +}; +struct linux_fanotify_mark_args { + register_t dummy; +}; +struct linux_prlimit64_args { + register_t dummy; +}; +struct linux_name_to_handle_at_args { + register_t dummy; +}; +struct linux_open_by_handle_at_args { + register_t dummy; +}; +struct linux_clock_adjtime_args { + register_t dummy; +}; +struct linux_syncfs_args { + register_t dummy; +}; +struct linux_sendmmsg_args { + register_t dummy; +}; +struct linux_setns_args { + register_t dummy; +}; +struct linux_process_vm_readv_args { + register_t dummy; +}; +struct linux_process_vm_writev_args { + register_t dummy; +}; #define nosys linux_nosys int linux_fork(struct thread *, struct linux_fork_args *); int linux_open(struct thread *, struct linux_open_args *); @@ -1264,6 +1360,38 @@ int linux_splice(struct thread *, struct int linux_sync_file_range(struct thread *, struct linux_sync_file_range_args *); int linux_tee(struct thread *, struct linux_tee_args *); int linux_vmsplice(struct thread *, struct linux_vmsplice_args *); +int linux_move_pages(struct thread *, struct linux_move_pages_args *); +int linux_getcpu(struct thread *, struct linux_getcpu_args *); +int linux_epoll_pwait(struct thread *, struct linux_epoll_pwait_args *); +int linux_utimensat(struct thread *, struct linux_utimensat_args *); +int linux_signalfd(struct thread *, struct linux_signalfd_args *); +int linux_timerfd_create(struct thread *, struct linux_timerfd_create_args *); +int linux_eventfd(struct thread *, struct linux_eventfd_args *); +int linux_fallocate(struct thread *, struct linux_fallocate_args *); +int linux_timerfd_settime(struct thread *, struct linux_timerfd_settime_args *); +int linux_timerfd_gettime(struct thread *, struct linux_timerfd_gettime_args *); +int linux_signalfd4(struct thread *, struct linux_signalfd4_args *); +int linux_eventfd2(struct thread *, struct linux_eventfd2_args *); +int linux_epoll_create1(struct thread *, struct linux_epoll_create1_args *); +int linux_dup3(struct thread *, struct linux_dup3_args *); +int linux_pipe2(struct thread *, struct linux_pipe2_args *); +int linux_inotify_init1(struct thread *, struct linux_inotify_init1_args *); +int linux_preadv(struct thread *, struct linux_preadv_args *); +int linux_pwritev(struct thread *, struct linux_pwritev_args *); +int linux_rt_tsigqueueinfo(struct thread *, struct linux_rt_tsigqueueinfo_args *); +int linux_perf_event_open(struct thread *, struct linux_perf_event_open_args *); +int linux_recvmmsg(struct thread *, struct linux_recvmmsg_args *); +int linux_fanotify_init(struct thread *, struct linux_fanotify_init_args *); +int linux_fanotify_mark(struct thread *, struct linux_fanotify_mark_args *); +int linux_prlimit64(struct thread *, struct linux_prlimit64_args *); +int linux_name_to_handle_at(struct thread *, struct linux_name_to_handle_at_args *); +int linux_open_by_handle_at(struct thread *, struct linux_open_by_handle_at_args *); +int linux_clock_adjtime(struct thread *, struct linux_clock_adjtime_args *); +int linux_syncfs(struct thread *, struct linux_syncfs_args *); +int linux_sendmmsg(struct thread *, struct linux_sendmmsg_args *); +int linux_setns(struct thread *, struct linux_setns_args *); +int linux_process_vm_readv(struct thread *, struct linux_process_vm_readv_args *); +int linux_process_vm_writev(struct thread *, struct linux_process_vm_writev_args *); #ifdef COMPAT_43 @@ -1535,6 +1663,38 @@ int linux_vmsplice(struct thread *, stru #define LINUX_SYS_AUE_linux_sync_file_range AUE_NULL #define LINUX_SYS_AUE_linux_tee AUE_NULL #define LINUX_SYS_AUE_linux_vmsplice AUE_NULL +#define LINUX_SYS_AUE_linux_move_pages AUE_NULL +#define LINUX_SYS_AUE_linux_getcpu AUE_NULL +#define LINUX_SYS_AUE_linux_epoll_pwait AUE_NULL +#define LINUX_SYS_AUE_linux_utimensat AUE_NULL +#define LINUX_SYS_AUE_linux_signalfd AUE_NULL +#define LINUX_SYS_AUE_linux_timerfd_create AUE_NULL +#define LINUX_SYS_AUE_linux_eventfd AUE_NULL +#define LINUX_SYS_AUE_linux_fallocate AUE_NULL +#define LINUX_SYS_AUE_linux_timerfd_settime AUE_NULL +#define LINUX_SYS_AUE_linux_timerfd_gettime AUE_NULL +#define LINUX_SYS_AUE_linux_signalfd4 AUE_NULL +#define LINUX_SYS_AUE_linux_eventfd2 AUE_NULL +#define LINUX_SYS_AUE_linux_epoll_create1 AUE_NULL +#define LINUX_SYS_AUE_linux_dup3 AUE_NULL +#define LINUX_SYS_AUE_linux_pipe2 AUE_NULL +#define LINUX_SYS_AUE_linux_inotify_init1 AUE_NULL +#define LINUX_SYS_AUE_linux_preadv AUE_NULL +#define LINUX_SYS_AUE_linux_pwritev AUE_NULL +#define LINUX_SYS_AUE_linux_rt_tsigqueueinfo AUE_NULL +#define LINUX_SYS_AUE_linux_perf_event_open AUE_NULL +#define LINUX_SYS_AUE_linux_recvmmsg AUE_NULL +#define LINUX_SYS_AUE_linux_fanotify_init AUE_NULL +#define LINUX_SYS_AUE_linux_fanotify_mark AUE_NULL +#define LINUX_SYS_AUE_linux_prlimit64 AUE_NULL +#define LINUX_SYS_AUE_linux_name_to_handle_at AUE_NULL +#define LINUX_SYS_AUE_linux_open_by_handle_at AUE_NULL +#define LINUX_SYS_AUE_linux_clock_adjtime AUE_NULL +#define LINUX_SYS_AUE_linux_syncfs AUE_NULL +#define LINUX_SYS_AUE_linux_sendmmsg AUE_NULL +#define LINUX_SYS_AUE_linux_setns AUE_NULL +#define LINUX_SYS_AUE_linux_process_vm_readv AUE_NULL +#define LINUX_SYS_AUE_linux_process_vm_writev AUE_NULL #undef PAD_ #undef PADL_ Modified: stable/9/sys/i386/linux/linux_syscall.h ============================================================================== --- stable/9/sys/i386/linux/linux_syscall.h Sun Apr 15 16:52:48 2012 (r234316) +++ stable/9/sys/i386/linux/linux_syscall.h Sun Apr 15 16:53:44 2012 (r234317) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/9/sys/i386/linux/syscalls.master 231145 2012-02-07 19:11:54Z jhb + * created from FreeBSD: stable/9/sys/i386/linux/syscalls.master 234316 2012-04-15 16:52:48Z netchild */ #define LINUX_SYS_exit 1 @@ -296,4 +296,36 @@ #define LINUX_SYS_linux_sync_file_range 314 #define LINUX_SYS_linux_tee 315 #define LINUX_SYS_linux_vmsplice 316 -#define LINUX_SYS_MAXSYSCALL 317 +#define LINUX_SYS_linux_move_pages 317 +#define LINUX_SYS_linux_getcpu 318 +#define LINUX_SYS_linux_epoll_pwait 319 +#define LINUX_SYS_linux_utimensat 320 +#define LINUX_SYS_linux_signalfd 321 +#define LINUX_SYS_linux_timerfd_create 322 +#define LINUX_SYS_linux_eventfd 323 +#define LINUX_SYS_linux_fallocate 324 +#define LINUX_SYS_linux_timerfd_settime 325 +#define LINUX_SYS_linux_timerfd_gettime 326 +#define LINUX_SYS_linux_signalfd4 327 +#define LINUX_SYS_linux_eventfd2 328 +#define LINUX_SYS_linux_epoll_create1 329 +#define LINUX_SYS_linux_dup3 330 +#define LINUX_SYS_linux_pipe2 331 +#define LINUX_SYS_linux_inotify_init1 332 +#define LINUX_SYS_linux_preadv 333 +#define LINUX_SYS_linux_pwritev 334 +#define LINUX_SYS_linux_rt_tsigqueueinfo 335 +#define LINUX_SYS_linux_perf_event_open 336 +#define LINUX_SYS_linux_recvmmsg 337 +#define LINUX_SYS_linux_fanotify_init 338 +#define LINUX_SYS_linux_fanotify_mark 339 +#define LINUX_SYS_linux_prlimit64 340 +#define LINUX_SYS_linux_name_to_handle_at 341 +#define LINUX_SYS_linux_open_by_handle_at 342 +#define LINUX_SYS_linux_clock_adjtime 343 +#define LINUX_SYS_linux_syncfs 344 +#define LINUX_SYS_linux_sendmmsg 345 +#define LINUX_SYS_linux_setns 346 +#define LINUX_SYS_linux_process_vm_readv 347 +#define LINUX_SYS_linux_process_vm_writev 348 +#define LINUX_SYS_MAXSYSCALL 349 Modified: stable/9/sys/i386/linux/linux_syscalls.c ============================================================================== --- stable/9/sys/i386/linux/linux_syscalls.c Sun Apr 15 16:52:48 2012 (r234316) +++ stable/9/sys/i386/linux/linux_syscalls.c Sun Apr 15 16:53:44 2012 (r234317) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/9/sys/i386/linux/syscalls.master 231145 2012-02-07 19:11:54Z jhb + * created from FreeBSD: stable/9/sys/i386/linux/syscalls.master 234316 2012-04-15 16:52:48Z netchild */ const char *linux_syscallnames[] = { @@ -281,7 +281,7 @@ const char *linux_syscallnames[] = { "linux_tgkill", /* 270 = linux_tgkill */ "linux_utimes", /* 271 = linux_utimes */ "linux_fadvise64_64", /* 272 = linux_fadvise64_64 */ - "#273", /* 273 = */ + "#273", /* 273 = vserver */ "linux_mbind", /* 274 = linux_mbind */ "linux_get_mempolicy", /* 275 = linux_get_mempolicy */ "linux_set_mempolicy", /* 276 = linux_set_mempolicy */ @@ -325,4 +325,36 @@ const char *linux_syscallnames[] = { "linux_sync_file_range", /* 314 = linux_sync_file_range */ "linux_tee", /* 315 = linux_tee */ "linux_vmsplice", /* 316 = linux_vmsplice */ + "linux_move_pages", /* 317 = linux_move_pages */ + "linux_getcpu", /* 318 = linux_getcpu */ + "linux_epoll_pwait", /* 319 = linux_epoll_pwait */ + "linux_utimensat", /* 320 = linux_utimensat */ + "linux_signalfd", /* 321 = linux_signalfd */ + "linux_timerfd_create", /* 322 = linux_timerfd_create */ + "linux_eventfd", /* 323 = linux_eventfd */ + "linux_fallocate", /* 324 = linux_fallocate */ + "linux_timerfd_settime", /* 325 = linux_timerfd_settime */ + "linux_timerfd_gettime", /* 326 = linux_timerfd_gettime */ + "linux_signalfd4", /* 327 = linux_signalfd4 */ + "linux_eventfd2", /* 328 = linux_eventfd2 */ + "linux_epoll_create1", /* 329 = linux_epoll_create1 */ + "linux_dup3", /* 330 = linux_dup3 */ + "linux_pipe2", /* 331 = linux_pipe2 */ + "linux_inotify_init1", /* 332 = linux_inotify_init1 */ + "linux_preadv", /* 333 = linux_preadv */ + "linux_pwritev", /* 334 = linux_pwritev */ + "linux_rt_tsigqueueinfo", /* 335 = linux_rt_tsigqueueinfo */ + "linux_perf_event_open", /* 336 = linux_perf_event_open */ + "linux_recvmmsg", /* 337 = linux_recvmmsg */ + "linux_fanotify_init", /* 338 = linux_fanotify_init */ + "linux_fanotify_mark", /* 339 = linux_fanotify_mark */ + "linux_prlimit64", /* 340 = linux_prlimit64 */ + "linux_name_to_handle_at", /* 341 = linux_name_to_handle_at */ + "linux_open_by_handle_at", /* 342 = linux_open_by_handle_at */ + "linux_clock_adjtime", /* 343 = linux_clock_adjtime */ + "linux_syncfs", /* 344 = linux_syncfs */ + "linux_sendmmsg", /* 345 = linux_sendmmsg */ + "linux_setns", /* 346 = linux_setns */ + "linux_process_vm_readv", /* 347 = linux_process_vm_readv */ + "linux_process_vm_writev", /* 348 = linux_process_vm_writev */ }; Modified: stable/9/sys/i386/linux/linux_sysent.c ============================================================================== --- stable/9/sys/i386/linux/linux_sysent.c Sun Apr 15 16:52:48 2012 (r234316) +++ stable/9/sys/i386/linux/linux_sysent.c Sun Apr 15 16:53:44 2012 (r234317) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/9/sys/i386/linux/syscalls.master 231145 2012-02-07 19:11:54Z jhb + * created from FreeBSD: stable/9/sys/i386/linux/syscalls.master 234316 2012-04-15 16:52:48Z netchild */ #include @@ -291,7 +291,7 @@ struct sysent linux_sysent[] = { { AS(linux_tgkill_args), (sy_call_t *)linux_tgkill, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 270 = linux_tgkill */ { AS(linux_utimes_args), (sy_call_t *)linux_utimes, AUE_UTIMES, NULL, 0, 0, 0, SY_THR_STATIC }, /* 271 = linux_utimes */ { AS(linux_fadvise64_64_args), (sy_call_t *)linux_fadvise64_64, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 272 = linux_fadvise64_64 */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 273 = */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 273 = vserver */ { 0, (sy_call_t *)linux_mbind, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 274 = linux_mbind */ { 0, (sy_call_t *)linux_get_mempolicy, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 275 = linux_get_mempolicy */ { 0, (sy_call_t *)linux_set_mempolicy, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 276 = linux_set_mempolicy */ @@ -335,4 +335,36 @@ struct sysent linux_sysent[] = { { 0, (sy_call_t *)linux_sync_file_range, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 314 = linux_sync_file_range */ { 0, (sy_call_t *)linux_tee, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 315 = linux_tee */ { 0, (sy_call_t *)linux_vmsplice, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 316 = linux_vmsplice */ + { 0, (sy_call_t *)linux_move_pages, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 317 = linux_move_pages */ + { 0, (sy_call_t *)linux_getcpu, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 318 = linux_getcpu */ + { 0, (sy_call_t *)linux_epoll_pwait, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 319 = linux_epoll_pwait */ + { 0, (sy_call_t *)linux_utimensat, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 320 = linux_utimensat */ + { 0, (sy_call_t *)linux_signalfd, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 321 = linux_signalfd */ + { 0, (sy_call_t *)linux_timerfd_create, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 322 = linux_timerfd_create */ + { 0, (sy_call_t *)linux_eventfd, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 323 = linux_eventfd */ + { 0, (sy_call_t *)linux_fallocate, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 324 = linux_fallocate */ + { 0, (sy_call_t *)linux_timerfd_settime, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 325 = linux_timerfd_settime */ + { 0, (sy_call_t *)linux_timerfd_gettime, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 326 = linux_timerfd_gettime */ + { 0, (sy_call_t *)linux_signalfd4, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 327 = linux_signalfd4 */ + { 0, (sy_call_t *)linux_eventfd2, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 328 = linux_eventfd2 */ + { 0, (sy_call_t *)linux_epoll_create1, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 329 = linux_epoll_create1 */ + { 0, (sy_call_t *)linux_dup3, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 330 = linux_dup3 */ + { 0, (sy_call_t *)linux_pipe2, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 331 = linux_pipe2 */ + { 0, (sy_call_t *)linux_inotify_init1, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 332 = linux_inotify_init1 */ + { 0, (sy_call_t *)linux_preadv, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 333 = linux_preadv */ + { 0, (sy_call_t *)linux_pwritev, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 334 = linux_pwritev */ + { 0, (sy_call_t *)linux_rt_tsigqueueinfo, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 335 = linux_rt_tsigqueueinfo */ + { 0, (sy_call_t *)linux_perf_event_open, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 336 = linux_perf_event_open */ + { 0, (sy_call_t *)linux_recvmmsg, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 337 = linux_recvmmsg */ + { 0, (sy_call_t *)linux_fanotify_init, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 338 = linux_fanotify_init */ + { 0, (sy_call_t *)linux_fanotify_mark, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 339 = linux_fanotify_mark */ + { 0, (sy_call_t *)linux_prlimit64, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 340 = linux_prlimit64 */ + { 0, (sy_call_t *)linux_name_to_handle_at, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 341 = linux_name_to_handle_at */ + { 0, (sy_call_t *)linux_open_by_handle_at, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 342 = linux_open_by_handle_at */ + { 0, (sy_call_t *)linux_clock_adjtime, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 343 = linux_clock_adjtime */ + { 0, (sy_call_t *)linux_syncfs, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 344 = linux_syncfs */ + { 0, (sy_call_t *)linux_sendmmsg, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 345 = linux_sendmmsg */ + { 0, (sy_call_t *)linux_setns, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 346 = linux_setns */ + { 0, (sy_call_t *)linux_process_vm_readv, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 347 = linux_process_vm_readv */ + { 0, (sy_call_t *)linux_process_vm_writev, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 348 = linux_process_vm_writev */ }; Modified: stable/9/sys/i386/linux/linux_systrace_args.c ============================================================================== --- stable/9/sys/i386/linux/linux_systrace_args.c Sun Apr 15 16:52:48 2012 (r234316) +++ stable/9/sys/i386/linux/linux_systrace_args.c Sun Apr 15 16:53:44 2012 (r234317) @@ -2190,6 +2190,166 @@ systrace_args(int sysnum, void *params, *n_args = 0; break; } + /* linux_move_pages */ + case 317: { + *n_args = 0; + break; + } + /* linux_getcpu */ + case 318: { + *n_args = 0; + break; + } + /* linux_epoll_pwait */ + case 319: { *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-9@FreeBSD.ORG Sun Apr 15 18:38:51 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CAF8F1065677 for ; Sun, 15 Apr 2012 18:38:51 +0000 (UTC) (envelope-from andrey@zonov.org) Received: from mail-lb0-f182.google.com (mail-lb0-f182.google.com [209.85.217.182]) by mx1.freebsd.org (Postfix) with ESMTP id 445418FC15 for ; Sun, 15 Apr 2012 18:38:51 +0000 (UTC) Received: by lbbgj3 with SMTP id gj3so4404655lbb.13 for ; Sun, 15 Apr 2012 11:38:49 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding :x-gm-message-state; bh=LP9z+4GdL9ButSHarlyMITEUWbx/0WfmFlnpg7W3rWw=; b=J7FW9ClTJGHhVdpJndRS9DisGw12opZJ1rlvTrFZylSjP5SgWPMespVWKBLRpLEJoc j5nQXE1Wu3i39Tz3VH0Qc11cETwZxtQmSYEMAk5hUpFvinLcNO8F5nr4856xpNtANhVN YClLBiHAFof9eZnVzfmYg3BPxPRacuK0iPQYCZ3OPquqT9tp9brhjzpupdrks5l8zfIb xf5gar8laq99+U+hDcK2Q5ZtXDQaGwpv/wiJR4c/l8TuA7klW2rjBAgSm3kxpLvKoz+U hnsln5UYlpuk1gJ+WSsVdgOiU2dqPyfO4z+nSlRTQcw8ay7p37lVVlVv8zbyHs+gfDCv 13Zg== Received: by 10.152.148.234 with SMTP id tv10mr7992210lab.41.1334515129842; Sun, 15 Apr 2012 11:38:49 -0700 (PDT) Received: from [10.254.254.77] (ppp95-165-130-108.pppoe.spdop.ru. [95.165.130.108]) by mx.google.com with ESMTPS id w10sm21327828lbe.14.2012.04.15.11.38.48 (version=SSLv3 cipher=OTHER); Sun, 15 Apr 2012 11:38:49 -0700 (PDT) Message-ID: <4F8B15B2.9090200@zonov.org> Date: Sun, 15 Apr 2012 22:38:42 +0400 From: Andrey Zonov User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; ru; rv:1.8.1.24) Gecko/20100228 Thunderbird/2.0.0.24 Mnenhy/0.7.6.0 MIME-Version: 1.0 To: Alexander Leidinger References: <201204151652.q3FGqns5093271@svn.freebsd.org> In-Reply-To: <201204151652.q3FGqns5093271@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Gm-Message-State: ALoCoQk/E1Rr2a3At9m0edXEgaI/tyZ3CMcHF2FQq5NEwxfl9WFyzeqF9B0cQDH/S3uq6IbZ/5ZX Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-9@freebsd.org Subject: Re: svn commit: r234316 - in stable/9/sys: amd64/linux32 i386/conf i386/linux kern X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Apr 2012 18:38:51 -0000 On 15.04.2012 20:52, Alexander Leidinger wrote: > Author: netchild > Date: Sun Apr 15 16:52:48 2012 > New Revision: 234316 > URL: http://svn.freebsd.org/changeset/base/234316 > > Log: > MFC r232799: > - add comments to syscalls.master and linux(32)_dummy about which linux > kernel version introduced the sysctl (based upon a linux man-page) > - add comments to syscalls.master regarding some names of sysctls which are > different than the linux-names (based upon the linux unistd.h) > - add some dummy sysctls > - name an unimplemented sysctl > Did you mean s/sysctl/syscall/? -- Andrey Zonov From owner-svn-src-stable-9@FreeBSD.ORG Sun Apr 15 19:07:41 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2ABD4106566C; Sun, 15 Apr 2012 19:07:41 +0000 (UTC) (envelope-from alexander@leidinger.net) Received: from mail.ebusiness-leidinger.de (mail.ebusiness-leidinger.de [217.11.53.44]) by mx1.freebsd.org (Postfix) with ESMTP id D0A5C8FC14; Sun, 15 Apr 2012 19:07:40 +0000 (UTC) Received: from outgoing.leidinger.net (p4FC432C0.dip.t-dialin.net [79.196.50.192]) by mail.ebusiness-leidinger.de (Postfix) with ESMTPSA id 15612844109; Sun, 15 Apr 2012 21:07:25 +0200 (CEST) Received: from unknown (IO.Leidinger.net [192.168.1.12]) by outgoing.leidinger.net (Postfix) with ESMTPS id 4BF3920BA; Sun, 15 Apr 2012 21:07:22 +0200 (CEST) Date: Sun, 15 Apr 2012 21:07:19 +0200 From: Alexander Leidinger To: Andrey Zonov Message-ID: <20120415210719.000031c7@unknown> In-Reply-To: <4F8B15B2.9090200@zonov.org> References: <201204151652.q3FGqns5093271@svn.freebsd.org> <4F8B15B2.9090200@zonov.org> X-Mailer: Claws Mail 3.7.10cvs42 (GTK+ 2.16.6; i586-pc-mingw32msvc) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-EBL-MailScanner-Information: Please contact the ISP for more information X-EBL-MailScanner-ID: 15612844109.A2AC5 X-EBL-MailScanner: Found to be clean X-EBL-MailScanner-SpamCheck: not spam, spamhaus-ZEN, SpamAssassin (not cached, score=-0.467, required 6, autolearn=disabled, ALL_TRUSTED -1.00, AWL -0.13, J_CHICKENPOX_45 0.60, TW_SV 0.08, T_RP_MATCHES_RCVD -0.01) X-EBL-MailScanner-From: alexander@leidinger.net X-EBL-MailScanner-Watermark: 1335121648.36859@flOU3YLs5YI5fKQ8yvvRVw X-EBL-Spam-Status: No Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Alexander Leidinger , svn-src-stable-9@freebsd.org Subject: Re: svn commit: r234316 - in stable/9/sys: amd64/linux32 i386/conf i386/linux kern X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Apr 2012 19:07:41 -0000 On Sun, 15 Apr 2012 22:38:42 +0400 Andrey Zonov wrote: > On 15.04.2012 20:52, Alexander Leidinger wrote: > > Author: netchild > > Date: Sun Apr 15 16:52:48 2012 > > New Revision: 234316 > > URL: http://svn.freebsd.org/changeset/base/234316 > > > > Log: > > MFC r232799: > > - add comments to syscalls.master and linux(32)_dummy about > > which linux kernel version introduced the sysctl (based upon a > > linux man-page) > > - add comments to syscalls.master regarding some names of > > sysctls which are different than the linux-names (based upon the > > linux unistd.h) > > - add some dummy sysctls > > - name an unimplemented sysctl > > > > Did you mean s/sysctl/syscall/? Yes, I already did it wrong in the original commit and overlooked it in the copy&paste (while fixing another typo). But it is obvious from the context of the change that it has to be "syscall" (sysctls do not belong into syscalls.master). Bye, Alexander. -- http://www.Leidinger.net Alexander @ Leidinger.net: PGP ID = B0063FE7 http://www.FreeBSD.org netchild @ FreeBSD.org : PGP ID = 72077137 From owner-svn-src-stable-9@FreeBSD.ORG Mon Apr 16 01:15:38 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AF5A4106566C; Mon, 16 Apr 2012 01:15:38 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 901A08FC14; Mon, 16 Apr 2012 01:15:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q3G1FcT9009756; Mon, 16 Apr 2012 01:15:38 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q3G1FcML009754; Mon, 16 Apr 2012 01:15:38 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201204160115.q3G1FcML009754@svn.freebsd.org> From: Kevin Lo Date: Mon, 16 Apr 2012 01:15:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r234330 - stable/9/usr.bin/unzip X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Apr 2012 01:15:38 -0000 Author: kevlo Date: Mon Apr 16 01:15:38 2012 New Revision: 234330 URL: http://svn.freebsd.org/changeset/base/234330 Log: MFC r234206: Partially implement zipinfo (-Z) support. This fixes some test failures seen with perl 5.12 and 5.14. PR: bin/166895 Submitted by: swills Modified: stable/9/usr.bin/unzip/unzip.c Directory Properties: stable/9/usr.bin/ (props changed) Modified: stable/9/usr.bin/unzip/unzip.c ============================================================================== --- stable/9/usr.bin/unzip/unzip.c Sun Apr 15 23:56:03 2012 (r234329) +++ stable/9/usr.bin/unzip/unzip.c Mon Apr 16 01:15:38 2012 (r234330) @@ -65,6 +65,7 @@ static int q_opt; /* quiet */ static int t_opt; /* test */ static int u_opt; /* update */ static int v_opt; /* verbose/list */ +static int Z1_opt; /* zipinfo mode list files only */ /* time when unzip started */ static time_t now; @@ -72,6 +73,9 @@ static time_t now; /* debug flag */ static int unzip_debug; +/* zipinfo mode */ +static int zipinfo_mode; + /* running on tty? */ static int tty; @@ -802,17 +806,22 @@ list(struct archive *a, struct archive_e mtime = archive_entry_mtime(e); strftime(buf, sizeof(buf), "%m-%d-%g %R", localtime(&mtime)); - if (v_opt == 1) { - printf(" %8ju %s %s\n", - (uintmax_t)archive_entry_size(e), - buf, archive_entry_pathname(e)); - } else if (v_opt == 2) { - printf("%8ju Stored %7ju 0%% %s %08x %s\n", - (uintmax_t)archive_entry_size(e), - (uintmax_t)archive_entry_size(e), - buf, - 0U, - archive_entry_pathname(e)); + if (!zipinfo_mode) { + if (v_opt == 1) { + printf(" %8ju %s %s\n", + (uintmax_t)archive_entry_size(e), + buf, archive_entry_pathname(e)); + } else if (v_opt == 2) { + printf("%8ju Stored %7ju 0%% %s %08x %s\n", + (uintmax_t)archive_entry_size(e), + (uintmax_t)archive_entry_size(e), + buf, + 0U, + archive_entry_pathname(e)); + } + } else { + if (Z1_opt) + printf("%s\n",archive_entry_pathname(e)); } ac(archive_read_data_skip(a)); } @@ -870,14 +879,16 @@ unzip(const char *fn) ac(archive_read_support_format_zip(a)); ac(archive_read_open_fd(a, fd, 8192)); - if (!p_opt && !q_opt) - printf("Archive: %s\n", fn); - if (v_opt == 1) { - printf(" Length Date Time Name\n"); - printf(" -------- ---- ---- ----\n"); - } else if (v_opt == 2) { - printf(" Length Method Size Ratio Date Time CRC-32 Name\n"); - printf("-------- ------ ------- ----- ---- ---- ------ ----\n"); + if (!zipinfo_mode) { + if (!p_opt && !q_opt) + printf("Archive: %s\n", fn); + if (v_opt == 1) { + printf(" Length Date Time Name\n"); + printf(" -------- ---- ---- ----\n"); + } else if (v_opt == 2) { + printf(" Length Method Size Ratio Date Time CRC-32 Name\n"); + printf("-------- ------ ------- ----- ---- ---- ------ ----\n"); + } } total_size = 0; @@ -888,28 +899,35 @@ unzip(const char *fn) if (ret == ARCHIVE_EOF) break; ac(ret); - if (t_opt) - error_count += test(a, e); - else if (v_opt) - list(a, e); - else if (p_opt || c_opt) - extract_stdout(a, e); - else - extract(a, e); + if (!zipinfo_mode) { + if (t_opt) + error_count += test(a, e); + else if (v_opt) + list(a, e); + else if (p_opt || c_opt) + extract_stdout(a, e); + else + extract(a, e); + } else { + if (Z1_opt) + list(a, e); + } total_size += archive_entry_size(e); ++file_count; } - if (v_opt == 1) { - printf(" -------- -------\n"); - printf(" %8ju %ju file%s\n", - total_size, file_count, file_count != 1 ? "s" : ""); - } else if (v_opt == 2) { - printf("-------- ------- --- -------\n"); - printf("%8ju %7ju 0%% %ju file%s\n", - total_size, total_size, file_count, - file_count != 1 ? "s" : ""); + if (zipinfo_mode) { + if (v_opt == 1) { + printf(" -------- -------\n"); + printf(" %8ju %ju file%s\n", + total_size, file_count, file_count != 1 ? "s" : ""); + } else if (v_opt == 2) { + printf("-------- ------- --- -------\n"); + printf("%8ju %7ju 0%% %ju file%s\n", + total_size, total_size, file_count, + file_count != 1 ? "s" : ""); + } } ac(archive_read_close(a)); @@ -933,7 +951,7 @@ static void usage(void) { - fprintf(stderr, "usage: unzip [-aCcfjLlnopqtuv] [-d dir] [-x pattern] zipfile\n"); + fprintf(stderr, "usage: unzip [-aCcfjLlnopqtuvZ1] [-d dir] [-x pattern] zipfile\n"); exit(1); } @@ -943,8 +961,11 @@ getopts(int argc, char *argv[]) int opt; optreset = optind = 1; - while ((opt = getopt(argc, argv, "aCcd:fjLlnopqtuvx:")) != -1) + while ((opt = getopt(argc, argv, "aCcd:fjLlnopqtuvx:Z1")) != -1) switch (opt) { + case '1': + Z1_opt = 1; + break; case 'a': a_opt = 1; break; @@ -995,6 +1016,9 @@ getopts(int argc, char *argv[]) case 'x': add_pattern(&exclude, optarg); break; + case 'Z': + zipinfo_mode = 1; + break; default: usage(); } @@ -1024,6 +1048,15 @@ main(int argc, char *argv[]) */ nopts = getopts(argc, argv); + /* + * When more of the zipinfo mode options are implemented, this + * will need to change. + */ + if (zipinfo_mode && !Z1_opt) { + printf("Zipinfo mode needs additional options\n"); + exit(1); + } + if (argc <= nopts) usage(); zipfile = argv[nopts++]; From owner-svn-src-stable-9@FreeBSD.ORG Mon Apr 16 12:49:19 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 97334106564A; Mon, 16 Apr 2012 12:49:19 +0000 (UTC) (envelope-from gavin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8190A8FC16; Mon, 16 Apr 2012 12:49:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q3GCnJao034220; Mon, 16 Apr 2012 12:49:19 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q3GCnJgr034217; Mon, 16 Apr 2012 12:49:19 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201204161249.q3GCnJgr034217@svn.freebsd.org> From: Gavin Atkinson Date: Mon, 16 Apr 2012 12:49:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r234340 - stable/9/contrib/tnftp/src X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Apr 2012 12:49:19 -0000 Author: gavin Date: Mon Apr 16 12:49:19 2012 New Revision: 234340 URL: http://svn.freebsd.org/changeset/base/234340 Log: Merge r232779 from head: Move determination of socket buffer sizes from startup to the first time a socket is used. The previous code structure assumed that AF_INET sockets were always available, which is an invalid assumption on IPv6-only systems. This merges the fololowing revisions from NetBSD: src/usr.bin/ftp/main.c 1.120 src/usr.bin/ftp/util.c 1.156 PR: bin/162661 Obtained from: NetBSD Modified: stable/9/contrib/tnftp/src/main.c stable/9/contrib/tnftp/src/util.c Directory Properties: stable/9/contrib/tnftp/ (props changed) Modified: stable/9/contrib/tnftp/src/main.c ============================================================================== --- stable/9/contrib/tnftp/src/main.c Mon Apr 16 10:43:06 2012 (r234339) +++ stable/9/contrib/tnftp/src/main.c Mon Apr 16 12:49:19 2012 (r234340) @@ -146,9 +146,8 @@ main(int volatile argc, char **volatile struct passwd *pw; char *cp, *ep, *anonpass, *upload_path, *src_addr; const char *anonuser; - int dumbterm, s, isupload; + int dumbterm, isupload; size_t len; - socklen_t slen; tzset(); #if 0 /* tnftp */ /* XXX */ @@ -213,35 +212,6 @@ main(int volatile argc, char **volatile if (cp != NULL && strlcpy(netrc, cp, sizeof(netrc)) >= sizeof(netrc)) errx(1, "$NETRC `%s': %s", cp, strerror(ENAMETOOLONG)); - /* - * Get the default socket buffer sizes if we don't already have them. - * It doesn't matter which socket we do this to, because on the first - * call no socket buffer sizes will have been modified, so we are - * guaranteed to get the system defaults. - */ - s = socket(AF_INET, SOCK_STREAM, 0); - if (s == -1) - err(1, "Can't create socket to determine default socket sizes"); - slen = sizeof(rcvbuf_size); - if (getsockopt(s, SOL_SOCKET, SO_RCVBUF, - (void *)&rcvbuf_size, &slen) == -1) - err(1, "Unable to get default rcvbuf size"); - slen = sizeof(sndbuf_size); - if (getsockopt(s, SOL_SOCKET, SO_SNDBUF, - (void *)&sndbuf_size, &slen) == -1) - err(1, "Unable to get default sndbuf size"); - (void)close(s); - /* sanity check returned buffer sizes */ - if (rcvbuf_size <= 0) - rcvbuf_size = 8 * 1024; - if (sndbuf_size <= 0) - sndbuf_size = 8 * 1024; - - if (sndbuf_size > 8 * 1024 * 1024) - sndbuf_size = 8 * 1024 * 1024; - if (rcvbuf_size > 8 * 1024 * 1024) - rcvbuf_size = 8 * 1024 * 1024; - marg_sl = ftp_sl_init(); if ((tmpdir = getenv("TMPDIR")) == NULL) tmpdir = _PATH_TMP; Modified: stable/9/contrib/tnftp/src/util.c ============================================================================== --- stable/9/contrib/tnftp/src/util.c Mon Apr 16 10:43:06 2012 (r234339) +++ stable/9/contrib/tnftp/src/util.c Mon Apr 16 12:49:19 2012 (r234340) @@ -1060,6 +1060,32 @@ strsuftoi(const char *arg) void setupsockbufsize(int sock) { + socklen_t slen; + + if (0 == rcvbuf_size) { + slen = sizeof(rcvbuf_size); + if (getsockopt(sock, SOL_SOCKET, SO_RCVBUF, + (void *)&rcvbuf_size, &slen) == -1) + err(1, "Unable to determine rcvbuf size"); + if (rcvbuf_size <= 0) + rcvbuf_size = 8 * 1024; + if (rcvbuf_size > 8 * 1024 * 1024) + rcvbuf_size = 8 * 1024 * 1024; + DPRINTF("setupsockbufsize: rcvbuf_size determined as %d\n", + rcvbuf_size); + } + if (0 == sndbuf_size) { + slen = sizeof(sndbuf_size); + if (getsockopt(sock, SOL_SOCKET, SO_SNDBUF, + (void *)&sndbuf_size, &slen) == -1) + err(1, "Unable to determine sndbuf size"); + if (sndbuf_size <= 0) + sndbuf_size = 8 * 1024; + if (sndbuf_size > 8 * 1024 * 1024) + sndbuf_size = 8 * 1024 * 1024; + DPRINTF("setupsockbufsize: sndbuf_size determined as %d\n", + sndbuf_size); + } if (setsockopt(sock, SOL_SOCKET, SO_SNDBUF, (void *)&sndbuf_size, sizeof(sndbuf_size)) == -1) From owner-svn-src-stable-9@FreeBSD.ORG Tue Apr 17 09:02:56 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 78D23106566C; Tue, 17 Apr 2012 09:02:56 +0000 (UTC) (envelope-from davidxu@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 592918FC08; Tue, 17 Apr 2012 09:02:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q3H92uDr073981; Tue, 17 Apr 2012 09:02:56 GMT (envelope-from davidxu@svn.freebsd.org) Received: (from davidxu@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q3H92u11073978; Tue, 17 Apr 2012 09:02:56 GMT (envelope-from davidxu@svn.freebsd.org) Message-Id: <201204170902.q3H92u11073978@svn.freebsd.org> From: David Xu Date: Tue, 17 Apr 2012 09:02:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r234371 - in stable/9/sys: kern sys X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Apr 2012 09:02:56 -0000 Author: davidxu Date: Tue Apr 17 09:02:55 2012 New Revision: 234371 URL: http://svn.freebsd.org/changeset/base/234371 Log: MFC r233912: mtx operation UMTX_OP_MUTEX_WAKE has a side-effect that it accesses a mutex after a thread has unlocked it, it event writes data to the mutex memory to clear contention bit, there is a race that other threads can lock it and unlock it, then destroy it, so it should not write data to the mutex memory if there isn't any waiter. The new operation UMTX_OP_MUTEX_WAKE2 try to fix the problem. It requires thread library to clear the lock word entirely, then call the WAKE2 operation to check if there is any waiter in kernel, and try to wake up a thread, if necessary, the contention bit is set again by the operation. This also mitgates the chance that other threads find the contention bit and try to enter kernel to compete with each other to wake up sleeping thread, this is unnecessary. With this change, the mutex owner is no longer holding the mutex until it reaches a point where kernel umtx queue is locked, it releases the mutex as soon as possible. Performance is improved when the mutex is contensted heavily. On Intel i3-2310M, the runtime of a benchmark program is reduced from 26.87 seconds to 2.39 seconds, it even is better than UMTX_OP_MUTEX_WAKE which is deprecated now. http://people.freebsd.org/~davidxu/bench/mutex_perf.c Modified: stable/9/sys/kern/kern_umtx.c stable/9/sys/sys/umtx.h Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/kern/kern_umtx.c ============================================================================== --- stable/9/sys/kern/kern_umtx.c Tue Apr 17 07:22:14 2012 (r234370) +++ stable/9/sys/kern/kern_umtx.c Tue Apr 17 09:02:55 2012 (r234371) @@ -1276,6 +1276,78 @@ do_wake_umutex(struct thread *td, struct return (0); } +/* + * Check if the mutex has waiters and tries to fix contention bit. + */ +static int +do_wake2_umutex(struct thread *td, struct umutex *m, uint32_t flags) +{ + struct umtx_key key; + uint32_t owner, old; + int type; + int error; + int count; + + switch(flags & (UMUTEX_PRIO_INHERIT | UMUTEX_PRIO_PROTECT)) { + case 0: + type = TYPE_NORMAL_UMUTEX; + break; + case UMUTEX_PRIO_INHERIT: + type = TYPE_PI_UMUTEX; + break; + case UMUTEX_PRIO_PROTECT: + type = TYPE_PP_UMUTEX; + break; + default: + return (EINVAL); + } + if ((error = umtx_key_get(m, type, GET_SHARE(flags), + &key)) != 0) + return (error); + + owner = 0; + umtxq_lock(&key); + umtxq_busy(&key); + count = umtxq_count(&key); + umtxq_unlock(&key); + /* + * Only repair contention bit if there is a waiter, this means the mutex + * is still being referenced by userland code, otherwise don't update + * any memory. + */ + if (count > 1) { + owner = fuword32(__DEVOLATILE(uint32_t *, &m->m_owner)); + while ((owner & UMUTEX_CONTESTED) ==0) { + old = casuword32(&m->m_owner, owner, + owner|UMUTEX_CONTESTED); + if (old == owner) + break; + owner = old; + } + } else if (count == 1) { + owner = fuword32(__DEVOLATILE(uint32_t *, &m->m_owner)); + while ((owner & ~UMUTEX_CONTESTED) != 0 && + (owner & UMUTEX_CONTESTED) == 0) { + old = casuword32(&m->m_owner, owner, + owner|UMUTEX_CONTESTED); + if (old == owner) + break; + owner = old; + } + } + umtxq_lock(&key); + if (owner == -1) { + error = EFAULT; + umtxq_signal(&key, INT_MAX); + } + else if (count != 0 && (owner & ~UMUTEX_CONTESTED) == 0) + umtxq_signal(&key, 1); + umtxq_unbusy(&key); + umtxq_unlock(&key); + umtx_key_release(&key); + return (error); +} + static inline struct umtx_pi * umtx_pi_alloc(int flags) { @@ -3183,6 +3255,12 @@ __umtx_op_sem_wake(struct thread *td, st return do_sem_wake(td, uap->obj); } +static int +__umtx_op_wake2_umutex(struct thread *td, struct _umtx_op_args *uap) +{ + return do_wake2_umutex(td, uap->obj, uap->val); +} + typedef int (*_umtx_op_func)(struct thread *td, struct _umtx_op_args *uap); static _umtx_op_func op_table[] = { @@ -3207,7 +3285,8 @@ static _umtx_op_func op_table[] = { __umtx_op_wake_umutex, /* UMTX_OP_UMUTEX_WAKE */ __umtx_op_sem_wait, /* UMTX_OP_SEM_WAIT */ __umtx_op_sem_wake, /* UMTX_OP_SEM_WAKE */ - __umtx_op_nwake_private /* UMTX_OP_NWAKE_PRIVATE */ + __umtx_op_nwake_private, /* UMTX_OP_NWAKE_PRIVATE */ + __umtx_op_wake2_umutex /* UMTX_OP_UMUTEX_WAKE2 */ }; int @@ -3473,7 +3552,8 @@ static _umtx_op_func op_table_compat32[] __umtx_op_wake_umutex, /* UMTX_OP_UMUTEX_WAKE */ __umtx_op_sem_wait_compat32, /* UMTX_OP_SEM_WAIT */ __umtx_op_sem_wake, /* UMTX_OP_SEM_WAKE */ - __umtx_op_nwake_private32 /* UMTX_OP_NWAKE_PRIVATE */ + __umtx_op_nwake_private32, /* UMTX_OP_NWAKE_PRIVATE */ + __umtx_op_wake2_umutex /* UMTX_OP_UMUTEX_WAKE2 */ }; int Modified: stable/9/sys/sys/umtx.h ============================================================================== --- stable/9/sys/sys/umtx.h Tue Apr 17 07:22:14 2012 (r234370) +++ stable/9/sys/sys/umtx.h Tue Apr 17 09:02:55 2012 (r234371) @@ -76,11 +76,12 @@ #define UMTX_OP_WAIT_UINT_PRIVATE 15 #define UMTX_OP_WAKE_PRIVATE 16 #define UMTX_OP_MUTEX_WAIT 17 -#define UMTX_OP_MUTEX_WAKE 18 +#define UMTX_OP_MUTEX_WAKE 18 /* deprecated */ #define UMTX_OP_SEM_WAIT 19 #define UMTX_OP_SEM_WAKE 20 #define UMTX_OP_NWAKE_PRIVATE 21 -#define UMTX_OP_MAX 22 +#define UMTX_OP_MUTEX_WAKE2 22 +#define UMTX_OP_MAX 23 /* Flags for UMTX_OP_CV_WAIT */ #define CVWAIT_CHECK_UNPARKING 0x01 From owner-svn-src-stable-9@FreeBSD.ORG Tue Apr 17 09:09:15 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 09277106564A; Tue, 17 Apr 2012 09:09:15 +0000 (UTC) (envelope-from davidxu@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DE6F68FC08; Tue, 17 Apr 2012 09:09:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q3H99Ecp074493; Tue, 17 Apr 2012 09:09:14 GMT (envelope-from davidxu@svn.freebsd.org) Received: (from davidxu@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q3H99E1E074489; Tue, 17 Apr 2012 09:09:14 GMT (envelope-from davidxu@svn.freebsd.org) Message-Id: <201204170909.q3H99E1E074489@svn.freebsd.org> From: David Xu Date: Tue, 17 Apr 2012 09:09:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r234372 - stable/9/lib/libthr/thread X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Apr 2012 09:09:15 -0000 Author: davidxu Date: Tue Apr 17 09:09:14 2012 New Revision: 234372 URL: http://svn.freebsd.org/changeset/base/234372 Log: Merge 233103, 233912 from head: 233103: Some software think a mutex can be destroyed after it owned it, for example, it uses a serialization point like following: pthread_mutex_lock(&mutex); pthread_mutex_unlock(&mutex); pthread_mutex_destroy(&muetx); They think a previous lock holder should have already left the mutex and is no longer referencing it, so they destroy it. To be maximum compatible with such code, we use IA64 version to unlock the mutex in kernel, remove the two steps unlocking code. 233912: umtx operation UMTX_OP_MUTEX_WAKE has a side-effect that it accesses a mutex after a thread has unlocked it, it event writes data to the mutex memory to clear contention bit, there is a race that other threads can lock it and unlock it, then destroy it, so it should not write data to the mutex memory if there isn't any waiter. The new operation UMTX_OP_MUTEX_WAKE2 try to fix the problem. It requires thread library to clear the lock word entirely, then call the WAKE2 operation to check if there is any waiter in kernel, and try to wake up a thread, if necessary, the contention bit is set again by the operation. This also mitgates the chance that other threads find the contention bit and try to enter kernel to compete with each other to wake up sleeping thread, this is unnecessary. With this change, the mutex owner is no longer holding the mutex until it reaches a point where kernel umtx queue is locked, it releases the mutex as soon as possible. Performance is improved when the mutex is contensted heavily. On Intel i3-2310M, the runtime of a benchmark program is reduced from 26.87 seconds to 2.39 seconds, it even is better than UMTX_OP_MUTEX_WAKE which is deprecated now. http://people.freebsd.org/~davidxu/bench/mutex_perf.c Special code for stable/9: And add code to detect if the UMTX_OP_MUTEX_WAKE2 is available. Modified: stable/9/lib/libthr/thread/thr_private.h stable/9/lib/libthr/thread/thr_umtx.c stable/9/lib/libthr/thread/thr_umtx.h Directory Properties: stable/9/lib/libthr/ (props changed) Modified: stable/9/lib/libthr/thread/thr_private.h ============================================================================== --- stable/9/lib/libthr/thread/thr_private.h Tue Apr 17 09:02:55 2012 (r234371) +++ stable/9/lib/libthr/thread/thr_private.h Tue Apr 17 09:09:14 2012 (r234372) @@ -832,8 +832,6 @@ ssize_t __sys_write(int, const void *, s void __sys_exit(int); #endif -int _umtx_op_err(void *, int op, u_long, void *, void *) __hidden; - static inline int _thr_isthreaded(void) { Modified: stable/9/lib/libthr/thread/thr_umtx.c ============================================================================== --- stable/9/lib/libthr/thread/thr_umtx.c Tue Apr 17 09:02:55 2012 (r234371) +++ stable/9/lib/libthr/thread/thr_umtx.c Tue Apr 17 09:09:14 2012 (r234372) @@ -152,13 +152,35 @@ __thr_umutex_timedlock(struct umutex *mt int __thr_umutex_unlock(struct umutex *mtx, uint32_t id) { -#ifndef __ia64__ - /* XXX this logic has a race-condition on ia64. */ - if ((mtx->m_flags & (UMUTEX_PRIO_PROTECT | UMUTEX_PRIO_INHERIT)) == 0) { - atomic_cmpset_rel_32(&mtx->m_owner, id | UMUTEX_CONTESTED, UMUTEX_CONTESTED); - return _umtx_op_err(mtx, UMTX_OP_MUTEX_WAKE, 0, 0, 0); + static int wake2_avail = 0; + + if (__predict_false(wake2_avail == 0)) { + struct umutex test = DEFAULT_UMUTEX; + + if (_umtx_op(&test, UMTX_OP_MUTEX_WAKE2, test.m_flags, 0, 0) == -1) + wake2_avail = -1; + else + wake2_avail = 1; + } + + if (wake2_avail != 1) + goto unlock; + + uint32_t flags = mtx->m_flags; + + if ((flags & (UMUTEX_PRIO_PROTECT | UMUTEX_PRIO_INHERIT)) == 0) { + uint32_t owner; + do { + owner = mtx->m_owner; + if (__predict_false((owner & ~UMUTEX_CONTESTED) != id)) + return (EPERM); + } while (__predict_false(!atomic_cmpset_rel_32(&mtx->m_owner, + owner, UMUTEX_UNOWNED))); + if ((owner & UMUTEX_CONTESTED)) + (void)_umtx_op_err(mtx, UMTX_OP_MUTEX_WAKE2, flags, 0, 0); + return (0); } -#endif /* __ia64__ */ +unlock: return _umtx_op_err(mtx, UMTX_OP_MUTEX_UNLOCK, 0, 0, 0); } Modified: stable/9/lib/libthr/thread/thr_umtx.h ============================================================================== --- stable/9/lib/libthr/thread/thr_umtx.h Tue Apr 17 09:02:55 2012 (r234371) +++ stable/9/lib/libthr/thread/thr_umtx.h Tue Apr 17 09:09:14 2012 (r234372) @@ -35,6 +35,7 @@ #define DEFAULT_UMUTEX {0,0,{0,0},{0,0,0,0}} #define DEFAULT_URWLOCK {0,0,0,0,{0,0,0,0}} +int _umtx_op_err(void *, int op, u_long, void *, void *) __hidden; int __thr_umutex_lock(struct umutex *mtx, uint32_t id) __hidden; int __thr_umutex_lock_spin(struct umutex *mtx, uint32_t id) __hidden; int __thr_umutex_timedlock(struct umutex *mtx, uint32_t id, @@ -119,9 +120,9 @@ _thr_umutex_timedlock(struct umutex *mtx static inline int _thr_umutex_unlock(struct umutex *mtx, uint32_t id) { - if (atomic_cmpset_rel_32(&mtx->m_owner, id, UMUTEX_UNOWNED)) - return (0); - return (__thr_umutex_unlock(mtx, id)); + if (atomic_cmpset_rel_32(&mtx->m_owner, id, UMUTEX_UNOWNED)) + return (0); + return (__thr_umutex_unlock(mtx, id)); } static inline int From owner-svn-src-stable-9@FreeBSD.ORG Tue Apr 17 11:01:18 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 27EE81065672; Tue, 17 Apr 2012 11:01:18 +0000 (UTC) (envelope-from pluknet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1238F8FC1F; Tue, 17 Apr 2012 11:01:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q3HB1H8K079345; Tue, 17 Apr 2012 11:01:17 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q3HB1H1o079343; Tue, 17 Apr 2012 11:01:17 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201204171101.q3HB1H1o079343@svn.freebsd.org> From: Sergey Kandaurov Date: Tue, 17 Apr 2012 11:01:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r234375 - stable/9/sys/dev/xen/balloon X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Apr 2012 11:01:18 -0000 Author: pluknet Date: Tue Apr 17 11:01:17 2012 New Revision: 234375 URL: http://svn.freebsd.org/changeset/base/234375 Log: MFC r233939: Free ballooned pages with the corresponding malloc type. Modified: stable/9/sys/dev/xen/balloon/balloon.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/dev/xen/balloon/balloon.c ============================================================================== --- stable/9/sys/dev/xen/balloon/balloon.c Tue Apr 17 10:44:28 2012 (r234374) +++ stable/9/sys/dev/xen/balloon/balloon.c Tue Apr 17 11:01:17 2012 (r234375) @@ -140,7 +140,7 @@ balloon_retrieve(void) STAILQ_REMOVE_HEAD(&ballooned_pages, list); page = entry->page; - free(entry, M_DEVBUF); + free(entry, M_BALLOON); bs.balloon_low--; From owner-svn-src-stable-9@FreeBSD.ORG Tue Apr 17 11:54:01 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A970E106566B; Tue, 17 Apr 2012 11:54:01 +0000 (UTC) (envelope-from pluknet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 943778FC19; Tue, 17 Apr 2012 11:54:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q3HBs1mF081084; Tue, 17 Apr 2012 11:54:01 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q3HBs1SL081082; Tue, 17 Apr 2012 11:54:01 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201204171154.q3HBs1SL081082@svn.freebsd.org> From: Sergey Kandaurov Date: Tue, 17 Apr 2012 11:54:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r234378 - stable/9/lib/libc/gen X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Apr 2012 11:54:01 -0000 Author: pluknet Date: Tue Apr 17 11:54:01 2012 New Revision: 234378 URL: http://svn.freebsd.org/changeset/base/234378 Log: MFC 233296,233300: Prevent fs_file NULL pointer dereference. Modified: stable/9/lib/libc/gen/fstab.c Directory Properties: stable/9/lib/libc/ (props changed) Modified: stable/9/lib/libc/gen/fstab.c ============================================================================== --- stable/9/lib/libc/gen/fstab.c Tue Apr 17 11:49:21 2012 (r234377) +++ stable/9/lib/libc/gen/fstab.c Tue Apr 17 11:54:01 2012 (r234378) @@ -91,7 +91,7 @@ fixfsfile() struct stat sb; struct statfs sf; - if (strcmp(_fs_fstab.fs_file, "/") != 0) + if (_fs_fstab.fs_file != NULL && strcmp(_fs_fstab.fs_file, "/") != 0) return; if (statfs("/", &sf) != 0) return; From owner-svn-src-stable-9@FreeBSD.ORG Tue Apr 17 19:55:32 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 795BF106564A; Tue, 17 Apr 2012 19:55:32 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5A4748FC0C; Tue, 17 Apr 2012 19:55:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q3HJtWKU096658; Tue, 17 Apr 2012 19:55:32 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q3HJtWc5096653; Tue, 17 Apr 2012 19:55:32 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201204171955.q3HJtWc5096653@svn.freebsd.org> From: John Baldwin Date: Tue, 17 Apr 2012 19:55:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r234391 - in stable/9/sys: amd64/amd64 amd64/include i386/conf i386/i386 i386/include kern X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Apr 2012 19:55:32 -0000 Author: jhb Date: Tue Apr 17 19:55:31 2012 New Revision: 234391 URL: http://svn.freebsd.org/changeset/base/234391 Log: MFC 234059: Recognize the RDRAND instruction feature. Modified: stable/9/sys/amd64/amd64/identcpu.c stable/9/sys/amd64/include/specialreg.h stable/9/sys/i386/i386/identcpu.c stable/9/sys/i386/include/specialreg.h Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) stable/9/sys/fs/ (props changed) stable/9/sys/fs/ntfs/ (props changed) stable/9/sys/i386/conf/XENHVM (props changed) stable/9/sys/kern/subr_witness.c (props changed) Modified: stable/9/sys/amd64/amd64/identcpu.c ============================================================================== --- stable/9/sys/amd64/amd64/identcpu.c Tue Apr 17 19:42:55 2012 (r234390) +++ stable/9/sys/amd64/amd64/identcpu.c Tue Apr 17 19:55:31 2012 (r234391) @@ -303,7 +303,7 @@ printcpuinfo(void) "\034OSXSAVE" /* OS-Enabled State Management*/ "\035AVX" /* Advanced Vector Extensions */ "\036F16C" /* Half-precision conversions */ - "\037" + "\037RDRAND" /* RDRAND Instruction */ "\040HV" /* Hypervisor */ ); } Modified: stable/9/sys/amd64/include/specialreg.h ============================================================================== --- stable/9/sys/amd64/include/specialreg.h Tue Apr 17 19:42:55 2012 (r234390) +++ stable/9/sys/amd64/include/specialreg.h Tue Apr 17 19:55:31 2012 (r234391) @@ -153,6 +153,7 @@ #define CPUID2_OSXSAVE 0x08000000 #define CPUID2_AVX 0x10000000 #define CPUID2_F16C 0x20000000 +#define CPUID2_RDRAND 0x40000000 #define CPUID2_HV 0x80000000 /* Modified: stable/9/sys/i386/i386/identcpu.c ============================================================================== --- stable/9/sys/i386/i386/identcpu.c Tue Apr 17 19:42:55 2012 (r234390) +++ stable/9/sys/i386/i386/identcpu.c Tue Apr 17 19:55:31 2012 (r234391) @@ -779,7 +779,7 @@ printcpuinfo(void) "\034OSXSAVE" /* OS-Enabled State Management*/ "\035AVX" /* Advanced Vector Extensions */ "\036F16C" /* Half-precision conversions */ - "\037" + "\037RDRAND" /* RDRAND Instruction */ "\040HV" /* Hypervisor */ ); } Modified: stable/9/sys/i386/include/specialreg.h ============================================================================== --- stable/9/sys/i386/include/specialreg.h Tue Apr 17 19:42:55 2012 (r234390) +++ stable/9/sys/i386/include/specialreg.h Tue Apr 17 19:55:31 2012 (r234391) @@ -138,6 +138,7 @@ #define CPUID2_OSXSAVE 0x08000000 #define CPUID2_AVX 0x10000000 #define CPUID2_F16C 0x20000000 +#define CPUID2_RDRAND 0x40000000 #define CPUID2_HV 0x80000000 /* From owner-svn-src-stable-9@FreeBSD.ORG Wed Apr 18 04:39:13 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 46AFA106566C; Wed, 18 Apr 2012 04:39:13 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 30F7B8FC08; Wed, 18 Apr 2012 04:39:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q3I4dDOY014518; Wed, 18 Apr 2012 04:39:13 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q3I4dCD7014516; Wed, 18 Apr 2012 04:39:12 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201204180439.q3I4dCD7014516@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Wed, 18 Apr 2012 04:39:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r234404 - stable/9/sys/geom/part X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Apr 2012 04:39:13 -0000 Author: ae Date: Wed Apr 18 04:39:12 2012 New Revision: 234404 URL: http://svn.freebsd.org/changeset/base/234404 Log: MFC r233175: Make kern.geom.part node not static. Also add CTLFLAG_TUN to the check_integrity sysctl. Modified: stable/9/sys/geom/part/g_part.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/geom/part/g_part.c ============================================================================== --- stable/9/sys/geom/part/g_part.c Wed Apr 18 01:39:14 2012 (r234403) +++ stable/9/sys/geom/part/g_part.c Wed Apr 18 04:39:12 2012 (r234404) @@ -106,11 +106,13 @@ struct g_part_alias_list { }; SYSCTL_DECL(_kern_geom); -SYSCTL_NODE(_kern_geom, OID_AUTO, part, CTLFLAG_RW, 0, "GEOM_PART stuff"); +SYSCTL_NODE(_kern_geom, OID_AUTO, part, CTLFLAG_RW, 0, + "GEOM_PART stuff"); static u_int check_integrity = 1; TUNABLE_INT("kern.geom.part.check_integrity", &check_integrity); -SYSCTL_UINT(_kern_geom_part, OID_AUTO, check_integrity, CTLFLAG_RW, - &check_integrity, 1, "Enable integrity checking"); +SYSCTL_UINT(_kern_geom_part, OID_AUTO, check_integrity, + CTLFLAG_RW | CTLFLAG_TUN, &check_integrity, 1, + "Enable integrity checking"); /* * The GEOM partitioning class. From owner-svn-src-stable-9@FreeBSD.ORG Wed Apr 18 04:59:48 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 87B231065670; Wed, 18 Apr 2012 04:59:48 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6FB978FC12; Wed, 18 Apr 2012 04:59:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q3I4xmhj015222; Wed, 18 Apr 2012 04:59:48 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q3I4xmsh015215; Wed, 18 Apr 2012 04:59:48 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201204180459.q3I4xmsh015215@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Wed, 18 Apr 2012 04:59:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r234406 - in stable/9/sys: conf geom/part modules/geom/geom_part modules/geom/geom_part/geom_part_ldm X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Apr 2012 04:59:48 -0000 Author: ae Date: Wed Apr 18 04:59:47 2012 New Revision: 234406 URL: http://svn.freebsd.org/changeset/base/234406 Log: MFC r233176: Add new GEOM_PART_LDM module that implements the Logical Disk Manager scheme. The LDM is a logical volume manager for MS Windows NT and it is also known as dynamic volumes. It supports about 2000 partitions and also provides the capability for software RAID implementations. This version implements only partitioning scheme capability and based on the linux-ntfs project documentation and several publications across the Web. NOTE: JBOD, RAID0 and RAID5 volumes aren't supported. An access to the LDM metadata is read-only. When LDM is on the disk partitioned with MBR we can also destroy metadata. For the GPT partitioned disks destroy action is not supported. MFC r233177: Connect geom_part_ldm module to the build. MFC r233178: Connect geom_part_ldm to the kernel build. MFC r233181: Add CTLFLAG_TUN to sysctls. MFC r233651: Do proper cleanup for the GPT case when an error occurs. MFC r233652: VMDB offset should be greater than logical volume size only for MBR. Added: stable/9/sys/geom/part/g_part_ldm.c - copied, changed from r233176, head/sys/geom/part/g_part_ldm.c stable/9/sys/modules/geom/geom_part/geom_part_ldm/ - copied from r233177, head/sys/modules/geom/geom_part/geom_part_ldm/ Modified: stable/9/sys/conf/NOTES stable/9/sys/conf/files stable/9/sys/conf/options stable/9/sys/modules/geom/geom_part/Makefile Directory Properties: stable/9/sys/ (props changed) stable/9/sys/conf/ (props changed) Modified: stable/9/sys/conf/NOTES ============================================================================== --- stable/9/sys/conf/NOTES Wed Apr 18 04:39:37 2012 (r234405) +++ stable/9/sys/conf/NOTES Wed Apr 18 04:59:47 2012 (r234406) @@ -159,6 +159,7 @@ options GEOM_PART_BSD # BSD disklabel options GEOM_PART_EBR # Extended Boot Records options GEOM_PART_EBR_COMPAT # Backward compatible partition names options GEOM_PART_GPT # GPT partitioning +options GEOM_PART_LDM # Logical Disk Manager options GEOM_PART_MBR # MBR partitioning options GEOM_PART_PC98 # PC-9800 disk partitioning options GEOM_PART_VTOC8 # SMI VTOC8 disk label Modified: stable/9/sys/conf/files ============================================================================== --- stable/9/sys/conf/files Wed Apr 18 04:39:37 2012 (r234405) +++ stable/9/sys/conf/files Wed Apr 18 04:59:47 2012 (r234406) @@ -2241,6 +2241,7 @@ geom/part/g_part_apm.c optional geom_pa geom/part/g_part_bsd.c optional geom_part_bsd geom/part/g_part_ebr.c optional geom_part_ebr geom/part/g_part_gpt.c optional geom_part_gpt +geom/part/g_part_ldm.c optional geom_part_ldm geom/part/g_part_mbr.c optional geom_part_mbr geom/part/g_part_pc98.c optional geom_part_pc98 geom/part/g_part_vtoc8.c optional geom_part_vtoc8 Modified: stable/9/sys/conf/options ============================================================================== --- stable/9/sys/conf/options Wed Apr 18 04:39:37 2012 (r234405) +++ stable/9/sys/conf/options Wed Apr 18 04:59:47 2012 (r234406) @@ -101,6 +101,7 @@ GEOM_PART_BSD opt_geom.h GEOM_PART_EBR opt_geom.h GEOM_PART_EBR_COMPAT opt_geom.h GEOM_PART_GPT opt_geom.h +GEOM_PART_LDM opt_geom.h GEOM_PART_MBR opt_geom.h GEOM_PART_PC98 opt_geom.h GEOM_PART_VTOC8 opt_geom.h Copied and modified: stable/9/sys/geom/part/g_part_ldm.c (from r233176, head/sys/geom/part/g_part_ldm.c) ============================================================================== --- head/sys/geom/part/g_part_ldm.c Mon Mar 19 13:14:44 2012 (r233176, copy source) +++ stable/9/sys/geom/part/g_part_ldm.c Wed Apr 18 04:59:47 2012 (r234406) @@ -56,8 +56,8 @@ static SYSCTL_NODE(_kern_geom_part, OID_ static u_int ldm_debug = 0; TUNABLE_INT("kern.geom.part.ldm.debug", &ldm_debug); -SYSCTL_UINT(_kern_geom_part_ldm, OID_AUTO, debug, CTLFLAG_RW, - &ldm_debug, 0, "Debug level"); +SYSCTL_UINT(_kern_geom_part_ldm, OID_AUTO, debug, + CTLFLAG_RW | CTLFLAG_TUN, &ldm_debug, 0, "Debug level"); /* * This allows access to mirrored LDM volumes. Since we do not @@ -65,8 +65,8 @@ SYSCTL_UINT(_kern_geom_part_ldm, OID_AUT */ static u_int show_mirrors = 0; TUNABLE_INT("kern.geom.part.ldm.show_mirrors", &show_mirrors); -SYSCTL_UINT(_kern_geom_part_ldm, OID_AUTO, show_mirrors, CTLFLAG_RW, - &show_mirrors, 0, "Show mirrored volumes"); +SYSCTL_UINT(_kern_geom_part_ldm, OID_AUTO, show_mirrors, + CTLFLAG_RW | CTLFLAG_TUN, &show_mirrors, 0, "Show mirrored volumes"); #define LDM_DEBUG(lvl, fmt, ...) do { \ if (ldm_debug >= (lvl)) { \ @@ -495,7 +495,7 @@ ldm_privhdr_check(struct ldm_db *db, str g_free(buf); if (hdr.start > last || hdr.start + hdr.size - 1 > last || - (hdr.start + hdr.size - 1 > hdr.db_offset && is_gpt) || + (hdr.start + hdr.size - 1 > hdr.db_offset && !is_gpt) || hdr.db_size != LDM_DB_SIZE || hdr.db_offset + LDM_DB_SIZE - 1 > last || hdr.th_offset[0] >= LDM_DB_SIZE || @@ -1371,14 +1371,15 @@ g_part_ldm_read(struct g_part_table *bas /* Read and parse LDM private headers. */ error = ldm_privhdr_check(&db, cp, table->is_gpt); if (error != 0) - return (error); + goto gpt_cleanup; basetable->gpt_first = table->is_gpt ? 0: db.ph.start; basetable->gpt_last = basetable->gpt_first + db.ph.size - 1; table->db_offset = db.ph.db_offset; /* Make additional checks for GPT */ if (table->is_gpt) { - if (ldm_gpt_check(&db, cp) != 0) - return (ENXIO); + error = ldm_gpt_check(&db, cp); + if (error != 0) + goto gpt_cleanup; /* * Now we should reset database offset to zero, because our * consumer cp is attached to the ms-ldm-metadata partition @@ -1389,12 +1390,25 @@ g_part_ldm_read(struct g_part_table *bas /* Read and parse LDM TOC headers. */ error = ldm_tochdr_check(&db, cp); if (error != 0) - return (error); + goto gpt_cleanup; /* Read and parse LDM VMDB header. */ error = ldm_vmdbhdr_check(&db, cp); if (error != 0) - return (error); + goto gpt_cleanup; error = ldm_vmdb_parse(&db, cp); + /* + * For the GPT case we must detach and destroy + * second consumer before return. + */ +gpt_cleanup: + if (table->is_gpt) { + g_topology_lock(); + g_access(cp, -1, 0, 0); + g_detach(cp); + g_destroy_consumer(cp); + g_topology_unlock(); + cp = cp2; + } if (error != 0) return (error); /* Search current disk in the disk list. */ @@ -1408,15 +1422,6 @@ g_part_ldm_read(struct g_part_table *bas ldm_vmdb_free(&db); return (ENXIO); } - if (table->is_gpt) { - /* Second consumer is no longer needed. */ - g_topology_lock(); - g_access(cp, -1, 0, 0); - g_detach(cp); - g_destroy_consumer(cp); - g_topology_unlock(); - cp = cp2; - } index = 1; LIST_FOREACH(vol, &db.volumes, entry) { LIST_FOREACH(comp, &vol->components, entry) { Modified: stable/9/sys/modules/geom/geom_part/Makefile ============================================================================== --- stable/9/sys/modules/geom/geom_part/Makefile Wed Apr 18 04:39:37 2012 (r234405) +++ stable/9/sys/modules/geom/geom_part/Makefile Wed Apr 18 04:59:47 2012 (r234406) @@ -4,6 +4,7 @@ SUBDIR= geom_part_apm \ geom_part_bsd \ geom_part_ebr \ geom_part_gpt \ + geom_part_ldm \ geom_part_mbr \ geom_part_pc98 \ geom_part_vtoc8 From owner-svn-src-stable-9@FreeBSD.ORG Wed Apr 18 05:11:52 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id ED396106566B; Wed, 18 Apr 2012 05:11:52 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CDDF58FC0C; Wed, 18 Apr 2012 05:11:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q3I5Bq4p015725; Wed, 18 Apr 2012 05:11:52 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q3I5Bq59015723; Wed, 18 Apr 2012 05:11:52 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201204180511.q3I5Bq59015723@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Wed, 18 Apr 2012 05:11:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r234408 - stable/9/sbin/geom/class/part X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Apr 2012 05:11:53 -0000 Author: ae Date: Wed Apr 18 05:11:52 2012 New Revision: 234408 URL: http://svn.freebsd.org/changeset/base/234408 Log: MFC r233179: Document GEOM_PART_LDM scheme and partition types. Modified: stable/9/sbin/geom/class/part/gpart.8 Directory Properties: stable/9/sbin/geom/class/part/ (props changed) Modified: stable/9/sbin/geom/class/part/gpart.8 ============================================================================== --- stable/9/sbin/geom/class/part/gpart.8 Wed Apr 18 05:00:25 2012 (r234407) +++ stable/9/sbin/geom/class/part/gpart.8 Wed Apr 18 05:11:52 2012 (r234408) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 8, 2012 +.Dd March 19, 2012 .Dt GPART 8 .Os .Sh NAME @@ -38,6 +38,7 @@ lines in the kernel configuration file: .Cd "options GEOM_PART_APM" .Cd "options GEOM_PART_BSD" .Cd "options GEOM_PART_GPT" +.Cd "options GEOM_PART_LDM" .Cd "options GEOM_PART_MBR" .Cd "options GEOM_PART_EBR" .Cd "options GEOM_PART_EBR_COMPAT" @@ -511,6 +512,12 @@ called Requires the .Cm GEOM_PART_BSD kernel option. +.It Cm LDM +The Logical Disk Manager is an implementation of volume manager for +Microsoft Windows NT. +Requires the +.Cd GEOM_PART_LDM +kernel option. .It Cm GPT GUID Partition Table is used on Intel-based Macintosh computers and gradually replacing MBR on most PCs and other systems. @@ -559,7 +566,7 @@ The utility also allows the user to specify scheme-specific partition types for partition types that do not have symbolic names. Symbolic names currently understood are: -.Bl -tag -width ".Cm freebsd-vinum" +.Bl -tag -width ".Cm ms-ldm-metadata" .It Cm bios-boot The system partition dedicated to second stage of the boot loader program. Usually it is used by the GRUB 2 loader for GPT partitioning schemes. @@ -634,6 +641,18 @@ A partition that is sub-partitioned by a This type is known as .Qq Li "!024dee41-33e7-11d3-9d69-0008c781f39f" by GPT. +.It Cm ms-ldm-data +A partition that contains Logical Disk Manager (LDM) volumes. +The scheme-specific types are +.Qq Li "!66" +for MBR, +.Qq Li "!af9b60a0-1431-4f62-bc68-3311714a69ad" +for GPT. +.It Cm ms-ldm-metadata +A partition that contains Logical Disk Manager (LDM) database. +The scheme-specifig type is +.Qq Li "!5808c8aa-7e8f-42e0-85d2-e1e90434cfb3" +for GPT. .El .Sh ATTRIBUTES The scheme-specific attributes for EBR: @@ -938,6 +957,23 @@ disk metadata. If some inconsistency is detected, the partition table will be rejected with a diagnostic message: .Sy "GEOM_PART: Integrity check failed (provider, scheme)" . +.It Va kern.geom.part.ldm.debug : No 0 +Debug level of the Logical Disk Manager (LDM) module. +This can be set to a number between 0 and 2 inclusive. +If set to 0 minimal debug information is printed, +and if set to 2 the maximum amount of debug information is printed. +.It Va kern.geom.part.ldm.show_mirrors : No 0 +This variable controls how the Logical Disk Manager (LDM) module handles +mirrored volumes. +By default mirrored volumes are shown as partitions with type +.Cm ms-ldm-data +(see the +.Sx "PARTITION TYPES" +section). +If this variable set to 1 each component of the mirrored volume will be +present as independet partition. +.Em NOTE : +This may break a mirrored volume and lead to data damage. .El .Sh EXIT STATUS Exit status is 0 on success, and 1 if the command fails. From owner-svn-src-stable-9@FreeBSD.ORG Wed Apr 18 05:16:03 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2E1F8106566C; Wed, 18 Apr 2012 05:16:03 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 18C158FC16; Wed, 18 Apr 2012 05:16:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q3I5G23U015951; Wed, 18 Apr 2012 05:16:02 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q3I5G2NG015949; Wed, 18 Apr 2012 05:16:02 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201204180516.q3I5G2NG015949@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Wed, 18 Apr 2012 05:16:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r234410 - stable/9/sbin/bsdlabel X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Apr 2012 05:16:03 -0000 Author: ae Date: Wed Apr 18 05:16:02 2012 New Revision: 234410 URL: http://svn.freebsd.org/changeset/base/234410 Log: MFC r234122: It seems that libdisk(3) incorrectly sets d_secperunit value. Automatically fix it like GEOM_PART_BSD does. PR: bin/165789 Modified: stable/9/sbin/bsdlabel/bsdlabel.c Directory Properties: stable/9/sbin/bsdlabel/ (props changed) Modified: stable/9/sbin/bsdlabel/bsdlabel.c ============================================================================== --- stable/9/sbin/bsdlabel/bsdlabel.c Wed Apr 18 05:12:17 2012 (r234409) +++ stable/9/sbin/bsdlabel/bsdlabel.c Wed Apr 18 05:16:02 2012 (r234410) @@ -1194,7 +1194,8 @@ checklabel(struct disklabel *lp) lp->d_interleave = vl->d_interleave; if (lp->d_secpercyl == 0) lp->d_secpercyl = vl->d_secpercyl; - if (lp->d_secperunit == 0) + if (lp->d_secperunit == 0 || + lp->d_secperunit > vl->d_secperunit) lp->d_secperunit = vl->d_secperunit; if (lp->d_bbsize == 0) lp->d_bbsize = vl->d_bbsize; From owner-svn-src-stable-9@FreeBSD.ORG Wed Apr 18 18:31:11 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id DC5171065670; Wed, 18 Apr 2012 18:31:11 +0000 (UTC) (envelope-from ambrisko@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C3A7C8FC08; Wed, 18 Apr 2012 18:31:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q3IIVBhM045145; Wed, 18 Apr 2012 18:31:11 GMT (envelope-from ambrisko@svn.freebsd.org) Received: (from ambrisko@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q3IIVBjd045141; Wed, 18 Apr 2012 18:31:11 GMT (envelope-from ambrisko@svn.freebsd.org) Message-Id: <201204181831.q3IIVBjd045141@svn.freebsd.org> From: Doug Ambrisko Date: Wed, 18 Apr 2012 18:31:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r234429 - in stable/9/sys: conf dev/mfi modules/mfi X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Apr 2012 18:31:12 -0000 Author: ambrisko Date: Wed Apr 18 18:31:11 2012 New Revision: 234429 URL: http://svn.freebsd.org/changeset/base/234429 Log: MFC r233711: Major update to driver to support for Drake Skinny and ThunderBolt cards. MFC r233768: Change typedef atomic_t to struct mfi_atomic to avoid name space collision and some couple more style changes. MFC r233805: Move struct megasas_sge from mfi_ioctl.h to mfivar.h so we can remove including machine/bus.h. Add some more mfi_ prefixes to avoid name space pollution. MFC r233877: - Do not include machine/atomic.h. It is no longer necessary since r233768. - Remove bogus "atomic" macros and a read-only variable from softc. Added: stable/9/sys/dev/mfi/mfi_syspd.c - copied unchanged from r233711, head/sys/dev/mfi/mfi_syspd.c stable/9/sys/dev/mfi/mfi_tbolt.c - copied, changed from r233711, head/sys/dev/mfi/mfi_tbolt.c Modified: stable/9/sys/conf/files stable/9/sys/dev/mfi/mfi.c stable/9/sys/dev/mfi/mfi_cam.c stable/9/sys/dev/mfi/mfi_debug.c stable/9/sys/dev/mfi/mfi_disk.c stable/9/sys/dev/mfi/mfi_ioctl.h stable/9/sys/dev/mfi/mfi_linux.c stable/9/sys/dev/mfi/mfi_pci.c stable/9/sys/dev/mfi/mfireg.h stable/9/sys/dev/mfi/mfivar.h stable/9/sys/modules/mfi/Makefile Directory Properties: stable/9/sys/ (props changed) stable/9/sys/conf/ (props changed) Modified: stable/9/sys/conf/files ============================================================================== --- stable/9/sys/conf/files Wed Apr 18 18:11:32 2012 (r234428) +++ stable/9/sys/conf/files Wed Apr 18 18:31:11 2012 (r234429) @@ -1414,6 +1414,8 @@ dev/mfi/mfi.c optional mfi dev/mfi/mfi_debug.c optional mfi dev/mfi/mfi_pci.c optional mfi pci dev/mfi/mfi_disk.c optional mfi +dev/mfi/mfi_syspd.c optional mfi +dev/mfi/mfi_tbolt.c optional mfi dev/mfi/mfi_linux.c optional mfi compat_linux dev/mfi/mfi_cam.c optional mfip scbus dev/mii/acphy.c optional miibus | acphy Modified: stable/9/sys/dev/mfi/mfi.c ============================================================================== --- stable/9/sys/dev/mfi/mfi.c Wed Apr 18 18:11:32 2012 (r234428) +++ stable/9/sys/dev/mfi/mfi.c Wed Apr 18 18:31:11 2012 (r234429) @@ -53,6 +53,7 @@ #include __FBSDID("$FreeBSD$"); +#include "opt_compat.h" #include "opt_mfi.h" #include @@ -72,6 +73,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -79,10 +81,11 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include static int mfi_alloc_commands(struct mfi_softc *); static int mfi_comms_init(struct mfi_softc *); -static int mfi_wait_command(struct mfi_softc *, struct mfi_command *); static int mfi_get_controller_info(struct mfi_softc *); static int mfi_get_log_state(struct mfi_softc *, struct mfi_evt_log_state **); @@ -93,29 +96,39 @@ static void mfi_data_cb(void *, bus_dma_ static void mfi_startup(void *arg); static void mfi_intr(void *arg); static void mfi_ldprobe(struct mfi_softc *sc); +static void mfi_syspdprobe(struct mfi_softc *sc); +static void mfi_handle_evt(void *context, int pending); static int mfi_aen_register(struct mfi_softc *sc, int seq, int locale); static void mfi_aen_complete(struct mfi_command *); -static int mfi_aen_setup(struct mfi_softc *, uint32_t); static int mfi_add_ld(struct mfi_softc *sc, int); static void mfi_add_ld_complete(struct mfi_command *); +static int mfi_add_sys_pd(struct mfi_softc *sc, int); +static void mfi_add_sys_pd_complete(struct mfi_command *); static struct mfi_command * mfi_bio_command(struct mfi_softc *); static void mfi_bio_complete(struct mfi_command *); -static int mfi_mapcmd(struct mfi_softc *, struct mfi_command *); +static struct mfi_command *mfi_build_ldio(struct mfi_softc *,struct bio*); +static struct mfi_command *mfi_build_syspdio(struct mfi_softc *,struct bio*); static int mfi_send_frame(struct mfi_softc *, struct mfi_command *); -static void mfi_complete(struct mfi_softc *, struct mfi_command *); static int mfi_abort(struct mfi_softc *, struct mfi_command *); static int mfi_linux_ioctl_int(struct cdev *, u_long, caddr_t, int, struct thread *); static void mfi_timeout(void *); static int mfi_user_command(struct mfi_softc *, struct mfi_ioc_passthru *); -static void mfi_enable_intr_xscale(struct mfi_softc *sc); -static void mfi_enable_intr_ppc(struct mfi_softc *sc); -static int32_t mfi_read_fw_status_xscale(struct mfi_softc *sc); -static int32_t mfi_read_fw_status_ppc(struct mfi_softc *sc); -static int mfi_check_clear_intr_xscale(struct mfi_softc *sc); -static int mfi_check_clear_intr_ppc(struct mfi_softc *sc); -static void mfi_issue_cmd_xscale(struct mfi_softc *sc,uint32_t bus_add,uint32_t frame_cnt); -static void mfi_issue_cmd_ppc(struct mfi_softc *sc,uint32_t bus_add,uint32_t frame_cnt); +static void mfi_enable_intr_xscale(struct mfi_softc *sc); +static void mfi_enable_intr_ppc(struct mfi_softc *sc); +static int32_t mfi_read_fw_status_xscale(struct mfi_softc *sc); +static int32_t mfi_read_fw_status_ppc(struct mfi_softc *sc); +static int mfi_check_clear_intr_xscale(struct mfi_softc *sc); +static int mfi_check_clear_intr_ppc(struct mfi_softc *sc); +static void mfi_issue_cmd_xscale(struct mfi_softc *sc, bus_addr_t bus_add, + uint32_t frame_cnt); +static void mfi_issue_cmd_ppc(struct mfi_softc *sc, bus_addr_t bus_add, + uint32_t frame_cnt); +static int mfi_config_lock(struct mfi_softc *sc, uint32_t opcode); +static void mfi_config_unlock(struct mfi_softc *sc, int locked); +static int mfi_check_command_pre(struct mfi_softc *sc, struct mfi_command *cm); +static void mfi_check_command_post(struct mfi_softc *sc, struct mfi_command *cm); +static int mfi_check_for_sscd(struct mfi_softc *sc, struct mfi_command *cm); SYSCTL_NODE(_hw, OID_AUTO, mfi, CTLFLAG_RD, 0, "MFI driver parameters"); static int mfi_event_locale = MFI_EVT_LOCALE_ALL; @@ -133,6 +146,11 @@ TUNABLE_INT("hw.mfi.max_cmds", &mfi_max_ SYSCTL_INT(_hw_mfi, OID_AUTO, max_cmds, CTLFLAG_RD, &mfi_max_cmds, 0, "Max commands"); +static int mfi_detect_jbod_change = 1; +TUNABLE_INT("hw.mfi.detect_jbod_change", &mfi_detect_jbod_change); +SYSCTL_INT(_hw_mfi, OID_AUTO, detect_jbod_change, CTLFLAG_RW, + &mfi_detect_jbod_change, 0, "Detect a change to a JBOD"); + /* Management interface */ static d_open_t mfi_open; static d_close_t mfi_close; @@ -152,6 +170,7 @@ static struct cdevsw mfi_cdevsw = { MALLOC_DEFINE(M_MFIBUF, "mfibuf", "Buffers for the MFI driver"); #define MFI_INQ_LENGTH SHORT_INQUIRY_LENGTH +struct mfi_skinny_dma_info mfi_skinny; static void mfi_enable_intr_xscale(struct mfi_softc *sc) @@ -162,12 +181,17 @@ mfi_enable_intr_xscale(struct mfi_softc static void mfi_enable_intr_ppc(struct mfi_softc *sc) { - MFI_WRITE4(sc, MFI_ODCR0, 0xFFFFFFFF); if (sc->mfi_flags & MFI_FLAGS_1078) { + MFI_WRITE4(sc, MFI_ODCR0, 0xFFFFFFFF); MFI_WRITE4(sc, MFI_OMSK, ~MFI_1078_EIM); - } else if (sc->mfi_flags & MFI_FLAGS_GEN2) { + } + else if (sc->mfi_flags & MFI_FLAGS_GEN2) { + MFI_WRITE4(sc, MFI_ODCR0, 0xFFFFFFFF); MFI_WRITE4(sc, MFI_OMSK, ~MFI_GEN2_EIM); } + else if (sc->mfi_flags & MFI_FLAGS_SKINNY) { + MFI_WRITE4(sc, MFI_OMSK, ~0x00000001); + } } static int32_t @@ -205,35 +229,51 @@ mfi_check_clear_intr_ppc(struct mfi_soft if (!(status & MFI_1078_RM)) { return 1; } - } else if (sc->mfi_flags & MFI_FLAGS_GEN2) { + } + else if (sc->mfi_flags & MFI_FLAGS_GEN2) { if (!(status & MFI_GEN2_RM)) { return 1; } } - - MFI_WRITE4(sc, MFI_ODCR0, status); + else if (sc->mfi_flags & MFI_FLAGS_SKINNY) { + if (!(status & MFI_SKINNY_RM)) { + return 1; + } + } + if (sc->mfi_flags & MFI_FLAGS_SKINNY) + MFI_WRITE4(sc, MFI_OSTS, status); + else + MFI_WRITE4(sc, MFI_ODCR0, status); return 0; } static void -mfi_issue_cmd_xscale(struct mfi_softc *sc,uint32_t bus_add,uint32_t frame_cnt) +mfi_issue_cmd_xscale(struct mfi_softc *sc, bus_addr_t bus_add, uint32_t frame_cnt) { MFI_WRITE4(sc, MFI_IQP,(bus_add >>3)|frame_cnt); } static void -mfi_issue_cmd_ppc(struct mfi_softc *sc,uint32_t bus_add,uint32_t frame_cnt) +mfi_issue_cmd_ppc(struct mfi_softc *sc, bus_addr_t bus_add, uint32_t frame_cnt) { - MFI_WRITE4(sc, MFI_IQP, (bus_add |frame_cnt <<1)|1 ); + if (sc->mfi_flags & MFI_FLAGS_SKINNY) { + MFI_WRITE4(sc, MFI_IQPL, (bus_add | frame_cnt <<1)|1 ); + MFI_WRITE4(sc, MFI_IQPH, 0x00000000); + } else { + MFI_WRITE4(sc, MFI_IQP, (bus_add | frame_cnt <<1)|1 ); + } } -static int +int mfi_transition_firmware(struct mfi_softc *sc) { uint32_t fw_state, cur_state; int max_wait, i; + uint32_t cur_abs_reg_val = 0; + uint32_t prev_abs_reg_val = 0; - fw_state = sc->mfi_read_fw_status(sc)& MFI_FWSTATE_MASK; + cur_abs_reg_val = sc->mfi_read_fw_status(sc); + fw_state = cur_abs_reg_val & MFI_FWSTATE_MASK; while (fw_state != MFI_FWSTATE_READY) { if (bootverbose) device_printf(sc->mfi_dev, "Waiting for firmware to " @@ -244,38 +284,60 @@ mfi_transition_firmware(struct mfi_softc device_printf(sc->mfi_dev, "Firmware fault\n"); return (ENXIO); case MFI_FWSTATE_WAIT_HANDSHAKE: - MFI_WRITE4(sc, MFI_IDB, MFI_FWINIT_CLEAR_HANDSHAKE); - max_wait = 2; + if (sc->mfi_flags & MFI_FLAGS_SKINNY || sc->mfi_flags & MFI_FLAGS_TBOLT) + MFI_WRITE4(sc, MFI_SKINNY_IDB, MFI_FWINIT_CLEAR_HANDSHAKE); + else + MFI_WRITE4(sc, MFI_IDB, MFI_FWINIT_CLEAR_HANDSHAKE); + max_wait = MFI_RESET_WAIT_TIME; break; case MFI_FWSTATE_OPERATIONAL: - MFI_WRITE4(sc, MFI_IDB, MFI_FWINIT_READY); - max_wait = 10; + if (sc->mfi_flags & MFI_FLAGS_SKINNY || sc->mfi_flags & MFI_FLAGS_TBOLT) + MFI_WRITE4(sc, MFI_SKINNY_IDB, 7); + else + MFI_WRITE4(sc, MFI_IDB, MFI_FWINIT_READY); + max_wait = MFI_RESET_WAIT_TIME; break; case MFI_FWSTATE_UNDEFINED: case MFI_FWSTATE_BB_INIT: - max_wait = 2; + max_wait = MFI_RESET_WAIT_TIME; + break; + case MFI_FWSTATE_FW_INIT_2: + max_wait = MFI_RESET_WAIT_TIME; break; case MFI_FWSTATE_FW_INIT: - case MFI_FWSTATE_DEVICE_SCAN: case MFI_FWSTATE_FLUSH_CACHE: - max_wait = 20; + max_wait = MFI_RESET_WAIT_TIME; + break; + case MFI_FWSTATE_DEVICE_SCAN: + max_wait = MFI_RESET_WAIT_TIME; /* wait for 180 seconds */ + prev_abs_reg_val = cur_abs_reg_val; break; case MFI_FWSTATE_BOOT_MESSAGE_PENDING: - MFI_WRITE4(sc, MFI_IDB, MFI_FWINIT_HOTPLUG); - max_wait = 10; + if (sc->mfi_flags & MFI_FLAGS_SKINNY || sc->mfi_flags & MFI_FLAGS_TBOLT) + MFI_WRITE4(sc, MFI_SKINNY_IDB, MFI_FWINIT_HOTPLUG); + else + MFI_WRITE4(sc, MFI_IDB, MFI_FWINIT_HOTPLUG); + max_wait = MFI_RESET_WAIT_TIME; break; default: - device_printf(sc->mfi_dev,"Unknown firmware state %#x\n", + device_printf(sc->mfi_dev, "Unknown firmware state %#x\n", fw_state); return (ENXIO); } for (i = 0; i < (max_wait * 10); i++) { - fw_state = sc->mfi_read_fw_status(sc) & MFI_FWSTATE_MASK; + cur_abs_reg_val = sc->mfi_read_fw_status(sc); + fw_state = cur_abs_reg_val & MFI_FWSTATE_MASK; if (fw_state == cur_state) DELAY(100000); else break; } + if (fw_state == MFI_FWSTATE_DEVICE_SCAN) { + /* Check the device scanning progress */ + if (prev_abs_reg_val != cur_abs_reg_val) { + continue; + } + } if (fw_state == cur_state) { device_printf(sc->mfi_dev, "Firmware stuck in state " "%#x\n", fw_state); @@ -286,26 +348,35 @@ mfi_transition_firmware(struct mfi_softc } static void -mfi_addr32_cb(void *arg, bus_dma_segment_t *segs, int nsegs, int error) +mfi_addr_cb(void *arg, bus_dma_segment_t *segs, int nsegs, int error) { - uint32_t *addr; + bus_addr_t *addr; addr = arg; *addr = segs[0].ds_addr; } + int mfi_attach(struct mfi_softc *sc) { uint32_t status; int error, commsz, framessz, sensesz; int frames, unit, max_fw_sge; + uint32_t tb_mem_size = 0; + + if (sc == NULL) + return EINVAL; - device_printf(sc->mfi_dev, "Megaraid SAS driver Ver 3.00 \n"); + device_printf(sc->mfi_dev, "Megaraid SAS driver Ver %s \n", + MEGASAS_VERSION); mtx_init(&sc->mfi_io_lock, "MFI I/O lock", NULL, MTX_DEF); sx_init(&sc->mfi_config_lock, "MFI config"); TAILQ_INIT(&sc->mfi_ld_tqh); + TAILQ_INIT(&sc->mfi_syspd_tqh); + TAILQ_INIT(&sc->mfi_evt_queue); + TASK_INIT(&sc->mfi_evt_task, 0, mfi_handle_evt, sc); TAILQ_INIT(&sc->mfi_aen_pids); TAILQ_INIT(&sc->mfi_cam_ccbq); @@ -314,15 +385,29 @@ mfi_attach(struct mfi_softc *sc) mfi_initq_busy(sc); mfi_initq_bio(sc); + sc->adpreset = 0; + sc->last_seq_num = 0; + sc->disableOnlineCtrlReset = 1; + sc->issuepend_done = 1; + sc->hw_crit_error = 0; + if (sc->mfi_flags & MFI_FLAGS_1064R) { sc->mfi_enable_intr = mfi_enable_intr_xscale; sc->mfi_read_fw_status = mfi_read_fw_status_xscale; sc->mfi_check_clear_intr = mfi_check_clear_intr_xscale; sc->mfi_issue_cmd = mfi_issue_cmd_xscale; - } - else { + } else if (sc->mfi_flags & MFI_FLAGS_TBOLT) { + sc->mfi_enable_intr = mfi_tbolt_enable_intr_ppc; + sc->mfi_disable_intr = mfi_tbolt_disable_intr_ppc; + sc->mfi_read_fw_status = mfi_tbolt_read_fw_status_ppc; + sc->mfi_check_clear_intr = mfi_tbolt_check_clear_intr_ppc; + sc->mfi_issue_cmd = mfi_tbolt_issue_cmd_ppc; + sc->mfi_adp_reset = mfi_tbolt_adp_reset; + sc->mfi_tbolt = 1; + TAILQ_INIT(&sc->mfi_cmd_tbolt_tqh); + } else { sc->mfi_enable_intr = mfi_enable_intr_ppc; - sc->mfi_read_fw_status = mfi_read_fw_status_ppc; + sc->mfi_read_fw_status = mfi_read_fw_status_ppc; sc->mfi_check_clear_intr = mfi_check_clear_intr_ppc; sc->mfi_issue_cmd = mfi_issue_cmd_ppc; } @@ -335,6 +420,32 @@ mfi_attach(struct mfi_softc *sc) return (ENXIO); } + /* Start: LSIP200113393 */ + if (bus_dma_tag_create( sc->mfi_parent_dmat, /* parent */ + 1, 0, /* algnmnt, boundary */ + BUS_SPACE_MAXADDR_32BIT,/* lowaddr */ + BUS_SPACE_MAXADDR, /* highaddr */ + NULL, NULL, /* filter, filterarg */ + MEGASAS_MAX_NAME*sizeof(bus_addr_t), /* maxsize */ + 1, /* msegments */ + MEGASAS_MAX_NAME*sizeof(bus_addr_t), /* maxsegsize */ + 0, /* flags */ + NULL, NULL, /* lockfunc, lockarg */ + &sc->verbuf_h_dmat)) { + device_printf(sc->mfi_dev, "Cannot allocate verbuf_h_dmat DMA tag\n"); + return (ENOMEM); + } + if (bus_dmamem_alloc(sc->verbuf_h_dmat, (void **)&sc->verbuf, + BUS_DMA_NOWAIT, &sc->verbuf_h_dmamap)) { + device_printf(sc->mfi_dev, "Cannot allocate verbuf_h_dmamap memory\n"); + return (ENOMEM); + } + bzero(sc->verbuf, MEGASAS_MAX_NAME*sizeof(bus_addr_t)); + bus_dmamap_load(sc->verbuf_h_dmat, sc->verbuf_h_dmamap, + sc->verbuf, MEGASAS_MAX_NAME*sizeof(bus_addr_t), + mfi_addr_cb, &sc->verbuf_h_busaddr, 0); + /* End: LSIP200113393 */ + /* * Get information needed for sizing the contiguous memory for the * frame pool. Size down the sgl parameter since we know that @@ -347,6 +458,100 @@ mfi_attach(struct mfi_softc *sc) max_fw_sge = (status & MFI_FWSTATE_MAXSGL_MASK) >> 16; sc->mfi_max_sge = min(max_fw_sge, ((MFI_MAXPHYS / PAGE_SIZE) + 1)); + /* ThunderBolt Support get the contiguous memory */ + + if (sc->mfi_flags & MFI_FLAGS_TBOLT) { + mfi_tbolt_init_globals(sc); + device_printf(sc->mfi_dev, "MaxCmd = %x MaxSgl = %x state = %x \n", + sc->mfi_max_fw_cmds, sc->mfi_max_sge, status); + tb_mem_size = mfi_tbolt_get_memory_requirement(sc); + + if (bus_dma_tag_create( sc->mfi_parent_dmat, /* parent */ + 1, 0, /* algnmnt, boundary */ + BUS_SPACE_MAXADDR_32BIT,/* lowaddr */ + BUS_SPACE_MAXADDR, /* highaddr */ + NULL, NULL, /* filter, filterarg */ + tb_mem_size, /* maxsize */ + 1, /* msegments */ + tb_mem_size, /* maxsegsize */ + 0, /* flags */ + NULL, NULL, /* lockfunc, lockarg */ + &sc->mfi_tb_dmat)) { + device_printf(sc->mfi_dev, "Cannot allocate comms DMA tag\n"); + return (ENOMEM); + } + if (bus_dmamem_alloc(sc->mfi_tb_dmat, (void **)&sc->request_message_pool, + BUS_DMA_NOWAIT, &sc->mfi_tb_dmamap)) { + device_printf(sc->mfi_dev, "Cannot allocate comms memory\n"); + return (ENOMEM); + } + bzero(sc->request_message_pool, tb_mem_size); + bus_dmamap_load(sc->mfi_tb_dmat, sc->mfi_tb_dmamap, + sc->request_message_pool, tb_mem_size, mfi_addr_cb, &sc->mfi_tb_busaddr, 0); + + /* For ThunderBolt memory init */ + if (bus_dma_tag_create( sc->mfi_parent_dmat, /* parent */ + 0x100, 0, /* alignmnt, boundary */ + BUS_SPACE_MAXADDR_32BIT,/* lowaddr */ + BUS_SPACE_MAXADDR, /* highaddr */ + NULL, NULL, /* filter, filterarg */ + MFI_FRAME_SIZE, /* maxsize */ + 1, /* msegments */ + MFI_FRAME_SIZE, /* maxsegsize */ + 0, /* flags */ + NULL, NULL, /* lockfunc, lockarg */ + &sc->mfi_tb_init_dmat)) { + device_printf(sc->mfi_dev, "Cannot allocate init DMA tag\n"); + return (ENOMEM); + } + if (bus_dmamem_alloc(sc->mfi_tb_init_dmat, (void **)&sc->mfi_tb_init, + BUS_DMA_NOWAIT, &sc->mfi_tb_init_dmamap)) { + device_printf(sc->mfi_dev, "Cannot allocate init memory\n"); + return (ENOMEM); + } + bzero(sc->mfi_tb_init, MFI_FRAME_SIZE); + bus_dmamap_load(sc->mfi_tb_init_dmat, sc->mfi_tb_init_dmamap, + sc->mfi_tb_init, MFI_FRAME_SIZE, mfi_addr_cb, + &sc->mfi_tb_init_busaddr, 0); + if (mfi_tbolt_init_desc_pool(sc, sc->request_message_pool, + tb_mem_size)) { + device_printf(sc->mfi_dev, + "Thunderbolt pool preparation error\n"); + return 0; + } + + /* + Allocate DMA memory mapping for MPI2 IOC Init descriptor, + we are taking it diffrent from what we have allocated for Request + and reply descriptors to avoid confusion later + */ + tb_mem_size = sizeof(struct MPI2_IOC_INIT_REQUEST); + if (bus_dma_tag_create( sc->mfi_parent_dmat, /* parent */ + 1, 0, /* algnmnt, boundary */ + BUS_SPACE_MAXADDR_32BIT,/* lowaddr */ + BUS_SPACE_MAXADDR, /* highaddr */ + NULL, NULL, /* filter, filterarg */ + tb_mem_size, /* maxsize */ + 1, /* msegments */ + tb_mem_size, /* maxsegsize */ + 0, /* flags */ + NULL, NULL, /* lockfunc, lockarg */ + &sc->mfi_tb_ioc_init_dmat)) { + device_printf(sc->mfi_dev, + "Cannot allocate comms DMA tag\n"); + return (ENOMEM); + } + if (bus_dmamem_alloc(sc->mfi_tb_ioc_init_dmat, + (void **)&sc->mfi_tb_ioc_init_desc, + BUS_DMA_NOWAIT, &sc->mfi_tb_ioc_init_dmamap)) { + device_printf(sc->mfi_dev, "Cannot allocate comms memory\n"); + return (ENOMEM); + } + bzero(sc->mfi_tb_ioc_init_desc, tb_mem_size); + bus_dmamap_load(sc->mfi_tb_ioc_init_dmat, sc->mfi_tb_ioc_init_dmamap, + sc->mfi_tb_ioc_init_desc, tb_mem_size, mfi_addr_cb, + &sc->mfi_tb_ioc_init_busaddr, 0); + } /* * Create the dma tag for data buffers. Used both for block I/O * and for various internal data queries. @@ -396,8 +601,7 @@ mfi_attach(struct mfi_softc *sc) } bzero(sc->mfi_comms, commsz); bus_dmamap_load(sc->mfi_comms_dmat, sc->mfi_comms_dmamap, - sc->mfi_comms, commsz, mfi_addr32_cb, &sc->mfi_comms_busaddr, 0); - + sc->mfi_comms, commsz, mfi_addr_cb, &sc->mfi_comms_busaddr, 0); /* * Allocate DMA memory for the command frames. Keep them in the * lower 4GB for efficiency. Calculate the size of the commands at @@ -414,6 +618,8 @@ mfi_attach(struct mfi_softc *sc) } else { sc->mfi_sge_size = sizeof(struct mfi_sg32); } + if (sc->mfi_flags & MFI_FLAGS_SKINNY) + sc->mfi_sge_size = sizeof(struct mfi_sg_skinny); frames = (sc->mfi_sge_size * sc->mfi_max_sge - 1) / MFI_FRAME_SIZE + 2; sc->mfi_cmd_size = frames * MFI_FRAME_SIZE; framessz = sc->mfi_cmd_size * sc->mfi_max_fw_cmds; @@ -438,8 +644,7 @@ mfi_attach(struct mfi_softc *sc) } bzero(sc->mfi_frames, framessz); bus_dmamap_load(sc->mfi_frames_dmat, sc->mfi_frames_dmamap, - sc->mfi_frames, framessz, mfi_addr32_cb, &sc->mfi_frames_busaddr,0); - + sc->mfi_frames, framessz, mfi_addr_cb, &sc->mfi_frames_busaddr,0); /* * Allocate DMA memory for the frame sense data. Keep them in the * lower 4GB for efficiency @@ -465,32 +670,47 @@ mfi_attach(struct mfi_softc *sc) return (ENOMEM); } bus_dmamap_load(sc->mfi_sense_dmat, sc->mfi_sense_dmamap, - sc->mfi_sense, sensesz, mfi_addr32_cb, &sc->mfi_sense_busaddr, 0); - + sc->mfi_sense, sensesz, mfi_addr_cb, &sc->mfi_sense_busaddr, 0); if ((error = mfi_alloc_commands(sc)) != 0) return (error); - if ((error = mfi_comms_init(sc)) != 0) - return (error); + /* Before moving the FW to operational state, check whether + * hostmemory is required by the FW or not + */ - if ((error = mfi_get_controller_info(sc)) != 0) - return (error); + /* ThunderBolt MFI_IOC2 INIT */ + if (sc->mfi_flags & MFI_FLAGS_TBOLT) { + sc->mfi_disable_intr(sc); + if ((error = mfi_tbolt_init_MFI_queue(sc)) != 0) { + device_printf(sc->mfi_dev, + "TB Init has failed with error %d\n",error); + return error; + } - mtx_lock(&sc->mfi_io_lock); - if ((error = mfi_aen_setup(sc, 0), 0) != 0) { - mtx_unlock(&sc->mfi_io_lock); - return (error); - } - mtx_unlock(&sc->mfi_io_lock); + if ((error = mfi_tbolt_alloc_cmd(sc)) != 0) + return error; + if (bus_setup_intr(sc->mfi_dev, sc->mfi_irq, + INTR_MPSAFE|INTR_TYPE_BIO, NULL, mfi_intr_tbolt, sc, + &sc->mfi_intr)) { + device_printf(sc->mfi_dev, "Cannot set up interrupt\n"); + return (EINVAL); + } + sc->mfi_enable_intr(sc); + sc->map_id = 0; + } else { + if ((error = mfi_comms_init(sc)) != 0) + return (error); - /* - * Set up the interrupt handler. - */ - if (bus_setup_intr(sc->mfi_dev, sc->mfi_irq, INTR_MPSAFE|INTR_TYPE_BIO, - NULL, mfi_intr, sc, &sc->mfi_intr)) { - device_printf(sc->mfi_dev, "Cannot set up interrupt\n"); - return (EINVAL); + if (bus_setup_intr(sc->mfi_dev, sc->mfi_irq, + INTR_MPSAFE|INTR_TYPE_BIO, NULL, mfi_intr, sc, &sc->mfi_intr)) { + device_printf(sc->mfi_dev, "Cannot set up interrupt\n"); + return (EINVAL); + } + sc->mfi_enable_intr(sc); } + if ((error = mfi_get_controller_info(sc)) != 0) + return (error); + sc->disableOnlineCtrlReset = 0; /* Register a config hook to probe the bus for arrays */ sc->mfi_ich.ich_func = mfi_startup; @@ -500,6 +720,10 @@ mfi_attach(struct mfi_softc *sc) "hook\n"); return (EINVAL); } + if ((error = mfi_aen_setup(sc, 0), 0) != 0) { + mtx_unlock(&sc->mfi_io_lock); + return (error); + } /* * Register a shutdown handler. @@ -571,8 +795,11 @@ mfi_alloc_commands(struct mfi_softc *sc) cm->cm_sc = sc; cm->cm_index = i; if (bus_dmamap_create(sc->mfi_buffer_dmat, 0, - &cm->cm_dmamap) == 0) + &cm->cm_dmamap) == 0) { + mtx_lock(&sc->mfi_io_lock); mfi_release_command(cm); + mtx_unlock(&sc->mfi_io_lock); + } else break; sc->mfi_total_cmds++; @@ -587,6 +814,8 @@ mfi_release_command(struct mfi_command * struct mfi_frame_header *hdr; uint32_t *hdr_data; + mtx_assert(&cm->cm_sc->mfi_io_lock, MA_OWNED); + /* * Zero out the important fields of the frame, but make sure the * context field is preserved. For efficiency, handle the fields @@ -611,24 +840,31 @@ mfi_release_command(struct mfi_command * cm->cm_data = NULL; cm->cm_sg = 0; cm->cm_total_frame_size = 0; + cm->retry_for_fw_reset = 0; mfi_enqueue_free(cm); } static int -mfi_dcmd_command(struct mfi_softc *sc, struct mfi_command **cmp, uint32_t opcode, - void **bufp, size_t bufsize) +mfi_dcmd_command(struct mfi_softc *sc, struct mfi_command **cmp, + uint32_t opcode, void **bufp, size_t bufsize) { struct mfi_command *cm; struct mfi_dcmd_frame *dcmd; void *buf = NULL; - + uint32_t context = 0; + mtx_assert(&sc->mfi_io_lock, MA_OWNED); - + cm = mfi_dequeue_free(sc); if (cm == NULL) return (EBUSY); + /* Zero out the MFI frame */ + context = cm->cm_frame->header.context; + bzero(cm->cm_frame, sizeof(union mfi_frame)); + cm->cm_frame->header.context = context; + if ((bufsize > 0) && (bufp != NULL)) { if (*bufp == NULL) { buf = malloc(bufsize, M_MFIBUF, M_NOWAIT|M_ZERO); @@ -648,6 +884,7 @@ mfi_dcmd_command(struct mfi_softc *sc, s dcmd->header.timeout = 0; dcmd->header.flags = 0; dcmd->header.data_len = bufsize; + dcmd->header.scsi_status = 0; dcmd->opcode = opcode; cm->cm_sg = &dcmd->sgl; cm->cm_total_frame_size = MFI_DCMD_FRAME_SIZE; @@ -669,11 +906,17 @@ mfi_comms_init(struct mfi_softc *sc) struct mfi_init_frame *init; struct mfi_init_qinfo *qinfo; int error; + uint32_t context = 0; mtx_lock(&sc->mfi_io_lock); if ((cm = mfi_dequeue_free(sc)) == NULL) return (EBUSY); + /* Zero out the MFI frame */ + context = cm->cm_frame->header.context; + bzero(cm->cm_frame, sizeof(union mfi_frame)); + cm->cm_frame->header.context = context; + /* * Abuse the SG list area of the frame to hold the init_qinfo * object; @@ -734,9 +977,11 @@ mfi_get_controller_info(struct mfi_softc BUS_DMASYNC_POSTREAD); bus_dmamap_unload(sc->mfi_buffer_dmat, cm->cm_dmamap); - max_sectors_1 = (1 << ci->stripe_sz_ops.min) * ci->max_strips_per_io; + max_sectors_1 = (1 << ci->stripe_sz_ops.max) * ci->max_strips_per_io; max_sectors_2 = ci->max_request_size; sc->mfi_max_io = min(max_sectors_1, max_sectors_2); + sc->disableOnlineCtrlReset = + ci->properties.OnOffProperties.disableOnlineCtrlReset; out: if (ci) @@ -753,6 +998,7 @@ mfi_get_log_state(struct mfi_softc *sc, struct mfi_command *cm = NULL; int error; + mtx_lock(&sc->mfi_io_lock); error = mfi_dcmd_command(sc, &cm, MFI_DCMD_CTRL_EVENT_GETINFO, (void **)log_state, sizeof(**log_state)); if (error) @@ -771,11 +1017,12 @@ mfi_get_log_state(struct mfi_softc *sc, out: if (cm) mfi_release_command(cm); + mtx_unlock(&sc->mfi_io_lock); return (error); } -static int +int mfi_aen_setup(struct mfi_softc *sc, uint32_t seq_start) { struct mfi_evt_log_state *log_state = NULL; @@ -789,6 +1036,7 @@ mfi_aen_setup(struct mfi_softc *sc, uint if (seq_start == 0) { error = mfi_get_log_state(sc, &log_state); + sc->mfi_boot_seq_num = log_state->boot_seq_num; if (error) { if (log_state) free(log_state, M_MFIBUF); @@ -810,7 +1058,7 @@ mfi_aen_setup(struct mfi_softc *sc, uint return 0; } -static int +int mfi_wait_command(struct mfi_softc *sc, struct mfi_command *cm) { @@ -883,6 +1131,64 @@ mfi_free(struct mfi_softc *sc) if (sc->mfi_comms_dmat != NULL) bus_dma_tag_destroy(sc->mfi_comms_dmat); + /* ThunderBolt contiguous memory free here */ + if (sc->mfi_flags & MFI_FLAGS_TBOLT) { + if (sc->mfi_tb_busaddr != 0) + bus_dmamap_unload(sc->mfi_tb_dmat, sc->mfi_tb_dmamap); + if (sc->request_message_pool != NULL) + bus_dmamem_free(sc->mfi_tb_dmat, sc->request_message_pool, + sc->mfi_tb_dmamap); + if (sc->mfi_tb_dmat != NULL) + bus_dma_tag_destroy(sc->mfi_tb_dmat); + + /* Version buffer memory free */ + /* Start LSIP200113393 */ + if (sc->verbuf_h_busaddr != 0) + bus_dmamap_unload(sc->verbuf_h_dmat, sc->verbuf_h_dmamap); + if (sc->verbuf != NULL) + bus_dmamem_free(sc->verbuf_h_dmat, sc->verbuf, + sc->verbuf_h_dmamap); + if (sc->verbuf_h_dmat != NULL) + bus_dma_tag_destroy(sc->verbuf_h_dmat); + + /* End LSIP200113393 */ + /* ThunderBolt INIT packet memory Free */ + if (sc->mfi_tb_init_busaddr != 0) + bus_dmamap_unload(sc->mfi_tb_init_dmat, sc->mfi_tb_init_dmamap); + if (sc->mfi_tb_init != NULL) + bus_dmamem_free(sc->mfi_tb_init_dmat, sc->mfi_tb_init, + sc->mfi_tb_init_dmamap); + if (sc->mfi_tb_init_dmat != NULL) + bus_dma_tag_destroy(sc->mfi_tb_init_dmat); + + /* ThunderBolt IOC Init Desc memory free here */ + if (sc->mfi_tb_ioc_init_busaddr != 0) + bus_dmamap_unload(sc->mfi_tb_ioc_init_dmat, + sc->mfi_tb_ioc_init_dmamap); + if (sc->mfi_tb_ioc_init_desc != NULL) + bus_dmamem_free(sc->mfi_tb_ioc_init_dmat, + sc->mfi_tb_ioc_init_desc, + sc->mfi_tb_ioc_init_dmamap); + if (sc->mfi_tb_ioc_init_dmat != NULL) + bus_dma_tag_destroy(sc->mfi_tb_ioc_init_dmat); + for (int i = 0; i < sc->mfi_max_fw_cmds; i++) { + if (sc->mfi_cmd_pool_tbolt != NULL) { + if (sc->mfi_cmd_pool_tbolt[i] != NULL) { + free(sc->mfi_cmd_pool_tbolt[i], + M_MFIBUF); + sc->mfi_cmd_pool_tbolt[i] = NULL; + } + } + } + if (sc->mfi_cmd_pool_tbolt != NULL) { + free(sc->mfi_cmd_pool_tbolt, M_MFIBUF); + sc->mfi_cmd_pool_tbolt = NULL; + } + if (sc->request_desc_pool != NULL) { + free(sc->request_desc_pool, M_MFIBUF); + sc->request_desc_pool = NULL; + } + } if (sc->mfi_buffer_dmat != NULL) bus_dma_tag_destroy(sc->mfi_buffer_dmat); if (sc->mfi_parent_dmat != NULL) @@ -909,6 +1215,8 @@ mfi_startup(void *arg) sx_xlock(&sc->mfi_config_lock); mtx_lock(&sc->mfi_io_lock); mfi_ldprobe(sc); + if (sc->mfi_flags & MFI_FLAGS_SKINNY) + mfi_syspdprobe(sc); mtx_unlock(&sc->mfi_io_lock); sx_xunlock(&sc->mfi_config_lock); } @@ -925,12 +1233,7 @@ mfi_intr(void *arg) if (sc->mfi_check_clear_intr(sc)) return; - /* - * Do a dummy read to flush the interrupt ACK that we just performed, - * ensuring that everything is really, truly consistent. - */ - (void)sc->mfi_read_fw_status(sc); - +restart: pi = sc->mfi_comms->hw_pi; ci = sc->mfi_comms->hw_ci; mtx_lock(&sc->mfi_io_lock); @@ -955,6 +1258,14 @@ mfi_intr(void *arg) mfi_startio(sc); mtx_unlock(&sc->mfi_io_lock); + /* + * Dummy read to flush the bus; this ensures that the indexes are up + * to date. Restart processing if more commands have come it. + */ + (void)sc->mfi_read_fw_status(sc); + if (pi != sc->mfi_comms->hw_pi) + goto restart; + return; } @@ -975,6 +1286,9 @@ mfi_shutdown(struct mfi_softc *sc) if (sc->mfi_aen_cm != NULL) mfi_abort(sc, sc->mfi_aen_cm); + if (sc->map_update_cmd != NULL) + mfi_abort(sc, sc->map_update_cmd); + dcmd = &cm->cm_frame->dcmd; dcmd->header.flags = MFI_FRAME_DIR_NONE; cm->cm_flags = MFI_CMD_POLLED; @@ -990,6 +1304,81 @@ mfi_shutdown(struct mfi_softc *sc) } static void +mfi_syspdprobe(struct mfi_softc *sc) +{ + struct mfi_frame_header *hdr; + struct mfi_command *cm = NULL; + struct mfi_pd_list *pdlist = NULL; + struct mfi_system_pd *syspd, *tmp; + int error, i, found; + + sx_assert(&sc->mfi_config_lock, SA_XLOCKED); + mtx_assert(&sc->mfi_io_lock, MA_OWNED); + /* Add SYSTEM PD's */ + error = mfi_dcmd_command(sc, &cm, MFI_DCMD_PD_LIST_QUERY, + (void **)&pdlist, sizeof(*pdlist)); + if (error){ + device_printf(sc->mfi_dev, + "Error while forming SYSTEM PD list\n"); + goto out; + } + + cm->cm_flags = MFI_CMD_DATAIN | MFI_CMD_POLLED; + cm->cm_frame->dcmd.mbox[0] = MR_PD_QUERY_TYPE_EXPOSED_TO_HOST; + cm->cm_frame->dcmd.mbox[1] = 0; + if (mfi_mapcmd(sc, cm) != 0) { + device_printf(sc->mfi_dev, + "Failed to get syspd device listing\n"); + goto out; + } + bus_dmamap_sync(sc->mfi_buffer_dmat,cm->cm_dmamap, + BUS_DMASYNC_POSTREAD); + bus_dmamap_unload(sc->mfi_buffer_dmat, cm->cm_dmamap); + hdr = &cm->cm_frame->header; + if (hdr->cmd_status != MFI_STAT_OK) { + device_printf(sc->mfi_dev, + "MFI_DCMD_PD_LIST_QUERY failed %x\n", hdr->cmd_status); + goto out; + } + /* Get each PD and add it to the system */ + for (i = 0; i < pdlist->count; i++) { + if (pdlist->addr[i].device_id == + pdlist->addr[i].encl_device_id) + continue; + found = 0; + TAILQ_FOREACH(syspd, &sc->mfi_syspd_tqh, pd_link) { + if (syspd->pd_id == pdlist->addr[i].device_id) + found = 1; + } + if (found == 0) + mfi_add_sys_pd(sc, pdlist->addr[i].device_id); + } + /* Delete SYSPD's whose state has been changed */ + TAILQ_FOREACH_SAFE(syspd, &sc->mfi_syspd_tqh, pd_link, tmp) { + found = 0; + for (i = 0; i < pdlist->count; i++) { + if (syspd->pd_id == pdlist->addr[i].device_id) + found = 1; + } + if (found == 0) { + printf("DELETE\n"); + mtx_unlock(&sc->mfi_io_lock); + mtx_lock(&Giant); + device_delete_child(sc->mfi_dev, syspd->pd_dev); + mtx_unlock(&Giant); + mtx_lock(&sc->mfi_io_lock); + } + } +out: + if (pdlist) + free(pdlist, M_MFIBUF); + if (cm) + mfi_release_command(cm); + + return; +} + +static void mfi_ldprobe(struct mfi_softc *sc) { struct mfi_frame_header *hdr; @@ -1083,10 +1472,124 @@ format_class(int8_t class) static void mfi_decode_evt(struct mfi_softc *sc, struct mfi_evt_detail *detail) { + struct mfi_system_pd *syspd = NULL; device_printf(sc->mfi_dev, "%d (%s/0x%04x/%s) - %s\n", detail->seq, format_timestamp(detail->time), detail->evt_class.members.locale, - format_class(detail->evt_class.members.evt_class), detail->description); + format_class(detail->evt_class.members.evt_class), + detail->description); + + /* Don't act on old AEN's or while shutting down */ + if (detail->seq < sc->mfi_boot_seq_num || sc->mfi_detaching) + return; + + switch (detail->arg_type) { + case MR_EVT_ARGS_NONE: + if (detail->code == MR_EVT_CTRL_HOST_BUS_SCAN_REQUESTED) { + device_printf(sc->mfi_dev, "HostBus scan raised\n"); + if (mfi_detect_jbod_change) { + /* + * Probe for new SYSPD's and Delete + * invalid SYSPD's + */ + sx_xlock(&sc->mfi_config_lock); + mtx_lock(&sc->mfi_io_lock); + mfi_syspdprobe(sc); + mtx_unlock(&sc->mfi_io_lock); + sx_xunlock(&sc->mfi_config_lock); + } + } + break; + case MR_EVT_ARGS_LD_STATE: + /* During load time driver reads all the events starting + * from the one that has been logged after shutdown. Avoid + * these old events. + */ + if (detail->args.ld_state.new_state == MFI_LD_STATE_OFFLINE ) { + /* Remove the LD */ + struct mfi_disk *ld; + TAILQ_FOREACH(ld, &sc->mfi_ld_tqh, ld_link) { + if (ld->ld_id == + detail->args.ld_state.ld.target_id) + break; + } + /* + Fix: for kernel panics when SSCD is removed + KASSERT(ld != NULL, ("volume dissappeared")); + */ + if (ld != NULL) { + mtx_lock(&Giant); + device_delete_child(sc->mfi_dev, ld->ld_dev); + mtx_unlock(&Giant); + } + } + break; + case MR_EVT_ARGS_PD: + if (detail->code == MR_EVT_PD_REMOVED) { + if (mfi_detect_jbod_change) { + /* + * If the removed device is a SYSPD then + * delete it + */ + TAILQ_FOREACH(syspd, &sc->mfi_syspd_tqh, + pd_link) { + if (syspd->pd_id == + detail->args.pd.device_id) { + mtx_lock(&Giant); + device_delete_child( + sc->mfi_dev, + syspd->pd_dev); + mtx_unlock(&Giant); + break; + } + } + } + } + if (detail->code == MR_EVT_PD_INSERTED) { + if (mfi_detect_jbod_change) { + /* Probe for new SYSPD's */ + sx_xlock(&sc->mfi_config_lock); + mtx_lock(&sc->mfi_io_lock); + mfi_syspdprobe(sc); + mtx_unlock(&sc->mfi_io_lock); + sx_xunlock(&sc->mfi_config_lock); + } + } + break; + } +} *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-9@FreeBSD.ORG Wed Apr 18 18:58:19 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7CA141065672; Wed, 18 Apr 2012 18:58:19 +0000 (UTC) (envelope-from ambrisko@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 437D38FC1B; Wed, 18 Apr 2012 18:58:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q3IIwJSo046159; Wed, 18 Apr 2012 18:58:19 GMT (envelope-from ambrisko@svn.freebsd.org) Received: (from ambrisko@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q3IIwJoD046156; Wed, 18 Apr 2012 18:58:19 GMT (envelope-from ambrisko@svn.freebsd.org) Message-Id: <201204181858.q3IIwJoD046156@svn.freebsd.org> From: Doug Ambrisko Date: Wed, 18 Apr 2012 18:58:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r234433 - stable/9/usr.sbin/mfiutil X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Apr 2012 18:58:19 -0000 Author: ambrisko Date: Wed Apr 18 18:58:18 2012 New Revision: 234433 URL: http://svn.freebsd.org/changeset/base/234433 Log: MFC r233713 Remove the magic mfi_array is 288 bytes and just use the sizeof the array since it is not 288 bytes. Change reporting of a "SYSTEM" disk to "JBOD" to match LSI MegaCli and firmware reporting. This means that mfiutil command to "create jbod" is now a little confusing since a RAID per drive is not really what LSI defines JBOD to be. This should be fixed in the future and support added to really create LSI JBOD and enable that feature on cards that support it. Modified: stable/9/usr.sbin/mfiutil/mfi_config.c stable/9/usr.sbin/mfiutil/mfi_drive.c Directory Properties: stable/9/ (props changed) stable/9/usr.sbin/mfiutil/ (props changed) Modified: stable/9/usr.sbin/mfiutil/mfi_config.c ============================================================================== --- stable/9/usr.sbin/mfiutil/mfi_config.c Wed Apr 18 18:43:01 2012 (r234432) +++ stable/9/usr.sbin/mfiutil/mfi_config.c Wed Apr 18 18:58:18 2012 (r234433) @@ -211,9 +211,8 @@ clear_config(int ac, char **av) } MFI_COMMAND(top, clear, clear_config); -#define MFI_ARRAY_SIZE 288 -#define MAX_DRIVES_PER_ARRAY \ - ((MFI_ARRAY_SIZE - sizeof(struct mfi_array)) / 8) +#define MAX_DRIVES_PER_ARRAY MFI_MAX_ROW_SIZE +#define MFI_ARRAY_SIZE sizeof(struct mfi_array) #define RT_RAID0 0 #define RT_RAID1 1 @@ -305,7 +304,7 @@ parse_array(int fd, int raid_type, char /* Validate the number of drives for this array. */ if (count >= MAX_DRIVES_PER_ARRAY) { - warnx("Too many drives for a single array: max is %zu", + warnx("Too many drives for a single array: max is %d", MAX_DRIVES_PER_ARRAY); return (EINVAL); } Modified: stable/9/usr.sbin/mfiutil/mfi_drive.c ============================================================================== --- stable/9/usr.sbin/mfiutil/mfi_drive.c Wed Apr 18 18:43:01 2012 (r234432) +++ stable/9/usr.sbin/mfiutil/mfi_drive.c Wed Apr 18 18:58:18 2012 (r234433) @@ -149,7 +149,7 @@ mfi_pdstate(enum mfi_pd_state state) case MFI_PD_STATE_COPYBACK: return ("COPYBACK"); case MFI_PD_STATE_SYSTEM: - return ("SYSTEM"); + return ("JBOD"); default: sprintf(buf, "PSTATE 0x%04x", state); return (buf); From owner-svn-src-stable-9@FreeBSD.ORG Wed Apr 18 19:16:00 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8A1E9106566C; Wed, 18 Apr 2012 19:16:00 +0000 (UTC) (envelope-from ambrisko@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 74B058FC17; Wed, 18 Apr 2012 19:16:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q3IJG08v046884; Wed, 18 Apr 2012 19:16:00 GMT (envelope-from ambrisko@svn.freebsd.org) Received: (from ambrisko@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q3IJG0lV046882; Wed, 18 Apr 2012 19:16:00 GMT (envelope-from ambrisko@svn.freebsd.org) Message-Id: <201204181916.q3IJG0lV046882@svn.freebsd.org> From: Doug Ambrisko Date: Wed, 18 Apr 2012 19:16:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r234438 - stable/9/sys/kern X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Apr 2012 19:16:00 -0000 Author: ambrisko Date: Wed Apr 18 19:15:59 2012 New Revision: 234438 URL: http://svn.freebsd.org/changeset/base/234438 Log: MFC r230778 When detaching an AIO or LIO requests grab the lock and tell knlist_remove that we have the lock now. This cleans up a locking panic ASSERT when knlist_empty is called without a lock when INVARIANTS etc. are turned. Modified: stable/9/sys/kern/vfs_aio.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/kern/vfs_aio.c ============================================================================== --- stable/9/sys/kern/vfs_aio.c Wed Apr 18 19:11:21 2012 (r234437) +++ stable/9/sys/kern/vfs_aio.c Wed Apr 18 19:15:59 2012 (r234438) @@ -2535,10 +2535,13 @@ filt_aioattach(struct knote *kn) static void filt_aiodetach(struct knote *kn) { - struct aiocblist *aiocbe = kn->kn_ptr.p_aio; + struct knlist *knl; - if (!knlist_empty(&aiocbe->klist)) - knlist_remove(&aiocbe->klist, kn, 0); + knl = &kn->kn_ptr.p_aio->klist; + knl->kl_lock(knl->kl_lockarg); + if (!knlist_empty(knl)) + knlist_remove(knl, kn, 1); + knl->kl_unlock(knl->kl_lockarg); } /* kqueue filter function */ @@ -2580,10 +2583,13 @@ filt_lioattach(struct knote *kn) static void filt_liodetach(struct knote *kn) { - struct aioliojob * lj = kn->kn_ptr.p_lio; + struct knlist *knl; - if (!knlist_empty(&lj->klist)) - knlist_remove(&lj->klist, kn, 0); + knl = &kn->kn_ptr.p_lio->klist; + knl->kl_lock(knl->kl_lockarg); + if (!knlist_empty(knl)) + knlist_remove(knl, kn, 1); + knl->kl_unlock(knl->kl_lockarg); } /* kqueue filter function */ From owner-svn-src-stable-9@FreeBSD.ORG Wed Apr 18 20:32:08 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D2D641065678; Wed, 18 Apr 2012 20:32:08 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A38A18FC0C; Wed, 18 Apr 2012 20:32:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q3IKW8Ch049442; Wed, 18 Apr 2012 20:32:08 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q3IKW8dS049438; Wed, 18 Apr 2012 20:32:08 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201204182032.q3IKW8dS049438@svn.freebsd.org> From: Dimitry Andric Date: Wed, 18 Apr 2012 20:32:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r234444 - in stable/9/usr.bin: kdump truss X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Apr 2012 20:32:08 -0000 Author: dim Date: Wed Apr 18 20:32:07 2012 New Revision: 234444 URL: http://svn.freebsd.org/changeset/base/234444 Log: MFC r234058: In kdump's mkioctls script, use '${CPP}' instead of hardcodedly using 'gcc -E'. This fixes building when WITH_CLANG_IS_CC is in effect. Report by: Niclas Zeising MFC r234060: Since truss also uses kdump's mkioctls script, pass the value of ${CPP} there too, similar to r234058. Modified: stable/9/usr.bin/kdump/Makefile stable/9/usr.bin/kdump/mkioctls stable/9/usr.bin/truss/Makefile Directory Properties: stable/9/usr.bin/kdump/ (props changed) stable/9/usr.bin/truss/ (props changed) Modified: stable/9/usr.bin/kdump/Makefile ============================================================================== --- stable/9/usr.bin/kdump/Makefile Wed Apr 18 19:34:20 2012 (r234443) +++ stable/9/usr.bin/kdump/Makefile Wed Apr 18 20:32:07 2012 (r234444) @@ -20,7 +20,8 @@ WARNS?= 0 CLEANFILES= ioctl.c kdump_subr.c linux_syscalls.c ioctl.c: mkioctls - sh ${.CURDIR}/mkioctls ${DESTDIR}/usr/include > ${.TARGET} + env CPP="${CPP}" \ + sh ${.CURDIR}/mkioctls ${DESTDIR}/usr/include > ${.TARGET} kdump_subr.c: mksubr sh ${.CURDIR}/mksubr ${DESTDIR}/usr/include > ${.TARGET} Modified: stable/9/usr.bin/kdump/mkioctls ============================================================================== --- stable/9/usr.bin/kdump/mkioctls Wed Apr 18 19:34:20 2012 (r234443) +++ stable/9/usr.bin/kdump/mkioctls Wed Apr 18 20:32:07 2012 (r234444) @@ -29,7 +29,7 @@ ioctl_includes=` ` awk -v x="$ioctl_includes" 'BEGIN {print x}' | - gcc -E -I$1 -dM -DCOMPAT_43TTY - | + $CPP -I$1 -dM -DCOMPAT_43TTY - | awk -v ioctl_includes="$ioctl_includes" -v use_switch="$use_switch" ' BEGIN { print "/* XXX obnoxious prerequisites. */" Modified: stable/9/usr.bin/truss/Makefile ============================================================================== --- stable/9/usr.bin/truss/Makefile Wed Apr 18 19:34:20 2012 (r234443) +++ stable/9/usr.bin/truss/Makefile Wed Apr 18 20:32:07 2012 (r234444) @@ -23,7 +23,8 @@ syscalls.h: syscalls.master ${.CURDIR}/i386.conf ioctl.c: ${.CURDIR}/../kdump/mkioctls - sh ${.CURDIR}/../kdump/mkioctls ${DESTDIR}/usr/include > ${.TARGET} + env CPP="${CPP}" \ + sh ${.CURDIR}/../kdump/mkioctls ${DESTDIR}/usr/include > ${.TARGET} .if ${MACHINE_CPUARCH} == "i386" SRCS+= i386-linux.c linux_syscalls.h From owner-svn-src-stable-9@FreeBSD.ORG Thu Apr 19 07:43:28 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A62E9106564A; Thu, 19 Apr 2012 07:43:28 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 913F08FC0C; Thu, 19 Apr 2012 07:43:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q3J7hSmD071293; Thu, 19 Apr 2012 07:43:28 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q3J7hSNY071291; Thu, 19 Apr 2012 07:43:28 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201204190743.q3J7hSNY071291@svn.freebsd.org> From: Martin Matuska Date: Thu, 19 Apr 2012 07:43:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r234452 - stable/9/cddl/contrib/opensolaris/cmd/zpool X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Apr 2012 07:43:28 -0000 Author: mm Date: Thu Apr 19 07:43:28 2012 New Revision: 234452 URL: http://svn.freebsd.org/changeset/base/234452 Log: MFC r234336: Fix typo miror -> mirror Reported by: Glen Barber Modified: stable/9/cddl/contrib/opensolaris/cmd/zpool/zpool.8 Directory Properties: stable/9/cddl/contrib/opensolaris/ (props changed) Modified: stable/9/cddl/contrib/opensolaris/cmd/zpool/zpool.8 ============================================================================== --- stable/9/cddl/contrib/opensolaris/cmd/zpool/zpool.8 Thu Apr 19 04:07:55 2012 (r234451) +++ stable/9/cddl/contrib/opensolaris/cmd/zpool/zpool.8 Thu Apr 19 07:43:28 2012 (r234452) @@ -1779,7 +1779,7 @@ The following command creates a storage pool consisting of two, two-way mirrors and mirrored log devices: .Bd -literal -offset 2n -.Li # Ic zpool create pool mirror da0 da1 mirror da2 da3 log miror da4 da5 +.Li # Ic zpool create pool mirror da0 da1 mirror da2 da3 log mirror da4 da5 .Ed .It Sy Example 14 No Adding Cache Devices to a Tn ZFS No Pool .Pp From owner-svn-src-stable-9@FreeBSD.ORG Thu Apr 19 10:17:29 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1EA16106566B; Thu, 19 Apr 2012 10:17:29 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 03B7D8FC0C; Thu, 19 Apr 2012 10:17:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q3JAHSFC081165; Thu, 19 Apr 2012 10:17:28 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q3JAHS41081163; Thu, 19 Apr 2012 10:17:28 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201204191017.q3JAHS41081163@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 19 Apr 2012 10:17:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r234454 - stable/9/libexec/rtld-elf X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Apr 2012 10:17:29 -0000 Author: kib Date: Thu Apr 19 10:17:28 2012 New Revision: 234454 URL: http://svn.freebsd.org/changeset/base/234454 Log: MFC r234170: Propagate the current state of rtld_bind_lock to dlopen_object() calls through the filter loading call chain. This fixes attempts to write-lock the already locked rtld_bind_lock when filter loading is initiated by relocation of dlopening dso. Modified: stable/9/libexec/rtld-elf/rtld.c Directory Properties: stable/9/libexec/rtld-elf/ (props changed) Modified: stable/9/libexec/rtld-elf/rtld.c ============================================================================== --- stable/9/libexec/rtld-elf/rtld.c Thu Apr 19 07:43:44 2012 (r234453) +++ stable/9/libexec/rtld-elf/rtld.c Thu Apr 19 10:17:28 2012 (r234454) @@ -85,7 +85,7 @@ static void digest_dynamic(Obj_Entry *, static Obj_Entry *digest_phdr(const Elf_Phdr *, int, caddr_t, const char *); static Obj_Entry *dlcheck(void *); static Obj_Entry *dlopen_object(const char *name, int fd, Obj_Entry *refobj, - int lo_flags, int mode); + int lo_flags, int mode, RtldLockState *lockstate); static Obj_Entry *do_load_object(int, const char *, char *, struct stat *, int); static int do_search_info(const Obj_Entry *obj, int, struct dl_serinfo *); static bool donelist_check(DoneList *, const Obj_Entry *); @@ -1672,13 +1672,14 @@ unload_filtees(Obj_Entry *obj) } static void -load_filtee1(Obj_Entry *obj, Needed_Entry *needed, int flags) +load_filtee1(Obj_Entry *obj, Needed_Entry *needed, int flags, + RtldLockState *lockstate) { for (; needed != NULL; needed = needed->next) { needed->obj = dlopen_object(obj->strtab + needed->name, -1, obj, flags, ((ld_loadfltr || obj->z_loadfltr) ? RTLD_NOW : RTLD_LAZY) | - RTLD_LOCAL); + RTLD_LOCAL, lockstate); } } @@ -1688,8 +1689,8 @@ load_filtees(Obj_Entry *obj, int flags, lock_restart_for_upgrade(lockstate); if (!obj->filtees_loaded) { - load_filtee1(obj, obj->needed_filtees, flags); - load_filtee1(obj, obj->needed_aux_filtees, flags); + load_filtee1(obj, obj->needed_filtees, flags, lockstate); + load_filtee1(obj, obj->needed_aux_filtees, flags, lockstate); obj->filtees_loaded = true; } } @@ -2489,7 +2490,7 @@ rtld_dlopen(const char *name, int fd, in lo_flags |= RTLD_LO_TRACE; return (dlopen_object(name, fd, obj_main, lo_flags, - mode & (RTLD_MODEMASK | RTLD_GLOBAL))); + mode & (RTLD_MODEMASK | RTLD_GLOBAL), NULL)); } static void @@ -2504,17 +2505,20 @@ dlopen_cleanup(Obj_Entry *obj) static Obj_Entry * dlopen_object(const char *name, int fd, Obj_Entry *refobj, int lo_flags, - int mode) + int mode, RtldLockState *lockstate) { Obj_Entry **old_obj_tail; Obj_Entry *obj; Objlist initlist; - RtldLockState lockstate; + RtldLockState mlockstate; int result; objlist_init(&initlist); - wlock_acquire(rtld_bind_lock, &lockstate); + if (lockstate == NULL && !(lo_flags & RTLD_LO_EARLY)) { + wlock_acquire(rtld_bind_lock, &mlockstate); + lockstate = &mlockstate; + } GDB_STATE(RT_ADD,NULL); old_obj_tail = obj_tail; @@ -2543,7 +2547,7 @@ dlopen_object(const char *name, int fd, if (result == -1 || (relocate_objects(obj, (mode & RTLD_MODEMASK) == RTLD_NOW, &obj_rtld, (lo_flags & RTLD_LO_EARLY) ? SYMLOOK_EARLY : 0, - &lockstate)) == -1) { + lockstate)) == -1) { dlopen_cleanup(obj); obj = NULL; } else if (lo_flags & RTLD_LO_EARLY) { @@ -2587,28 +2591,31 @@ dlopen_object(const char *name, int fd, GDB_STATE(RT_CONSISTENT,obj ? &obj->linkmap : NULL); if (!(lo_flags & RTLD_LO_EARLY)) { - map_stacks_exec(&lockstate); + map_stacks_exec(lockstate); } if (initlist_objects_ifunc(&initlist, (mode & RTLD_MODEMASK) == RTLD_NOW, (lo_flags & RTLD_LO_EARLY) ? SYMLOOK_EARLY : 0, - &lockstate) == -1) { + lockstate) == -1) { objlist_clear(&initlist); dlopen_cleanup(obj); - lock_release(rtld_bind_lock, &lockstate); + if (lockstate == &mlockstate) + lock_release(rtld_bind_lock, lockstate); return (NULL); } if (!(lo_flags & RTLD_LO_EARLY)) { /* Call the init functions. */ - objlist_call_init(&initlist, &lockstate); + objlist_call_init(&initlist, lockstate); } objlist_clear(&initlist); - lock_release(rtld_bind_lock, &lockstate); + if (lockstate == &mlockstate) + lock_release(rtld_bind_lock, lockstate); return obj; trace: trace_loaded_objects(obj); - lock_release(rtld_bind_lock, &lockstate); + if (lockstate == &mlockstate) + lock_release(rtld_bind_lock, lockstate); exit(0); } From owner-svn-src-stable-9@FreeBSD.ORG Thu Apr 19 10:36:24 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7375A1065673; Thu, 19 Apr 2012 10:36:24 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 44FAA8FC16; Thu, 19 Apr 2012 10:36:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q3JAaOtB081845; Thu, 19 Apr 2012 10:36:24 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q3JAaOcC081841; Thu, 19 Apr 2012 10:36:24 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201204191036.q3JAaOcC081841@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 19 Apr 2012 10:36:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r234455 - in stable/9/sys: kern sys X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Apr 2012 10:36:24 -0000 Author: kib Date: Thu Apr 19 10:36:23 2012 New Revision: 234455 URL: http://svn.freebsd.org/changeset/base/234455 Log: MFC r234172: Add thread-private flag to indicate that error value is already placed in td_errno. Flag is supposed to be used by syscalls returning EJUSTRETURN because errno was already placed into the usermode frame by a call to set_syscall_retval(9). Both ktrace and dtrace get errno value from td_errno if the flag is set. Use the flag to fix sigsuspend(2) error return ktrace records. Modified: stable/9/sys/kern/kern_sig.c stable/9/sys/kern/subr_syscall.c stable/9/sys/sys/proc.h Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/kern/kern_sig.c ============================================================================== --- stable/9/sys/kern/kern_sig.c Thu Apr 19 10:17:28 2012 (r234454) +++ stable/9/sys/kern/kern_sig.c Thu Apr 19 10:36:23 2012 (r234455) @@ -1465,6 +1465,8 @@ kern_sigsuspend(struct thread *td, sigse mtx_unlock(&p->p_sigacts->ps_mtx); } PROC_UNLOCK(p); + td->td_errno = EINTR; + td->td_pflags |= TDP_NERRNO; return (EJUSTRETURN); } Modified: stable/9/sys/kern/subr_syscall.c ============================================================================== --- stable/9/sys/kern/subr_syscall.c Thu Apr 19 10:17:28 2012 (r234454) +++ stable/9/sys/kern/subr_syscall.c Thu Apr 19 10:36:23 2012 (r234455) @@ -136,7 +136,8 @@ syscallenter(struct thread *td, struct s AUDIT_SYSCALL_EXIT(error, td); /* Save the latest error return value. */ - td->td_errno = error; + if ((td->td_pflags & TDP_NERRNO) == 0) + td->td_errno = error; #ifdef KDTRACE_HOOKS /* @@ -191,9 +192,12 @@ syscallret(struct thread *td, int error, syscallname(p, sa->code), td, td->td_proc->p_pid, td->td_name); #ifdef KTRACE - if (KTRPOINT(td, KTR_SYSRET)) - ktrsysret(sa->code, error, td->td_retval[0]); + if (KTRPOINT(td, KTR_SYSRET)) { + ktrsysret(sa->code, (td->td_pflags & TDP_NERRNO) == 0 ? + error : td->td_errno, td->td_retval[0]); + } #endif + td->td_pflags &= ~TDP_NERRNO; if (p->p_flag & P_TRACED) { traced = 1; Modified: stable/9/sys/sys/proc.h ============================================================================== --- stable/9/sys/sys/proc.h Thu Apr 19 10:17:28 2012 (r234454) +++ stable/9/sys/sys/proc.h Thu Apr 19 10:36:23 2012 (r234455) @@ -417,6 +417,7 @@ do { \ #define TDP_AUDITREC 0x01000000 /* Audit record pending on thread */ #define TDP_RFPPWAIT 0x02000000 /* Handle RFPPWAIT on syscall exit */ #define TDP_RESETSPUR 0x04000000 /* Reset spurious page fault history. */ +#define TDP_NERRNO 0x08000000 /* Last errno is already in td_errno */ /* * Reasons that the current thread can not be run yet. From owner-svn-src-stable-9@FreeBSD.ORG Thu Apr 19 18:03:25 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1FD43106564A; Thu, 19 Apr 2012 18:03:25 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 08D008FC08; Thu, 19 Apr 2012 18:03:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q3JI3O7M000268; Thu, 19 Apr 2012 18:03:24 GMT (envelope-from mckusick@svn.freebsd.org) Received: (from mckusick@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q3JI3O5k000262; Thu, 19 Apr 2012 18:03:24 GMT (envelope-from mckusick@svn.freebsd.org) Message-Id: <201204191803.q3JI3O5k000262@svn.freebsd.org> From: Kirk McKusick Date: Thu, 19 Apr 2012 18:03:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r234466 - in stable/9/sys: fs/msdosfs geom i386/conf kern sys ufs/ffs vm X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Apr 2012 18:03:25 -0000 Author: mckusick Date: Thu Apr 19 18:03:24 2012 New Revision: 234466 URL: http://svn.freebsd.org/changeset/base/234466 Log: MFC of 233627, 234024, 234025, and 234026 Restore per mount-point counts of synchronous and asynchronous reads and writes associated with UFS and MSDOS filesystems. MFS 233627: Keep track of the mount point associated with a special device to enable the collection of counts of synchronous and asynchronous reads and writes for its associated filesystem. The counts are displayed using `mount -v'. Ensure that buffers used for paging indicate the vnode from which they are operating so that counts of paging I/O operations from the filesystem are collected. This checkin only adds the setting of the mount point for the UFS/FFS filesystem, but it would be trivial to add the setting and clearing of the mount point at filesystem mount/unmount time for other filesystems too. Reviewed by: kib MFC 234024: Drop an unnecessary setting of si_mountpt when updating a UFS mount point. Clearly it must have been set when the mount was done. Reviewed by: kib MFC 234025: Add I/O accounting to msdos filesystem. Suggested and reviewed by: kib MFC 234026: Expand locking around identification of filesystem mount point when accounting for I/O counts at completion of I/O operation. Also switch from using global devmtx to vnode mutex to reduce contention. Suggested and reviewed by: kib Modified: stable/9/sys/fs/msdosfs/msdosfs_vfsops.c stable/9/sys/geom/geom_vfs.c stable/9/sys/sys/conf.h stable/9/sys/ufs/ffs/ffs_vfsops.c stable/9/sys/vm/vnode_pager.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) stable/9/sys/fs/ (props changed) stable/9/sys/fs/ntfs/ (props changed) stable/9/sys/i386/conf/XENHVM (props changed) stable/9/sys/kern/subr_witness.c (props changed) Modified: stable/9/sys/fs/msdosfs/msdosfs_vfsops.c ============================================================================== --- stable/9/sys/fs/msdosfs/msdosfs_vfsops.c Thu Apr 19 16:13:15 2012 (r234465) +++ stable/9/sys/fs/msdosfs/msdosfs_vfsops.c Thu Apr 19 18:03:24 2012 (r234466) @@ -401,6 +401,8 @@ msdosfs_mount(struct mount *mp) return error; } + if (devvp->v_type == VCHR && devvp->v_rdev != NULL) + devvp->v_rdev->si_mountpt = mp; vfs_mountedfrom(mp, from); #ifdef MSDOSFS_DEBUG printf("msdosfs_mount(): mp %p, pmp %p, inusemap %p\n", mp, pmp, pmp->pm_inusemap); @@ -843,6 +845,8 @@ msdosfs_unmount(struct mount *mp, int mn } #endif DROP_GIANT(); + if (pmp->pm_devvp->v_type == VCHR && pmp->pm_devvp->v_rdev != NULL) + pmp->pm_devvp->v_rdev->si_mountpt = NULL; g_topology_lock(); g_vfs_close(pmp->pm_cp); g_topology_unlock(); Modified: stable/9/sys/geom/geom_vfs.c ============================================================================== --- stable/9/sys/geom/geom_vfs.c Thu Apr 19 16:13:15 2012 (r234465) +++ stable/9/sys/geom/geom_vfs.c Thu Apr 19 18:03:24 2012 (r234466) @@ -70,6 +70,9 @@ g_vfs_done(struct bio *bip) { struct buf *bp; int vfslocked; + struct mount *mp; + struct vnode *vp; + struct cdev *cdevp; /* * Provider ('bio_to') could have withered away sometime @@ -81,12 +84,50 @@ g_vfs_done(struct bio *bip) if (bip->bio_from->provider == NULL) bip->bio_to = NULL; + /* + * Collect statistics on synchronous and asynchronous read + * and write counts for disks that have associated filesystems. + * Since this is run by the g_up thread it is single threaded and + * we do not need to use atomic increments on the counters. + */ + bp = bip->bio_caller2; + vp = bp->b_vp; + if (vp == NULL) { + mp = NULL; + } else { + /* + * If not a disk vnode, use its associated mount point + * otherwise use the mountpoint associated with the disk. + */ + VI_LOCK(vp); + if (vp->v_type != VCHR || + (cdevp = vp->v_rdev) == NULL || + cdevp->si_devsw == NULL || + (cdevp->si_devsw->d_flags & D_DISK) == 0) + mp = vp->v_mount; + else + mp = cdevp->si_mountpt; + VI_UNLOCK(vp); + } + if (mp != NULL) { + if (bp->b_iocmd == BIO_WRITE) { + if (LK_HOLDER(bp->b_lock.lk_lock) == LK_KERNPROC) + mp->mnt_stat.f_asyncwrites++; + else + mp->mnt_stat.f_syncwrites++; + } else { + if (LK_HOLDER(bp->b_lock.lk_lock) == LK_KERNPROC) + mp->mnt_stat.f_asyncreads++; + else + mp->mnt_stat.f_syncreads++; + } + } + if (bip->bio_error) { printf("g_vfs_done():"); g_print_bio(bip); printf("error = %d\n", bip->bio_error); } - bp = bip->bio_caller2; bp->b_error = bip->bio_error; bp->b_ioflags = bip->bio_flags; if (bip->bio_error) Modified: stable/9/sys/sys/conf.h ============================================================================== --- stable/9/sys/sys/conf.h Thu Apr 19 16:13:15 2012 (r234465) +++ stable/9/sys/sys/conf.h Thu Apr 19 18:03:24 2012 (r234466) @@ -52,7 +52,7 @@ struct cdevsw; struct file; struct cdev { - void *__si_reserved; + struct mount *si_mountpt; u_int si_flags; #define SI_ETERNAL 0x0001 /* never destroyed */ #define SI_ALIAS 0x0002 /* carrier of alias name */ Modified: stable/9/sys/ufs/ffs/ffs_vfsops.c ============================================================================== --- stable/9/sys/ufs/ffs/ffs_vfsops.c Thu Apr 19 16:13:15 2012 (r234465) +++ stable/9/sys/ufs/ffs/ffs_vfsops.c Thu Apr 19 18:03:24 2012 (r234466) @@ -1050,6 +1050,8 @@ ffs_mountfs(devvp, mp, td) ffs_flushfiles(mp, FORCECLOSE, td); goto out; } + if (devvp->v_type == VCHR && devvp->v_rdev != NULL) + devvp->v_rdev->si_mountpt = mp; if (fs->fs_snapinum[0] != 0) ffs_snapshot_mount(mp); fs->fs_fmod = 1; @@ -1295,6 +1297,8 @@ ffs_unmount(mp, mntflags) g_vfs_close(ump->um_cp); g_topology_unlock(); PICKUP_GIANT(); + if (ump->um_devvp->v_type == VCHR && ump->um_devvp->v_rdev != NULL) + ump->um_devvp->v_rdev->si_mountpt = NULL; vrele(ump->um_devvp); dev_rel(ump->um_dev); mtx_destroy(UFS_MTX(ump)); Modified: stable/9/sys/vm/vnode_pager.c ============================================================================== --- stable/9/sys/vm/vnode_pager.c Thu Apr 19 16:13:15 2012 (r234465) +++ stable/9/sys/vm/vnode_pager.c Thu Apr 19 18:03:24 2012 (r234466) @@ -541,6 +541,7 @@ vnode_pager_input_smlfs(object, m) bp->b_data = (caddr_t)sf_buf_kva(sf) + i * bsize; bp->b_blkno = fileaddr; pbgetbo(bo, bp); + bp->b_vp = vp; bp->b_bcount = bsize; bp->b_bufsize = bsize; bp->b_runningbufspace = bp->b_bufsize; @@ -558,6 +559,7 @@ vnode_pager_input_smlfs(object, m) /* * free the buffer header back to the swap buffer pool */ + bp->b_vp = NULL; pbrelbo(bp); relpbuf(bp, &vnode_pbuf_freecnt); if (error) @@ -916,6 +918,7 @@ vnode_pager_generic_getpages(vp, m, byte bp->b_wcred = crhold(curthread->td_ucred); bp->b_blkno = firstaddr; pbgetbo(bo, bp); + bp->b_vp = vp; bp->b_bcount = size; bp->b_bufsize = size; bp->b_runningbufspace = bp->b_bufsize; @@ -942,6 +945,7 @@ vnode_pager_generic_getpages(vp, m, byte /* * free the buffer header back to the swap buffer pool */ + bp->b_vp = NULL; pbrelbo(bp); relpbuf(bp, &vnode_pbuf_freecnt); From owner-svn-src-stable-9@FreeBSD.ORG Thu Apr 19 20:11:44 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 03A9810657BD; Thu, 19 Apr 2012 20:11:44 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C80878FC14; Thu, 19 Apr 2012 20:11:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q3JKBhRn005387; Thu, 19 Apr 2012 20:11:43 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q3JKBhku005384; Thu, 19 Apr 2012 20:11:43 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201204192011.q3JKBhku005384@svn.freebsd.org> From: Jung-uk Kim Date: Thu, 19 Apr 2012 20:11:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r234467 - stable/9/sys/i386/i386 X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Apr 2012 20:11:44 -0000 Author: jkim Date: Thu Apr 19 20:11:43 2012 New Revision: 234467 URL: http://svn.freebsd.org/changeset/base/234467 Log: MFC: r234350 - When interrupt is not requested for VM86 call, make a fake exit point and push the address onto stack as we do for INTn emulation. This avoids stack underflow when we encounter RETF instruction in VM86 mode. Lack of this exit point actually caused page fault in VM86 mode with VESA module when we resume from suspend state. - Remove unnecessary CLI and STI instructions from BIOS interrupt emulation. INTn and IRET must be able to emulate the flag correctly. Modified: stable/9/sys/i386/i386/vm86.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/i386/i386/vm86.c ============================================================================== --- stable/9/sys/i386/i386/vm86.c Thu Apr 19 18:03:24 2012 (r234466) +++ stable/9/sys/i386/i386/vm86.c Thu Apr 19 20:11:43 2012 (r234467) @@ -512,22 +512,27 @@ full: void vm86_prepcall(struct vm86frame *vmf) { - uintptr_t addr[] = { 0xA00, 0x1000 }; /* code, stack */ - u_char intcall[] = { - CLI, INTn, 0x00, STI, HLT - }; struct vm86_kernel *vm86; + uint32_t *stack; + uint8_t *code; + code = (void *)0xa00; + stack = (void *)(0x1000 - 2); /* keep aligned */ if ((vmf->vmf_trapno & PAGE_MASK) <= 0xff) { /* interrupt call requested */ - intcall[2] = (u_char)(vmf->vmf_trapno & 0xff); - memcpy((void *)addr[0], (void *)intcall, sizeof(intcall)); - vmf->vmf_ip = addr[0]; + code[0] = INTn; + code[1] = vmf->vmf_trapno & 0xff; + code[2] = HLT; + vmf->vmf_ip = (uintptr_t)code; vmf->vmf_cs = 0; + } else { + code[0] = HLT; + stack--; + stack[0] = MAKE_VEC(0, (uintptr_t)code); } - vmf->vmf_sp = addr[1] - 2; /* keep aligned */ - vmf->kernel_fs = vmf->kernel_es = vmf->kernel_ds = 0; + vmf->vmf_sp = (uintptr_t)stack; vmf->vmf_ss = 0; + vmf->kernel_fs = vmf->kernel_es = vmf->kernel_ds = 0; vmf->vmf_eflags = PSL_VIF | PSL_VM | PSL_USER; vm86 = &PCPU_GET(curpcb)->pcb_ext->ext_vm86; From owner-svn-src-stable-9@FreeBSD.ORG Thu Apr 19 20:44:40 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 9C764106564A; Thu, 19 Apr 2012 20:44:40 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8669C8FC1F; Thu, 19 Apr 2012 20:44:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q3JKiexc006572; Thu, 19 Apr 2012 20:44:40 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q3JKieVp006570; Thu, 19 Apr 2012 20:44:40 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201204192044.q3JKieVp006570@svn.freebsd.org> From: Doug Barton Date: Thu, 19 Apr 2012 20:44:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r234468 - in stable/9: contrib/bind9 share/doc/bind9 X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Apr 2012 20:44:40 -0000 Author: dougb Date: Thu Apr 19 20:44:40 2012 New Revision: 234468 URL: http://svn.freebsd.org/changeset/base/234468 Log: MFV r234164/MFC r234165: The BIND 9.8.2 tarball was re-rolled to remove 9.8.1 release notes. This change was noticed by ISC at: https://lists.isc.org/pipermail/bind-users/2012-April/087345.html and verified by me both by comparing the contents of the old and new distfiles and by verifying the PGP signature on the new distfile. Deleted: stable/9/contrib/bind9/RELEASE-NOTES-BIND-9.8.1.html stable/9/contrib/bind9/RELEASE-NOTES-BIND-9.8.1.pdf stable/9/contrib/bind9/RELEASE-NOTES-BIND-9.8.1.txt stable/9/contrib/bind9/release-notes.css Modified: stable/9/share/doc/bind9/Makefile Directory Properties: stable/9/contrib/bind9/ (props changed) stable/9/share/doc/bind9/ (props changed) Modified: stable/9/share/doc/bind9/Makefile ============================================================================== --- stable/9/share/doc/bind9/Makefile Thu Apr 19 20:11:43 2012 (r234467) +++ stable/9/share/doc/bind9/Makefile Thu Apr 19 20:44:40 2012 (r234468) @@ -8,9 +8,7 @@ SRCDIR= ${BIND_DIR}/doc NO_OBJ= FILESGROUPS= TOP ARM MISC -TOP= CHANGES COPYRIGHT FAQ HISTORY README \ - RELEASE-NOTES-BIND-9.8.1.pdf RELEASE-NOTES-BIND-9.8.1.txt \ - RELEASE-NOTES-BIND-9.8.1.html release-notes.css +TOP= CHANGES COPYRIGHT FAQ HISTORY README TOPDIR= ${DOCDIR}/bind9 ARM= Bv9ARM.ch01.html Bv9ARM.ch02.html Bv9ARM.ch03.html \ Bv9ARM.ch04.html Bv9ARM.ch05.html Bv9ARM.ch06.html \ From owner-svn-src-stable-9@FreeBSD.ORG Thu Apr 19 22:22:22 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 61E9D1065675; Thu, 19 Apr 2012 22:22:22 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4A6EA8FC1B; Thu, 19 Apr 2012 22:22:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q3JMMM28009893; Thu, 19 Apr 2012 22:22:22 GMT (envelope-from mckusick@svn.freebsd.org) Received: (from mckusick@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q3JMMM1e009890; Thu, 19 Apr 2012 22:22:22 GMT (envelope-from mckusick@svn.freebsd.org) Message-Id: <201204192222.q3JMMM1e009890@svn.freebsd.org> From: Kirk McKusick Date: Thu, 19 Apr 2012 22:22:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r234470 - in stable/9/sys: i386/conf kern ufs/ffs ufs/ufs X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Apr 2012 22:22:22 -0000 Author: mckusick Date: Thu Apr 19 22:22:21 2012 New Revision: 234470 URL: http://svn.freebsd.org/changeset/base/234470 Log: MFC of 233817: A file cannot be deallocated until its last name has been removed and it is no longer referenced by a user process. The inode for a file whose name has been removed, but is still referenced at the time of a crash will still be allocated in the filesystem, but will have no references (e.g., they will have no names referencing them from any directory). With traditional soft updates these unreferenced inodes will be found and reclaimed when the background fsck is run. When using journaled soft updates, the kernel must keep track of these inodes so that it can find and reclaim them during the cleanup process. Their existence cannot be stored in the journal as the journal only handles short-term events, and they may persist for days. So, they are tracked by keeping them in a linked list whose head pointer is stored in the superblock. The journal tracks them only until their linked list pointers have been commited to disk. Part of the cleanup process involves traversing the list of unreferenced inodes and reclaiming them. This bug was triggered when confusion arose in the commit steps of keeping the unreferenced-inode linked list coherent on disk. Notably, a race between the link() system call adding a link-count to a file and the unlink() system call removing a link-count to the file. Here if the unlink() ran after link() had looked up the file but before link() had incremented the link-count of the file, the file's link-count would drop to zero before the link() incremented it back up to one. If the file was referenced by a user process, the first transition through zero made it appear that it should be added to the unreferenced-inode list when in fact it should not have been added. If the new name created by link() was deleted within a few seconds (with the file still referenced by a user process) it would legitimately be a candidate for addition to the unreferenced-inode list. The result was that there were two attempts to add the same inode to the unreferenced-inode list which scrambled the unreferenced-inode list's pointers leading to a panic. The fix is to detect and avoid the false attempt at adding it to the unreferenced-inode list by having the link() system call check to see if the link count is zero before it increments it. If it is, the link() fails with ENOENT (showing that it has failed the link()/unlink() race). While tracking down this bug, we have added additional assertions to detect the problem sooner and also simplified some of the code. Reported by: Kirk Russell Fix submitted by: Jeff Roberson Tested by: Peter Holm PR: kern/159971 Modified: stable/9/sys/ufs/ffs/ffs_softdep.c stable/9/sys/ufs/ufs/ufs_vnops.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) stable/9/sys/fs/ (props changed) stable/9/sys/fs/ntfs/ (props changed) stable/9/sys/i386/conf/XENHVM (props changed) stable/9/sys/kern/subr_witness.c (props changed) Modified: stable/9/sys/ufs/ffs/ffs_softdep.c ============================================================================== --- stable/9/sys/ufs/ffs/ffs_softdep.c Thu Apr 19 21:12:08 2012 (r234469) +++ stable/9/sys/ufs/ffs/ffs_softdep.c Thu Apr 19 22:22:21 2012 (r234470) @@ -4322,6 +4322,7 @@ inodedep_lookup_ip(ip) (void) inodedep_lookup(UFSTOVFS(ip->i_ump), ip->i_number, dflags, &inodedep); inodedep->id_nlinkdelta = ip->i_nlink - ip->i_effnlink; + KASSERT((inodedep->id_state & UNLINKED) == 0, ("inode unlinked")); return (inodedep); } @@ -8454,6 +8455,7 @@ softdep_setup_remove(bp, dp, ip, isrmdir if (inodedep_lookup(UFSTOVFS(ip->i_ump), ip->i_number, 0, &inodedep) == 0) panic("softdep_setup_remove: Lost inodedep."); + KASSERT((inodedep->id_state & UNLINKED) == 0, ("inode unlinked")); dirrem->dm_state |= ONDEPLIST; LIST_INSERT_HEAD(&inodedep->id_dirremhd, dirrem, dm_inonext); @@ -8986,6 +8988,7 @@ first_unlinked_inodedep(ump) struct inodedep *inodedep; struct inodedep *idp; + mtx_assert(&lk, MA_OWNED); for (inodedep = TAILQ_LAST(&ump->softdep_unlinked, inodedeplst); inodedep; inodedep = idp) { if ((inodedep->id_state & UNLINKNEXT) == 0) @@ -8994,11 +8997,8 @@ first_unlinked_inodedep(ump) if (idp == NULL || (idp->id_state & UNLINKNEXT) == 0) break; if ((inodedep->id_state & UNLINKPREV) == 0) - panic("first_unlinked_inodedep: prev != next"); + break; } - if (inodedep == NULL) - return (NULL); - return (inodedep); } @@ -9037,8 +9037,12 @@ handle_written_sbdep(sbdep, bp) struct mount *mp; struct fs *fs; + mtx_assert(&lk, MA_OWNED); fs = sbdep->sb_fs; mp = UFSTOVFS(sbdep->sb_ump); + /* + * If the superblock doesn't match the in-memory list start over. + */ inodedep = first_unlinked_inodedep(sbdep->sb_ump); if ((inodedep && fs->fs_sujfree != inodedep->id_ino) || (inodedep == NULL && fs->fs_sujfree != 0)) { @@ -9048,8 +9052,6 @@ handle_written_sbdep(sbdep, bp) WORKITEM_FREE(sbdep, D_SBDEP); if (fs->fs_sujfree == 0) return (0); - if (inodedep_lookup(mp, fs->fs_sujfree, 0, &inodedep) == 0) - panic("handle_written_sbdep: lost inodedep"); /* * Now that we have a record of this inode in stable store allow it * to be written to free up pending work. Inodes may see a lot of @@ -9077,10 +9079,13 @@ unlinked_inodedep(mp, inodedep) { struct ufsmount *ump; + mtx_assert(&lk, MA_OWNED); if (MOUNTEDSUJ(mp) == 0) return; ump = VFSTOUFS(mp); ump->um_fs->fs_fmod = 1; + if (inodedep->id_state & UNLINKED) + panic("unlinked_inodedep: %p already unlinked\n", inodedep); inodedep->id_state |= UNLINKED; TAILQ_INSERT_HEAD(&ump->softdep_unlinked, inodedep, id_unlinked); } @@ -9108,6 +9113,10 @@ clear_unlinked_inodedep(inodedep) ino = inodedep->id_ino; error = 0; for (;;) { + mtx_assert(&lk, MA_OWNED); + KASSERT((inodedep->id_state & UNLINKED) != 0, + ("clear_unlinked_inodedep: inodedep %p not unlinked", + inodedep)); /* * If nothing has yet been written simply remove us from * the in memory list and return. This is the most common @@ -9165,36 +9174,19 @@ clear_unlinked_inodedep(inodedep) ACQUIRE_LOCK(&lk); continue; } + nino = 0; + idn = TAILQ_NEXT(inodedep, id_unlinked); + if (idn) + nino = idn->id_ino; /* * Remove us from the in memory list. After this we cannot * access the inodedep. */ - idn = TAILQ_NEXT(inodedep, id_unlinked); - inodedep->id_state &= ~(UNLINKED | UNLINKLINKS); + KASSERT((inodedep->id_state & UNLINKED) != 0, + ("clear_unlinked_inodedep: inodedep %p not unlinked", + inodedep)); + inodedep->id_state &= ~(UNLINKED | UNLINKLINKS | UNLINKONLIST); TAILQ_REMOVE(&ump->softdep_unlinked, inodedep, id_unlinked); - /* - * Determine the next inode number. - */ - nino = 0; - if (idn) { - /* - * If next isn't on the list we can just clear prev's - * state and schedule it to be fixed later. No need - * to synchronously write if we're not in the real - * list. - */ - if ((idn->id_state & UNLINKPREV) == 0 && pino != 0) { - idp->id_state &= ~UNLINKNEXT; - if ((idp->id_state & ONWORKLIST) == 0) - WORKLIST_INSERT(&bp->b_dep, - &idp->id_list); - FREE_LOCK(&lk); - bawrite(bp); - ACQUIRE_LOCK(&lk); - return; - } - nino = idn->id_ino; - } FREE_LOCK(&lk); /* * The predecessor's next pointer is manually updated here @@ -9233,13 +9225,14 @@ clear_unlinked_inodedep(inodedep) bwrite(bp); ACQUIRE_LOCK(&lk); } + if (fs->fs_sujfree != ino) return; panic("clear_unlinked_inodedep: Failed to clear free head"); } if (inodedep->id_ino == fs->fs_sujfree) panic("clear_unlinked_inodedep: Freeing head of free list"); - inodedep->id_state &= ~(UNLINKED | UNLINKLINKS); + inodedep->id_state &= ~(UNLINKED | UNLINKLINKS | UNLINKONLIST); TAILQ_REMOVE(&ump->softdep_unlinked, inodedep, id_unlinked); return; } @@ -9838,18 +9831,6 @@ initiate_write_inodeblock_ufs2(inodedep, inon = TAILQ_NEXT(inodedep, id_unlinked); dp->di_freelink = inon ? inon->id_ino : 0; } - if ((inodedep->id_state & (UNLINKED | UNLINKNEXT)) == - (UNLINKED | UNLINKNEXT)) { - struct inodedep *inon; - ino_t freelink; - - inon = TAILQ_NEXT(inodedep, id_unlinked); - freelink = inon ? inon->id_ino : 0; - if (freelink != dp->di_freelink) - panic("ino %p(0x%X) %d, %d != %d", - inodedep, inodedep->id_state, inodedep->id_ino, - freelink, dp->di_freelink); - } /* * If the bitmap is not yet written, then the allocated * inode cannot be written to disk. @@ -10848,10 +10829,9 @@ handle_written_inodeblock(inodedep, bp) freelink = dp2->di_freelink; } /* - * If we wrote a valid freelink pointer during the last write - * record it here. + * Leave this inodeblock dirty until it's in the list. */ - if ((inodedep->id_state & (UNLINKED | UNLINKNEXT)) == UNLINKED) { + if ((inodedep->id_state & (UNLINKED | UNLINKONLIST)) == UNLINKED) { struct inodedep *inon; inon = TAILQ_NEXT(inodedep, id_unlinked); @@ -10860,12 +10840,9 @@ handle_written_inodeblock(inodedep, bp) if (inon) inon->id_state |= UNLINKPREV; inodedep->id_state |= UNLINKNEXT; - } else - hadchanges = 1; - } - /* Leave this inodeblock dirty until it's in the list. */ - if ((inodedep->id_state & (UNLINKED | UNLINKONLIST)) == UNLINKED) + } hadchanges = 1; + } /* * If we had to rollback the inode allocation because of * bitmaps being incomplete, then simply restore it. Modified: stable/9/sys/ufs/ufs/ufs_vnops.c ============================================================================== --- stable/9/sys/ufs/ufs/ufs_vnops.c Thu Apr 19 21:12:08 2012 (r234469) +++ stable/9/sys/ufs/ufs/ufs_vnops.c Thu Apr 19 22:22:21 2012 (r234470) @@ -1002,6 +1002,14 @@ ufs_link(ap) error = EMLINK; goto out; } + /* + * The file may have been removed after namei droped the original + * lock. + */ + if (ip->i_effnlink == 0) { + error = ENOENT; + goto out; + } if (ip->i_flags & (IMMUTABLE | APPEND)) { error = EPERM; goto out; From owner-svn-src-stable-9@FreeBSD.ORG Thu Apr 19 22:28:43 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id BB44D1065674; Thu, 19 Apr 2012 22:28:43 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8C2EE8FC0A; Thu, 19 Apr 2012 22:28:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q3JMSh30010126; Thu, 19 Apr 2012 22:28:43 GMT (envelope-from mckusick@svn.freebsd.org) Received: (from mckusick@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q3JMSh5T010124; Thu, 19 Apr 2012 22:28:43 GMT (envelope-from mckusick@svn.freebsd.org) Message-Id: <201204192228.q3JMSh5T010124@svn.freebsd.org> From: Kirk McKusick Date: Thu, 19 Apr 2012 22:28:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r234471 - in stable/9/sys: i386/conf kern sys X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Apr 2012 22:28:43 -0000 Author: mckusick Date: Thu Apr 19 22:28:42 2012 New Revision: 234471 URL: http://svn.freebsd.org/changeset/base/234471 Log: MFC of 234157: Whitespace cleanup. Modified: stable/9/sys/sys/mount.h Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) stable/9/sys/fs/ (props changed) stable/9/sys/fs/ntfs/ (props changed) stable/9/sys/i386/conf/XENHVM (props changed) stable/9/sys/kern/subr_witness.c (props changed) Modified: stable/9/sys/sys/mount.h ============================================================================== --- stable/9/sys/sys/mount.h Thu Apr 19 22:22:21 2012 (r234470) +++ stable/9/sys/sys/mount.h Thu Apr 19 22:28:42 2012 (r234471) @@ -200,10 +200,10 @@ void __mnt_vnode_markerfree(str __mnt_vnode_markerfree(&(mvp), (mp)) #define MNT_VNODE_FOREACH_ABORT(mp, mvp) \ - do { \ - MNT_ILOCK(mp); \ - MNT_VNODE_FOREACH_ABORT_ILOCKED(mp, mvp); \ - MNT_IUNLOCK(mp); \ + do { \ + MNT_ILOCK(mp); \ + MNT_VNODE_FOREACH_ABORT_ILOCKED(mp, mvp); \ + MNT_IUNLOCK(mp); \ } while (0) #define MNT_ILOCK(mp) mtx_lock(&(mp)->mnt_mtx) @@ -212,7 +212,7 @@ void __mnt_vnode_markerfree(str #define MNT_MTX(mp) (&(mp)->mnt_mtx) #define MNT_REF(mp) (mp)->mnt_ref++ #define MNT_REL(mp) do { \ - KASSERT((mp)->mnt_ref > 0, ("negative mnt_ref")); \ + KASSERT((mp)->mnt_ref > 0, ("negative mnt_ref")); \ (mp)->mnt_ref--; \ if ((mp)->mnt_ref == 0) \ wakeup((mp)); \ From owner-svn-src-stable-9@FreeBSD.ORG Thu Apr 19 22:42:28 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B74FC106567A; Thu, 19 Apr 2012 22:42:28 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A0BA38FC18; Thu, 19 Apr 2012 22:42:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q3JMgS5e010679; Thu, 19 Apr 2012 22:42:28 GMT (envelope-from mckusick@svn.freebsd.org) Received: (from mckusick@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q3JMgSpR010675; Thu, 19 Apr 2012 22:42:28 GMT (envelope-from mckusick@svn.freebsd.org) Message-Id: <201204192242.q3JMgSpR010675@svn.freebsd.org> From: Kirk McKusick Date: Thu, 19 Apr 2012 22:42:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r234473 - in stable/9/sys: i386/conf kern sys ufs/ffs X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Apr 2012 22:42:29 -0000 Author: mckusick Date: Thu Apr 19 22:42:28 2012 New Revision: 234473 URL: http://svn.freebsd.org/changeset/base/234473 Log: MFC of 234158: Export vinactive() from kern/vfs_subr.c (e.g., make it no longer static and declare its prototype in sys/vnode.h) so that it can be called from process_deferred_inactive() (in ufs/ffs/ffs_snapshot.c) instead of the body of vinactive() being cut and pasted into process_deferred_inactive(). Reviewed by: kib MFC after: 2 weeks Modified: stable/9/sys/kern/vfs_subr.c stable/9/sys/sys/vnode.h stable/9/sys/ufs/ffs/ffs_snapshot.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) stable/9/sys/fs/ (props changed) stable/9/sys/fs/ntfs/ (props changed) stable/9/sys/i386/conf/XENHVM (props changed) stable/9/sys/kern/subr_witness.c (props changed) Modified: stable/9/sys/kern/vfs_subr.c ============================================================================== --- stable/9/sys/kern/vfs_subr.c Thu Apr 19 22:37:24 2012 (r234472) +++ stable/9/sys/kern/vfs_subr.c Thu Apr 19 22:42:28 2012 (r234473) @@ -103,7 +103,6 @@ static int flushbuflist(struct bufv *buf static void syncer_shutdown(void *arg, int howto); static int vtryrecycle(struct vnode *vp); static void vbusy(struct vnode *vp); -static void vinactive(struct vnode *, struct thread *); static void v_incr_usecount(struct vnode *); static void v_decr_usecount(struct vnode *); static void v_decr_useonly(struct vnode *); @@ -2401,7 +2400,7 @@ vdropl(struct vnode *vp) * OWEINACT tracks whether a vnode missed a call to inactive due to a * failed lock upgrade. */ -static void +void vinactive(struct vnode *vp, struct thread *td) { Modified: stable/9/sys/sys/vnode.h ============================================================================== --- stable/9/sys/sys/vnode.h Thu Apr 19 22:37:24 2012 (r234472) +++ stable/9/sys/sys/vnode.h Thu Apr 19 22:42:28 2012 (r234473) @@ -635,6 +635,7 @@ int vget(struct vnode *vp, int lockflag, void vgone(struct vnode *vp); void vhold(struct vnode *); void vholdl(struct vnode *); +void vinactive(struct vnode *, struct thread *); int vinvalbuf(struct vnode *vp, int save, int slpflag, int slptimeo); int vtruncbuf(struct vnode *vp, struct ucred *cred, struct thread *td, off_t length, int blksize); Modified: stable/9/sys/ufs/ffs/ffs_snapshot.c ============================================================================== --- stable/9/sys/ufs/ffs/ffs_snapshot.c Thu Apr 19 22:37:24 2012 (r234472) +++ stable/9/sys/ufs/ffs/ffs_snapshot.c Thu Apr 19 22:42:28 2012 (r234473) @@ -2572,20 +2572,9 @@ process_deferred_inactive(struct mount * MNT_ILOCK(mp); continue; } - - VNASSERT((vp->v_iflag & VI_DOINGINACT) == 0, vp, - ("process_deferred_inactive: " - "recursed on VI_DOINGINACT")); - vp->v_iflag |= VI_DOINGINACT; - vp->v_iflag &= ~VI_OWEINACT; - VI_UNLOCK(vp); - (void) VOP_INACTIVE(vp, td); - VI_LOCK(vp); - VNASSERT(vp->v_iflag & VI_DOINGINACT, vp, - ("process_deferred_inactive: lost VI_DOINGINACT")); + vinactive(vp, td); VNASSERT((vp->v_iflag & VI_OWEINACT) == 0, vp, ("process_deferred_inactive: got VI_OWEINACT")); - vp->v_iflag &= ~VI_DOINGINACT; VI_UNLOCK(vp); VOP_UNLOCK(vp, 0); vdrop(vp); From owner-svn-src-stable-9@FreeBSD.ORG Fri Apr 20 00:45:24 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5F1F41065672; Fri, 20 Apr 2012 00:45:24 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 476C58FC18; Fri, 20 Apr 2012 00:45:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q3K0jOT4014826; Fri, 20 Apr 2012 00:45:24 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q3K0jO65014820; Fri, 20 Apr 2012 00:45:24 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201204200045.q3K0jO65014820@svn.freebsd.org> From: Nathan Whitehorn Date: Fri, 20 Apr 2012 00:45:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r234476 - in stable/9/sys: powerpc/aim vm X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Apr 2012 00:45:24 -0000 Author: nwhitehorn Date: Fri Apr 20 00:45:23 2012 New Revision: 234476 URL: http://svn.freebsd.org/changeset/base/234476 Log: MFC r233949,233957,233964,234149,234155: More PMAP concurrency and performance improvements by only flushing icaches when needed and executing ptesync only when architecturally required. Modified: stable/9/sys/powerpc/aim/machdep.c stable/9/sys/powerpc/aim/mmu_oea.c stable/9/sys/powerpc/aim/mmu_oea64.c stable/9/sys/powerpc/aim/moea64_native.c stable/9/sys/vm/vm_page.h Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/powerpc/aim/machdep.c ============================================================================== --- stable/9/sys/powerpc/aim/machdep.c Fri Apr 20 00:34:15 2012 (r234475) +++ stable/9/sys/powerpc/aim/machdep.c Fri Apr 20 00:45:23 2012 (r234476) @@ -400,6 +400,9 @@ powerpc_init(vm_offset_t startkernel, vm cacheline_size = 32; } + /* Make sure the kernel icache is valid before we go too much further */ + __syncicache((caddr_t)startkernel, endkernel - startkernel); + #ifndef __powerpc64__ /* * Figure out whether we need to use the 64 bit PMAP. This works by Modified: stable/9/sys/powerpc/aim/mmu_oea.c ============================================================================== --- stable/9/sys/powerpc/aim/mmu_oea.c Fri Apr 20 00:34:15 2012 (r234475) +++ stable/9/sys/powerpc/aim/mmu_oea.c Fri Apr 20 00:45:23 2012 (r234476) @@ -1055,7 +1055,7 @@ moea_enter_locked(pmap_t pmap, vm_offset struct pvo_head *pvo_head; uma_zone_t zone; vm_page_t pg; - u_int pte_lo, pvo_flags, was_exec; + u_int pte_lo, pvo_flags; int error; if (!moea_initialized) { @@ -1063,13 +1063,11 @@ moea_enter_locked(pmap_t pmap, vm_offset zone = moea_upvo_zone; pvo_flags = 0; pg = NULL; - was_exec = PTE_EXEC; } else { pvo_head = vm_page_to_pvoh(m); pg = m; zone = moea_mpvo_zone; pvo_flags = PVO_MANAGED; - was_exec = 0; } if (pmap_bootstrapped) mtx_assert(&vm_page_queue_mtx, MA_OWNED); @@ -1085,18 +1083,6 @@ moea_enter_locked(pmap_t pmap, vm_offset zone = moea_upvo_zone; } - /* - * If this is a managed page, and it's the first reference to the page, - * clear the execness of the page. Otherwise fetch the execness. - */ - if ((pg != NULL) && ((m->oflags & VPO_UNMANAGED) == 0)) { - if (LIST_EMPTY(pvo_head)) { - moea_attr_clear(pg, PTE_EXEC); - } else { - was_exec = moea_attr_fetch(pg) & PTE_EXEC; - } - } - pte_lo = moea_calc_wimg(VM_PAGE_TO_PHYS(m), pmap_page_get_memattr(m)); if (prot & VM_PROT_WRITE) { @@ -1117,22 +1103,14 @@ moea_enter_locked(pmap_t pmap, vm_offset pte_lo, pvo_flags); /* - * Flush the real page from the instruction cache if this page is - * mapped executable and cacheable and was not previously mapped (or - * was not mapped executable). + * Flush the real page from the instruction cache. This has be done + * for all user mappings to prevent information leakage via the + * instruction cache. moea_pvo_enter() returns ENOENT for the first + * mapping for a page. */ - if (error == 0 && (pvo_flags & PVO_EXECUTABLE) && - (pte_lo & PTE_I) == 0 && was_exec == 0) { - /* - * Flush the real memory from the cache. - */ + if (pmap != kernel_pmap && error == ENOENT && + (pte_lo & (PTE_I | PTE_G)) == 0) moea_syncicache(VM_PAGE_TO_PHYS(m), PAGE_SIZE); - if (pg != NULL) - moea_attr_save(pg, PTE_EXEC); - } - - /* XXX syncicache always until problems are sorted */ - moea_syncicache(VM_PAGE_TO_PHYS(m), PAGE_SIZE); } /* @@ -1454,12 +1432,6 @@ moea_kenter_attr(mmu_t mmu, vm_offset_t panic("moea_kenter: failed to enter va %#x pa %#x: %d", va, pa, error); - /* - * Flush the real memory from the instruction cache. - */ - if ((pte_lo & (PTE_I | PTE_G)) == 0) { - moea_syncicache(pa, PAGE_SIZE); - } PMAP_UNLOCK(kernel_pmap); } Modified: stable/9/sys/powerpc/aim/mmu_oea64.c ============================================================================== --- stable/9/sys/powerpc/aim/mmu_oea64.c Fri Apr 20 00:34:15 2012 (r234475) +++ stable/9/sys/powerpc/aim/mmu_oea64.c Fri Apr 20 00:45:23 2012 (r234476) @@ -283,8 +283,6 @@ static struct pvo_entry *moea64_pvo_find /* * Utility routines. */ -static void moea64_enter_locked(mmu_t, pmap_t, vm_offset_t, - vm_page_t, vm_prot_t, boolean_t); static boolean_t moea64_query_bit(mmu_t, vm_page_t, u_int64_t); static u_int moea64_clear_bit(mmu_t, vm_page_t, u_int64_t); static void moea64_kremove(mmu_t, vm_offset_t); @@ -1167,30 +1165,11 @@ moea64_zero_page_idle(mmu_t mmu, vm_page * target pmap with the protection requested. If specified the page * will be wired down. */ + void moea64_enter(mmu_t mmu, pmap_t pmap, vm_offset_t va, vm_page_t m, vm_prot_t prot, boolean_t wired) { - - LOCK_TABLE_WR(); - PMAP_LOCK(pmap); - moea64_enter_locked(mmu, pmap, va, m, prot, wired); - UNLOCK_TABLE_WR(); - PMAP_UNLOCK(pmap); -} - -/* - * Map the given physical page at the specified virtual address in the - * target pmap with the protection requested. If specified the page - * will be wired down. - * - * The table (write) and pmap must be locked. - */ - -static void -moea64_enter_locked(mmu_t mmu, pmap_t pmap, vm_offset_t va, vm_page_t m, - vm_prot_t prot, boolean_t wired) -{ struct pvo_head *pvo_head; uma_zone_t zone; vm_page_t pg; @@ -1210,10 +1189,9 @@ moea64_enter_locked(mmu_t mmu, pmap_t pm pvo_flags = PVO_MANAGED; } - PMAP_LOCK_ASSERT(pmap, MA_OWNED); KASSERT((m->oflags & (VPO_UNMANAGED | VPO_BUSY)) != 0 || VM_OBJECT_LOCKED(m->object), - ("moea64_enter_locked: page %p is not busy", m)); + ("moea64_enter: page %p is not busy", m)); /* XXX change the pvo head for fake pages */ if ((m->oflags & VPO_UNMANAGED) != 0) { @@ -1238,15 +1216,22 @@ moea64_enter_locked(mmu_t mmu, pmap_t pm if (wired) pvo_flags |= PVO_WIRED; + LOCK_TABLE_WR(); + PMAP_LOCK(pmap); error = moea64_pvo_enter(mmu, pmap, zone, pvo_head, va, VM_PAGE_TO_PHYS(m), pte_lo, pvo_flags); + PMAP_UNLOCK(pmap); + UNLOCK_TABLE_WR(); /* * Flush the page from the instruction cache if this page is * mapped executable and cacheable. */ - if ((pte_lo & (LPTE_I | LPTE_G | LPTE_NOEXEC)) == 0) + if (pmap != kernel_pmap && !(m->aflags & PGA_EXECUTABLE) && + (pte_lo & (LPTE_I | LPTE_G | LPTE_NOEXEC)) == 0) { + vm_page_aflag_set(m, PGA_EXECUTABLE); moea64_syncicache(mmu, pmap, va, VM_PAGE_TO_PHYS(m), PAGE_SIZE); + } } static void @@ -1307,15 +1292,11 @@ moea64_enter_object(mmu_t mmu, pmap_t pm psize = atop(end - start); m = m_start; - LOCK_TABLE_WR(); - PMAP_LOCK(pm); while (m != NULL && (diff = m->pindex - m_start->pindex) < psize) { - moea64_enter_locked(mmu, pm, start + ptoa(diff), m, prot & + moea64_enter(mmu, pm, start + ptoa(diff), m, prot & (VM_PROT_READ | VM_PROT_EXECUTE), FALSE); m = TAILQ_NEXT(m, listq); } - UNLOCK_TABLE_WR(); - PMAP_UNLOCK(pm); } void @@ -1323,12 +1304,8 @@ moea64_enter_quick(mmu_t mmu, pmap_t pm, vm_prot_t prot) { - LOCK_TABLE_WR(); - PMAP_LOCK(pm); - moea64_enter_locked(mmu, pm, va, m, + moea64_enter(mmu, pm, va, m, prot & (VM_PROT_READ | VM_PROT_EXECUTE), FALSE); - UNLOCK_TABLE_WR(); - PMAP_UNLOCK(pm); } vm_paddr_t @@ -1664,12 +1641,6 @@ moea64_kenter_attr(mmu_t mmu, vm_offset_ if (error != 0 && error != ENOENT) panic("moea64_kenter: failed to enter va %#zx pa %#zx: %d", va, pa, error); - - /* - * Flush the memory from the instruction cache. - */ - if ((pte_lo & (LPTE_I | LPTE_G)) == 0) - __syncicache((void *)va, PAGE_SIZE); } void @@ -1900,6 +1871,7 @@ static void moea64_pvo_protect(mmu_t mmu, pmap_t pm, struct pvo_entry *pvo, vm_prot_t prot) { uintptr_t pt; + struct vm_page *pg; uint64_t oldlo; PMAP_LOCK_ASSERT(pm, MA_OWNED); @@ -1923,18 +1895,20 @@ moea64_pvo_protect(mmu_t mmu, pmap_t pm else pvo->pvo_pte.lpte.pte_lo |= LPTE_BR; + pg = PHYS_TO_VM_PAGE(pvo->pvo_pte.lpte.pte_lo & LPTE_RPGN); + /* * If the PVO is in the page table, update that pte as well. */ - if (pt != -1) { + if (pt != -1) MOEA64_PTE_CHANGE(mmu, pt, &pvo->pvo_pte.lpte, pvo->pvo_vpn); - if ((pvo->pvo_pte.lpte.pte_lo & - (LPTE_I | LPTE_G | LPTE_NOEXEC)) == 0) { - moea64_syncicache(mmu, pm, PVO_VADDR(pvo), - pvo->pvo_pte.lpte.pte_lo & LPTE_RPGN, - PAGE_SIZE); - } + if (pm != kernel_pmap && pg != NULL && !(pg->aflags & PGA_EXECUTABLE) && + (pvo->pvo_pte.lpte.pte_lo & (LPTE_I | LPTE_G | LPTE_NOEXEC)) == 0) { + if ((pg->oflags & VPO_UNMANAGED) == 0) + vm_page_aflag_set(pg, PGA_EXECUTABLE); + moea64_syncicache(mmu, pm, PVO_VADDR(pvo), + pvo->pvo_pte.lpte.pte_lo & LPTE_RPGN, PAGE_SIZE); } /* @@ -1943,9 +1917,6 @@ moea64_pvo_protect(mmu_t mmu, pmap_t pm */ if ((pvo->pvo_vaddr & PVO_MANAGED) == PVO_MANAGED && (oldlo & LPTE_PP) != LPTE_BR && !(prot && VM_PROT_WRITE)) { - struct vm_page *pg; - - pg = PHYS_TO_VM_PAGE(pvo->pvo_pte.lpte.pte_lo & LPTE_RPGN); if (pg != NULL) { if (pvo->pvo_pte.lpte.pte_lo & LPTE_CHG) vm_page_dirty(pg); @@ -2128,15 +2099,11 @@ moea64_remove(mmu_t mmu, pmap_t pm, vm_o void moea64_remove_all(mmu_t mmu, vm_page_t m) { - struct pvo_head *pvo_head; struct pvo_entry *pvo, *next_pvo; pmap_t pmap; - pvo_head = vm_page_to_pvoh(m); LOCK_TABLE_WR(); - for (pvo = LIST_FIRST(pvo_head); pvo != NULL; pvo = next_pvo) { - next_pvo = LIST_NEXT(pvo, pvo_vlink); - + LIST_FOREACH_SAFE(pvo, vm_page_to_pvoh(m), pvo_vlink, next_pvo) { pmap = pvo->pvo_pmap; PMAP_LOCK(pmap); moea64_pvo_remove(mmu, pvo); @@ -2146,6 +2113,7 @@ moea64_remove_all(mmu_t mmu, vm_page_t m if ((m->aflags & PGA_WRITEABLE) && moea64_is_modified(mmu, m)) vm_page_dirty(m); vm_page_aflag_clear(m, PGA_WRITEABLE); + vm_page_aflag_clear(m, PGA_EXECUTABLE); } /* @@ -2350,6 +2318,7 @@ moea64_pvo_enter(mmu_t mmu, pmap_t pm, u static void moea64_pvo_remove(mmu_t mmu, struct pvo_entry *pvo) { + struct vm_page *pg; uintptr_t pt; PMAP_LOCK_ASSERT(pvo->pvo_pmap, MA_OWNED); @@ -2389,12 +2358,10 @@ moea64_pvo_remove(mmu_t mmu, struct pvo_ /* * Update vm about the REF/CHG bits if the page is managed. */ - if ((pvo->pvo_vaddr & PVO_MANAGED) == PVO_MANAGED && - (pvo->pvo_pte.lpte.pte_lo & LPTE_PP) != LPTE_BR) { - struct vm_page *pg; + pg = PHYS_TO_VM_PAGE(pvo->pvo_pte.lpte.pte_lo & LPTE_RPGN); - pg = PHYS_TO_VM_PAGE(pvo->pvo_pte.lpte.pte_lo & LPTE_RPGN); - if (pg != NULL) { + if ((pvo->pvo_vaddr & PVO_MANAGED) == PVO_MANAGED && pg != NULL) { + if ((pvo->pvo_pte.lpte.pte_lo & LPTE_PP) != LPTE_BR) { if (pvo->pvo_pte.lpte.pte_lo & LPTE_CHG) vm_page_dirty(pg); if (pvo->pvo_pte.lpte.pte_lo & LPTE_REF) @@ -2402,6 +2369,8 @@ moea64_pvo_remove(mmu_t mmu, struct pvo_ if (LIST_EMPTY(vm_page_to_pvoh(pg))) vm_page_aflag_clear(pg, PGA_WRITEABLE); } + if (LIST_EMPTY(vm_page_to_pvoh(pg))) + vm_page_aflag_clear(pg, PGA_EXECUTABLE); } moea64_pvo_entries--; Modified: stable/9/sys/powerpc/aim/moea64_native.c ============================================================================== --- stable/9/sys/powerpc/aim/moea64_native.c Fri Apr 20 00:34:15 2012 (r234475) +++ stable/9/sys/powerpc/aim/moea64_native.c Fri Apr 20 00:45:23 2012 (r234476) @@ -153,13 +153,10 @@ TLBIE(uint64_t vpn) { vpn &= ~(0xffffULL << 48); #ifdef __powerpc64__ - sched_pin(); - __asm __volatile("ptesync"); mtx_lock(&tlbie_mutex); __asm __volatile("tlbie %0" :: "r"(vpn) : "memory"); mtx_unlock(&tlbie_mutex); __asm __volatile("eieio; tlbsync; ptesync"); - sched_unpin(); #else vpn_hi = (uint32_t)(vpn >> 32); vpn_lo = (uint32_t)vpn; @@ -171,7 +168,6 @@ TLBIE(uint64_t vpn) { mr %1, %0; \ insrdi %1,%5,1,0; \ mtmsrd %1; isync; \ - ptesync; \ \ sld %1,%2,%4; \ or %1,%1,%3; \ @@ -265,7 +261,9 @@ moea64_pte_clear_native(mmu_t mmu, uintp * As shown in Section 7.6.3.2.3 */ pt->pte_lo &= ~ptebit; + sched_pin(); TLBIE(vpn); + sched_unpin(); } static void @@ -295,21 +293,16 @@ moea64_pte_unset_native(mmu_t mmu, uintp { struct lpte *pt = (struct lpte *)pt_cookie; - pvo_pt->pte_hi &= ~LPTE_VALID; - - /* Finish all pending operations */ - isync(); - - /* - * Force the reg & chg bits back into the PTEs. - */ - SYNC(); - /* * Invalidate the pte. */ + isync(); + sched_pin(); + pvo_pt->pte_hi &= ~LPTE_VALID; pt->pte_hi &= ~LPTE_VALID; + PTESYNC(); TLBIE(vpn); + sched_unpin(); /* * Save the reg & chg bits. Modified: stable/9/sys/vm/vm_page.h ============================================================================== --- stable/9/sys/vm/vm_page.h Fri Apr 20 00:34:15 2012 (r234475) +++ stable/9/sys/vm/vm_page.h Fri Apr 20 00:45:23 2012 (r234476) @@ -248,9 +248,13 @@ extern struct vpglocks pa_lock[]; * * PGA_WRITEABLE is set exclusively on managed pages by pmap_enter(). When it * does so, the page must be VPO_BUSY. + * + * PGA_EXECUTABLE may be set by pmap routines, and indicates that a page has + * at least one executable mapping. It is not consumed by the VM layer. */ #define PGA_WRITEABLE 0x01 /* page may be mapped writeable */ #define PGA_REFERENCED 0x02 /* page has been referenced */ +#define PGA_EXECUTABLE 0x04 /* page may be mapped executable */ /* * Page flags. If changed at any other time than page allocation or From owner-svn-src-stable-9@FreeBSD.ORG Fri Apr 20 13:47:23 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F1D1A106566B; Fri, 20 Apr 2012 13:47:22 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C1F048FC16; Fri, 20 Apr 2012 13:47:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q3KDlMgB041673; Fri, 20 Apr 2012 13:47:22 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q3KDlM9A041670; Fri, 20 Apr 2012 13:47:22 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201204201347.q3KDlM9A041670@svn.freebsd.org> From: Marius Strobl Date: Fri, 20 Apr 2012 13:47:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r234490 - in stable/9/sys: i386/conf kern sparc64/sparc64 X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Apr 2012 13:47:23 -0000 Author: marius Date: Fri Apr 20 13:47:22 2012 New Revision: 234490 URL: http://svn.freebsd.org/changeset/base/234490 Log: MFC: r234247 Merge from x86: r233961: Fix interrupt load balancing regression, introduced in revision 222813, that left all un-pinned interrupts assigned to CPU 0. In intr_shuffle_irqs(), remove CPU_SETOF() call that initialized the "intr_cpus" cpuset to only contain CPU0. This initialization is too late and nullifies the results of calls to the intr_add_cpu() that occur much earlier in the boot process. r234074 (partial): The BSP is not added to the mask of valid target CPUs for interrupts. Fix this by adding the BSP as an interrupt target directly in r234105: Fix !SMP build after r234074. Modified: stable/9/sys/sparc64/sparc64/intr_machdep.c stable/9/sys/sparc64/sparc64/machdep.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) stable/9/sys/fs/ (props changed) stable/9/sys/fs/ntfs/ (props changed) stable/9/sys/i386/conf/XENHVM (props changed) stable/9/sys/kern/subr_witness.c (props changed) Modified: stable/9/sys/sparc64/sparc64/intr_machdep.c ============================================================================== --- stable/9/sys/sparc64/sparc64/intr_machdep.c Fri Apr 20 10:08:30 2012 (r234489) +++ stable/9/sys/sparc64/sparc64/intr_machdep.c Fri Apr 20 13:47:22 2012 (r234490) @@ -528,9 +528,6 @@ intr_shuffle_irqs(void *arg __unused) struct intr_vector *iv; int i; - /* The BSP is always a valid target. */ - CPU_SETOF(0, &intr_cpus); - /* Don't bother on UP. */ if (mp_ncpus == 1) return; Modified: stable/9/sys/sparc64/sparc64/machdep.c ============================================================================== --- stable/9/sys/sparc64/sparc64/machdep.c Fri Apr 20 10:08:30 2012 (r234489) +++ stable/9/sys/sparc64/sparc64/machdep.c Fri Apr 20 13:47:22 2012 (r234490) @@ -196,6 +196,13 @@ cpu_startup(void *arg) printf("machine: %s\n", sparc64_model); cpu_identify(rdpr(ver), PCPU_GET(clock), curcpu); + +#ifdef SMP + /* + * Add BSP as an interrupt target. + */ + intr_add_cpu(0); +#endif } void From owner-svn-src-stable-9@FreeBSD.ORG Fri Apr 20 16:20:17 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 74B1C106564A; Fri, 20 Apr 2012 16:20:17 +0000 (UTC) (envelope-from gnn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5EBA38FC0C; Fri, 20 Apr 2012 16:20:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q3KGKHqu046637; Fri, 20 Apr 2012 16:20:17 GMT (envelope-from gnn@svn.freebsd.org) Received: (from gnn@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q3KGKHpc046635; Fri, 20 Apr 2012 16:20:17 GMT (envelope-from gnn@svn.freebsd.org) Message-Id: <201204201620.q3KGKHpc046635@svn.freebsd.org> From: "George V. Neville-Neil" Date: Fri, 20 Apr 2012 16:20:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r234497 - stable/9/cddl/contrib/opensolaris/lib/libdtrace/common X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Apr 2012 16:20:17 -0000 Author: gnn Date: Fri Apr 20 16:20:16 2012 New Revision: 234497 URL: http://svn.freebsd.org/changeset/base/234497 Log: MFC: 234234 Change SIGUSR1 to SIGTHR to properly wake up a process that is being traced. The use of SIGUSR1 caused traced processes (those attached to with dtrace -p) to exit when dtrace exited. Modified: stable/9/cddl/contrib/opensolaris/lib/libdtrace/common/dt_proc.c Directory Properties: stable/9/cddl/contrib/opensolaris/ (props changed) Modified: stable/9/cddl/contrib/opensolaris/lib/libdtrace/common/dt_proc.c ============================================================================== --- stable/9/cddl/contrib/opensolaris/lib/libdtrace/common/dt_proc.c Fri Apr 20 16:09:28 2012 (r234496) +++ stable/9/cddl/contrib/opensolaris/lib/libdtrace/common/dt_proc.c Fri Apr 20 16:20:16 2012 (r234497) @@ -811,7 +811,7 @@ dt_proc_destroy(dtrace_hdl_t *dtp, struc #if defined(sun) (void) _lwp_kill(dpr->dpr_tid, SIGCANCEL); #else - pthread_kill(dpr->dpr_tid, SIGUSR1); + pthread_kill(dpr->dpr_tid, SIGTHR); #endif /* From owner-svn-src-stable-9@FreeBSD.ORG Fri Apr 20 21:40:32 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 9CBAC1065673; Fri, 20 Apr 2012 21:40:32 +0000 (UTC) (envelope-from davide@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7B8208FC16; Fri, 20 Apr 2012 21:40:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q3KLeWSO056653; Fri, 20 Apr 2012 21:40:32 GMT (envelope-from davide@svn.freebsd.org) Received: (from davide@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q3KLeWpm056649; Fri, 20 Apr 2012 21:40:32 GMT (envelope-from davide@svn.freebsd.org) Message-Id: <201204202140.q3KLeWpm056649@svn.freebsd.org> From: Davide Italiano Date: Fri, 20 Apr 2012 21:40:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r234505 - in stable/9/sys: conf kern X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Apr 2012 21:40:32 -0000 Author: davide Date: Fri Apr 20 21:40:31 2012 New Revision: 234505 URL: http://svn.freebsd.org/changeset/base/234505 Log: MFC: r233045, r234302 r233045: Add rudimentary profiling of the hash table used in the umtx code to hold active lock queues. r234302: Fix some style bugs introduced in a previous commit (r233045) Approved by: gnn (mentor) Modified: stable/9/sys/conf/NOTES stable/9/sys/conf/options stable/9/sys/kern/kern_umtx.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/conf/ (props changed) Modified: stable/9/sys/conf/NOTES ============================================================================== --- stable/9/sys/conf/NOTES Fri Apr 20 21:37:42 2012 (r234504) +++ stable/9/sys/conf/NOTES Fri Apr 20 21:40:31 2012 (r234505) @@ -275,6 +275,8 @@ options SX_NOINLINE # frequency. # TURNSTILE_PROFILING enables rudimentary profiling of the hash table # used to hold active lock queues. +# UMTX_PROFILING enables rudimentary profiling of the hash table used + to hold active lock queues. # WITNESS enables the witness code which detects deadlocks and cycles # during locking operations. # WITNESS_KDB causes the witness code to drop into the kernel debugger if @@ -298,8 +300,9 @@ options MPROF_HASH_SIZE="1543" # Profiling for internal hash tables. options SLEEPQUEUE_PROFILING options TURNSTILE_PROFILING +options UMTX_PROFILING + - ##################################################################### # COMPATIBILITY OPTIONS Modified: stable/9/sys/conf/options ============================================================================== --- stable/9/sys/conf/options Fri Apr 20 21:37:42 2012 (r234504) +++ stable/9/sys/conf/options Fri Apr 20 21:40:31 2012 (r234505) @@ -184,6 +184,7 @@ SYSVSEM opt_sysvipc.h SYSVSHM opt_sysvipc.h SW_WATCHDOG opt_watchdog.h TURNSTILE_PROFILING +UMTX_PROFILING VFS_AIO VERBOSE_SYSINIT opt_global.h WLCACHE opt_wavelan.h Modified: stable/9/sys/kern/kern_umtx.c ============================================================================== --- stable/9/sys/kern/kern_umtx.c Fri Apr 20 21:37:42 2012 (r234504) +++ stable/9/sys/kern/kern_umtx.c Fri Apr 20 21:40:31 2012 (r234505) @@ -29,6 +29,8 @@ __FBSDID("$FreeBSD$"); #include "opt_compat.h" +#include "opt_umtx_profiling.h" + #include #include #include @@ -154,6 +156,10 @@ struct umtxq_chain { /* All PI in the list */ TAILQ_HEAD(,umtx_pi) uc_pi_list; +#ifdef UMTX_PROFILING + int length; + int max_length; +#endif }; #define UMTXQ_LOCKED_ASSERT(uc) mtx_assert(&(uc)->uc_lock, MA_OWNED) @@ -190,6 +196,12 @@ SYSCTL_NODE(_debug, OID_AUTO, umtx, CTLF SYSCTL_INT(_debug_umtx, OID_AUTO, umtx_pi_allocated, CTLFLAG_RD, &umtx_pi_allocated, 0, "Allocated umtx_pi"); +#ifdef UMTX_PROFILING +static long max_length; +SYSCTL_LONG(_debug_umtx, OID_AUTO, max_length, CTLFLAG_RD, &max_length, 0, "max_length"); +static SYSCTL_NODE(_debug_umtx, OID_AUTO, chains, CTLFLAG_RD, 0, "umtx chain stats"); +#endif + static void umtxq_sysinit(void *); static void umtxq_hash(struct umtx_key *key); static struct umtxq_chain *umtxq_getchain(struct umtx_key *key); @@ -215,6 +227,27 @@ SYSINIT(umtx, SI_SUB_EVENTHANDLER+1, SI_ static struct mtx umtx_lock; +#ifdef UMTX_PROFILING +static void +umtx_init_profiling(void) +{ + struct sysctl_oid *chain_oid; + char chain_name[10]; + int i; + + for (i = 0; i < UMTX_CHAINS; ++i) { + snprintf(chain_name, sizeof(chain_name), "%d", i); + chain_oid = SYSCTL_ADD_NODE(NULL, + SYSCTL_STATIC_CHILDREN(_debug_umtx_chains), OID_AUTO, + chain_name, CTLFLAG_RD, NULL, "umtx hash stats"); + SYSCTL_ADD_INT(NULL, SYSCTL_CHILDREN(chain_oid), OID_AUTO, + "max_length0", CTLFLAG_RD, &umtxq_chains[0][i].max_length, 0, NULL); + SYSCTL_ADD_INT(NULL, SYSCTL_CHILDREN(chain_oid), OID_AUTO, + "max_length1", CTLFLAG_RD, &umtxq_chains[1][i].max_length, 0, NULL); + } +} +#endif + static void umtxq_sysinit(void *arg __unused) { @@ -232,8 +265,15 @@ umtxq_sysinit(void *arg __unused) TAILQ_INIT(&umtxq_chains[i][j].uc_pi_list); umtxq_chains[i][j].uc_busy = 0; umtxq_chains[i][j].uc_waiters = 0; +#ifdef UMTX_PROFILING + umtxq_chains[i][j].length = 0; + umtxq_chains[i][j].max_length = 0; +#endif } } +#ifdef UMTX_PROFILING + umtx_init_profiling(); +#endif mtx_init(&umtx_lock, "umtx lock", NULL, MTX_SPIN); EVENTHANDLER_REGISTER(process_exec, umtx_exec_hook, NULL, EVENTHANDLER_PRI_ANY); @@ -384,6 +424,14 @@ umtxq_insert_queue(struct umtx_q *uq, in TAILQ_INSERT_TAIL(&uh->head, uq, uq_link); uh->length++; +#ifdef UMTX_PROFILING + uc->length++; + if (uc->length > uc->max_length) { + uc->max_length = uc->length; + if (uc->max_length > max_length) + max_length = uc->max_length; + } +#endif uq->uq_flags |= UQF_UMTXQ; uq->uq_cur_queue = uh; return; @@ -401,6 +449,9 @@ umtxq_remove_queue(struct umtx_q *uq, in uh = uq->uq_cur_queue; TAILQ_REMOVE(&uh->head, uq, uq_link); uh->length--; +#ifdef UMTX_PROFILING + uc->length--; +#endif uq->uq_flags &= ~UQF_UMTXQ; if (TAILQ_EMPTY(&uh->head)) { KASSERT(uh->length == 0, From owner-svn-src-stable-9@FreeBSD.ORG Fri Apr 20 22:14:27 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 9541D106564A; Fri, 20 Apr 2012 22:14:27 +0000 (UTC) (envelope-from rmh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 662208FC12; Fri, 20 Apr 2012 22:14:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q3KMERZ7058062; Fri, 20 Apr 2012 22:14:27 GMT (envelope-from rmh@svn.freebsd.org) Received: (from rmh@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q3KMERvu058060; Fri, 20 Apr 2012 22:14:27 GMT (envelope-from rmh@svn.freebsd.org) Message-Id: <201204202214.q3KMERvu058060@svn.freebsd.org> From: Robert Millan Date: Fri, 20 Apr 2012 22:14:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r234511 - in stable/9/sys: fs/tmpfs i386/conf kern X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Apr 2012 22:14:27 -0000 Author: rmh Date: Fri Apr 20 22:14:26 2012 New Revision: 234511 URL: http://svn.freebsd.org/changeset/base/234511 Log: MFC of r227310: Don astbestos garment and remove the warning about TMPFS being experimental -- highly experimental even. So far the closest to a bug in TMPFS that people have gotten to relates to how ZFS can take away from the memory that TMPFS needs. One can argue that such is not a bug in TMPFS. Irrespective, even if there is a bug here and there in TMPFS, it's not in our own advantage to scare people away from using TMPFS. I for one have been using it, even with ZFS, very successfully. Reviewed by: marcel Modified: stable/9/sys/fs/tmpfs/tmpfs_vfsops.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) stable/9/sys/fs/ (props changed) stable/9/sys/fs/ntfs/ (props changed) stable/9/sys/i386/conf/XENHVM (props changed) stable/9/sys/kern/subr_witness.c (props changed) Modified: stable/9/sys/fs/tmpfs/tmpfs_vfsops.c ============================================================================== --- stable/9/sys/fs/tmpfs/tmpfs_vfsops.c Fri Apr 20 22:07:21 2012 (r234510) +++ stable/9/sys/fs/tmpfs/tmpfs_vfsops.c Fri Apr 20 22:14:26 2012 (r234511) @@ -156,9 +156,6 @@ tmpfs_mount(struct mount *mp) return EOPNOTSUPP; } - printf("WARNING: TMPFS is considered to be a highly experimental " - "feature in FreeBSD.\n"); - vn_lock(mp->mnt_vnodecovered, LK_SHARED | LK_RETRY); error = VOP_GETATTR(mp->mnt_vnodecovered, &va, mp->mnt_cred); VOP_UNLOCK(mp->mnt_vnodecovered, 0); From owner-svn-src-stable-9@FreeBSD.ORG Fri Apr 20 22:43:04 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C179B106564A; Fri, 20 Apr 2012 22:43:04 +0000 (UTC) (envelope-from davide@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AB28C8FC0A; Fri, 20 Apr 2012 22:43:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q3KMh4H5059160; Fri, 20 Apr 2012 22:43:04 GMT (envelope-from davide@svn.freebsd.org) Received: (from davide@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q3KMh4ua059158; Fri, 20 Apr 2012 22:43:04 GMT (envelope-from davide@svn.freebsd.org) Message-Id: <201204202243.q3KMh4ua059158@svn.freebsd.org> From: Davide Italiano Date: Fri, 20 Apr 2012 22:43:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r234514 - stable/9/sys/kern X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Apr 2012 22:43:04 -0000 Author: davide Date: Fri Apr 20 22:43:04 2012 New Revision: 234514 URL: http://svn.freebsd.org/changeset/base/234514 Log: MFC: r234303 Fix a typo. Approved by: gnn (mentor) Modified: stable/9/sys/kern/subr_turnstile.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/kern/subr_turnstile.c ============================================================================== --- stable/9/sys/kern/subr_turnstile.c Fri Apr 20 22:27:10 2012 (r234513) +++ stable/9/sys/kern/subr_turnstile.c Fri Apr 20 22:43:04 2012 (r234514) @@ -142,7 +142,7 @@ SYSCTL_NODE(_debug, OID_AUTO, turnstile, SYSCTL_NODE(_debug_turnstile, OID_AUTO, chains, CTLFLAG_RD, 0, "turnstile chain stats"); SYSCTL_UINT(_debug_turnstile, OID_AUTO, max_depth, CTLFLAG_RD, - &turnstile_max_depth, 0, "maxmimum depth achieved of a single chain"); + &turnstile_max_depth, 0, "maximum depth achieved of a single chain"); #endif static struct mtx td_contested_lock; static struct turnstile_chain turnstile_chains[TC_TABLESIZE]; From owner-svn-src-stable-9@FreeBSD.ORG Sat Apr 21 00:26:04 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 71269106566B; Sat, 21 Apr 2012 00:26:04 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 508808FC15; Sat, 21 Apr 2012 00:26:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q3L0Q4iV062733; Sat, 21 Apr 2012 00:26:04 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q3L0Q4QJ062725; Sat, 21 Apr 2012 00:26:04 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201204210026.q3L0Q4QJ062725@svn.freebsd.org> From: Nathan Whitehorn Date: Sat, 21 Apr 2012 00:26:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r234520 - in stable/9: lib/libc/powerpc/gen lib/libc/powerpc64/gen sys/powerpc/powerpc X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Apr 2012 00:26:04 -0000 Author: nwhitehorn Date: Sat Apr 21 00:26:03 2012 New Revision: 234520 URL: http://svn.freebsd.org/changeset/base/234520 Log: MFC r234115: Do not restore the register holding the TLS pointer when doing various usermode context switches (long jumps and ucontext operations). If these are used across threads, multiple threads can end up with the same TLS base. Madness will then result. This makes behavior on PPC match that on x86 systems and on Linux. Modified: stable/9/lib/libc/powerpc/gen/_setjmp.S stable/9/lib/libc/powerpc/gen/setjmp.S stable/9/lib/libc/powerpc/gen/sigsetjmp.S stable/9/lib/libc/powerpc64/gen/_setjmp.S stable/9/lib/libc/powerpc64/gen/setjmp.S stable/9/lib/libc/powerpc64/gen/sigsetjmp.S stable/9/sys/powerpc/powerpc/exec_machdep.c Directory Properties: stable/9/lib/libc/ (props changed) stable/9/sys/ (props changed) Modified: stable/9/lib/libc/powerpc/gen/_setjmp.S ============================================================================== --- stable/9/lib/libc/powerpc/gen/_setjmp.S Fri Apr 20 23:40:43 2012 (r234519) +++ stable/9/lib/libc/powerpc/gen/_setjmp.S Sat Apr 21 00:26:03 2012 (r234520) @@ -63,7 +63,6 @@ ENTRY(_longjmp) lmw %r9,20(%r3) mtlr %r11 mtcr %r12 - mr %r2,%r9 mr %r1,%r10 or. %r3,%r4,%r4 bnelr Modified: stable/9/lib/libc/powerpc/gen/setjmp.S ============================================================================== --- stable/9/lib/libc/powerpc/gen/setjmp.S Fri Apr 20 23:40:43 2012 (r234519) +++ stable/9/lib/libc/powerpc/gen/setjmp.S Sat Apr 21 00:26:03 2012 (r234520) @@ -76,7 +76,6 @@ ENTRY(__longjmp) mr %r6,%r4 /* save val param */ mtlr %r11 /* r11 -> link reg */ mtcr %r12 /* r12 -> condition reg */ - mr %r2,%r9 /* r9 -> global ptr */ mr %r1,%r10 /* r10 -> stackptr */ mr %r4,%r3 li %r3,3 /* SIG_SETMASK */ Modified: stable/9/lib/libc/powerpc/gen/sigsetjmp.S ============================================================================== --- stable/9/lib/libc/powerpc/gen/sigsetjmp.S Fri Apr 20 23:40:43 2012 (r234519) +++ stable/9/lib/libc/powerpc/gen/sigsetjmp.S Sat Apr 21 00:26:03 2012 (r234520) @@ -80,7 +80,6 @@ ENTRY(siglongjmp) mr %r6,%r4 mtlr %r11 mtcr %r12 - mr %r2,%r9 mr %r1,%r10 or. %r7,%r7,%r7 beq 1f Modified: stable/9/lib/libc/powerpc64/gen/_setjmp.S ============================================================================== --- stable/9/lib/libc/powerpc64/gen/_setjmp.S Fri Apr 20 23:40:43 2012 (r234519) +++ stable/9/lib/libc/powerpc64/gen/_setjmp.S Sat Apr 21 00:26:03 2012 (r234520) @@ -86,7 +86,6 @@ ENTRY(_longjmp) ld %r10,40 + 1*8(%r3) ld %r11,40 + 2*8(%r3) ld %r12,40 + 3*8(%r3) - ld %r13,40 + 4*8(%r3) ld %r14,40 + 5*8(%r3) ld %r15,40 + 6*8(%r3) ld %r16,40 + 7*8(%r3) Modified: stable/9/lib/libc/powerpc64/gen/setjmp.S ============================================================================== --- stable/9/lib/libc/powerpc64/gen/setjmp.S Fri Apr 20 23:40:43 2012 (r234519) +++ stable/9/lib/libc/powerpc64/gen/setjmp.S Sat Apr 21 00:26:03 2012 (r234520) @@ -102,7 +102,6 @@ ENTRY(__longjmp) ld %r10,40 + 1*8(%r3) ld %r11,40 + 2*8(%r3) ld %r12,40 + 3*8(%r3) - ld %r13,40 + 4*8(%r3) ld %r14,40 + 5*8(%r3) ld %r15,40 + 6*8(%r3) ld %r16,40 + 7*8(%r3) Modified: stable/9/lib/libc/powerpc64/gen/sigsetjmp.S ============================================================================== --- stable/9/lib/libc/powerpc64/gen/sigsetjmp.S Fri Apr 20 23:40:43 2012 (r234519) +++ stable/9/lib/libc/powerpc64/gen/sigsetjmp.S Sat Apr 21 00:26:03 2012 (r234520) @@ -103,7 +103,6 @@ ENTRY(siglongjmp) ld %r10,40 + 1*8(%r3) ld %r11,40 + 2*8(%r3) ld %r12,40 + 3*8(%r3) - ld %r13,40 + 4*8(%r3) ld %r14,40 + 5*8(%r3) ld %r15,40 + 6*8(%r3) ld %r16,40 + 7*8(%r3) Modified: stable/9/sys/powerpc/powerpc/exec_machdep.c ============================================================================== --- stable/9/sys/powerpc/powerpc/exec_machdep.c Fri Apr 20 23:40:43 2012 (r234519) +++ stable/9/sys/powerpc/powerpc/exec_machdep.c Sat Apr 21 00:26:03 2012 (r234520) @@ -441,6 +441,7 @@ set_mcontext(struct thread *td, const mc { struct pcb *pcb; struct trapframe *tf; + register_t tls; pcb = td->td_pcb; tf = td->td_frame; @@ -448,16 +449,25 @@ set_mcontext(struct thread *td, const mc if (mcp->mc_vers != _MC_VERSION || mcp->mc_len != sizeof(*mcp)) return (EINVAL); - #ifdef AIM +#ifdef AIM /* * Don't let the user set privileged MSR bits */ if ((mcp->mc_srr1 & PSL_USERSTATIC) != (tf->srr1 & PSL_USERSTATIC)) { return (EINVAL); } - #endif +#endif + /* Copy trapframe, preserving TLS pointer across context change */ + if (SV_PROC_FLAG(td->td_proc, SV_LP64)) + tls = tf->fixreg[13]; + else + tls = tf->fixreg[2]; memcpy(tf, mcp->mc_frame, sizeof(mcp->mc_frame)); + if (SV_PROC_FLAG(td->td_proc, SV_LP64)) + tf->fixreg[13] = tls; + else + tf->fixreg[2] = tls; #ifdef AIM if (mcp->mc_flags & _MC_FP_VALID) { From owner-svn-src-stable-9@FreeBSD.ORG Sat Apr 21 07:00:40 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 32A76106581B; Sat, 21 Apr 2012 07:00:40 +0000 (UTC) (envelope-from das@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0521C8FC18; Sat, 21 Apr 2012 07:00:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q3L70dfI076289; Sat, 21 Apr 2012 07:00:39 GMT (envelope-from das@svn.freebsd.org) Received: (from das@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q3L70dNW076285; Sat, 21 Apr 2012 07:00:39 GMT (envelope-from das@svn.freebsd.org) Message-Id: <201204210700.q3L70dNW076285@svn.freebsd.org> From: David Schultz Date: Sat, 21 Apr 2012 07:00:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r234535 - stable/9/lib/msun/src X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Apr 2012 07:00:40 -0000 Author: das Date: Sat Apr 21 07:00:39 2012 New Revision: 234535 URL: http://svn.freebsd.org/changeset/base/234535 Log: MFC r233973: Fix bugs in remquo{,f,l}. Modified: stable/9/lib/msun/src/s_remquo.c stable/9/lib/msun/src/s_remquof.c stable/9/lib/msun/src/s_remquol.c Directory Properties: stable/9/lib/msun/ (props changed) Modified: stable/9/lib/msun/src/s_remquo.c ============================================================================== --- stable/9/lib/msun/src/s_remquo.c Sat Apr 21 07:00:00 2012 (r234534) +++ stable/9/lib/msun/src/s_remquo.c Sat Apr 21 07:00:39 2012 (r234535) @@ -51,7 +51,7 @@ remquo(double x, double y, int *quo) goto fixup; /* |x|<|y| return x or x-y */ } if(lx==ly) { - *quo = 1; + *quo = (sxy ? -1 : 1); return Zero[(u_int32_t)sx>>31]; /* |x|=|y| return x*0*/ } } @@ -114,6 +114,7 @@ remquo(double x, double y, int *quo) /* convert back to floating value and restore the sign */ if((hx|lx)==0) { /* return sign(x)*0 */ + q &= 0x7fffffff; *quo = (sxy ? -q : q); return Zero[(u_int32_t)sx>>31]; } @@ -129,9 +130,9 @@ remquo(double x, double y, int *quo) lx = (lx>>n)|((u_int32_t)hx<<(32-n)); hx >>= n; } else if (n<=31) { - lx = (hx<<(32-n))|(lx>>n); hx = sx; + lx = (hx<<(32-n))|(lx>>n); hx = 0; } else { - lx = hx>>(n-32); hx = sx; + lx = hx>>(n-32); hx = 0; } } fixup: Modified: stable/9/lib/msun/src/s_remquof.c ============================================================================== --- stable/9/lib/msun/src/s_remquof.c Sat Apr 21 07:00:00 2012 (r234534) +++ stable/9/lib/msun/src/s_remquof.c Sat Apr 21 07:00:39 2012 (r234535) @@ -46,7 +46,7 @@ remquof(float x, float y, int *quo) q = 0; goto fixup; /* |x|<|y| return x or x-y */ } else if(hx==hy) { - *quo = 1; + *quo = (sxy ? -1 : 1); return Zero[(u_int32_t)sx>>31]; /* |x|=|y| return x*0*/ } @@ -88,6 +88,7 @@ remquof(float x, float y, int *quo) /* convert back to floating value and restore the sign */ if(hx==0) { /* return sign(x)*0 */ + q &= 0x7fffffff; *quo = (sxy ? -q : q); return Zero[(u_int32_t)sx>>31]; } Modified: stable/9/lib/msun/src/s_remquol.c ============================================================================== --- stable/9/lib/msun/src/s_remquol.c Sat Apr 21 07:00:00 2012 (r234534) +++ stable/9/lib/msun/src/s_remquol.c Sat Apr 21 07:00:39 2012 (r234535) @@ -96,7 +96,7 @@ remquol(long double x, long double y, in goto fixup; /* |x|<|y| return x or x-y */ } if(ux.bits.manh==uy.bits.manh && ux.bits.manl==uy.bits.manl) { - *quo = 1; + *quo = (sxy ? -1 : 1); return Zero[sx]; /* |x|=|y| return x*0*/ } } @@ -138,6 +138,7 @@ remquol(long double x, long double y, in /* convert back to floating value and restore the sign */ if((hx|lx)==0) { /* return sign(x)*0 */ + q &= 0x7fffffff; *quo = (sxy ? -q : q); return Zero[sx]; } From owner-svn-src-stable-9@FreeBSD.ORG Sat Apr 21 18:12:25 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 179DD1065670; Sat, 21 Apr 2012 18:12:25 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 026F18FC12; Sat, 21 Apr 2012 18:12:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q3LICO7e099111; Sat, 21 Apr 2012 18:12:24 GMT (envelope-from melifaro@svn.freebsd.org) Received: (from melifaro@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q3LICOSb099109; Sat, 21 Apr 2012 18:12:24 GMT (envelope-from melifaro@svn.freebsd.org) Message-Id: <201204211812.q3LICOSb099109@svn.freebsd.org> From: "Alexander V. Chernikov" Date: Sat, 21 Apr 2012 18:12:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r234552 - stable/9/share/man/man4 X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Apr 2012 18:12:25 -0000 Author: melifaro Date: Sat Apr 21 18:12:24 2012 New Revision: 234552 URL: http://svn.freebsd.org/changeset/base/234552 Log: MFC r229930 Add setsockopt(2) example to ng_ksocket(4). While here, fix formatting a bit Approved by: ae(mentor) Modified: stable/9/share/man/man4/ng_ksocket.4 Directory Properties: stable/9/share/man/man4/ (props changed) Modified: stable/9/share/man/man4/ng_ksocket.4 ============================================================================== --- stable/9/share/man/man4/ng_ksocket.4 Sat Apr 21 17:49:23 2012 (r234551) +++ stable/9/share/man/man4/ng_ksocket.4 Sat Apr 21 18:12:24 2012 (r234552) @@ -34,7 +34,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 28, 2005 +.Dd January 09, 2012 .Dt NG_KSOCKET 4 .Os .Sh NAME @@ -199,7 +199,7 @@ For the address is the pathname as a doubly quoted string. .Pp Examples: -.Bl -tag -width XXXXXXXXXX +.Bl -tag -width "PF_LOCAL" .It Dv PF_LOCAL local/"/tmp/foo.socket" .It Dv PF_INET @@ -215,6 +215,12 @@ the normal form for that structure is used. In the future, more convenient encoding of the more common socket options may be supported. +.Pp +Setting socket options example: +.Bl -tag -width "PF_LOCAL" +.It Set FIB 2 for a socket (SOL_SOCKET, SO_SETFIB): +.Dv "setopt \&{ level=0xffff name=0x1014 data=[ 2 ] \&}" +.El .Sh SHUTDOWN This node shuts down upon receipt of a .Dv NGM_SHUTDOWN From owner-svn-src-stable-9@FreeBSD.ORG Sat Apr 21 19:22:54 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 3E4051065677; Sat, 21 Apr 2012 19:22:54 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2865A8FC14; Sat, 21 Apr 2012 19:22:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q3LJMs5f001692; Sat, 21 Apr 2012 19:22:54 GMT (envelope-from melifaro@svn.freebsd.org) Received: (from melifaro@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q3LJMrDb001687; Sat, 21 Apr 2012 19:22:53 GMT (envelope-from melifaro@svn.freebsd.org) Message-Id: <201204211922.q3LJMrDb001687@svn.freebsd.org> From: "Alexander V. Chernikov" Date: Sat, 21 Apr 2012 19:22:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r234557 - in stable/9/sys: modules/netgraph/netflow netgraph/netflow X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Apr 2012 19:22:54 -0000 Author: melifaro Date: Sat Apr 21 19:22:53 2012 New Revision: 234557 URL: http://svn.freebsd.org/changeset/base/234557 Log: MFC r232921: Use rt_numfibs variable instead of compile-time RT_NUMFIBS. Approved by: kib(mentor) Modified: stable/9/sys/modules/netgraph/netflow/Makefile stable/9/sys/netgraph/netflow/netflow.c stable/9/sys/netgraph/netflow/ng_netflow.c stable/9/sys/netgraph/netflow/ng_netflow.h Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/modules/netgraph/netflow/Makefile ============================================================================== --- stable/9/sys/modules/netgraph/netflow/Makefile Sat Apr 21 18:36:53 2012 (r234556) +++ stable/9/sys/modules/netgraph/netflow/Makefile Sat Apr 21 19:22:53 2012 (r234557) @@ -17,8 +17,6 @@ opt_inet6.h: echo "#define INET6 1" > ${.TARGET} .endif -opt_route.h: - echo "#define ROUTETABLES RT_MAXFIBS" > ${.TARGET} .endif .include Modified: stable/9/sys/netgraph/netflow/netflow.c ============================================================================== --- stable/9/sys/netgraph/netflow/netflow.c Sat Apr 21 18:36:53 2012 (r234556) +++ stable/9/sys/netgraph/netflow/netflow.c Sat Apr 21 19:22:53 2012 (r234557) @@ -630,7 +630,7 @@ ng_netflow_cache_flush(priv_p priv) free(priv->hash6, M_NETFLOW_HASH); #endif - for (i = 0; i < RT_NUMFIBS; i++) { + for (i = 0; i < priv->maxfibs; i++) { if ((fe = priv_to_fib(priv, i)) == NULL) continue; Modified: stable/9/sys/netgraph/netflow/ng_netflow.c ============================================================================== --- stable/9/sys/netgraph/netflow/ng_netflow.c Sat Apr 21 18:36:53 2012 (r234556) +++ stable/9/sys/netgraph/netflow/ng_netflow.c Sat Apr 21 19:22:53 2012 (r234557) @@ -225,6 +225,11 @@ ng_netflow_constructor(node_p node) /* Initialize private data */ priv = malloc(sizeof(*priv), M_NETGRAPH, M_WAITOK | M_ZERO); + /* Initialize fib data */ + priv->maxfibs = rt_numfibs; + priv->fib_data = malloc(sizeof(fib_export_p) * priv->maxfibs, + M_NETGRAPH, M_WAITOK | M_ZERO); + /* Make node and its data point at each other */ NG_NODE_SET_PRIVATE(node, priv); priv->node = node; @@ -901,8 +906,10 @@ loopend: /* Check packet FIB */ fib = M_GETFIB(m); - if (fib >= RT_NUMFIBS) { - CTR2(KTR_NET, "ng_netflow_rcvdata(): packet fib %d is out of range of available fibs: 0 .. %d", fib, RT_NUMFIBS); + if (fib >= priv->maxfibs) { + CTR2(KTR_NET, "ng_netflow_rcvdata(): packet fib %d is out of " + "range of available fibs: 0 .. %d", + fib, priv->maxfibs); goto bypass; } @@ -973,6 +980,7 @@ ng_netflow_rmnode(node_p node) NG_NODE_SET_PRIVATE(node, NULL); NG_NODE_UNREF(priv->node); + free(priv->fib_data, M_NETGRAPH); free(priv, M_NETGRAPH); return (0); Modified: stable/9/sys/netgraph/netflow/ng_netflow.h ============================================================================== --- stable/9/sys/netgraph/netflow/ng_netflow.h Sat Apr 21 18:36:53 2012 (r234556) +++ stable/9/sys/netgraph/netflow/ng_netflow.h Sat Apr 21 19:22:53 2012 (r234557) @@ -413,7 +413,8 @@ struct netflow { struct flow_hash_entry *hash6; #endif /* Multiple FIB support */ - fib_export_p fib_data[RT_NUMFIBS]; /* array of pointers to fib-specific data */ + fib_export_p *fib_data; /* array of pointers to per-fib data */ + uint16_t maxfibs; /* number of allocated fibs */ /* * RFC 3954 clause 7.3 From owner-svn-src-stable-9@FreeBSD.ORG Sat Apr 21 20:10:26 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9B9271065670; Sat, 21 Apr 2012 20:10:26 +0000 (UTC) (envelope-from raj@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 837378FC0A; Sat, 21 Apr 2012 20:10:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q3LKAQNd003295; Sat, 21 Apr 2012 20:10:26 GMT (envelope-from raj@svn.freebsd.org) Received: (from raj@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q3LKAQgK003292; Sat, 21 Apr 2012 20:10:26 GMT (envelope-from raj@svn.freebsd.org) Message-Id: <201204212010.q3LKAQgK003292@svn.freebsd.org> From: Rafal Jaworowski Date: Sat, 21 Apr 2012 20:10:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r234558 - in stable/9/sys: boot/fdt boot/uboot/common i386/conf kern X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Apr 2012 20:10:26 -0000 Author: raj Date: Sat Apr 21 20:10:26 2012 New Revision: 234558 URL: http://svn.freebsd.org/changeset/base/234558 Log: MFC r233230, r233323: Improve device tree blob (DTB) handling in loader(8). Enable using the statically embedded blob from the kernel, if present. The KLD loaded DTB takes precedence, but they are both recognized and handled in the same way. Improve FDT handling in loader(8) and make it more robust. o Fix buffer overflows when using a long property body in node paths. o Fix loop end condition when iterating through the symbol table. o Better error handling during node modification, better problem reporting. o Eliminate build time warnings. Submitted by: Lukasz Wojcik Obtained from: Semihalf Modified: stable/9/sys/boot/fdt/fdt_loader_cmd.c stable/9/sys/boot/uboot/common/metadata.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) stable/9/sys/fs/ (props changed) stable/9/sys/fs/ntfs/ (props changed) stable/9/sys/i386/conf/XENHVM (props changed) stable/9/sys/kern/subr_witness.c (props changed) Modified: stable/9/sys/boot/fdt/fdt_loader_cmd.c ============================================================================== --- stable/9/sys/boot/fdt/fdt_loader_cmd.c Sat Apr 21 19:22:53 2012 (r234557) +++ stable/9/sys/boot/fdt/fdt_loader_cmd.c Sat Apr 21 20:10:26 2012 (r234558) @@ -33,6 +33,9 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include +#include #include "bootstrap.h" #include "glue.h" @@ -54,7 +57,9 @@ __FBSDID("$FreeBSD$"); #define STR(number) #number #define STRINGIFY(number) STR(number) -#define MIN(num1, num2) (((num1) < (num2)) ? (num1):(num2)) +#define COPYOUT(s,d,l) archsw.arch_copyout((vm_offset_t)(s), d, l) + +#define FDT_STATIC_DTB_SYMBOL "fdt_static_dtb" static struct fdt_header *fdtp = NULL; @@ -92,6 +97,91 @@ static const struct cmdtab commands[] = static char cwd[FDT_CWD_LEN] = "/"; +static vm_offset_t +fdt_find_static_dtb(void) +{ + Elf_Sym sym; + vm_offset_t dyntab, esym; + uint64_t offs; + struct preloaded_file *kfp; + struct file_metadata *md; + Elf_Sym *symtab; + Elf_Dyn *dyn; + char *strtab, *strp; + int i, sym_count; + + symtab = NULL; + dyntab = esym = 0; + strtab = strp = NULL; + + offs = __elfN(relocation_offset); + + kfp = file_findfile(NULL, NULL); + if (kfp == NULL) + return (0); + + md = file_findmetadata(kfp, MODINFOMD_ESYM); + if (md == NULL) + return (0); + COPYOUT(md->md_data, &esym, sizeof(esym)); + + md = file_findmetadata(kfp, MODINFOMD_DYNAMIC); + if (md == NULL) + return (0); + COPYOUT(md->md_data, &dyntab, sizeof(dyntab)); + + dyntab += offs; + + /* Locate STRTAB and DYNTAB */ + for (dyn = (Elf_Dyn *)dyntab; dyn->d_tag != DT_NULL; dyn++) { + if (dyn->d_tag == DT_STRTAB) { + strtab = (char *)(uintptr_t)(dyn->d_un.d_ptr + offs); + continue; + } else if (dyn->d_tag == DT_SYMTAB) { + symtab = (Elf_Sym *)(uintptr_t) + (dyn->d_un.d_ptr + offs); + continue; + } + } + + if (symtab == NULL || strtab == NULL) { + /* + * No symtab? No strtab? That should not happen here, + * and should have been verified during __elfN(loadimage). + * This must be some kind of a bug. + */ + return (0); + } + + sym_count = (int)((Elf_Sym *)esym - symtab) / sizeof(Elf_Sym); + + /* + * The most efficent way to find a symbol would be to calculate a + * hash, find proper bucket and chain, and thus find a symbol. + * However, that would involve code duplication (e.g. for hash + * function). So we're using simpler and a bit slower way: we're + * iterating through symbols, searching for the one which name is + * 'equal' to 'fdt_static_dtb'. To speed up the process a little bit, + * we are eliminating symbols type of which is not STT_NOTYPE, or(and) + * those which binding attribute is not STB_GLOBAL. + */ + for (i = 0; i < sym_count; i++) { + COPYOUT(symtab + i, &sym, sizeof(sym)); + if (ELF_ST_BIND(sym.st_info) != STB_GLOBAL || + ELF_ST_TYPE(sym.st_info) != STT_NOTYPE) + continue; + + strp = strdupout((vm_offset_t)(strtab + sym.st_name)); + if (strcmp(strp, FDT_STATIC_DTB_SYMBOL) == 0) { + /* Found a match ! */ + free(strp); + return ((vm_offset_t)(sym.st_value + offs)); + } + free(strp); + } + return (0); +} + static int fdt_setup_fdtp() { @@ -103,10 +193,14 @@ fdt_setup_fdtp() */ bfp = file_findfile(NULL, "dtb"); if (bfp == NULL) { - command_errmsg = "no device tree blob loaded"; - return (CMD_ERROR); + if ((fdtp = (struct fdt_header *)fdt_find_static_dtb()) == 0) { + command_errmsg = "no device tree blob found!"; + return (CMD_ERROR); + } + } else { + /* Dynamic blob has precedence over static. */ + fdtp = (struct fdt_header *)bfp->f_addr; } - fdtp = (struct fdt_header *)bfp->f_addr; /* * Validate the blob. @@ -448,7 +542,10 @@ fixup_stdout(const char *env) } } -int +/* + * Locate the blob, fix it up and return its location. + */ +void * fdt_fixup(void) { const char *env; @@ -461,13 +558,10 @@ fdt_fixup(void) ethstr = NULL; len = 0; - if (!fdtp) { - err = fdt_setup_fdtp(); - if (err) { - sprintf(command_errbuf, "Could not perform blob " - "fixups. Error code: %d\n", err); - return (err); - } + err = fdt_setup_fdtp(); + if (err) { + sprintf(command_errbuf, "No valid device tree blob found!"); + return (NULL); } /* Create /chosen node (if not exists) */ @@ -477,7 +571,7 @@ fdt_fixup(void) /* Value assigned to fixup-applied does not matter. */ if (fdt_getprop(fdtp, chosen, "fixup-applied", NULL)) - return (CMD_OK); + goto success; /* Acquire sys_info */ si = ub_get_sys_info(); @@ -521,7 +615,8 @@ fdt_fixup(void) fdt_setprop(fdtp, chosen, "fixup-applied", NULL, 0); - return (CMD_OK); +success: + return (fdtp); } int @@ -539,7 +634,8 @@ command_fdt_internal(int argc, char *arg /* * Check if uboot env vars were parsed already. If not, do it now. */ - fdt_fixup(); + if (fdt_fixup() == NULL) + return (CMD_ERROR); /* * Validate fdt . @@ -560,10 +656,6 @@ command_fdt_internal(int argc, char *arg return (CMD_ERROR); } - if (!fdtp) - if (fdt_setup_fdtp()) - return (CMD_ERROR); - /* * Call command handler. */ @@ -753,32 +845,41 @@ fdt_isprint(const void *data, int len, i static int fdt_data_str(const void *data, int len, int count, char **buf) { - char tmp[80], *b; + char *b, *tmp; const char *d; - int i, l; + int buf_len, i, l; /* * Calculate the length for the string and allocate memory. * - * Note len already includes at least one terminator. + * Note that 'len' already includes at least one terminator. */ - l = len; + buf_len = len; if (count > 1) { /* * Each token had already a terminator buried in 'len', but we * only need one eventually, don't count space for these. */ - l -= count - 1; + buf_len -= count - 1; /* Each consecutive token requires a ", " separator. */ - l += count * 2; + buf_len += count * 2; } - /* Space for surrounding double quotes. */ - l += count * 2; - b = (char *)malloc(l); + /* Add some space for surrounding double quotes. */ + buf_len += count * 2; + + /* Note that string being put in 'tmp' may be as big as 'buf_len'. */ + b = (char *)malloc(buf_len); + tmp = (char *)malloc(buf_len); if (b == NULL) - return (1); + goto error; + + if (tmp == NULL) { + free(b); + goto error; + } + b[0] = '\0'; /* @@ -798,13 +899,17 @@ fdt_data_str(const void *data, int len, } while (i < len); *buf = b; + free(tmp); + return (0); +error: + return (1); } static int fdt_data_cell(const void *data, int len, char **buf) { - char tmp[80], *b; + char *b, *tmp; const uint32_t *c; int count, i, l; @@ -827,8 +932,14 @@ fdt_data_cell(const void *data, int len, l += 3; b = (char *)malloc(l); + tmp = (char *)malloc(l); if (b == NULL) - return (1); + goto error; + + if (tmp == NULL) { + free(b); + goto error; + } b[0] = '\0'; strcat(b, "<"); @@ -842,13 +953,17 @@ fdt_data_cell(const void *data, int len, strcat(b, ">"); *buf = b; + free(tmp); + return (0); +error: + return (1); } static int fdt_data_bytes(const void *data, int len, char **buf) { - char tmp[80], *b; + char *b, *tmp; const char *d; int i, l; @@ -867,8 +982,14 @@ fdt_data_bytes(const void *data, int len l += 3; b = (char *)malloc(l); + tmp = (char *)malloc(l); if (b == NULL) - return (1); + goto error; + + if (tmp == NULL) { + free(b); + goto error; + } b[0] = '\0'; strcat(b, "["); @@ -880,7 +1001,11 @@ fdt_data_bytes(const void *data, int len strcat(b, "]"); *buf = b; + free(tmp); + return (0); +error: + return (1); } static int @@ -1019,6 +1144,14 @@ fdt_modprop(int nodeoff, char *propname, break; } + if (rv != 0) { + if (rv == -FDT_ERR_NOSPACE) + sprintf(command_errbuf, + "Device tree blob is too small!\n"); + else + sprintf(command_errbuf, + "Could not add/modify property!\n"); + } return (rv); } @@ -1261,9 +1394,12 @@ fdt_cmd_mknode(int argc, char *argv[]) rv = fdt_add_subnode(fdtp, o, nodename); if (rv < 0) { - sprintf(command_errbuf, "could not delete node %s\n", - (rv == -FDT_ERR_NOTFOUND) ? - "(node does not exist)" : ""); + if (rv == -FDT_ERR_NOSPACE) + sprintf(command_errbuf, + "Device tree blob is too small!\n"); + else + sprintf(command_errbuf, + "Could not add node!\n"); return (CMD_ERROR); } return (CMD_OK); @@ -1272,7 +1408,7 @@ fdt_cmd_mknode(int argc, char *argv[]) static int fdt_cmd_pwd(int argc, char *argv[]) { - char line[80]; + char line[FDT_CWD_LEN]; pager_open(); sprintf(line, "%s\n", cwd); Modified: stable/9/sys/boot/uboot/common/metadata.c ============================================================================== --- stable/9/sys/boot/uboot/common/metadata.c Sat Apr 21 19:22:53 2012 (r234557) +++ stable/9/sys/boot/uboot/common/metadata.c Sat Apr 21 20:10:26 2012 (r234558) @@ -333,13 +333,12 @@ md_load(char *args, vm_offset_t *modulep #if defined(LOADER_FDT_SUPPORT) /* Handle device tree blob */ - fdt_fixup(); - if ((bfp = file_findfile(NULL, "dtb")) == NULL && - (howto & RB_VERBOSE)) - printf("**WARNING** Booting with no DTB loaded!\n"); - - dtbp = bfp == NULL ? 0 : bfp->f_addr; - file_addmetadata(kfp, MODINFOMD_DTBP, sizeof dtbp, &dtbp); + dtbp = fdt_fixup(); + if (dtbp != (vm_offset_t)NULL) + file_addmetadata(kfp, MODINFOMD_DTBP, sizeof dtbp, &dtbp); + else + pager_output("WARNING! Trying to fire up the kernel, but no " + "device tree blob found!\n"); #endif file_addmetadata(kfp, MODINFOMD_KERNEND, sizeof kernend, &kernend); From owner-svn-src-stable-9@FreeBSD.ORG Sat Apr 21 20:22:03 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 78B2A1065670; Sat, 21 Apr 2012 20:22:03 +0000 (UTC) (envelope-from raj@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 61E098FC08; Sat, 21 Apr 2012 20:22:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q3LKM3aL003693; Sat, 21 Apr 2012 20:22:03 GMT (envelope-from raj@svn.freebsd.org) Received: (from raj@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q3LKM3s0003687; Sat, 21 Apr 2012 20:22:03 GMT (envelope-from raj@svn.freebsd.org) Message-Id: <201204212022.q3LKM3s0003687@svn.freebsd.org> From: Rafal Jaworowski Date: Sat, 21 Apr 2012 20:22:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r234559 - in stable/9/sys: arm/conf arm/mv boot/fdt/dts dev/cesa i386/conf kern X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Apr 2012 20:22:03 -0000 Author: raj Date: Sat Apr 21 20:22:02 2012 New Revision: 234559 URL: http://svn.freebsd.org/changeset/base/234559 Log: MFC r227730: Initial version of cesa(4) driver for Marvell crypto engine and security accelerator. The following algorithms and schemes are supported: - 3DES, AES, DES - MD5, SHA1 Obtained from: Semihalf Written by: Piotr Ziecik Added: stable/9/sys/dev/cesa/ - copied from r227730, head/sys/dev/cesa/ Modified: stable/9/sys/arm/conf/DB-88F6XXX stable/9/sys/arm/conf/SHEEVAPLUG stable/9/sys/arm/mv/files.mv stable/9/sys/boot/fdt/dts/db88f6281.dts stable/9/sys/boot/fdt/dts/sheevaplug.dts Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) stable/9/sys/fs/ (props changed) stable/9/sys/fs/ntfs/ (props changed) stable/9/sys/i386/conf/XENHVM (props changed) stable/9/sys/kern/subr_witness.c (props changed) Modified: stable/9/sys/arm/conf/DB-88F6XXX ============================================================================== --- stable/9/sys/arm/conf/DB-88F6XXX Sat Apr 21 20:10:26 2012 (r234558) +++ stable/9/sys/arm/conf/DB-88F6XXX Sat Apr 21 20:22:02 2012 (r234559) @@ -66,6 +66,10 @@ device mii device e1000phy device bpf +device cesa # Marvell security engine +device crypto +device cryptodev + # USB options USB_DEBUG # enable debug msgs device usb Modified: stable/9/sys/arm/conf/SHEEVAPLUG ============================================================================== --- stable/9/sys/arm/conf/SHEEVAPLUG Sat Apr 21 20:10:26 2012 (r234558) +++ stable/9/sys/arm/conf/SHEEVAPLUG Sat Apr 21 20:22:02 2012 (r234559) @@ -60,6 +60,10 @@ options HZ=1000 options DEVICE_POLLING device vlan +device cesa # Marvell security engine +device crypto +device cryptodev + # USB options USB_DEBUG # enable debug msgs device usb Modified: stable/9/sys/arm/mv/files.mv ============================================================================== --- stable/9/sys/arm/mv/files.mv Sat Apr 21 20:10:26 2012 (r234558) +++ stable/9/sys/arm/mv/files.mv Sat Apr 21 20:22:02 2012 (r234559) @@ -28,6 +28,7 @@ arm/mv/mv_sata.c optional ata | atamvsa arm/mv/timer.c standard arm/mv/twsi.c optional iicbus +dev/cesa/cesa.c optional cesa dev/mge/if_mge.c optional mge dev/mvs/mvs_soc.c optional mvs dev/uart/uart_dev_ns8250.c optional uart Modified: stable/9/sys/boot/fdt/dts/db88f6281.dts ============================================================================== --- stable/9/sys/boot/fdt/dts/db88f6281.dts Sat Apr 21 20:10:26 2012 (r234558) +++ stable/9/sys/boot/fdt/dts/db88f6281.dts Sat Apr 21 20:22:02 2012 (r234559) @@ -239,6 +239,8 @@ reg = <0x30000 0x10000>; interrupts = <22>; interrupt-parent = <&PIC>; + + sram-handle = <&SRAM>; }; usb@50000 { Modified: stable/9/sys/boot/fdt/dts/sheevaplug.dts ============================================================================== --- stable/9/sys/boot/fdt/dts/sheevaplug.dts Sat Apr 21 20:10:26 2012 (r234558) +++ stable/9/sys/boot/fdt/dts/sheevaplug.dts Sat Apr 21 20:22:02 2012 (r234559) @@ -236,6 +236,8 @@ reg = <0x30000 0x10000>; interrupts = <22>; interrupt-parent = <&PIC>; + + sram-handle = <&SRAM>; }; usb@50000 {