From owner-freebsd-alpha Tue Nov 24 12:39:21 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id MAA03586 for freebsd-alpha-outgoing; Tue, 24 Nov 1998 12:39:21 -0800 (PST) (envelope-from owner-freebsd-alpha@FreeBSD.ORG) Received: from nlsystems.com (nlsys.demon.co.uk [158.152.125.33]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id MAA03581 for ; Tue, 24 Nov 1998 12:39:18 -0800 (PST) (envelope-from dfr@nlsystems.com) Received: from herring.nlsystems.com (herring.nlsystems.com [10.0.0.2]) by nlsystems.com (8.9.1/8.8.5) with SMTP id UAA07946; Tue, 24 Nov 1998 20:41:18 GMT Date: Tue, 24 Nov 1998 20:41:18 +0000 (GMT) From: Doug Rabson To: Simon Shapiro cc: freebsd-alpha@FreeBSD.ORG, Mike Smith Subject: Re: UnAligned Access, but why? In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-alpha@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org On Tue, 24 Nov 1998, Simon Shapiro wrote: > OK. This all makes lots of sense, but look at the example I provided in > the original post. It is a modification of code I did not write, but some > of you may have: > > /* static __inline void */ > void > bus_space_write_4(bus_space_tag_t tag, bus_space_handle_t bsh, > bus_size_t offset, u_int32_t value) > { > #if defined(_ALPHA_BUS_PIO_H_) > #if defined(_ALPHA_BUS_MEMIO_H_) > if (tag == ALPHA_BUS_SPACE_IO) > #endif > { > u_int32_t port, data; > > port = (u_int32_t)bsh + (u_int32_t)offset; > data = (u_int32_t)value; > > printf("%s.%d I/O handle = %x, offset = %x, value = %x\n", __FILE__, > __LINE__, b > sh, offset, value); > printf("%s.%d I/O port = %x, data = %x\n", __FILE__, __LINE__, port, data); > > >>>>-------->>>> Everything is honky-dory until this point <<<<--------<<<< > outl(port, data); > >>>>-------->>>> This printf never happens. We panic before it happens > > printf("%s.%d I/O DONE = %x, data = %x\n", __FILE__, __LINE__, port, data); > } > #endif > #if defined(_ALPHA_BUS_MEMIO_H_) > #if defined(_ALPHA_BUS_PIO_H_) > else > #endif > writel(bsh + offset, value); > #endif > } > > You can trace back this call to the sys/dev/dpt/dpt_scsi.c file the > dpt_send_eata_command function, line 1088, where the line: > > dpt_outl(dpt, HA_WDMAADDR, cmd_busaddr); > > can be traced back to bus_space_write_4 above. Please trust me in saying > that I tried everything you suggest before posting my mssage. The casts at > the top of my example were necessary to avoid a similar panic. All the > data types involoved are taken from the CAM code and are either pointers or > 64bit integers. Ok, its fairly obvious that something strange is happening here. What is the faulting address for the unaligned access (the value of a0 in the printtrap() report)? The code which implements the various variants of inx, outx etc. is in the chipset implementations in sys/alpha/pci. You are probably using the implementation in cia.c (you have a Miata right?) which uses the byte-word-extension instructions to access the i/o memory. The functions for this combination are named cia_bwx_in*, etc. -- Doug Rabson Mail: dfr@nlsystems.com Nonlinear Systems Ltd. Phone: +44 181 951 1891 Fax: +44 181 381 1039 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-alpha" in the body of the message