tech-kern 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 7,  8:46am, mrg%eterna.com.au@localhost (matthew green) wrote:
-- Subject: re: Unaligned access in kernel on ARMv6+ (Re: CVS commit: src/sys

| > http://netbsd.org/~kamil/kubsan/0007-boot-real-hardware.txt
| 
| for xhci, all of these seem to be the same issue and it
| appears to be a "high level allocator doesn't know what
| it is allocating and does not align properly".  the
| problem is likely:
| 
| #define XHCI_TRB_ALIGN 16
| struct xhci_trb {
| ...
| } __packed __aligned(XHCI_TRB_ALIGN);   
| 
| which is included in:
| 
| struct xhci_softc {
| ...
|         struct xhci_trb sc_result_trb;
| 
| 
| ... how do we convey the structure alignment needed for
| softc, or do we fix it by moving it into its own separate
| aligned allocation?

Shouldn't the compiler know how to do this right by padding around the
structure that needs alignment and assuming the default alignment for
the enclosing structure?

christos


Home | Main Index | Thread Index | Old Index