KVM: PPC: Don't secretly add 1T segment feature to CPU
When we select a CPU type that does not support 1TB segments, we should not expose 1TB just because KVM supports 1TB segments. User configuration always wins over feature availability. Signed-off-by: Alexander Graf <agraf@suse.de>
This commit is contained in:
parent
c15424531f
commit
08215d8fd8
|
@ -356,6 +356,10 @@ static void kvm_fixup_page_sizes(PowerPCCPU *cpu)
|
||||||
/* Convert to QEMU form */
|
/* Convert to QEMU form */
|
||||||
memset(&env->sps, 0, sizeof(env->sps));
|
memset(&env->sps, 0, sizeof(env->sps));
|
||||||
|
|
||||||
|
/*
|
||||||
|
* XXX This loop should be an entry wide AND of the capabilities that
|
||||||
|
* the selected CPU has with the capabilities that KVM supports.
|
||||||
|
*/
|
||||||
for (ik = iq = 0; ik < KVM_PPC_PAGE_SIZES_MAX_SZ; ik++) {
|
for (ik = iq = 0; ik < KVM_PPC_PAGE_SIZES_MAX_SZ; ik++) {
|
||||||
struct ppc_one_seg_page_size *qsps = &env->sps.sps[iq];
|
struct ppc_one_seg_page_size *qsps = &env->sps.sps[iq];
|
||||||
struct kvm_ppc_one_seg_page_size *ksps = &smmu_info.sps[ik];
|
struct kvm_ppc_one_seg_page_size *ksps = &smmu_info.sps[ik];
|
||||||
|
@ -382,9 +386,7 @@ static void kvm_fixup_page_sizes(PowerPCCPU *cpu)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
env->slb_nr = smmu_info.slb_size;
|
env->slb_nr = smmu_info.slb_size;
|
||||||
if (smmu_info.flags & KVM_PPC_1T_SEGMENTS) {
|
if (!(smmu_info.flags & KVM_PPC_1T_SEGMENTS)) {
|
||||||
env->mmu_model |= POWERPC_MMU_1TSEG;
|
|
||||||
} else {
|
|
||||||
env->mmu_model &= ~POWERPC_MMU_1TSEG;
|
env->mmu_model &= ~POWERPC_MMU_1TSEG;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue