Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'x86-cache-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull x86 cache resource control update from Ingo Molnar:
"Two cleanup patches"

* 'x86-cache-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
x86/resctrl: Cleanup cbm_ensure_valid()
x86/resctrl: Use _ASM_BX to avoid ifdeffery

+7 -11
+1 -5
arch/x86/kernel/cpu/resctrl/pseudo_lock.c
··· 431 431 #else 432 432 register unsigned int line_size asm("esi"); 433 433 register unsigned int size asm("edi"); 434 - #ifdef CONFIG_X86_64 435 - register void *mem_r asm("rbx"); 436 - #else 437 - register void *mem_r asm("ebx"); 438 - #endif /* CONFIG_X86_64 */ 434 + register void *mem_r asm(_ASM_BX); 439 435 #endif /* CONFIG_KASAN */ 440 436 441 437 /*
+6 -6
arch/x86/kernel/cpu/resctrl/rdtgroup.c
··· 2488 2488 * modification to the CBM if the default does not satisfy the 2489 2489 * requirements. 2490 2490 */ 2491 - static void cbm_ensure_valid(u32 *_val, struct rdt_resource *r) 2491 + static u32 cbm_ensure_valid(u32 _val, struct rdt_resource *r) 2492 2492 { 2493 - unsigned long val = *_val; 2494 2493 unsigned int cbm_len = r->cache.cbm_len; 2495 2494 unsigned long first_bit, zero_bit; 2495 + unsigned long val = _val; 2496 2496 2497 - if (val == 0) 2498 - return; 2497 + if (!val) 2498 + return 0; 2499 2499 2500 2500 first_bit = find_first_bit(&val, cbm_len); 2501 2501 zero_bit = find_next_zero_bit(&val, cbm_len, first_bit); 2502 2502 2503 2503 /* Clear any remaining bits to ensure contiguous region */ 2504 2504 bitmap_clear(&val, zero_bit, cbm_len - zero_bit); 2505 - *_val = (u32)val; 2505 + return (u32)val; 2506 2506 } 2507 2507 2508 2508 /* ··· 2560 2560 * Force the initial CBM to be valid, user can 2561 2561 * modify the CBM based on system availability. 2562 2562 */ 2563 - cbm_ensure_valid(&d->new_ctrl, r); 2563 + d->new_ctrl = cbm_ensure_valid(d->new_ctrl, r); 2564 2564 /* 2565 2565 * Assign the u32 CBM to an unsigned long to ensure that 2566 2566 * bitmap_weight() does not access out-of-bound memory.