[PATCH 0/4] Patches for -next
Russell King - ARM Linux
linux at arm.linux.org.uk
Wed May 26 14:28:10 EDT 2010
On Wed, May 26, 2010 at 02:06:35PM +0100, Catalin Marinas wrote:
> +#ifdef CONFIG_SMP
> +void __sync_icache_dcache(pte_t pteval)
> +{
> + struct page *page = pte_page(pteval);
> + struct address_space *mapping = page_mapping(page);
Err. no. You're assuming that the physical page associated with the
PTE always has a struct page. What if it's a device mapping? What
if it's a mapping for some memory which isn't being handled by the
kernel?
You want this to be:
unsigned long pfn = pte_pfn(pteval);
if (pfn_valid(pfn)) {
struct page *page = pfn_to_page(pfn);
struct address_space *mapping = page_mapping(page);
More information about the linux-arm-kernel
mailing list