Re: [RFC PATCH v1 00/40] Meta Linux Kernel Port

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

 



On Monday 12 November 2012, James Hogan wrote:
> Using inline assembly actually causes us a few problems. There is no way
> for inline assembly to allow the compiler to intelligently generate
> [Reg+Reg] or [Reg+#imm] memory addressing like it can with volatile (and
> even if it could, the constraints would be hard/impossible to express
> due to the different encodings of GET and SET that have different
> immediate lengths and restrictions on register units). This results in
> extra code to do an ADD prior to the memory access, and will also
> increase register pressure.

Probably not something to do right away, but you should consider extending
your gcc so you can express the more complex constraints. That will likely
also improve the normal code that gcc generates.

> Note that Meta doesn't support unaligned accesses anyway so use of
> __packed on MMIO is likely broken from the outset.

The problem is actually the opposite: Some people incorrectly annotate
structures that are always aligned to be __packed. This has no effect
on architectures that support unaligned accesses, but causes the
access to be split into byte sized loads and stores on architectures
like Meta that cannot.

Note also that gcc is free to split any accesses for whatever reason
it deems necessary.

> I'd like to therefore
> keep using the <asm-generic/io.h> implementations of the __raw_* functions.

Ok, just be aware that if something breaks in device drivers because of
this, it can be a problem that is very hard to debug.

	Arnd
--
To unsubscribe from this list: send the line "unsubscribe linux-arch" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel]     [Kernel Newbies]     [x86 Platform Driver]     [Netdev]     [Linux Wireless]     [Netfilter]     [Bugtraq]     [Linux Filesystems]     [Yosemite Discussion]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Device Mapper]

  Powered by Linux