Bug 203845
Summary: | Can't run qemu/kvm on 5.0.0 kernel (NULL pointer dereference) | ||
---|---|---|---|
Product: | Virtualization | Reporter: | Jiri Palecek (jpalecek) |
Component: | kvm | Assignee: | virtualization_kvm |
Status: | RESOLVED CODE_FIX | ||
Severity: | normal | CC: | seanjc |
Priority: | P1 | ||
Hardware: | All | ||
OS: | Linux | ||
Kernel Version: | 5.0.0 | Subsystem: | |
Regression: | No | Bisected commit-id: |
Description
Jiri Palecek
2019-06-07 15:57:49 UTC
The EIP and code stream puts this at the following line in mmu_alloc_direct_roots(): vcpu->arch.mmu->pae_root[i] = root | PT_PRESENT_MASK; The code in question is only encountered on a 32-bit KVM with two-dimensional paging (TDP) is disabled, i.e. without AMD's Nested Page Tables, which fits your setup (i686-pae on Athlon). What I can't figure out is how pae_root would be NULL in this scenario. There is one flow that I think could theoretically result in a NULL pae_root, but it would require using nested virtualization, which doesn't seem to be the case here. I tried to test my theory but running a 32-bit KVM without TDP just hangs for me, i.e. it appears to be broken on Intel VMX at least as far back as v4.20. What was the last kernel that did work on your system? That might help narrow down when things went awry. In the meantime, I'll try to debug/bisect the issue I'm seeing as time allows. Hello, thanks for looking at it. 4.18.20 works for me, while 4.19.37 doesn't. So, after bisecting, the first bad commit is: commit ee6268ba3a6861b2806e569bff7fe91fbdf846dd (refs/bisect/bad) Author: Liang Chen <liangchen.linux@gmail.com> Date: Wed Jul 25 16:32:14 2018 +0800 KVM: x86: Skip pae_root shadow allocation if tdp enabled Considering the fact that the pae_root shadow is not needed when tdp is in use, skip the pae_root shadow page allocation to allow mmu creation even not being able to obtain memory from DMA32 zone when particular cgroup cpuset.mems or mempolicy control is applied. Signed-off-by: Liang Chen <liangchen.linux@gmail.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Ah, I finally see how KVM ends up consuming a NULL pae_root. 32-bit KVM on SVM with nested page tables uses PAE tables in the host. I'll send a patch. Fixed by commit b6b80c78af |