From mboxrd@z Thu Jan 1 00:00:00 1970 From: linux@arm.linux.org.uk (Russell King - ARM Linux) Date: Thu, 27 Jan 2011 17:37:16 +0000 Subject: HIGHMEM is broken when working in SMP V6 mode In-Reply-To: References: <20110123145639.GB30094@n2100.arm.linux.org.uk> <20110123170830.GG30094@n2100.arm.linux.org.uk> Message-ID: <20110127173716.GA605@n2100.arm.linux.org.uk> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org 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.