xtensa: support aliasing cache in kmap
Define ARCH_PKMAP_COLORING and provide corresponding macro definitions on cores with aliasing data cache. Instead of single last_pkmap_nr maintain an array last_pkmap_nr_arr of pkmap counters for each page color. Make sure that kmap maps physical page at virtual address with color matching its physical address. Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
This commit is contained in:
@@ -14,6 +14,23 @@
|
||||
|
||||
static pte_t *kmap_pte;
|
||||
|
||||
#if DCACHE_WAY_SIZE > PAGE_SIZE
|
||||
unsigned int last_pkmap_nr_arr[DCACHE_N_COLORS];
|
||||
wait_queue_head_t pkmap_map_wait_arr[DCACHE_N_COLORS];
|
||||
|
||||
static void __init kmap_waitqueues_init(void)
|
||||
{
|
||||
unsigned int i;
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(pkmap_map_wait_arr); ++i)
|
||||
init_waitqueue_head(pkmap_map_wait_arr + i);
|
||||
}
|
||||
#else
|
||||
static inline void kmap_waitqueues_init(void)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
|
||||
static inline enum fixed_addresses kmap_idx(int type, unsigned long color)
|
||||
{
|
||||
return (type + KM_TYPE_NR * smp_processor_id()) * DCACHE_N_COLORS +
|
||||
@@ -72,4 +89,5 @@ void __init kmap_init(void)
|
||||
/* cache the first kmap pte */
|
||||
kmap_vstart = __fix_to_virt(FIX_KMAP_BEGIN);
|
||||
kmap_pte = kmap_get_fixmap_pte(kmap_vstart);
|
||||
kmap_waitqueues_init();
|
||||
}
|
||||
|
Reference in New Issue
Block a user