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 tag 'powerpc-5.1-3' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux

Pull powerpc fixes from Michael Ellerman:
"One fix for a boot failure on 32-bit, introduced during the merge
window.

A fix for our handling of CLOCK_MONOTONIC in the 64-bit VDSO. Changing
the wall clock across the Y2038 boundary could cause CLOCK_MONOTONIC
to jump forward and backward.

Our spectre_v2 reporting was a bit confusing due to a bug I
introduced. On some systems it was reporting that the count cache was
disabled and also that we were flushing the count cache on context
switch. Only the former is true, and given that the count cache is
disabled it doesn't make any sense to flush it. No one reported it, so
presumably the presence of any mitigation is all people check for.

Finally a small build fix for zsmalloc on 32-bit.

Thanks to: Ben Hutchings, Christophe Leroy, Diana Craciun, Guenter
Roeck, Michael Neuling"

* tag 'powerpc-5.1-3' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux:
powerpc/security: Fix spectre_v2 reporting
powerpc/mm: Only define MAX_PHYSMEM_BITS in SPARSEMEM configurations
powerpc/6xx: fix setup and use of SPRN_SPRG_PGDIR for hash32
powerpc/vdso64: Fix CLOCK_MONOTONIC inconsistencies across Y2038

+25 -29
+1 -1
arch/powerpc/include/asm/mmu.h
··· 352 352 #if defined(CONFIG_SPARSEMEM_VMEMMAP) && defined(CONFIG_SPARSEMEM_EXTREME) && \ 353 353 defined (CONFIG_PPC_64K_PAGES) 354 354 #define MAX_PHYSMEM_BITS 51 355 - #else 355 + #elif defined(CONFIG_SPARSEMEM) 356 356 #define MAX_PHYSMEM_BITS 46 357 357 #endif 358 358
+4 -4
arch/powerpc/include/asm/vdso_datapage.h
··· 82 82 __u32 icache_block_size; /* L1 i-cache block size */ 83 83 __u32 dcache_log_block_size; /* L1 d-cache log block size */ 84 84 __u32 icache_log_block_size; /* L1 i-cache log block size */ 85 - __s32 wtom_clock_sec; /* Wall to monotonic clock */ 86 - __s32 wtom_clock_nsec; 87 - struct timespec stamp_xtime; /* xtime as at tb_orig_stamp */ 88 - __u32 stamp_sec_fraction; /* fractional seconds of stamp_xtime */ 85 + __u32 stamp_sec_fraction; /* fractional seconds of stamp_xtime */ 86 + __s32 wtom_clock_nsec; /* Wall to monotonic clock nsec */ 87 + __s64 wtom_clock_sec; /* Wall to monotonic clock sec */ 88 + struct timespec stamp_xtime; /* xtime as at tb_orig_stamp */ 89 89 __u32 syscall_map_64[SYSCALL_MAP_SIZE]; /* map of syscalls */ 90 90 __u32 syscall_map_32[SYSCALL_MAP_SIZE]; /* map of syscalls */ 91 91 };
-3
arch/powerpc/kernel/cpu_setup_6xx.S
··· 24 24 li r10,0 25 25 mtspr SPRN_SPRG_603_LRU,r10 /* init SW LRU tracking */ 26 26 END_MMU_FTR_SECTION_IFSET(MMU_FTR_NEED_DTLB_SW_LRU) 27 - lis r10, (swapper_pg_dir - PAGE_OFFSET)@h 28 - ori r10, r10, (swapper_pg_dir - PAGE_OFFSET)@l 29 - mtspr SPRN_SPRG_PGDIR, r10 30 27 31 28 BEGIN_FTR_SECTION 32 29 bl __init_fpu_registers
+6
arch/powerpc/kernel/head_32.S
··· 855 855 li r3,0 856 856 stw r3, RTAS_SP(r4) /* 0 => not in RTAS */ 857 857 #endif 858 + lis r4, (swapper_pg_dir - PAGE_OFFSET)@h 859 + ori r4, r4, (swapper_pg_dir - PAGE_OFFSET)@l 860 + mtspr SPRN_SPRG_PGDIR, r4 858 861 859 862 /* enable MMU and jump to start_secondary */ 860 863 li r4,MSR_KERNEL ··· 945 942 li r3,0 946 943 stw r3, RTAS_SP(r4) /* 0 => not in RTAS */ 947 944 #endif 945 + lis r4, (swapper_pg_dir - PAGE_OFFSET)@h 946 + ori r4, r4, (swapper_pg_dir - PAGE_OFFSET)@l 947 + mtspr SPRN_SPRG_PGDIR, r4 948 948 949 949 /* stack */ 950 950 lis r1,init_thread_union@ha
+8 -15
arch/powerpc/kernel/security.c
··· 190 190 bcs = security_ftr_enabled(SEC_FTR_BCCTRL_SERIALISED); 191 191 ccd = security_ftr_enabled(SEC_FTR_COUNT_CACHE_DISABLED); 192 192 193 - if (bcs || ccd || count_cache_flush_type != COUNT_CACHE_FLUSH_NONE) { 194 - bool comma = false; 193 + if (bcs || ccd) { 195 194 seq_buf_printf(&s, "Mitigation: "); 196 195 197 - if (bcs) { 196 + if (bcs) 198 197 seq_buf_printf(&s, "Indirect branch serialisation (kernel only)"); 199 - comma = true; 200 - } 201 198 202 - if (ccd) { 203 - if (comma) 204 - seq_buf_printf(&s, ", "); 205 - seq_buf_printf(&s, "Indirect branch cache disabled"); 206 - comma = true; 207 - } 208 - 209 - if (comma) 199 + if (bcs && ccd) 210 200 seq_buf_printf(&s, ", "); 211 201 212 - seq_buf_printf(&s, "Software count cache flush"); 202 + if (ccd) 203 + seq_buf_printf(&s, "Indirect branch cache disabled"); 204 + } else if (count_cache_flush_type != COUNT_CACHE_FLUSH_NONE) { 205 + seq_buf_printf(&s, "Mitigation: Software count cache flush"); 213 206 214 207 if (count_cache_flush_type == COUNT_CACHE_FLUSH_HW) 215 - seq_buf_printf(&s, "(hardware accelerated)"); 208 + seq_buf_printf(&s, " (hardware accelerated)"); 216 209 } else if (btb_flush_enabled) { 217 210 seq_buf_printf(&s, "Mitigation: Branch predictor state flush"); 218 211 } else {
+2 -2
arch/powerpc/kernel/vdso64/gettimeofday.S
··· 92 92 * At this point, r4,r5 contain our sec/nsec values. 93 93 */ 94 94 95 - lwa r6,WTOM_CLOCK_SEC(r3) 95 + ld r6,WTOM_CLOCK_SEC(r3) 96 96 lwa r9,WTOM_CLOCK_NSEC(r3) 97 97 98 98 /* We now have our result in r6,r9. We create a fake dependency ··· 125 125 bne cr6,75f 126 126 127 127 /* CLOCK_MONOTONIC_COARSE */ 128 - lwa r6,WTOM_CLOCK_SEC(r3) 128 + ld r6,WTOM_CLOCK_SEC(r3) 129 129 lwa r9,WTOM_CLOCK_NSEC(r3) 130 130 131 131 /* check if counter has updated */
+4 -4
arch/powerpc/mm/hash_low_32.S
··· 70 70 lis r0,KERNELBASE@h /* check if kernel address */ 71 71 cmplw 0,r4,r0 72 72 ori r3,r3,_PAGE_USER|_PAGE_PRESENT /* test low addresses as user */ 73 - mfspr r5, SPRN_SPRG_PGDIR /* virt page-table root */ 73 + mfspr r5, SPRN_SPRG_PGDIR /* phys page-table root */ 74 74 blt+ 112f /* assume user more likely */ 75 - lis r5,swapper_pg_dir@ha /* if kernel address, use */ 76 - addi r5,r5,swapper_pg_dir@l /* kernel page table */ 75 + lis r5, (swapper_pg_dir - PAGE_OFFSET)@ha /* if kernel address, use */ 76 + addi r5 ,r5 ,(swapper_pg_dir - PAGE_OFFSET)@l /* kernel page table */ 77 77 rlwimi r3,r9,32-12,29,29 /* MSR_PR -> _PAGE_USER */ 78 - 112: tophys(r5, r5) 78 + 112: 79 79 #ifndef CONFIG_PTE_64BIT 80 80 rlwimi r5,r4,12,20,29 /* insert top 10 bits of address */ 81 81 lwz r8,0(r5) /* get pmd entry */