> On Jan 6, 2019, at 5:36 AM, Martin Husemann <mar...@duskware.de> wrote: > > On Sun, Jan 06, 2019 at 08:31:53AM -0500, Greg Troxel wrote: >> Why do we generate code with unaligned access in user space? That seems >> surprising, if the processor isn't happy about it. > > The processor is happy with it, both in user- and kernel space. > Only special memory regions mapped uncached make it trap. There is a performance penalty for unaligned accesses, and not even all ARM versions can do it in a way that produces the expected results. The device in question here is a USB device, and we support pre-ARMv6 systems that have USB capability. > Nick suggest to change the mapping for bus_dma to cached, which would avoid > the issue but may expose bugs in device drivers. That's probably a good idea in any case, because there will almost certainly be a performance benefit, but I still think ensuring that drivers don't perform unaligned accesses is desirable. -- thorpej
- re: CVS commit: src/sys/dev/usb matthew green
- Re: CVS commit: src/sys/dev/usb maya
- Unaligned access in kernel on ARMv6+ (Re: CVS co... Rin Okuyama
- Re: Unaligned access in kernel on ARMv6+ (Re... Nick Hudson
- Re: Unaligned access in kernel on ARMv6+... Christos Zoulas
- Re: Unaligned access in kernel on A... Nick Hudson
- Re: Unaligned access in kernel ... Christos Zoulas
- re: Unaligned access in kernel on ARMv6+ (Re... matthew green
- Re: Unaligned access in kernel on ARMv6+... Greg Troxel
- Re: Unaligned access in kernel on A... Martin Husemann
- Re: Unaligned access in kernel ... Jason Thorpe
- Re: Unaligned access in kernel ... Martin Husemann
- Re: Unaligned access in kernel on ARMv6+ (Re... Kamil Rytarowski
- re: Unaligned access in kernel on ARMv6+... matthew green
- Re: Unaligned access in kernel on A... Rin Okuyama
- Re: Unaligned access in kernel ... Nick Hudson
- Re: Unaligned access in kernel ... Rin Okuyama
- Re: Unaligned access in kernel on ARMv6+ (Re... Christos Zoulas
- Re: CVS commit: src/sys/dev/usb Robert Swindells
- Re: CVS commit: src/sys/dev/usb Michael van Elst
- Re: CVS commit: src/sys/dev/usb Rin Okuyama