powerpc fixes for 5.17 #3
- 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, Sachin Sant. -----BEGIN PGP SIGNATURE----- iQJHBAABCAAxFiEEJFGtCPCthwEv2Y/bUevqPMjhpYAFAmH1IV8THG1wZUBlbGxl cm1hbi5pZC5hdQAKCRBR6+o8yOGlgBp5D/0VWxmbrFOSX669t9ieTaUHSLWvoHf2 pK9QZ4DnOwBjxVsLdWfxVWO7dy0m7Pe0QTHB8JDi2aiuYcMPWronEf70WSvqsElK h/Y6V2usZhn+WVxtTaNollkYao9zCf48IPHQgNFaRQaPGHqVK28YiI2q/gh3OqHa 97pNMfzB0sRrZthZHhC8DlKpV/Wd1Kakos9qnT/RHiA49aja3CZA0NsvZeZ5ZER5 Su2BzcRorJmMIToJLzFtXjSJ6surLPYh0mpDMx0soHQUNQtlZ66JgDkhnwJR8Gj2 ffrI+brdTMKCNC5e7s2nOF+Dld8IC5TGg7RQgMFzXTEESmDrZXmCfmgZIS/Oidmv 2ghuqpvvkPifpny+GTScx6Uf9rByzWVKlPx6r0y8ZUryr47jdkzumIyuhU+XuA3P 6yDCZ0zeApnvhgVvSZqrNT7RduVgEpY1Ouc/JEXv0lUCqXb+FMusa6JCxRCle7O4 HBkLGVSEnOqbfkYo6ImfO05y+znYwYJUEwqGXBtQCEzYGAy7flWhS9FnT/YREKd0 MP9uHO57dJGWf5GVtueGEYY5r7t1pun3Lv3Hpw6S2wCkFPro9F+408uJQjZjlAkz pnIksL3ov+Kg998X0UOiFS4Y4OXhzcKsaJBEcaU4vTCMAgkPR3lSZuQyowrbi6a2 B+FjbnE4ScB5jg== =yhvx -----END PGP SIGNATURE----- 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
This commit is contained in:
commit
d66c1e79b9
@ -178,6 +178,7 @@ static inline bool pte_user(pte_t pte)
|
|||||||
#ifndef __ASSEMBLY__
|
#ifndef __ASSEMBLY__
|
||||||
|
|
||||||
int map_kernel_page(unsigned long va, phys_addr_t pa, pgprot_t prot);
|
int map_kernel_page(unsigned long va, phys_addr_t pa, pgprot_t prot);
|
||||||
|
void unmap_kernel_page(unsigned long va);
|
||||||
|
|
||||||
#endif /* !__ASSEMBLY__ */
|
#endif /* !__ASSEMBLY__ */
|
||||||
|
|
||||||
|
@ -1082,6 +1082,8 @@ static inline int map_kernel_page(unsigned long ea, unsigned long pa, pgprot_t p
|
|||||||
return hash__map_kernel_page(ea, pa, prot);
|
return hash__map_kernel_page(ea, pa, prot);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void unmap_kernel_page(unsigned long va);
|
||||||
|
|
||||||
static inline int __meminit vmemmap_create_mapping(unsigned long start,
|
static inline int __meminit vmemmap_create_mapping(unsigned long start,
|
||||||
unsigned long page_size,
|
unsigned long page_size,
|
||||||
unsigned long phys)
|
unsigned long phys)
|
||||||
|
@ -111,8 +111,10 @@ static inline void __set_fixmap(enum fixed_addresses idx,
|
|||||||
BUILD_BUG_ON(idx >= __end_of_fixed_addresses);
|
BUILD_BUG_ON(idx >= __end_of_fixed_addresses);
|
||||||
else if (WARN_ON(idx >= __end_of_fixed_addresses))
|
else if (WARN_ON(idx >= __end_of_fixed_addresses))
|
||||||
return;
|
return;
|
||||||
|
if (pgprot_val(flags))
|
||||||
map_kernel_page(__fix_to_virt(idx), phys, flags);
|
map_kernel_page(__fix_to_virt(idx), phys, flags);
|
||||||
|
else
|
||||||
|
unmap_kernel_page(__fix_to_virt(idx));
|
||||||
}
|
}
|
||||||
|
|
||||||
#define __early_set_fixmap __set_fixmap
|
#define __early_set_fixmap __set_fixmap
|
||||||
|
@ -39,7 +39,6 @@ struct kvm_nested_guest {
|
|||||||
pgd_t *shadow_pgtable; /* our page table for this guest */
|
pgd_t *shadow_pgtable; /* our page table for this guest */
|
||||||
u64 l1_gr_to_hr; /* L1's addr of part'n-scoped table */
|
u64 l1_gr_to_hr; /* L1's addr of part'n-scoped table */
|
||||||
u64 process_table; /* process table entry for this guest */
|
u64 process_table; /* process table entry for this guest */
|
||||||
u64 hfscr; /* HFSCR that the L1 requested for this nested guest */
|
|
||||||
long refcnt; /* number of pointers to this struct */
|
long refcnt; /* number of pointers to this struct */
|
||||||
struct mutex tlb_lock; /* serialize page faults and tlbies */
|
struct mutex tlb_lock; /* serialize page faults and tlbies */
|
||||||
struct kvm_nested_guest *next;
|
struct kvm_nested_guest *next;
|
||||||
|
@ -818,6 +818,7 @@ struct kvm_vcpu_arch {
|
|||||||
|
|
||||||
/* For support of nested guests */
|
/* For support of nested guests */
|
||||||
struct kvm_nested_guest *nested;
|
struct kvm_nested_guest *nested;
|
||||||
|
u64 nested_hfscr; /* HFSCR that the L1 requested for the nested guest */
|
||||||
u32 nested_vcpu_id;
|
u32 nested_vcpu_id;
|
||||||
gpa_t nested_io_gpr;
|
gpa_t nested_io_gpr;
|
||||||
#endif
|
#endif
|
||||||
|
@ -64,6 +64,7 @@ extern int icache_44x_need_flush;
|
|||||||
#ifndef __ASSEMBLY__
|
#ifndef __ASSEMBLY__
|
||||||
|
|
||||||
int map_kernel_page(unsigned long va, phys_addr_t pa, pgprot_t prot);
|
int map_kernel_page(unsigned long va, phys_addr_t pa, pgprot_t prot);
|
||||||
|
void unmap_kernel_page(unsigned long va);
|
||||||
|
|
||||||
#endif /* !__ASSEMBLY__ */
|
#endif /* !__ASSEMBLY__ */
|
||||||
|
|
||||||
|
@ -308,6 +308,7 @@ static inline void __ptep_set_access_flags(struct vm_area_struct *vma,
|
|||||||
#define __swp_entry_to_pte(x) __pte((x).val)
|
#define __swp_entry_to_pte(x) __pte((x).val)
|
||||||
|
|
||||||
int map_kernel_page(unsigned long ea, unsigned long pa, pgprot_t prot);
|
int map_kernel_page(unsigned long ea, unsigned long pa, pgprot_t prot);
|
||||||
|
void unmap_kernel_page(unsigned long va);
|
||||||
extern int __meminit vmemmap_create_mapping(unsigned long start,
|
extern int __meminit vmemmap_create_mapping(unsigned long start,
|
||||||
unsigned long page_size,
|
unsigned long page_size,
|
||||||
unsigned long phys);
|
unsigned long phys);
|
||||||
|
@ -649,7 +649,8 @@ DEFINE_INTERRUPT_HANDLER_ASYNC(timer_interrupt)
|
|||||||
__this_cpu_inc(irq_stat.timer_irqs_event);
|
__this_cpu_inc(irq_stat.timer_irqs_event);
|
||||||
} else {
|
} else {
|
||||||
now = *next_tb - now;
|
now = *next_tb - now;
|
||||||
if (now <= decrementer_max)
|
if (now > decrementer_max)
|
||||||
|
now = decrementer_max;
|
||||||
set_dec_or_work(now);
|
set_dec_or_work(now);
|
||||||
__this_cpu_inc(irq_stat.timer_irqs_others);
|
__this_cpu_inc(irq_stat.timer_irqs_others);
|
||||||
}
|
}
|
||||||
|
@ -1816,7 +1816,6 @@ static int kvmppc_handle_exit_hv(struct kvm_vcpu *vcpu,
|
|||||||
|
|
||||||
static int kvmppc_handle_nested_exit(struct kvm_vcpu *vcpu)
|
static int kvmppc_handle_nested_exit(struct kvm_vcpu *vcpu)
|
||||||
{
|
{
|
||||||
struct kvm_nested_guest *nested = vcpu->arch.nested;
|
|
||||||
int r;
|
int r;
|
||||||
int srcu_idx;
|
int srcu_idx;
|
||||||
|
|
||||||
@ -1922,7 +1921,7 @@ static int kvmppc_handle_nested_exit(struct kvm_vcpu *vcpu)
|
|||||||
* it into a HEAI.
|
* it into a HEAI.
|
||||||
*/
|
*/
|
||||||
if (!(vcpu->arch.hfscr_permitted & (1UL << cause)) ||
|
if (!(vcpu->arch.hfscr_permitted & (1UL << cause)) ||
|
||||||
(nested->hfscr & (1UL << cause))) {
|
(vcpu->arch.nested_hfscr & (1UL << cause))) {
|
||||||
vcpu->arch.trap = BOOK3S_INTERRUPT_H_EMUL_ASSIST;
|
vcpu->arch.trap = BOOK3S_INTERRUPT_H_EMUL_ASSIST;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -363,7 +363,7 @@ long kvmhv_enter_nested_guest(struct kvm_vcpu *vcpu)
|
|||||||
/* set L1 state to L2 state */
|
/* set L1 state to L2 state */
|
||||||
vcpu->arch.nested = l2;
|
vcpu->arch.nested = l2;
|
||||||
vcpu->arch.nested_vcpu_id = l2_hv.vcpu_token;
|
vcpu->arch.nested_vcpu_id = l2_hv.vcpu_token;
|
||||||
l2->hfscr = l2_hv.hfscr;
|
vcpu->arch.nested_hfscr = l2_hv.hfscr;
|
||||||
vcpu->arch.regs = l2_regs;
|
vcpu->arch.regs = l2_regs;
|
||||||
|
|
||||||
/* Guest must always run with ME enabled, HV disabled. */
|
/* Guest must always run with ME enabled, HV disabled. */
|
||||||
|
@ -206,6 +206,15 @@ void set_pte_at(struct mm_struct *mm, unsigned long addr, pte_t *ptep,
|
|||||||
__set_pte_at(mm, addr, ptep, pte, 0);
|
__set_pte_at(mm, addr, ptep, pte, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void unmap_kernel_page(unsigned long va)
|
||||||
|
{
|
||||||
|
pmd_t *pmdp = pmd_off_k(va);
|
||||||
|
pte_t *ptep = pte_offset_kernel(pmdp, va);
|
||||||
|
|
||||||
|
pte_clear(&init_mm, va, ptep);
|
||||||
|
flush_tlb_kernel_range(va, va + PAGE_SIZE);
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This is called when relaxing access to a PTE. It's also called in the page
|
* This is called when relaxing access to a PTE. It's also called in the page
|
||||||
* fault path when we don't hit any of the major fault cases, ie, a minor
|
* fault path when we don't hit any of the major fault cases, ie, a minor
|
||||||
|
@ -1355,9 +1355,20 @@ static void power_pmu_disable(struct pmu *pmu)
|
|||||||
* Otherwise provide a warning if there is PMI pending, but
|
* Otherwise provide a warning if there is PMI pending, but
|
||||||
* no counter is found overflown.
|
* no counter is found overflown.
|
||||||
*/
|
*/
|
||||||
if (any_pmc_overflown(cpuhw))
|
if (any_pmc_overflown(cpuhw)) {
|
||||||
|
/*
|
||||||
|
* Since power_pmu_disable runs under local_irq_save, it
|
||||||
|
* could happen that code hits a PMC overflow without PMI
|
||||||
|
* pending in paca. Hence only clear PMI pending if it was
|
||||||
|
* set.
|
||||||
|
*
|
||||||
|
* If a PMI is pending, then MSR[EE] must be disabled (because
|
||||||
|
* the masked PMI handler disabling EE). So it is safe to
|
||||||
|
* call clear_pmi_irq_pending().
|
||||||
|
*/
|
||||||
|
if (pmi_irq_pending())
|
||||||
clear_pmi_irq_pending();
|
clear_pmi_irq_pending();
|
||||||
else
|
} else
|
||||||
WARN_ON(pmi_irq_pending());
|
WARN_ON(pmi_irq_pending());
|
||||||
|
|
||||||
val = mmcra = cpuhw->mmcr.mmcra;
|
val = mmcra = cpuhw->mmcr.mmcra;
|
||||||
|
Loading…
Reference in New Issue
Block a user