
Hey Cole. I took my sweet time but I got some answers here: On 12/17/19 2:58 PM, Cole Robinson wrote:
On 12/12/19 4:11 PM, Daniel Henrique Barboza wrote:
POWER hosts does not implement CPU virtualization extensions like x86 or s390x. Instead, all bare-metal POWER hosts are considered to be virtualization ready.
For POWER, the validation is done by checking the virtualization kernel modules, kvm_hv and kvm_pr, to see if they are either not installed or not loaded in the host. If the KVM modules aren't present, we should not just warn but fail to validate.
This patch implements this support. If kvm_hv is not installed, which can be determined by 'modinfo' returning not-zero return code, fail the verification. If kvm_hv is installed but not loaded, show a warning. The exception are POWER8 hosts, which can work with kvm_pr. In its case, ACK the use of kvm_pr if kvm_hv is not loaded/present.
For x86, we check for /dev/kvm being available and usable. This side steps whether kvm is a module or not, in theory it could be compiled into the kernel. Is there anything in /dev we can check for power8?
The device /dev/kvm exists in Power even without the KVM module loaded. This is why we must check for kvm being loaded instead of relying in the /dev/kvm device being present. About KVM being compiled into the kernel, this is not possible for ppc64 at all - it must be a module. And in a quick check here it seems to be case for KVM_INTEL as well - you can choose either 'm' or 'N' in the config. You can't built it in the kernel.
I don't follow the reasoning for for why the module is installed vs loaded matters for FAIL vs WARN. Can you expand on that a bit more?
Rather than parsing /proc/modinfo, can we check for /sys/module/$modname instead, or something under that directory?
I'll drop the verification I was doing with modinfo to check for the module existence. Instead I'll just check for the 'kvm_hv' module being loaded and fire a WARN in case it isn't, regardless of being a Power 8 that can work with kvm_pr. This can be done by checking /proc/modules. kvm_pr is too slow for most usages and, now that PowerPC has nested support with kvm_hv, kvm_pr is now even more niche. The average user will want to use kvm_hv instead. Thanks, DHB
- Cole