Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 13 Nov 2010 17:21:47 -0800
From:      Garrett Cooper <gcooper@FreeBSD.org>
To:        delphij@freebsd.org
Cc:        Attilio Rao <attilio@freebsd.org>, scsi@freebsd.org, i386@freebsd.org
Subject:   Re: [head tinderbox] failure on i386/i386
Message-ID:  <AANLkTikcoGiuf%2BbHa_=vJeMgsaxtwk9iYzj2VWp4tUbz@mail.gmail.com>
In-Reply-To: <201011132338.oADNcZkA035129@freebsd-current.sentex.ca>
References:  <201011132338.oADNcZkA035129@freebsd-current.sentex.ca>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sat, Nov 13, 2010 at 3:38 PM, FreeBSD Tinderbox
<tinderbox@freebsd.org> wrote:
> TB --- 2010-11-13 21:00:00 - tinderbox 2.6 running on freebsd-current.sen=
tex.ca
> TB --- 2010-11-13 21:00:00 - starting HEAD tinderbox run for i386/i386
> TB --- 2010-11-13 21:00:00 - cleaning the object tree
> TB --- 2010-11-13 21:00:24 - cvsupping the source tree
> TB --- 2010-11-13 21:00:24 - /usr/bin/csup -z -r 3 -g -L 1 -h cvsup.sente=
x.ca /tinderbox/HEAD/i386/i386/supfile
> TB --- 2010-11-13 21:00:51 - building world
> TB --- 2010-11-13 21:00:51 - MAKEOBJDIRPREFIX=3D/obj
> TB --- 2010-11-13 21:00:51 - PATH=3D/usr/bin:/usr/sbin:/bin:/sbin
> TB --- 2010-11-13 21:00:51 - TARGET=3Di386
> TB --- 2010-11-13 21:00:51 - TARGET_ARCH=3Di386
> TB --- 2010-11-13 21:00:51 - TZ=3DUTC
> TB --- 2010-11-13 21:00:51 - __MAKE_CONF=3D/dev/null
> TB --- 2010-11-13 21:00:51 - cd /src
> TB --- 2010-11-13 21:00:51 - /usr/bin/make -B buildworld
>>>> World build started on Sat Nov 13 21:00:51 UTC 2010
>>>> 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
>>>> World build completed on Sat Nov 13 22:46:32 UTC 2010
> TB --- 2010-11-13 22:46:32 - generating LINT kernel config
> TB --- 2010-11-13 22:46:32 - cd /src/sys/i386/conf
> TB --- 2010-11-13 22:46:32 - /usr/bin/make -B LINT
> TB --- 2010-11-13 22:46:32 - building LINT kernel
> TB --- 2010-11-13 22:46:32 - MAKEOBJDIRPREFIX=3D/obj
> TB --- 2010-11-13 22:46:32 - PATH=3D/usr/bin:/usr/sbin:/bin:/sbin
> TB --- 2010-11-13 22:46:32 - TARGET=3Di386
> TB --- 2010-11-13 22:46:32 - TARGET_ARCH=3Di386
> TB --- 2010-11-13 22:46:32 - TZ=3DUTC
> TB --- 2010-11-13 22:46:32 - __MAKE_CONF=3D/dev/null
> TB --- 2010-11-13 22:46:32 - cd /src
> TB --- 2010-11-13 22:46:32 - /usr/bin/make -B buildkernel KERNCONF=3DLINT
>>>> Kernel build for LINT started on Sat Nov 13 22:46:32 UTC 2010
>>>> 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
>>>> Kernel build for LINT completed on Sat Nov 13 23:13:00 UTC 2010
> TB --- 2010-11-13 23:13:00 - building GENERIC kernel
> TB --- 2010-11-13 23:13:00 - MAKEOBJDIRPREFIX=3D/obj
> TB --- 2010-11-13 23:13:00 - PATH=3D/usr/bin:/usr/sbin:/bin:/sbin
> TB --- 2010-11-13 23:13:00 - TARGET=3Di386
> TB --- 2010-11-13 23:13:00 - TARGET_ARCH=3Di386
> TB --- 2010-11-13 23:13:00 - TZ=3DUTC
> TB --- 2010-11-13 23:13:00 - __MAKE_CONF=3D/dev/null
> TB --- 2010-11-13 23:13:00 - cd /src
> TB --- 2010-11-13 23:13:00 - /usr/bin/make -B buildkernel KERNCONF=3DGENE=
RIC
>>>> Kernel build for GENERIC started on Sat Nov 13 23:13:00 UTC 2010
>>>> 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
>>>> Kernel build for GENERIC completed on Sat Nov 13 23:33:39 UTC 2010
> TB --- 2010-11-13 23:33:39 - WARNING: no kernel config for GENERIC64
> TB --- 2010-11-13 23:33:39 - building PAE kernel
> TB --- 2010-11-13 23:33:39 - MAKEOBJDIRPREFIX=3D/obj
> TB --- 2010-11-13 23:33:39 - PATH=3D/usr/bin:/usr/sbin:/bin:/sbin
> TB --- 2010-11-13 23:33:39 - TARGET=3Di386
> TB --- 2010-11-13 23:33:39 - TARGET_ARCH=3Di386
> TB --- 2010-11-13 23:33:39 - TZ=3DUTC
> TB --- 2010-11-13 23:33:39 - __MAKE_CONF=3D/dev/null
> TB --- 2010-11-13 23:33:39 - cd /src
> TB --- 2010-11-13 23:33:39 - /usr/bin/make -B buildkernel KERNCONF=3DPAE
>>>> Kernel build for PAE started on Sat Nov 13 23:33:40 UTC 2010
>>>> 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 -O -pipe =A0-std=3Dc99 -g -Wall -Wredundant-decls -Wnested-externs =
-Wstrict-prototypes =A0-Wmissing-prototypes -Wpointer-arith -Winline -Wcast=
-qual =A0-Wundef -Wno-pointer-sign -fformat-extensions -nostdinc =A0-I. -I/=
src/sys -I/src/sys/contrib/altq -D_KERNEL -DHAVE_KERNEL_OPTION_HEADERS -inc=
lude opt_global.h -fno-common -finline-limit=3D8000 --param inline-unit-gro=
wth=3D100 --param large-function-growth=3D1000 =A0-mno-align-long-strings -=
mpreferred-stack-boundary=3D2 -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-s=
se3 -ffreestanding -fstack-protector -Werror =A0/src/sys/xdr/xdr_mbuf.c
> cc -c -O -pipe =A0-std=3Dc99 -g -Wall -Wredundant-decls -Wnested-externs =
-Wstrict-prototypes =A0-Wmissing-prototypes -Wpointer-arith -Winline -Wcast=
-qual =A0-Wundef -Wno-pointer-sign -fformat-extensions -nostdinc =A0-I. -I/=
src/sys -I/src/sys/contrib/altq -D_KERNEL -DHAVE_KERNEL_OPTION_HEADERS -inc=
lude opt_global.h -fno-common -finline-limit=3D8000 --param inline-unit-gro=
wth=3D100 --param large-function-growth=3D1000 =A0-mno-align-long-strings -=
mpreferred-stack-boundary=3D2 -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-s=
se3 -ffreestanding -fstack-protector -Werror =A0/src/sys/xdr/xdr_mem.c
> cc -c -O -pipe =A0-std=3Dc99 -g -Wall -Wredundant-decls -Wnested-externs =
-Wstrict-prototypes =A0-Wmissing-prototypes -Wpointer-arith -Winline -Wcast=
-qual =A0-Wundef -Wno-pointer-sign -fformat-extensions -nostdinc =A0-I. -I/=
src/sys -I/src/sys/contrib/altq -D_KERNEL -DHAVE_KERNEL_OPTION_HEADERS -inc=
lude opt_global.h -fno-common -finline-limit=3D8000 --param inline-unit-gro=
wth=3D100 --param large-function-growth=3D1000 =A0-mno-align-long-strings -=
mpreferred-stack-boundary=3D2 -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-s=
se3 -ffreestanding -fstack-protector -Werror =A0/src/sys/xdr/xdr_reference.=
c
> cc -c -O -pipe =A0-std=3Dc99 -g -Wall -Wredundant-decls -Wnested-externs =
-Wstrict-prototypes =A0-Wmissing-prototypes -Wpointer-arith -Winline -Wcast=
-qual =A0-Wundef -Wno-pointer-sign -fformat-extensions -nostdinc =A0-I. -I/=
src/sys -I/src/sys/contrib/altq -D_KERNEL -DHAVE_KERNEL_OPTION_HEADERS -inc=
lude opt_global.h -fno-common -finline-limit=3D8000 --param inline-unit-gro=
wth=3D100 --param large-function-growth=3D1000 =A0-mno-align-long-strings -=
mpreferred-stack-boundary=3D2 -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-s=
se3 -ffreestanding -fstack-protector -Werror =A0/src/sys/xdr/xdr_sizeof.c
> cc -c -O -pipe =A0-std=3Dc99 -g -Wall -Wredundant-decls -Wnested-externs =
-Wstrict-prototypes =A0-Wmissing-prototypes -Wpointer-arith -Winline -Wcast=
-qual =A0-Wundef -Wno-pointer-sign -fformat-extensions -nostdinc =A0-I. -I/=
src/sys -I/src/sys/contrib/altq -D_KERNEL -DHAVE_KERNEL_OPTION_HEADERS -inc=
lude opt_global.h -fno-common -finline-limit=3D8000 --param inline-unit-gro=
wth=3D100 --param large-function-growth=3D1000 =A0-mno-align-long-strings -=
mpreferred-stack-boundary=3D2 -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-s=
se3 -ffreestanding -fstack-protector -Werror =A0/src/sys/dev/arcmsr/arcmsr.=
c
> cc1: warnings being treated as errors
> /src/sys/dev/arcmsr/arcmsr.c: In function 'arcmsr_action':
> /src/sys/dev/arcmsr/arcmsr.c:2475: warning: cast from pointer to integer =
of different size
> *** Error code 1
>
> Stop in /obj/i386.i386/src/sys/PAE.
> *** Error code 1
>
> Stop in /src.
> *** Error code 1

