From owner-freebsd-amd64@FreeBSD.ORG Thu Feb 6 19:22:12 2014 Return-Path: Delivered-To: freebsd-amd64@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 720EA7CC; Thu, 6 Feb 2014 19:22:12 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 48D711B0C; Thu, 6 Feb 2014 19:22:12 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id D6324B976; Thu, 6 Feb 2014 14:22:08 -0500 (EST) From: John Baldwin To: freebsd-amd64@freebsd.org Subject: Re: amd64/186291: Compilation fail when "device pst" in kernel config on amd64. Date: Thu, 6 Feb 2014 13:22:52 -0500 User-Agent: KMail/1.13.5 (FreeBSD/8.4-CBSD-20130906; KDE/4.5.5; amd64; ; ) References: <201401310700.s0V70RTv017959@oldred.freebsd.org> In-Reply-To: <201401310700.s0V70RTv017959@oldred.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201402061322.52522.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Thu, 06 Feb 2014 14:22:08 -0500 (EST) Cc: freebsd-gnats-submit@freebsd.org, Ivan Chetyrkin X-BeenThere: freebsd-amd64@freebsd.org X-Mailman-Version: 2.1.17 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, 06 Feb 2014 19:22:12 -0000 On Friday, January 31, 2014 2:00:27 am Ivan Chetyrkin wrote: > > >Number: 186291 > >Category: amd64 > >Synopsis: Compilation fail when "device pst" in kernel config on amd64. > >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: Fri Jan 31 07:10:00 UTC 2014 > >Closed-Date: > >Last-Modified: > >Originator: Ivan Chetyrkin > >Release: 10.0-STABLE > >Organization: > >Environment: > FreeBSD v64.devel.local 10.0-STABLE FreeBSD 10.0-STABLE #0: Thu Jan 30 21:31:03 UTC 2014 root@v64.devel.local:/usr/obj/usr/src/sys/VBOX64 amd64 > >Description: > When trying to compile my own kernel with "device pst" in configuration file, process fail with message: > > cc -c -O2 -pipe -fno-strict-aliasing -std=c99 -g -Wall -Wredundant-decls - Wnested-externs -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith - Winline -Wcast-qual -Wundef -Wno-pointer-sign -fformat-extensions -Wmissing- include-dirs -fdiagnostics-show-option -Wno-error-tautological-compare -Wno- error-empty-body -Wno-error-parentheses-equality -nostdinc -I. - I/usr/src/sys -I/usr/src/sys/contrib/altq -I/usr/src/sys/contrib/libfdt - D_KERNEL -DHAVE_KERNEL_OPTION_HEADERS -include opt_global.h -fno-omit-frame- pointer -mno-omit-leaf-frame-pointer -mno-aes -mno-avx -mcmodel=kernel -mno- red-zone -mno-mmx -mno-sse -msoft-float -fno-asynchronous-unwind-tables - ffreestanding -fstack-protector -Werror /usr/src/sys/dev/pst/pst-iop.c > /usr/src/sys/dev/pst/pst-iop.c:197:3: error: cast to 'void (*)(struct iop_softc *, u_int32_t, struct i2o_single_reply *)' from smaller integer type 'u_int32_t' (aka 'unsigned int') > [-Werror,-Wint-to-pointer-cast] > ((void (*)(struct iop_softc *, u_int32_t, struct i2o_single_reply *)) > ^ > /usr/src/sys/dev/pst/pst-iop.c:419:9: error: cast to 'struct iop_request *' from smaller integer type 'u_int32_t' (aka 'unsigned int') [-Werror,-Wint-to- pointer-cast] > (struct iop_request *)reply->transaction_context; > ^ > 2 errors generated. > > As we see from /usr/src/sys/dev/pst/pst-iop.h, initiator_context and transaction_context fields of driver message struct are declared as u_int32_t, which doesn't match pointer size on 64-bit processor. > >How-To-Repeat: > On amd64 machine include > device pst > in your config file and try compile kernel. > >Fix: > The controller is very old hardware and one of fix may be exclude it from available devices on amd64 platform. Yes, this driver is not supported on amd64. Do you need it to work? You would need to implement a cookie hash table of some sort to map transaction context IDs to request pointers. If you do not need it, we should probably disable it on amd64 as no one else has asked about it. -- John Baldwin