Re: [PATCH] dell-wmi: Stop storing pointers to DMI tables

From: Andy Lutomirski
Date: Fri Jan 15 2016 - 15:00:29 EST


On Fri, Jan 15, 2016 at 9:53 AM, Jean Delvare <jdelvare@xxxxxxx> wrote:
> Hi Andy,
>
> Le Friday 15 January 2016 Ã 08:27 -0800, Andy Lutomirski a Ãcrit :
>> FWIW, especially if we consider mapping it persistently, maybe we
>> should use ioremap_prot and map it both cached and ro.
>>
>> Actually, switching to a cached mapping regardless of persistence
>> could noticeably help boot times. UC accesses are very, very slow.
>
> Sorry if it is obvious for everybody else, but what does "UC accesses"
> mean?
>

Sorry, I sometimes have my head buried too far in the CPU :)

UC means uncached. ioremap, on x86, asks for an uncached mapping, so
every memory access (load or store) hits main memory individually.
Assuming that the spec says that whatever physical memory the DMI
tables live in is permitted to be used with cached accesses, asking
for the CPU cache to be permitted on those accesses will make them a
whole lot faster.

If that isn't safe, you could also just copy each table out of the
ioremap space into normal RAM as needed using MOVNTDQA. I forget what
the helper for that is called, but it basically does a fast streaming
IO read and then writes to normal RAM, memcpy style. Most modern CPUs
support it.

--Andy