Hi Xin Li!
	There's some bad casting being done for PAE's _bus.h vs this driver;
the target data type is an 32-bit integer for non-PAE and 64-bit for
PAE [1]:

   37 #ifdef PAE
   38 typedef uint64_t bus_addr_t;
   39 #else
   40 typedef uint32_t bus_addr_t;

	But the type that it's trying to assign the value to is an 8-byte
integer (address) (!):

  630 struct ccb_scsiio {
  631         struct     ccb_hdr ccb_h;
  632         union      ccb *next_ccb;       /* Ptr for next CCB for actio=
n */
  633         u_int8_t   *req_map;            /* Ptr to mapping info */
  634         u_int8_t   *data_ptr;           /* Ptr to the data buf/SG lis=
t */
  635         u_int32_t  dxfer_len;           /* Data transfer length */

	data_ptr might need to be dereferenced, but there are other sections
in the code that pass (potentially by accident) today:

/sys/dev/arcmsr/arcmsr.c:		buffer =3D pccb->csio.data_ptr;
/sys/dev/arcmsr/arcmsr.c:		char *buffer=3Dpccb->csio.data_ptr;
/sys/dev/arcmsr/arcmsr.c:							, pccb->csio.data_ptr
/sys/dev/arcmsr/arcmsr.c:						seg.ds_addr =3D (bus_addr_t)pccb->csio.data_=
ptr;
/sys/dev/arcmsr/arcmsr.c:					segs=3D(struct bus_dma_segment
*)pccb->csio.data_ptr;

	There are some other minor issues with downcasting the integer in the
driver as well:

/sys/dev/arcmsr/arcmsr.c:			address_lo=3Darcmsr_htole32(dma_addr_lo32(dm_se=
gs[i].ds_addr));
/sys/dev/arcmsr/arcmsr.c:			address_hi=3Darcmsr_htole32(dma_addr_hi32(dm_se=
gs[i].ds_addr));
/sys/dev/arcmsr/arcmsr.c:						seg.ds_addr =3D (bus_addr_t)pccb->csio.data_=
ptr;
/sys/dev/arcmsr/arcmsr.c:	unsigned long srb_phyaddr=3D(unsigned
long)segs->ds_addr;

	In particular, AFAICT the 4th assignment shown above is wrong on PAE
(should be bus_addr_t, not unsigned long).
Thanks!
-Garrett



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?AANLkTikcoGiuf%2BbHa_=vJeMgsaxtwk9iYzj2VWp4tUbz>