Re: [PATCH] do not try to sync identity map for non-mapped pages

Tetsuo Handa
2013-03-07T22:05:25Z

Dave Hansen wrote:
>
> The original bug reporter says this fixes it for him, so I'm
> broadening the cc list a bit. I assume this should just get
> sucked in to the x86 tree.
>
> The double-signed-off-by from my is because my IBM email is
> going away very shortly.
>
> --
>
> kernel_map_sync_memtype() is called from a variety of contexts. The
> pat.c code that calls it seems to ensure that it is not called for
> non-ram areas by checking via pat_pagerange_is_ram(). It is important
> that it only be called on the actual identity map because there *IS*
> no map to sync for highmem pages, or for memory holes.
>
> The ioremap.c uses are not as careful as those from pat.c, and call
> kernel_map_sync_memtype() on PCI space which is in the middle of the
> kernel identity map _range_, but is not actually mapped.
>
> This patch adds a check to kernel_map_sync_memtype() which probably
> duplicates some of the checks already in pat.c. But, it is necessary
> for the ioremap.c uses and shouldn't hurt other callers.
>
> I have reproduced this bug and this patch fixes it for me and the
> original bug reporter:
>
> https://lkml.org/lkml/2013/2/5/396
>

Excuse me, but I didn't realize that the link is wrong.

https://lkml.org/lkml/2013/2/5/396 is a bug in CONFIG_MICROCODE_INTEL_EARLY=y
&& CONFIG_64BIT=n && CONFIG_DEBUG_VIRTUAL=y where patches are not available.

https://lkml.org/lkml/2013/3/5/314 is a bug in CONFIG_ACPI=y &&
CONFIG_DEBUG_VIRTUAL=y where your patch fixes.

Please use https://lkml.org/lkml/2013/3/5/314 rather than
https://lkml.org/lkml/2013/2/5/396 in your patch.

Regards.