From owner-freebsd-amd64@FreeBSD.ORG Mon Mar 21 11:06:53 2011 Return-Path: Delivered-To: freebsd-amd64@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 17AA61065672 for ; Mon, 21 Mar 2011 11:06:53 +0000 (UTC) (envelope-from owner-bugmaster@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id E1E8E8FC1A for ; Mon, 21 Mar 2011 11:06:52 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id p2LB6qRm085913 for ; Mon, 21 Mar 2011 11:06:52 GMT (envelope-from owner-bugmaster@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id p2LB6qNX085911 for freebsd-amd64@FreeBSD.org; Mon, 21 Mar 2011 11:06:52 GMT (envelope-from owner-bugmaster@FreeBSD.org) Date: Mon, 21 Mar 2011 11:06:52 GMT Message-Id: <201103211106.p2LB6qNX085911@freefall.freebsd.org> X-Authentication-Warning: freefall.freebsd.org: gnats set sender to owner-bugmaster@FreeBSD.org using -f From: FreeBSD bugmaster To: freebsd-amd64@FreeBSD.org Cc: Subject: Current problem reports assigned to freebsd-amd64@FreeBSD.org X-BeenThere: freebsd-amd64@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting FreeBSD to the AMD64 platform List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Mar 2011 11:06:53 -0000 Note: to view an individual PR, use: http://www.freebsd.org/cgi/query-pr.cgi?pr=(number). The following is a listing of current problems submitted by FreeBSD users. These represent problem reports covering all versions including experimental development code and obsolete releases. S Tracker Resp. Description -------------------------------------------------------------------------------- o amd64/155249 amd64 [build] 8.1 buildworld failure o amd64/155135 amd64 [boot] Does Not Boot On a Very Standard Hardware o amd64/154957 amd64 [boot] Install boot CD won't boot up - keeps rebooting o amd64/154629 amd64 [panic] Fatal trap 9: general protection fault while i o amd64/153935 amd64 [hang] system hangs while trying to do 'shutdown -h no o amd64/153831 amd64 [boot] CD bootloader won't on Tyan s2912G2nr o amd64/153496 amd64 [hyper-v] [install] Install on Hyper-V leaves corrupt o amd64/153372 amd64 [panic] kernel panic o amd64/153175 amd64 [amd64] Kernel Panic on only FreeBSD 8 amd64 o amd64/152874 amd64 [install] 8.1 install fails where 7.3 works due to lac o amd64/152430 amd64 [boot] HP ProLiant Microserver n36l cannot boot into i o amd64/151385 amd64 [boot] Installation hangs on MacBook o amd64/150170 amd64 [patch] [amd64] [headers] SIG_ATOMIC_MIN/SIG_ATOMIC_MA o amd64/148526 amd64 [ahci] ahci driver does not boot on AMD chip o amd64/145991 amd64 [NOTES] [patch] Add a requires line to /sys/amd64/conf o amd64/144405 amd64 [build] [patch] include /usr/obj/lib32 in cleanworld t s amd64/143173 amd64 [ata] Promise FastTrack TX4 + SATA DVD, installer can' f amd64/141413 amd64 [hang] Tyan 2881 m3289 SMDC freeze o amd64/141060 amd64 [install] Can't install 8.0-RELEASE on the server wher o amd64/140715 amd64 [boot] Dell M600 Blade fails to boot 7.2+ 64 bit o amd64/139998 amd64 [panic][net] 7.2 amd64 panic in rtrequest1_fib o amd64/139924 amd64 [boot] cd or dvd not load o amd64/138029 amd64 [panic][bpf] periodically kernel panic and reboot o amd64/137942 amd64 [pci] 8.0-BETA2 having problems with Asus M2N-SLI-delu o amd64/135265 amd64 [mpt] Boot from install cd hangs on HP DL160 G5 with L o amd64/135040 amd64 [ata] FreeBSD/amd64 does not (always) detect disk on S o amd64/133977 amd64 [panic] [ffs] "panic: ffs_blkfree: freeing free block" o amd64/133701 amd64 Recompiling the kernel with k8temp or smbios break GEO o amd64/132574 amd64 [boot] [hang] Freeze on bootstrap loader (CD) using AT o amd64/131456 amd64 [acpi] [ata] ACPI & ATA problems s amd64/131209 amd64 [panic] [bce] 7.1-STABLE amd64 crash - m0 NULL o amd64/130368 amd64 [hang] Switching from xorg to console locks up compute o amd64/129889 amd64 [boot] [hang] The booting process stops at the line mo o amd64/129426 amd64 [panic] FreeBSD 7.0 crash after subdiskXX: detached o amd64/129315 amd64 [em] amd64 motherboard: Intel DG965WH motherboard comp o amd64/128765 amd64 [install] Install CD loads to Install choices but stop o amd64/127640 amd64 [amd64] gcc(1) will not build shared libraries with -f o amd64/125002 amd64 [install] amd64, SATA hard disks not detected o amd64/124432 amd64 [panic] 7.0-STABLE panic: invalbuf: dirty bufs o amd64/122549 amd64 7.0-RELEASE-amd64-bootonly.iso doesn't work w/ serial o amd64/120202 amd64 [amd64] [patch] [panic] kernel panic at start_all_aps, o amd64/117296 amd64 [ata] I don`t see second SATA IDE on VIA VT8237A o amd64/116620 amd64 [hang] ifconfig spins when creating carp(4) device on s amd64/115815 amd64 [ata] [request] Gigabyte GA-M61P-S3 Motherboard unsupp o amd64/115194 amd64 LCD screen remains blank after Dell XPS M1210 lid is c o amd64/91405 amd64 [asr] [panic] Kernel panic caused by asr on 6.0-amd64 46 problems total. From owner-freebsd-amd64@FreeBSD.ORG Tue Mar 22 20:35:00 2011 Return-Path: Delivered-To: amd64@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A4A41106564A; Tue, 22 Mar 2011 20:35:00 +0000 (UTC) (envelope-from tinderbox@freebsd.org) Received: from freebsd-current.sentex.ca (freebsd-current.sentex.ca [64.7.128.98]) by mx1.freebsd.org (Postfix) with ESMTP id 6428B8FC17; Tue, 22 Mar 2011 20:35:00 +0000 (UTC) Received: from freebsd-current.sentex.ca (localhost [127.0.0.1]) by freebsd-current.sentex.ca (8.14.4/8.14.4) with ESMTP id p2MKYxHx064414; Tue, 22 Mar 2011 16:34:59 -0400 (EDT) (envelope-from tinderbox@freebsd.org) Received: (from tinderbox@localhost) by freebsd-current.sentex.ca (8.14.4/8.14.4/Submit) id p2MKYx4B064410; Tue, 22 Mar 2011 20:34:59 GMT (envelope-from tinderbox@freebsd.org) Date: Tue, 22 Mar 2011 20:34:59 GMT Message-Id: <201103222034.p2MKYx4B064410@freebsd-current.sentex.ca> X-Authentication-Warning: freebsd-current.sentex.ca: tinderbox set sender to FreeBSD Tinderbox using -f Sender: FreeBSD Tinderbox From: FreeBSD Tinderbox To: FreeBSD Tinderbox , , Precedence: bulk Cc: Subject: [head tinderbox] failure on amd64/amd64 X-BeenThere: freebsd-amd64@freebsd.org X-Mailman-Version: 2.1.5 List-Id: Porting FreeBSD to the AMD64 platform List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Mar 2011 20:35:00 -0000 TB --- 2011-03-22 18:50:00 - tinderbox 2.6 running on freebsd-current.sentex.ca TB --- 2011-03-22 18:50:00 - starting HEAD tinderbox run for amd64/amd64 TB --- 2011-03-22 18:50:00 - cleaning the object tree TB --- 2011-03-22 18:50:26 - cvsupping the source tree TB --- 2011-03-22 18:50:26 - /usr/bin/csup -z -r 3 -g -L 1 -h cvsup.sentex.ca /tinderbox/HEAD/amd64/amd64/supfile TB --- 2011-03-22 18:55:49 - building world TB --- 2011-03-22 18:55:49 - MAKEOBJDIRPREFIX=/obj TB --- 2011-03-22 18:55:49 - PATH=/usr/bin:/usr/sbin:/bin:/sbin TB --- 2011-03-22 18:55:49 - TARGET=amd64 TB --- 2011-03-22 18:55:49 - TARGET_ARCH=amd64 TB --- 2011-03-22 18:55:49 - TZ=UTC TB --- 2011-03-22 18:55:49 - __MAKE_CONF=/dev/null TB --- 2011-03-22 18:55:49 - cd /src TB --- 2011-03-22 18:55:49 - /usr/bin/make -B buildworld >>> World build started on Tue Mar 22 18:55:50 UTC 2011 >>> Rebuilding the temporary build tree >>> stage 1.1: legacy release compatibility shims >>> stage 1.2: bootstrap tools >>> stage 2.1: cleaning up the object tree >>> stage 2.2: rebuilding the object tree >>> stage 2.3: build tools >>> stage 3: cross tools >>> stage 4.1: building includes >>> stage 4.2: building libraries >>> stage 4.3: make dependencies >>> stage 4.4: building everything [...] cc -O2 -pipe -I/src/sbin/hastctl/../hastd -DINET -DINET6 -DYY_NO_UNPUT -DYY_NO_INPUT -DHAVE_CRYPTO -std=gnu99 -fstack-protector -Wsystem-headers -Werror -Wall -Wno-format-y2k -W -Wno-unused-parameter -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch -Wshadow -Wunused-parameter -Wcast-align -Wchar-subscripts -Winline -Wnested-externs -Wredundant-decls -Wold-style-definition -Wno-pointer-sign -Wno-format -c /src/sbin/hastctl/../hastd/proto_common.c cc -O2 -pipe -I/src/sbin/hastctl/../hastd -DINET -DINET6 -DYY_NO_UNPUT -DYY_NO_INPUT -DHAVE_CRYPTO -std=gnu99 -fstack-protector -Wsystem-headers -Werror -Wall -Wno-format-y2k -W -Wno-unused-parameter -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch -Wshadow -Wunused-parameter -Wcast-align -Wchar-subscripts -Winline -Wnested-externs -Wredundant-decls -Wold-style-definition -Wno-pointer-sign -Wno-format -c /src/sbin/hastctl/../hastd/proto_tcp4.c /src/sbin/hastctl/../hastd/proto_tcp4.c: In function 'tcp4_setup_new': /src/sbin/hastctl/../hastd/proto_tcp4.c:188: error: 'PROTO_TCP4_DEFAULT_PORT' undeclared (first use in this function) /src/sbin/hastctl/../hastd/proto_tcp4.c:188: error: (Each undeclared identifier is reported only once /src/sbin/hastctl/../hastd/proto_tcp4.c:188: error: for each function it appears in.) /src/sbin/hastctl/../hastd/proto_tcp4.c: In function 'tcp4_address_match': /src/sbin/hastctl/../hastd/proto_tcp4.c:513: error: 'PROTO_TCP4_DEFAULT_PORT' undeclared (first use in this function) *** Error code 1 Stop in /src/sbin/hastctl. *** Error code 1 Stop in /src/sbin. *** Error code 1 Stop in /src. *** Error code 1 Stop in /src. *** Error code 1 Stop in /src. TB --- 2011-03-22 20:34:59 - WARNING: /usr/bin/make returned exit code 1 TB --- 2011-03-22 20:34:59 - ERROR: failed to build world TB --- 2011-03-22 20:34:59 - 4841.73 user 789.77 system 6298.82 real http://tinderbox.freebsd.org/tinderbox-head-HEAD-amd64-amd64.full From owner-freebsd-amd64@FreeBSD.ORG Tue Mar 22 23:49:35 2011 Return-Path: Delivered-To: amd64@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 21909106567C; Tue, 22 Mar 2011 23:49:35 +0000 (UTC) (envelope-from tinderbox@freebsd.org) Received: from freebsd-current.sentex.ca (freebsd-current.sentex.ca [64.7.128.98]) by mx1.freebsd.org (Postfix) with ESMTP id 908BB8FC16; Tue, 22 Mar 2011 23:49:34 +0000 (UTC) Received: from freebsd-current.sentex.ca (localhost [127.0.0.1]) by freebsd-current.sentex.ca (8.14.4/8.14.4) with ESMTP id p2MNnYiV000285; Tue, 22 Mar 2011 19:49:34 -0400 (EDT) (envelope-from tinderbox@freebsd.org) Received: (from tinderbox@localhost) by freebsd-current.sentex.ca (8.14.4/8.14.4/Submit) id p2MNnYrM000282; Tue, 22 Mar 2011 23:49:34 GMT (envelope-from tinderbox@freebsd.org) Date: Tue, 22 Mar 2011 23:49:34 GMT Message-Id: <201103222349.p2MNnYrM000282@freebsd-current.sentex.ca> X-Authentication-Warning: freebsd-current.sentex.ca: tinderbox set sender to FreeBSD Tinderbox using -f Sender: FreeBSD Tinderbox From: FreeBSD Tinderbox To: FreeBSD Tinderbox , , Precedence: bulk Cc: Subject: [head tinderbox] failure on amd64/amd64 X-BeenThere: freebsd-amd64@freebsd.org X-Mailman-Version: 2.1.5 List-Id: Porting FreeBSD to the AMD64 platform List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Mar 2011 23:49:35 -0000 TB --- 2011-03-22 22:10:00 - tinderbox 2.6 running on freebsd-current.sentex.ca TB --- 2011-03-22 22:10:00 - starting HEAD tinderbox run for amd64/amd64 TB --- 2011-03-22 22:10:00 - cleaning the object tree TB --- 2011-03-22 22:10:07 - cvsupping the source tree TB --- 2011-03-22 22:10:07 - /usr/bin/csup -z -r 3 -g -L 1 -h cvsup.sentex.ca /tinderbox/HEAD/amd64/amd64/supfile TB --- 2011-03-22 22:10:47 - building world TB --- 2011-03-22 22:10:47 - MAKEOBJDIRPREFIX=/obj TB --- 2011-03-22 22:10:47 - PATH=/usr/bin:/usr/sbin:/bin:/sbin TB --- 2011-03-22 22:10:47 - TARGET=amd64 TB --- 2011-03-22 22:10:47 - TARGET_ARCH=amd64 TB --- 2011-03-22 22:10:47 - TZ=UTC TB --- 2011-03-22 22:10:47 - __MAKE_CONF=/dev/null TB --- 2011-03-22 22:10:47 - cd /src TB --- 2011-03-22 22:10:47 - /usr/bin/make -B buildworld >>> World build started on Tue Mar 22 22:10:49 UTC 2011 >>> Rebuilding the temporary build tree >>> stage 1.1: legacy release compatibility shims >>> stage 1.2: bootstrap tools >>> stage 2.1: cleaning up the object tree >>> stage 2.2: rebuilding the object tree >>> stage 2.3: build tools >>> stage 3: cross tools >>> stage 4.1: building includes >>> stage 4.2: building libraries >>> stage 4.3: make dependencies >>> stage 4.4: building everything [...] cc -O2 -pipe -I/src/sbin/hastctl/../hastd -DINET -DINET6 -DYY_NO_UNPUT -DYY_NO_INPUT -DHAVE_CRYPTO -std=gnu99 -fstack-protector -Wsystem-headers -Werror -Wall -Wno-format-y2k -W -Wno-unused-parameter -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch -Wshadow -Wunused-parameter -Wcast-align -Wchar-subscripts -Winline -Wnested-externs -Wredundant-decls -Wold-style-definition -Wno-pointer-sign -Wno-format -c /src/sbin/hastctl/../hastd/proto_common.c cc -O2 -pipe -I/src/sbin/hastctl/../hastd -DINET -DINET6 -DYY_NO_UNPUT -DYY_NO_INPUT -DHAVE_CRYPTO -std=gnu99 -fstack-protector -Wsystem-headers -Werror -Wall -Wno-format-y2k -W -Wno-unused-parameter -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch -Wshadow -Wunused-parameter -Wcast-align -Wchar-subscripts -Winline -Wnested-externs -Wredundant-decls -Wold-style-definition -Wno-pointer-sign -Wno-format -c /src/sbin/hastctl/../hastd/proto_tcp4.c /src/sbin/hastctl/../hastd/proto_tcp4.c: In function 'tcp4_setup_new': /src/sbin/hastctl/../hastd/proto_tcp4.c:188: error: 'PROTO_TCP4_DEFAULT_PORT' undeclared (first use in this function) /src/sbin/hastctl/../hastd/proto_tcp4.c:188: error: (Each undeclared identifier is reported only once /src/sbin/hastctl/../hastd/proto_tcp4.c:188: error: for each function it appears in.) /src/sbin/hastctl/../hastd/proto_tcp4.c: In function 'tcp4_address_match': /src/sbin/hastctl/../hastd/proto_tcp4.c:513: error: 'PROTO_TCP4_DEFAULT_PORT' undeclared (first use in this function) *** Error code 1 Stop in /src/sbin/hastctl. *** Error code 1 Stop in /src/sbin. *** Error code 1 Stop in /src. *** Error code 1 Stop in /src. *** Error code 1 Stop in /src. TB --- 2011-03-22 23:49:33 - WARNING: /usr/bin/make returned exit code 1 TB --- 2011-03-22 23:49:33 - ERROR: failed to build world TB --- 2011-03-22 23:49:33 - 4834.62 user 792.77 system 5973.26 real http://tinderbox.freebsd.org/tinderbox-head-HEAD-amd64-amd64.full From owner-freebsd-amd64@FreeBSD.ORG Thu Mar 24 06:56:26 2011 Return-Path: Delivered-To: amd64@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0FB2E106564A; Thu, 24 Mar 2011 06:56:26 +0000 (UTC) (envelope-from tinderbox@freebsd.org) Received: from freebsd-current.sentex.ca (freebsd-current.sentex.ca [64.7.128.98]) by mx1.freebsd.org (Postfix) with ESMTP id D96448FC0C; Thu, 24 Mar 2011 06:56:25 +0000 (UTC) Received: from freebsd-current.sentex.ca (localhost [127.0.0.1]) by freebsd-current.sentex.ca (8.14.4/8.14.4) with ESMTP id p2O6uPwU041660; Thu, 24 Mar 2011 02:56:25 -0400 (EDT) (envelope-from tinderbox@freebsd.org) Received: (from tinderbox@localhost) by freebsd-current.sentex.ca (8.14.4/8.14.4/Submit) id p2O6uP5w041643; Thu, 24 Mar 2011 06:56:25 GMT (envelope-from tinderbox@freebsd.org) Date: Thu, 24 Mar 2011 06:56:25 GMT Message-Id: <201103240656.p2O6uP5w041643@freebsd-current.sentex.ca> X-Authentication-Warning: freebsd-current.sentex.ca: tinderbox set sender to FreeBSD Tinderbox using -f Sender: FreeBSD Tinderbox From: FreeBSD Tinderbox To: FreeBSD Tinderbox , , Precedence: bulk Cc: Subject: [head tinderbox] failure on amd64/amd64 X-BeenThere: freebsd-amd64@freebsd.org X-Mailman-Version: 2.1.5 List-Id: Porting FreeBSD to the AMD64 platform List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Mar 2011 06:56:26 -0000 TB --- 2011-03-24 04:30:00 - tinderbox 2.6 running on freebsd-current.sentex.ca TB --- 2011-03-24 04:30:00 - starting HEAD tinderbox run for amd64/amd64 TB --- 2011-03-24 04:30:00 - cleaning the object tree TB --- 2011-03-24 04:30:21 - cvsupping the source tree TB --- 2011-03-24 04:30:21 - /usr/bin/csup -z -r 3 -g -L 1 -h cvsup.sentex.ca /tinderbox/HEAD/amd64/amd64/supfile TB --- 2011-03-24 04:30:51 - building world TB --- 2011-03-24 04:30:51 - MAKEOBJDIRPREFIX=/obj TB --- 2011-03-24 04:30:51 - PATH=/usr/bin:/usr/sbin:/bin:/sbin TB --- 2011-03-24 04:30:51 - TARGET=amd64 TB --- 2011-03-24 04:30:51 - TARGET_ARCH=amd64 TB --- 2011-03-24 04:30:51 - TZ=UTC TB --- 2011-03-24 04:30:51 - __MAKE_CONF=/dev/null TB --- 2011-03-24 04:30:51 - cd /src TB --- 2011-03-24 04:30:51 - /usr/bin/make -B buildworld >>> World build started on Thu Mar 24 04:30:52 UTC 2011 >>> Rebuilding the temporary build tree >>> stage 1.1: legacy release compatibility shims >>> stage 1.2: bootstrap tools >>> stage 2.1: cleaning up the object tree >>> stage 2.2: rebuilding the object tree >>> stage 2.3: build tools >>> stage 3: cross tools >>> stage 4.1: building includes >>> stage 4.2: building libraries >>> stage 4.3: make dependencies >>> stage 4.4: building everything >>> stage 5.1: building 32 bit shim libraries >>> World build completed on Thu Mar 24 06:50:46 UTC 2011 TB --- 2011-03-24 06:50:47 - generating LINT kernel config TB --- 2011-03-24 06:50:47 - cd /src/sys/amd64/conf TB --- 2011-03-24 06:50:47 - /usr/bin/make -B LINT TB --- 2011-03-24 06:50:47 - building LINT kernel TB --- 2011-03-24 06:50:47 - MAKEOBJDIRPREFIX=/obj TB --- 2011-03-24 06:50:47 - PATH=/usr/bin:/usr/sbin:/bin:/sbin TB --- 2011-03-24 06:50:47 - TARGET=amd64 TB --- 2011-03-24 06:50:47 - TARGET_ARCH=amd64 TB --- 2011-03-24 06:50:47 - TZ=UTC TB --- 2011-03-24 06:50:47 - __MAKE_CONF=/dev/null TB --- 2011-03-24 06:50:47 - cd /src TB --- 2011-03-24 06:50:47 - /usr/bin/make -B buildkernel KERNCONF=LINT >>> Kernel build for LINT started on Thu Mar 24 06:50:47 UTC 2011 >>> stage 1: configuring the kernel >>> stage 2.1: cleaning up the object tree >>> stage 2.2: rebuilding the object tree >>> stage 2.3: build tools >>> stage 3.1: making dependencies >>> stage 3.2: building everything [...] cc -c -O2 -frename-registers -pipe -fno-strict-aliasing -std=c99 -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual -Wundef -Wno-pointer-sign -fformat-extensions -nostdinc -I. -I/src/sys -I/src/sys/contrib/altq -D_KERNEL -DHAVE_KERNEL_OPTION_HEADERS -include opt_global.h -fno-common -finline-limit=8000 --param inline-unit-growth=100 --param large-function-growth=1000 -DGPROF -falign-functions=16 -DGPROF4 -DGUPROF -fno-builtin -fno-omit-frame-pointer -mcmodel=kernel -mno-red-zone -mfpmath=387 -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 -msoft-float -fno-asynchronous-unwind-tables -ffreestanding -fstack-protector -Werror -pg -mprofiler-epilogue /src/sys/dev/ath/if_ath_debug.c -I/src/sys/dev/ath cc -c -O2 -frename-registers -pipe -fno-strict-aliasing -std=c99 -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual -Wundef -Wno-pointer-sign -fformat-extensions -nostdinc -I. -I/src/sys -I/src/sys/contrib/altq -D_KERNEL -DHAVE_KERNEL_OPTION_HEADERS -include opt_global.h -fno-common -finline-limit=8000 --param inline-unit-growth=100 --param large-function-growth=1000 -DGPROF -falign-functions=16 -DGPROF4 -DGUPROF -fno-builtin -fno-omit-frame-pointer -mcmodel=kernel -mno-red-zone -mfpmath=387 -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 -msoft-float -fno-asynchronous-unwind-tables -ffreestanding -fstack-protector -Werror -pg -mprofiler-epilogue /src/sys/dev/ath/if_ath_keycache.c -I/src/sys/dev/ath cc -c -O2 -frename-registers -pipe -fno-strict-aliasing -std=c99 -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual -Wundef -Wno-pointer-sign -fformat-extensions -nostdinc -I. -I/src/sys -I/src/sys/contrib/altq -D_KERNEL -DHAVE_KERNEL_OPTION_HEADERS -include opt_global.h -fno-common -finline-limit=8000 --param inline-unit-growth=100 --param large-function-growth=1000 -DGPROF -falign-functions=16 -DGPROF4 -DGUPROF -fno-builtin -fno-omit-frame-pointer -mcmodel=kernel -mno-red-zone -mfpmath=387 -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 -msoft-float -fno-asynchronous-unwind-tables -ffreestanding -fstack-protector -Werror -pg -mprofiler-epilogue /src/sys/dev/ath/if_ath_tx.c -I/src/sys/dev/ath cc -c -O2 -frename-registers -pipe -fno-strict-aliasing -std=c99 -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual -Wundef -Wno-pointer-sign -fformat-extensions -nostdinc -I. -I/src/sys -I/src/sys/contrib/altq -D_KERNEL -DHAVE_KERNEL_OPTION_HEADERS -include opt_global.h -fno-common -finline-limit=8000 --param inline-unit-growth=100 --param large-function-growth=1000 -DGPROF -falign-functions=16 -DGPROF4 -DGUPROF -fno-builtin -fno-omit-frame-pointer -mcmodel=kernel -mno-red-zone -mfpmath=387 -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 -msoft-float -fno-asynchronous-unwind-tables -ffreestanding -fstack-protector -Werror -pg -mprofiler-epilogue /src/sys/dev/ath/if_ath_tx_ht.c -I/src/sys/dev/ath cc -c -O2 -frename-registers -pipe -fno-strict-aliasing -std=c99 -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual -Wundef -Wno-pointer-sign -fformat-extensions -nostdinc -I. -I/src/sys -I/src/sys/contrib/altq -D_KERNEL -DHAVE_KERNEL_OPTION_HEADERS -include opt_global.h -fno-common -finline-limit=8000 --param inline-unit-growth=100 --param large-function-growth=1000 -DGPROF -falign-functions=16 -DGPROF4 -DGUPROF -fno-builtin -fno-omit-frame-pointer -mcmodel=kernel -mno-red-zone -mfpmath=387 -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 -msoft-float -fno-asynchronous-unwind-tables -ffreestanding -fstack-protector -Werror -pg -mprofiler-epilogue /src/sys/dev/ath/if_ath_sysctl.c -I/src/sys/dev/ath cc -c -O2 -frename-registers -pipe -fno-strict-aliasing -std=c99 -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual -Wundef -Wno-pointer-sign -fformat-extensions -nostdinc -I. -I/src/sys -I/src/sys/contrib/altq -D_KERNEL -DHAVE_KERNEL_OPTION_HEADERS -include opt_global.h -fno-common -finline-limit=8000 --param inline-unit-growth=100 --param large-function-growth=1000 -DGPROF -falign-functions=16 -DGPROF4 -DGUPROF -fno-builtin -fno-omit-frame-pointer -mcmodel=kernel -mno-red-zone -mfpmath=387 -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 -msoft-float -fno-asynchronous-unwind-tables -ffreestanding -fstack-protector -Werror -pg -mprofiler-epilogue /src/sys/dev/ath/if_ath_pci.c -I/src/sys/dev/ath cc -c -O2 -frename-registers -pipe -fno-strict-aliasing -std=c99 -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual -Wundef -Wno-pointer-sign -fformat-extensions -nostdinc -I. -I/src/sys -I/src/sys/contrib/altq -D_KERNEL -DHAVE_KERNEL_OPTION_HEADERS -include opt_global.h -fno-common -finline-limit=8000 --param inline-unit-growth=100 --param large-function-growth=1000 -DGPROF -falign-functions=16 -DGPROF4 -DGUPROF -fno-builtin -fno-omit-frame-pointer -mcmodel=kernel -mno-red-zone -mfpmath=387 -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 -msoft-float -fno-asynchronous-unwind-tables -ffreestanding -fstack-protector -Werror -pg -mprofiler-epilogue /src/sys/dev/ath/ah_osdep.c -I/src/sys/dev/ath /src/sys/dev/ath/ah_osdep.c:89: error: 'ath_hal_debug' undeclared here (not in a function) *** Error code 1 Stop in /obj/src/sys/LINT. *** Error code 1 Stop in /src. *** Error code 1 Stop in /src. TB --- 2011-03-24 06:56:24 - WARNING: /usr/bin/make returned exit code 1 TB --- 2011-03-24 06:56:24 - ERROR: failed to build lint kernel TB --- 2011-03-24 06:56:24 - 6921.56 user 1303.55 system 8784.38 real http://tinderbox.freebsd.org/tinderbox-head-HEAD-amd64-amd64.full From owner-freebsd-amd64@FreeBSD.ORG Thu Mar 24 05:20:01 2011 Return-Path: Delivered-To: freebsd-amd64@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8F4651065673 for ; Thu, 24 Mar 2011 05:20:01 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 4955D8FC18 for ; Thu, 24 Mar 2011 05:20:01 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id p2O5K1Yj086686 for ; Thu, 24 Mar 2011 05:20:01 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id p2O5K1GA086685; Thu, 24 Mar 2011 05:20:01 GMT (envelope-from gnats) Resent-Date: Thu, 24 Mar 2011 05:20:01 GMT Resent-Message-Id: <201103240520.p2O5K1GA086685@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-amd64@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, John Wehle Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6B75D10656B9 for ; Thu, 24 Mar 2011 05:10:09 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22]) by mx1.freebsd.org (Postfix) with ESMTP id 566F08FC08 for ; Thu, 24 Mar 2011 05:10:09 +0000 (UTC) Received: from red.freebsd.org (localhost [127.0.0.1]) by red.freebsd.org (8.14.4/8.14.4) with ESMTP id p2O5A9nX057937 for ; Thu, 24 Mar 2011 05:10:09 GMT (envelope-from nobody@red.freebsd.org) Received: (from nobody@localhost) by red.freebsd.org (8.14.4/8.14.4/Submit) id p2O5A9YJ057936; Thu, 24 Mar 2011 05:10:09 GMT (envelope-from nobody) Message-Id: <201103240510.p2O5A9YJ057936@red.freebsd.org> Date: Thu, 24 Mar 2011 05:10:09 GMT From: John Wehle To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 X-Mailman-Approved-At: Thu, 24 Mar 2011 11:03:58 +0000 Cc: Subject: amd64/155903: FreeBSD32 emulation patch to support i386 X11 Server X-BeenThere: freebsd-amd64@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting FreeBSD to the AMD64 platform List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Mar 2011 05:20:01 -0000 >Number: 155903 >Category: amd64 >Synopsis: FreeBSD32 emulation patch to support i386 X11 Server >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-amd64 >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Thu Mar 24 05:20:00 UTC 2011 >Closed-Date: >Last-Modified: >Originator: John Wehle >Release: 8.2 >Organization: >Environment: 8.2-RELEASE amd64 >Description: The enclosed lightly tested patch extends the FreeBSD32 emulation so that the i386 X11 server runs on amd64. Specifically tested: a) i386 pciconf -v -l b) i386 X11 Server 1.9.5 using the VESA driver. Changes: 1) Fix fd count leakage in the freebsd32_ioctl routines. freebsd32_ioctl called fget for a fd and called a subroutine to handle each specific ioctl. It was expected that the subroutine would call fdrop when done. However many of the subroutines would exit out early if copyin encountered an error resulting in fdrop never being called. 2) Extend freebsd32_ioctl to handle MEMRANGE_GET, MEMRANGE_SET, and PCIOCGETCONF. 3) Promote ksyms_map / ksyms_unmap to copyout_map / copyout_unmap as discussed on one of the mailing lists. Necessary in order to handle PCIOCGETCONF. 4) Modify copyout_map / copyout_unmap to handle size == 0. -- John >How-To-Repeat: Try running i386 X11 server on amd64 ... the X11 server will fail to find any video cards since the PCIOCGETCONF doesn't work from 32 bit binaries on amd64. It also has problems with mtrr. You can also try running i386 pciconf -v -l which will fail to find any hardware. >Fix: Apply the supplied patch. Patch attached with submission follows: --- ./compat/freebsd32/freebsd32_ioctl.h.ORIGINAL 2010-12-21 12:09:25.000000000 -0500 +++ ./compat/freebsd32/freebsd32_ioctl.h 2011-03-23 02:26:12.000000000 -0400 @@ -67,6 +67,51 @@ struct fiodgname_arg32 { caddr_t32 buf; }; +struct mem_range_op32 +{ + caddr_t32 mo_desc; + int mo_arg[2]; +}; + +struct pci_conf32 { + struct pcisel pc_sel; /* domain+bus+slot+function */ + u_int8_t pc_hdr; /* PCI header type */ + u_int16_t pc_subvendor; /* card vendor ID */ + u_int16_t pc_subdevice; /* card device ID, assigned by + card vendor */ + u_int16_t pc_vendor; /* chip vendor ID */ + u_int16_t pc_device; /* chip device ID, assigned by + chip vendor */ + u_int8_t pc_class; /* chip PCI class */ + u_int8_t pc_subclass; /* chip PCI subclass */ + u_int8_t pc_progif; /* chip PCI programming interface */ + u_int8_t pc_revid; /* chip revision ID */ + char pd_name[PCI_MAXNAMELEN + 1]; /* device name */ + u_int32_t pd_unit; /* device unit number */ +}; + +struct pci_match_conf32 { + struct pcisel pc_sel; /* domain+bus+slot+function */ + char pd_name[PCI_MAXNAMELEN + 1]; /* device name */ + u_int32_t pd_unit; /* Unit number */ + u_int16_t pc_vendor; /* PCI Vendor ID */ + u_int16_t pc_device; /* PCI Device ID */ + u_int8_t pc_class; /* PCI class */ + pci_getconf_flags flags; /* Matching expression */ +}; + +struct pci_conf_io32 { + u_int32_t pat_buf_len; /* pattern buffer length */ + u_int32_t num_patterns; /* number of patterns */ + caddr_t32 patterns; /* struct pci_match_conf ptr */ + u_int32_t match_buf_len; /* match buffer length */ + u_int32_t num_matches; /* number of matches returned */ + caddr_t32 matches; /* struct pci_conf ptr */ + u_int32_t offset; /* offset into device list */ + u_int32_t generation; /* device list generation */ + pci_getconf_status status; /* request status */ +}; + #define CDIOREADTOCENTRYS_32 _IOWR('c', 5, struct ioc_read_toc_entry32) #define CDIOREADTOCHEADER_32 _IOR('c', 4, struct ioc_toc_header32) #define MDIOCATTACH_32 _IOC(IOC_INOUT, 'm', 0, sizeof(struct md_ioctl32) + 4) @@ -74,5 +119,8 @@ struct fiodgname_arg32 { #define MDIOCQUERY_32 _IOC(IOC_INOUT, 'm', 2, sizeof(struct md_ioctl32) + 4) #define MDIOCLIST_32 _IOC(IOC_INOUT, 'm', 3, sizeof(struct md_ioctl32) + 4) #define FIODGNAME_32 _IOW('f', 120, struct fiodgname_arg32) +#define MEMRANGE_GET32 _IOWR('m', 50, struct mem_range_op32) +#define MEMRANGE_SET32 _IOW('m', 51, struct mem_range_op32) +#define PCIOCGETCONF_32 _IOWR('p', 5, struct pci_conf_io32) #endif /* _COMPAT_FREEBSD32_IOCTL_H_ */ --- ./compat/freebsd32/freebsd32_ioctl.c.ORIGINAL 2010-12-21 12:09:25.000000000 -0500 +++ ./compat/freebsd32/freebsd32_ioctl.c 2011-03-24 00:26:59.000000000 -0400 @@ -38,7 +38,10 @@ __FBSDID("$FreeBSD: src/sys/compat/freeb #include #include #include +#include #include +#include +#include #include #include #include @@ -47,6 +50,9 @@ __FBSDID("$FreeBSD: src/sys/compat/freeb #include #include +#include +#include + #include #include #include @@ -55,6 +61,10 @@ __FBSDID("$FreeBSD: src/sys/compat/freeb CTASSERT((sizeof(struct md_ioctl32)+4) == 436); CTASSERT(sizeof(struct ioc_read_toc_entry32) == 8); CTASSERT(sizeof(struct ioc_toc_header32) == 4); +CTASSERT(sizeof(struct mem_range_op32) == 12); +CTASSERT(sizeof(struct pci_conf_io32) == 36); +CTASSERT(sizeof(struct pci_match_conf32) == 44); +CTASSERT(sizeof(struct pci_conf32) == 44); static int @@ -70,7 +80,6 @@ freebsd32_ioctl_md(struct thread *td, st panic("%s: where is my ioctl data??", __func__); if (uap->com & IOC_IN) { if ((error = copyin(uap->data, &md32, sizeof(md32)))) { - fdrop(fp, td); return (error); } CP(md32, mdv, md_version); @@ -121,7 +130,6 @@ freebsd32_ioctl_md(struct thread *td, st CP(mdv, md32, md_fwsectors); error = copyout(&md32, uap->data, sizeof(md32)); } - fdrop(fp, td); return error; } @@ -144,7 +152,6 @@ freebsd32_ioctl_ioc_toc_header(struct th CP(toch32, toch, ending_track); error = fo_ioctl(fp, CDIOREADTOCHEADER, (caddr_t)&toch, td->td_ucred, td); - fdrop(fp, td); return (error); } @@ -175,7 +182,6 @@ freebsd32_ioctl_ioc_read_toc(struct thre PTROUT_CP(toce, toce32, data); error = copyout(&toce32, uap->data, sizeof(toce32)); } - fdrop(fp, td); return error; } @@ -192,7 +198,151 @@ freebsd32_ioctl_fiodgname(struct thread CP(fgn32, fgn, len); PTRIN_CP(fgn32, fgn, buf); error = fo_ioctl(fp, FIODGNAME, (caddr_t)&fgn, td->td_ucred, td); - fdrop(fp, td); + return (error); +} + +static int +freebsd32_ioctl_memrange(struct thread *td, + struct freebsd32_ioctl_args *uap, struct file *fp) +{ + struct mem_range_op mro; + struct mem_range_op32 mro32; + int error; + u_long com; + + if ((error = copyin(uap->data, &mro32, sizeof(mro32))) != 0) + return (error); + + PTRIN_CP(mro32, mro, mo_desc); + CP(mro32, mro, mo_arg[0]); + CP(mro32, mro, mo_arg[1]); + + com = 0; + switch (uap->com) { + case MEMRANGE_GET32: + com = MEMRANGE_GET; + break; + + case MEMRANGE_SET32: + com = MEMRANGE_SET; + break; + + default: + panic("%s: unknown MEMRANGE %#x", __func__, uap->com); + } + + if ((error = fo_ioctl(fp, com, (caddr_t)&mro, td->td_ucred, td)) != 0) + return (error); + + if ( (com & IOC_OUT) ) { + CP(mro, mro32, mo_arg[0]); + CP(mro, mro32, mo_arg[1]); + + error = copyout(&mro32, uap->data, sizeof(mro32)); + } + + return (error); +} + +static int +freebsd32_ioctl_pciocgetconf(struct thread *td, + struct freebsd32_ioctl_args *uap, struct file *fp) +{ + struct pci_conf_io pci; + struct pci_conf_io32 pci32; + struct pci_match_conf32 pmc32; + struct pci_match_conf32 *pmc32p; + struct pci_match_conf pmc; + struct pci_match_conf *pmcp; + struct pci_conf32 pc32; + struct pci_conf32 *pc32p; + struct pci_conf pc; + struct pci_conf *pcp; + u_int32_t i; + u_int32_t npat_to_convert; + u_int32_t nmatch_to_convert; + vm_offset_t addr; + int error; + + if ((error = copyin(uap->data, &pci32, sizeof(pci32))) != 0) + return (error); + + CP(pci32, pci, num_patterns); + CP(pci32, pci, offset); + CP(pci32, pci, generation); + + npat_to_convert = pci32.pat_buf_len / sizeof(struct pci_match_conf32); + pci.pat_buf_len = npat_to_convert * sizeof(struct pci_match_conf); + pci.patterns = NULL; + nmatch_to_convert = pci32.match_buf_len / sizeof(struct pci_conf32); + pci.match_buf_len = nmatch_to_convert * sizeof(struct pci_conf); + pci.matches = NULL; + + if ((error = copyout_map(td, &addr, pci.pat_buf_len)) != 0) + goto cleanup; + pci.patterns = (struct pci_match_conf *)addr; + if ((error = copyout_map(td, &addr, pci.match_buf_len)) != 0) + goto cleanup; + pci.matches = (struct pci_conf *)addr; + + npat_to_convert = min(npat_to_convert, pci.num_patterns); + + for (i = 0, pmc32p = (struct pci_match_conf32 *)PTRIN(pci32.patterns), + pmcp = pci.patterns; + i < npat_to_convert; i++, pmc32p++, pmcp++) { + if ((error = copyin(pmc32p, &pmc32, sizeof(pmc32))) != 0) + goto cleanup; + CP(pmc32,pmc,pc_sel); + strlcpy(pmc.pd_name, pmc32.pd_name, sizeof(pmc.pd_name)); + CP(pmc32,pmc,pd_unit); + CP(pmc32,pmc,pc_vendor); + CP(pmc32,pmc,pc_device); + CP(pmc32,pmc,pc_class); + CP(pmc32,pmc,flags); + if ((error = copyout(&pmc, pmcp, sizeof(pmc))) != 0) + goto cleanup; + } + + if ((error = fo_ioctl(fp, PCIOCGETCONF, (caddr_t)&pci, + td->td_ucred, td)) != 0) + goto cleanup; + + nmatch_to_convert = min(nmatch_to_convert, pci.num_matches); + + for (i = 0, pcp = pci.matches, + pc32p = (struct pci_conf32 *)PTRIN(pci32.matches); + i < nmatch_to_convert; i++, pcp++, pc32p++) { + if ((error = copyin(pcp, &pc, sizeof(pc))) != 0) + goto cleanup; + CP(pc,pc32,pc_sel); + CP(pc,pc32,pc_hdr); + CP(pc,pc32,pc_subvendor); + CP(pc,pc32,pc_subdevice); + CP(pc,pc32,pc_vendor); + CP(pc,pc32,pc_device); + CP(pc,pc32,pc_class); + CP(pc,pc32,pc_subclass); + CP(pc,pc32,pc_progif); + CP(pc,pc32,pc_revid); + strlcpy(pc32.pd_name, pc.pd_name, sizeof(pc32.pd_name)); + CP(pc,pc32,pd_unit); + if ((error = copyout(&pc32, pc32p, sizeof(pc32))) != 0) + goto cleanup; + } + + CP(pci, pci32, num_matches); + CP(pci, pci32, offset); + CP(pci, pci32, generation); + CP(pci, pci32, status); + + error = copyout(&pci32, uap->data, sizeof(pci32)); + +cleanup: + if (pci.patterns) + copyout_unmap(td, (vm_offset_t)pci.patterns, pci.pat_buf_len); + if (pci.matches) + copyout_unmap(td, (vm_offset_t)pci.matches, pci.match_buf_len); + return (error); } @@ -219,16 +369,29 @@ freebsd32_ioctl(struct thread *td, struc case MDIOCDETACH_32: /* FALLTHROUGH */ case MDIOCQUERY_32: /* FALLTHROUGH */ case MDIOCLIST_32: - return freebsd32_ioctl_md(td, uap, fp); + error = freebsd32_ioctl_md(td, uap, fp); + break; case CDIOREADTOCENTRYS_32: - return freebsd32_ioctl_ioc_read_toc(td, uap, fp); + error = freebsd32_ioctl_ioc_read_toc(td, uap, fp); + break; case CDIOREADTOCHEADER_32: - return freebsd32_ioctl_ioc_toc_header(td, uap, fp); + error = freebsd32_ioctl_ioc_toc_header(td, uap, fp); + break; case FIODGNAME_32: - return freebsd32_ioctl_fiodgname(td, uap, fp); + error = freebsd32_ioctl_fiodgname(td, uap, fp); + break; + + case MEMRANGE_GET32: /* FALLTHROUGH */ + case MEMRANGE_SET32: + error = freebsd32_ioctl_memrange(td, uap, fp); + break; + + case PCIOCGETCONF_32: + error = freebsd32_ioctl_pciocgetconf(td, uap, fp); + break; default: fdrop(fp, td); @@ -237,4 +400,7 @@ freebsd32_ioctl(struct thread *td, struc PTRIN_CP(*uap, ap, data); return ioctl(td, &ap); } + + fdrop(fp, td); + return error; } --- ./vm/vm_extern.h.ORIGINAL 2010-12-21 12:09:25.000000000 -0500 +++ ./vm/vm_extern.h 2011-03-23 02:26:54.000000000 -0400 @@ -88,5 +88,7 @@ void vm_thread_dispose(struct thread *td int vm_thread_new(struct thread *td, int pages); void vm_thread_swapin(struct thread *td); void vm_thread_swapout(struct thread *td); +int copyout_map(struct thread *td, vm_offset_t *addr, size_t sz); +int copyout_unmap(struct thread *td, vm_offset_t addr, size_t sz); #endif /* _KERNEL */ #endif /* !_VM_EXTERN_H_ */ --- ./vm/vm_glue.c.ORIGINAL 2010-12-21 12:09:25.000000000 -0500 +++ ./vm/vm_glue.c 2011-03-23 02:26:54.000000000 -0400 @@ -67,6 +67,7 @@ __FBSDID("$FreeBSD: src/sys/vm/vm_glue.c #include #include #include +#include #include #include #include @@ -1100,3 +1101,57 @@ swapout(p) return (0); } #endif /* !NO_SWAPPING */ + +/* + * Map some anonymous memory in user space of size sz, rounded up to the page + * boundary. + */ +int +copyout_map(struct thread *td, vm_offset_t *addr, size_t sz) +{ + struct vmspace *vms = td->td_proc->p_vmspace; + int error; + vm_size_t size; + + if (sz == 0) { + *addr = 0; + return 0; + } + + /* + * Map somewhere after heap in process memory. + */ + PROC_LOCK(td->td_proc); + *addr = round_page((vm_offset_t)vms->vm_daddr + + lim_max(td->td_proc, RLIMIT_DATA)); + PROC_UNLOCK(td->td_proc); + + /* round size up to page boundry */ + size = (vm_size_t) round_page(sz); + + error = vm_mmap(&vms->vm_map, addr, size, PROT_READ | PROT_WRITE, + VM_PROT_ALL, MAP_PRIVATE | MAP_ANON, OBJT_DEFAULT, NULL, 0); + + return (error); +} + +/* + * Unmap memory in user space. + */ +int +copyout_unmap(struct thread *td, vm_offset_t addr, size_t sz) +{ + vm_map_t map; + vm_size_t size; + + if (sz == 0) + return 0; + + map = &td->td_proc->p_vmspace->vm_map; + size = (vm_size_t) round_page(sz); + + if (!vm_map_remove(map, addr, addr + size)) + return (EINVAL); + + return (0); +} --- ./dev/ksyms/ksyms.c.ORIGINAL 2010-12-21 12:09:25.000000000 -0500 +++ ./dev/ksyms/ksyms.c 2011-03-23 02:27:23.000000000 -0400 @@ -360,53 +360,6 @@ ksyms_snapshot(struct tsizes *ts, vm_off return (error); } -/* - * Map some anonymous memory in user space of size sz, rounded up to the page - * boundary. - */ -static int -ksyms_map(struct thread *td, vm_offset_t *addr, size_t sz) -{ - struct vmspace *vms = td->td_proc->p_vmspace; - int error; - vm_size_t size; - - - /* - * Map somewhere after heap in process memory. - */ - PROC_LOCK(td->td_proc); - *addr = round_page((vm_offset_t)vms->vm_daddr + - lim_max(td->td_proc, RLIMIT_DATA)); - PROC_UNLOCK(td->td_proc); - - /* round size up to page boundry */ - size = (vm_size_t) round_page(sz); - - error = vm_mmap(&vms->vm_map, addr, size, PROT_READ | PROT_WRITE, - VM_PROT_ALL, MAP_PRIVATE | MAP_ANON, OBJT_DEFAULT, NULL, 0); - - return (error); -} - -/* - * Unmap memory in user space. - */ -static int -ksyms_unmap(struct thread *td, vm_offset_t addr, size_t sz) -{ - vm_map_t map; - vm_size_t size; - - map = &td->td_proc->p_vmspace->vm_map; - size = (vm_size_t) round_page(sz); - - if (!vm_map_remove(map, addr, addr + size)) - return (EINVAL); - - return (0); -} - static void ksyms_cdevpriv_dtr(void *data) { @@ -475,7 +428,7 @@ ksyms_open(struct cdev *dev, int flags, total_elf_sz = sizeof(struct ksyms_hdr) + ts.ts_symsz + ts.ts_strsz; - error = ksyms_map(td, &(sc->sc_uaddr), + error = copyout_map(td, &(sc->sc_uaddr), (vm_size_t) total_elf_sz); if (error) break; @@ -488,7 +441,7 @@ ksyms_open(struct cdev *dev, int flags, } /* Snapshot failed, unmap the memory and try again */ - (void) ksyms_unmap(td, sc->sc_uaddr, sc->sc_usize); + (void) copyout_unmap(td, sc->sc_uaddr, sc->sc_usize); } failed: @@ -624,7 +577,7 @@ ksyms_close(struct cdev *dev, int flags return (error); /* Unmap the buffer from the process address space. */ - error = ksyms_unmap(td, sc->sc_uaddr, sc->sc_usize); + error = copyout_unmap(td, sc->sc_uaddr, sc->sc_usize); devfs_clear_cdevpriv(); >Release-Note: >Audit-Trail: >Unformatted: From owner-freebsd-amd64@FreeBSD.ORG Thu Mar 24 11:44:45 2011 Return-Path: Delivered-To: amd64@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0317A1065675 for ; Thu, 24 Mar 2011 11:44:45 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id 91D628FC0C for ; Thu, 24 Mar 2011 11:44:44 +0000 (UTC) Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id p2OBR7cs001906 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 24 Mar 2011 13:27:07 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4) with ESMTP id p2OBR7gj032891; Thu, 24 Mar 2011 13:27:07 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4/Submit) id p2OBR7QK032890; Thu, 24 Mar 2011 13:27:07 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 24 Mar 2011 13:27:07 +0200 From: Kostik Belousov To: John Wehle Message-ID: <20110324112707.GD78089@deviant.kiev.zoral.com.ua> References: <201103240510.p2O5A9YJ057936@red.freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="z9gnJ0FuBGqVysVJ" Content-Disposition: inline In-Reply-To: <201103240510.p2O5A9YJ057936@red.freebsd.org> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-3.4 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00, DNS_FROM_OPENWHOIS autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: amd64@freebsd.org Subject: Re: amd64/155903: FreeBSD32 emulation patch to support i386 X11 Server X-BeenThere: freebsd-amd64@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting FreeBSD to the AMD64 platform List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Mar 2011 11:44:45 -0000 --z9gnJ0FuBGqVysVJ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Mar 24, 2011 at 05:10:09AM +0000, John Wehle wrote: >=20 > >Number: 155903 > >Category: amd64 > >Synopsis: FreeBSD32 emulation patch to support i386 X11 Server > >Confidential: no > >Severity: non-critical > >Priority: low > >Responsible: freebsd-amd64 > >State: open > >Quarter: =20 > >Keywords: =20 > >Date-Required: > >Class: sw-bug > >Submitter-Id: current-users > >Arrival-Date: Thu Mar 24 05:20:00 UTC 2011 > >Closed-Date: > >Last-Modified: > >Originator: John Wehle > >Release: 8.2 > >Organization: > >Environment: > 8.2-RELEASE amd64 > >Description: > The enclosed lightly tested patch extends the FreeBSD32 emulation > so that the i386 X11 server runs on amd64. Specifically tested: >=20 > a) i386 pciconf -v -l >=20 > b) i386 X11 Server 1.9.5 using the VESA driver. >=20 > Changes: >=20 > 1) Fix fd count leakage in the freebsd32_ioctl routines. >=20 > freebsd32_ioctl called fget for a fd and called a subroutine to hand= le > each specific ioctl. It was expected that the subroutine would call > fdrop when done. However many of the subroutines would exit out ear= ly > if copyin encountered an error resulting in fdrop never being called. >=20 > 2) Extend freebsd32_ioctl to handle MEMRANGE_GET, MEMRANGE_SET, and > PCIOCGETCONF. >=20 > 3) Promote ksyms_map / ksyms_unmap to copyout_map / copyout_unmap > as discussed on one of the mailing lists. Necessary in order to > handle PCIOCGETCONF. >=20 > 4) Modify copyout_map / copyout_unmap to handle size =3D=3D 0. All of this looks interesting. First, please split the patch into smaller, logically self-contained parts. E.g. the change to handle fdrop() in one place should be committed separately. Then, I propose to add the compat definitions of MEMRANGE_GET32, SET32 and PCIOCGETCONF_32. Then, we could move the copyin_map/copyout_map. Also, we could fix the sz =3D=3D 0 case. The last commit is the most controversial, in fact. I understand the reason to get the user memory for calling into pciconf ioctls, but this is somewhat ugly. Ideally, the pci_ioctl() would be changed into wrapper and core code, and two wrappers produced, one for the native call path, other for compat32. BTW, would you do the shims for other pciconf ioctls, while there ? >=20 > -- John >=20 > >How-To-Repeat: > Try running i386 X11 server on amd64 ... the X11 server will fail > to find any video cards since the PCIOCGETCONF doesn't work from > 32 bit binaries on amd64. It also has problems with mtrr. >=20 > You can also try running i386 pciconf -v -l which will fail to find > any hardware. --z9gnJ0FuBGqVysVJ Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iEYEARECAAYFAk2LKosACgkQC3+MBN1Mb4gXAwCfVOWgHs033FZKjIt9dgKh+31n 6ZkAn3q/CdK8ztWDK8kFf5Lw2ZkBl6vZ =h+Pj -----END PGP SIGNATURE----- --z9gnJ0FuBGqVysVJ-- From owner-freebsd-amd64@FreeBSD.ORG Thu Mar 24 15:40:03 2011 Return-Path: Delivered-To: freebsd-amd64@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 99259106564A for ; Thu, 24 Mar 2011 15:40:03 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 84C5F8FC0C for ; Thu, 24 Mar 2011 15:40:03 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id p2OFe3oE096326 for ; Thu, 24 Mar 2011 15:40:03 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id p2OFe3CC096324; Thu, 24 Mar 2011 15:40:03 GMT (envelope-from gnats) Date: Thu, 24 Mar 2011 15:40:03 GMT Message-Id: <201103241540.p2OFe3CC096324@freefall.freebsd.org> To: freebsd-amd64@FreeBSD.org From: Mark Linimon X-Mailman-Approved-At: Thu, 24 Mar 2011 15:59:08 +0000 Cc: Subject: Re: amd64/155903: FreeBSD32 emulation patch to support i386 X11 Server X-BeenThere: freebsd-amd64@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Mark Linimon List-Id: Porting FreeBSD to the AMD64 platform List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Mar 2011 15:40:03 -0000 The following reply was made to PR amd64/155903; it has been noted by GNATS. From: Mark Linimon To: bug-followup@FreeBSD.org Cc: Subject: Re: amd64/155903: FreeBSD32 emulation patch to support i386 X11 Server Date: Thu, 24 Mar 2011 10:34:30 -0500 ----- Forwarded message from Kostik Belousov ----- Date: Thu, 24 Mar 2011 13:27:07 +0200 From: Kostik Belousov To: John Wehle Cc: amd64@freebsd.org Subject: Re: amd64/155903: FreeBSD32 emulation patch to support i386 X11 Server User-Agent: Mutt/1.4.2.3i All of this looks interesting. First, please split the patch into smaller, logically self-contained parts. E.g. the change to handle fdrop() in one place should be committed separately. Then, I propose to add the compat definitions of MEMRANGE_GET32, SET32 and PCIOCGETCONF_32. Then, we could move the copyin_map/copyout_map. Also, we could fix the sz == 0 case. The last commit is the most controversial, in fact. I understand the reason to get the user memory for calling into pciconf ioctls, but this is somewhat ugly. Ideally, the pci_ioctl() would be changed into wrapper and core code, and two wrappers produced, one for the native call path, other for compat32. BTW, would you do the shims for other pciconf ioctls, while there ? ----- End forwarded message ----- From owner-freebsd-amd64@FreeBSD.ORG Thu Mar 24 20:39:42 2011 Return-Path: Delivered-To: amd64@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 54E78106566B for ; Thu, 24 Mar 2011 20:39:42 +0000 (UTC) (envelope-from john@feith.com) Received: from feith1.FEITH.COM (feith1.FEITH.COM [192.251.93.1]) by mx1.freebsd.org (Postfix) with ESMTP id 699178FC21 for ; Thu, 24 Mar 2011 20:39:40 +0000 (UTC) Received: from jwlab.FEITH.COM (jwlab.FEITH.COM [192.251.93.16]) by feith1.FEITH.COM (8.14.4+Sun/8.12.9) with ESMTP id p2OKJZNd012983; Thu, 24 Mar 2011 16:19:35 -0400 (EDT) (envelope-from john@jwlab.FEITH.COM) Received: from jwlab.FEITH.COM (localhost [127.0.0.1]) by jwlab.FEITH.COM (8.13.8+Sun/8.13.8) with ESMTP id p2OLQ9NW023022; Thu, 24 Mar 2011 17:26:09 -0400 (EDT) Received: (from john@localhost) by jwlab.FEITH.COM (8.13.8+Sun/8.13.8/Submit) id p2OLQ8HM023021; Thu, 24 Mar 2011 17:26:08 -0400 (EDT) Date: Thu, 24 Mar 2011 17:26:08 -0400 (EDT) From: John Wehle Message-Id: <201103242126.p2OLQ8HM023021@jwlab.FEITH.COM> To: kostikbel@gmail.com MIME-Version: 1.0 Content-Type: text/plain X-DCC-x.dcc-servers-Metrics: feith1; whitelist X-Scanned-By: MIMEDefang 2.67 on 192.251.93.1 X-Archived: cashew X-Mailman-Approved-At: Thu, 24 Mar 2011 20:49:40 +0000 Cc: amd64@freebsd.org Subject: Re: amd64/155903: FreeBSD32 emulation patch to support i386 X11 Server X-BeenThere: freebsd-amd64@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting FreeBSD to the AMD64 platform List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Mar 2011 20:39:42 -0000 > First, please split the patch into smaller, logically self-contained > parts. E.g. the change to handle fdrop() in one place should be committed > separately. Will do. Okay to just submit the series of patches under amd64/155903 or do you want them file under separate bug reports? > The last commit is the most controversial, in fact. I understand the > reason to get the user memory for calling into pciconf ioctls, but this > is somewhat ugly. Ideally, the pci_ioctl() would be changed into wrapper > and core code, and two wrappers produced, one for the native call path, > other for compat32. I don't necessarily disagree, however that's more work than I'm planning on at the moment. > BTW, would you do the shims for other pciconf ioctls, while there ? I would have if necesary (since I was there). However at a quick glance of pciio.h it didn't appear to me to be necessary. Also I do suspect that the i386 X11 Server is making successfuly use of some of the other calls. Keep in mind that the freebsd32 layer has generic handling for those ioctl calls that don't require anything special. I believe PCIOCREAD, PCIOCWRITE, and friends fall into that category since it appears the structures don't change size or alignment between i386 and amd64 (mind you this was based just on a quick glance at the header). -- John ------------------------------------------------------------------------- | Feith Systems | Voice: 1-215-646-8000 | Email: john@feith.com | | John Wehle | Fax: 1-215-540-5495 | | ------------------------------------------------------------------------- From owner-freebsd-amd64@FreeBSD.ORG Thu Mar 24 21:49:05 2011 Return-Path: Delivered-To: amd64@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D9F37106566B for ; Thu, 24 Mar 2011 21:49:05 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id 564AF8FC13 for ; Thu, 24 Mar 2011 21:49:04 +0000 (UTC) Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id p2OLmv9H059467 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 24 Mar 2011 23:48:57 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4) with ESMTP id p2OLmvGm035347; Thu, 24 Mar 2011 23:48:57 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4/Submit) id p2OLmva2035346; Thu, 24 Mar 2011 23:48:57 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 24 Mar 2011 23:48:57 +0200 From: Kostik Belousov To: John Wehle Message-ID: <20110324214857.GE78089@deviant.kiev.zoral.com.ua> References: <201103242126.p2OLQ8HM023021@jwlab.FEITH.COM> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="N17FoJWtlLf7DYpQ" Content-Disposition: inline In-Reply-To: <201103242126.p2OLQ8HM023021@jwlab.FEITH.COM> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-3.4 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00, DNS_FROM_OPENWHOIS autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: amd64@freebsd.org Subject: Re: amd64/155903: FreeBSD32 emulation patch to support i386 X11 Server X-BeenThere: freebsd-amd64@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting FreeBSD to the AMD64 platform List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Mar 2011 21:49:05 -0000 --N17FoJWtlLf7DYpQ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Mar 24, 2011 at 05:26:08PM -0400, John Wehle wrote: > > First, please split the patch into smaller, logically self-contained > > parts. E.g. the change to handle fdrop() in one place should be committ= ed > > separately. >=20 > Will do. Okay to just submit the series of patches under amd64/155903 > or do you want them file under separate bug reports? Simply mail the patches to me, with some words attached. I will land them into the tree. >=20 > > The last commit is the most controversial, in fact. I understand the > > reason to get the user memory for calling into pciconf ioctls, but this > > is somewhat ugly. Ideally, the pci_ioctl() would be changed into wrapper > > and core code, and two wrappers produced, one for the native call path, > > other for compat32. >=20 > I don't necessarily disagree, however that's more work than I'm planning = on > at the moment. Sigh. >=20 > > BTW, would you do the shims for other pciconf ioctls, while there ? >=20 > I would have if necesary (since I was there). However at a quick glance > of pciio.h it didn't appear to me to be necessary. Also I do suspect > that the i386 X11 Server is making successfuly use of some of the other > calls. >=20 > Keep in mind that the freebsd32 layer has generic handling for those > ioctl calls that don't require anything special. I believe PCIOCREAD, > PCIOCWRITE, and friends fall into that category since it appears the > structures don't change size or alignment between i386 and amd64 > (mind you this was based just on a quick glance at the header). This is good answer, I wanted to make sure that ioctls that need special handling are handled. Thanks. --N17FoJWtlLf7DYpQ Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iEYEARECAAYFAk2LvEkACgkQC3+MBN1Mb4jHtwCgkIGQqGCBJcndvftn4UTPPyuD NcYAni3Jtwa9QQTgbtqjHtaVjVGHOyVK =vBcb -----END PGP SIGNATURE----- --N17FoJWtlLf7DYpQ--