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?
I don't know. I'll investigate.
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?
The reasoning is that the module not present (i.e. not compiled
in the kernel) is not easy to solve, while the module not loaded is
a matter of loading either kvm_pr or kvm_hv.
The nonexistence of both kvm_pr and kvm_hv is something I haven't seen
in the field and I'm somewhat theorizing about it. I wouldn't oppose to
simply check for the modules being loaded and use WARN.
Rather than parsing /proc/modinfo, can we check for /sys/module/$modname
instead, or something under that directory?
Just checked. If the existence of say /sys/module/kvm_hv is an indication
that the module kvm_hv is loaded, then I see no issues with checking for
this instead of parsing modinfo.
Thanks,
DHB
- Cole