HIGHMEM is broken when working in SMP V6 mode

Russell King - ARM Linux linux at arm.linux.org.uk
Thu Jan 27 12:37:16 EST 2011


On Mon, Jan 24, 2011 at 02:58:07PM -0500, Nicolas Pitre wrote:
>  /*
> + * The reason for kmap_high_get() is to ensure that the currently kmap'd
> + * page usage count does not decrease to zero while we're using its
> + * existing virtual mapping in an atomic context.  With a VIVT cache this
> + * is essential to do, but with a VIPT cache this is only an optimization
> + * so not to pay the price of establishing a second mapping if an existing
> + * one can be used.  However, on platforms without hardware TLB maintainence
> + * broadcast, we simply cannot use ARCH_NEEDS_KMAP_HIGH_GET at all since
> + * the locking involved must also disable IRQs which is incompatible with
> + * the IPI mechanism used by global TLB operations.
> + */
> +#define ARCH_NEEDS_KMAP_HIGH_GET
> +#if defined(CONFIG_SMP) && defined(CONFIG_CPU_TLB_V6)
> +#undef ARCH_NEEDS_KMAP_HIGH_GET
> +#if defined(CONFIG_HIGHMEM) && defined(CONFIG_CPU_CACHE_VIVT)
> +#error "The sum of feature in your kernel config cannot be supported together"
> +#endif

This is wrong.  Take a moment to consider a kernel supporting an ARMv6
VIPT aliasing cache CPU and ARMv7 SMP.  Don't we need kmap_high_get()
for ARMv6 VIPT aliasing cache?

The effect of this is that dma_cache_maint_page() will create new mappings
which could be have the wrong colour - and therefore the subsequent cache
maintainence will not have the desired effect.

I think this may break OMAP.



More information about the linux-arm-kernel mailing list