Skip to content

Commit c63c50f

Browse files
committed
Merge tag 'powerpc-5.6-5' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux
Pull powerpc fixes from Michael Ellerman: "Two fixes for bugs introduced this cycle: - fix a crash when shutting down a KVM PR guest (our original style of KVM which doesn't use hypervisor mode) - fix for the recently added 32-bit KASAN_VMALLOC support Thanks to: Christophe Leroy, Greg Kurz, Sean Christopherson" * tag 'powerpc-5.6-5' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux: KVM: PPC: Fix kernel crash with PR KVM powerpc/kasan: Fix shadow memory protection with CONFIG_KASAN_VMALLOC
2 parents 5ad0ec0 + 1d0c32e commit c63c50f

File tree

3 files changed

+3
-9
lines changed

3 files changed

+3
-9
lines changed

arch/powerpc/kvm/book3s_pr.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1817,6 +1817,7 @@ static void kvmppc_core_vcpu_free_pr(struct kvm_vcpu *vcpu)
18171817
{
18181818
struct kvmppc_vcpu_book3s *vcpu_book3s = to_book3s(vcpu);
18191819

1820+
kvmppc_mmu_destroy_pr(vcpu);
18201821
free_page((unsigned long)vcpu->arch.shared & PAGE_MASK);
18211822
#ifdef CONFIG_KVM_BOOK3S_32_HANDLER
18221823
kfree(vcpu->arch.shadow_vcpu);

arch/powerpc/kvm/powerpc.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -759,7 +759,6 @@ int kvm_arch_vcpu_create(struct kvm_vcpu *vcpu)
759759
return 0;
760760

761761
out_vcpu_uninit:
762-
kvmppc_mmu_destroy(vcpu);
763762
kvmppc_subarch_vcpu_uninit(vcpu);
764763
return err;
765764
}
@@ -792,7 +791,6 @@ void kvm_arch_vcpu_destroy(struct kvm_vcpu *vcpu)
792791

793792
kvmppc_core_vcpu_free(vcpu);
794793

795-
kvmppc_mmu_destroy(vcpu);
796794
kvmppc_subarch_vcpu_uninit(vcpu);
797795
}
798796

arch/powerpc/mm/kasan/kasan_init_32.c

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -120,12 +120,6 @@ static void __init kasan_unmap_early_shadow_vmalloc(void)
120120
unsigned long k_cur;
121121
phys_addr_t pa = __pa(kasan_early_shadow_page);
122122

123-
if (!early_mmu_has_feature(MMU_FTR_HPTE_TABLE)) {
124-
int ret = kasan_init_shadow_page_tables(k_start, k_end);
125-
126-
if (ret)
127-
panic("kasan: kasan_init_shadow_page_tables() failed");
128-
}
129123
for (k_cur = k_start & PAGE_MASK; k_cur < k_end; k_cur += PAGE_SIZE) {
130124
pmd_t *pmd = pmd_offset(pud_offset(pgd_offset_k(k_cur), k_cur), k_cur);
131125
pte_t *ptep = pte_offset_kernel(pmd, k_cur);
@@ -143,7 +137,8 @@ void __init kasan_mmu_init(void)
143137
int ret;
144138
struct memblock_region *reg;
145139

146-
if (early_mmu_has_feature(MMU_FTR_HPTE_TABLE)) {
140+
if (early_mmu_has_feature(MMU_FTR_HPTE_TABLE) ||
141+
IS_ENABLED(CONFIG_KASAN_VMALLOC)) {
147142
ret = kasan_init_shadow_page_tables(KASAN_SHADOW_START, KASAN_SHADOW_END);
148143

149144
if (ret)

0 commit comments

Comments
 (0)