Port-arm archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Unaligned access in kernel on ARMv6+ (Re: CVS commit: src/sys/dev/usb)

> On Jan 6, 2019, at 5:36 AM, Martin Husemann <martin%duskware.de@localhost> 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

Home | Main Index | Thread Index | Old Index