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

Pull powerpc fixes from Michael Ellerman:

- Fix VM debug warnings on boot triggered via __set_fixmap().

- Fix a debug warning in the 64-bit Book3S PMU handling code.

- Fix nested guest HFSCR handling with multiple vCPUs on Power9 or
later.

- Fix decrementer storm caused by a recent change, seen with some
configs.

Thanks to Alexey Kardashevskiy, Athira Rajeev, Christophe Leroy,
Fabiano Rosas, Maxime Bizon, Nicholas Piggin, and Sachin Sant.

* tag 'powerpc-5.17-3' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux:
powerpc/64s/interrupt: Fix decrementer storm
KVM: PPC: Book3S HV Nested: Fix nested HFSCR being clobbered with multiple vCPUs
powerpc/perf: Fix power_pmu_disable to call clear_pmi_irq_pending only if PMI is pending
powerpc/fixmap: Fix VM debug warning on unmap

+38 -11
+1
arch/powerpc/include/asm/book3s/32/pgtable.h
··· 178 178 #ifndef __ASSEMBLY__ 179 179 180 180 int map_kernel_page(unsigned long va, phys_addr_t pa, pgprot_t prot); 181 + void unmap_kernel_page(unsigned long va); 181 182 182 183 #endif /* !__ASSEMBLY__ */ 183 184
+2
arch/powerpc/include/asm/book3s/64/pgtable.h
··· 1082 1082 return hash__map_kernel_page(ea, pa, prot); 1083 1083 } 1084 1084 1085 + void unmap_kernel_page(unsigned long va); 1086 + 1085 1087 static inline int __meminit vmemmap_create_mapping(unsigned long start, 1086 1088 unsigned long page_size, 1087 1089 unsigned long phys)
+4 -2
arch/powerpc/include/asm/fixmap.h
··· 111 111 BUILD_BUG_ON(idx >= __end_of_fixed_addresses); 112 112 else if (WARN_ON(idx >= __end_of_fixed_addresses)) 113 113 return; 114 - 115 - map_kernel_page(__fix_to_virt(idx), phys, flags); 114 + if (pgprot_val(flags)) 115 + map_kernel_page(__fix_to_virt(idx), phys, flags); 116 + else 117 + unmap_kernel_page(__fix_to_virt(idx)); 116 118 } 117 119 118 120 #define __early_set_fixmap __set_fixmap
-1
arch/powerpc/include/asm/kvm_book3s_64.h
··· 39 39 pgd_t *shadow_pgtable; /* our page table for this guest */ 40 40 u64 l1_gr_to_hr; /* L1's addr of part'n-scoped table */ 41 41 u64 process_table; /* process table entry for this guest */ 42 - u64 hfscr; /* HFSCR that the L1 requested for this nested guest */ 43 42 long refcnt; /* number of pointers to this struct */ 44 43 struct mutex tlb_lock; /* serialize page faults and tlbies */ 45 44 struct kvm_nested_guest *next;
+1
arch/powerpc/include/asm/kvm_host.h
··· 818 818 819 819 /* For support of nested guests */ 820 820 struct kvm_nested_guest *nested; 821 + u64 nested_hfscr; /* HFSCR that the L1 requested for the nested guest */ 821 822 u32 nested_vcpu_id; 822 823 gpa_t nested_io_gpr; 823 824 #endif
+1
arch/powerpc/include/asm/nohash/32/pgtable.h
··· 64 64 #ifndef __ASSEMBLY__ 65 65 66 66 int map_kernel_page(unsigned long va, phys_addr_t pa, pgprot_t prot); 67 + void unmap_kernel_page(unsigned long va); 67 68 68 69 #endif /* !__ASSEMBLY__ */ 69 70
+1
arch/powerpc/include/asm/nohash/64/pgtable.h
··· 308 308 #define __swp_entry_to_pte(x) __pte((x).val) 309 309 310 310 int map_kernel_page(unsigned long ea, unsigned long pa, pgprot_t prot); 311 + void unmap_kernel_page(unsigned long va); 311 312 extern int __meminit vmemmap_create_mapping(unsigned long start, 312 313 unsigned long page_size, 313 314 unsigned long phys);
+3 -2
arch/powerpc/kernel/time.c
··· 649 649 __this_cpu_inc(irq_stat.timer_irqs_event); 650 650 } else { 651 651 now = *next_tb - now; 652 - if (now <= decrementer_max) 653 - set_dec_or_work(now); 652 + if (now > decrementer_max) 653 + now = decrementer_max; 654 + set_dec_or_work(now); 654 655 __this_cpu_inc(irq_stat.timer_irqs_others); 655 656 } 656 657
+1 -2
arch/powerpc/kvm/book3s_hv.c
··· 1816 1816 1817 1817 static int kvmppc_handle_nested_exit(struct kvm_vcpu *vcpu) 1818 1818 { 1819 - struct kvm_nested_guest *nested = vcpu->arch.nested; 1820 1819 int r; 1821 1820 int srcu_idx; 1822 1821 ··· 1921 1922 * it into a HEAI. 1922 1923 */ 1923 1924 if (!(vcpu->arch.hfscr_permitted & (1UL << cause)) || 1924 - (nested->hfscr & (1UL << cause))) { 1925 + (vcpu->arch.nested_hfscr & (1UL << cause))) { 1925 1926 vcpu->arch.trap = BOOK3S_INTERRUPT_H_EMUL_ASSIST; 1926 1927 1927 1928 /*
+1 -1
arch/powerpc/kvm/book3s_hv_nested.c
··· 363 363 /* set L1 state to L2 state */ 364 364 vcpu->arch.nested = l2; 365 365 vcpu->arch.nested_vcpu_id = l2_hv.vcpu_token; 366 - l2->hfscr = l2_hv.hfscr; 366 + vcpu->arch.nested_hfscr = l2_hv.hfscr; 367 367 vcpu->arch.regs = l2_regs; 368 368 369 369 /* Guest must always run with ME enabled, HV disabled. */
+9
arch/powerpc/mm/pgtable.c
··· 206 206 __set_pte_at(mm, addr, ptep, pte, 0); 207 207 } 208 208 209 + void unmap_kernel_page(unsigned long va) 210 + { 211 + pmd_t *pmdp = pmd_off_k(va); 212 + pte_t *ptep = pte_offset_kernel(pmdp, va); 213 + 214 + pte_clear(&init_mm, va, ptep); 215 + flush_tlb_kernel_range(va, va + PAGE_SIZE); 216 + } 217 + 209 218 /* 210 219 * This is called when relaxing access to a PTE. It's also called in the page 211 220 * fault path when we don't hit any of the major fault cases, ie, a minor
+14 -3
arch/powerpc/perf/core-book3s.c
··· 1355 1355 * Otherwise provide a warning if there is PMI pending, but 1356 1356 * no counter is found overflown. 1357 1357 */ 1358 - if (any_pmc_overflown(cpuhw)) 1359 - clear_pmi_irq_pending(); 1360 - else 1358 + if (any_pmc_overflown(cpuhw)) { 1359 + /* 1360 + * Since power_pmu_disable runs under local_irq_save, it 1361 + * could happen that code hits a PMC overflow without PMI 1362 + * pending in paca. Hence only clear PMI pending if it was 1363 + * set. 1364 + * 1365 + * If a PMI is pending, then MSR[EE] must be disabled (because 1366 + * the masked PMI handler disabling EE). So it is safe to 1367 + * call clear_pmi_irq_pending(). 1368 + */ 1369 + if (pmi_irq_pending()) 1370 + clear_pmi_irq_pending(); 1371 + } else 1361 1372 WARN_ON(pmi_irq_pending()); 1362 1373 1363 1374 val = mmcra = cpuhw->mmcr.mmcra;