On Mon, 10 Mar 2025, Eric Auger wrote:
Hi Philippe,
On 3/9/25 12:09 AM, Philippe Mathieu-Daudé wrote:
Use the runtime kvm_enabled() helper to check whether
KVM is available or not.
Miss the "why" of this patch.
By the way I fail to remember/see where kvm_allowed is set.
It's in include/system/kvm.h
I am also confused because we still have some code, like in
vfio/common.c which does both checks:
#ifdef CONFIG_KVM
if (kvm_enabled()) {
max_memslots = kvm_get_max_memslots();
}
#endif
I think this is because if KVM is not available the if cannot be true so
it can be left out altogether. This may make sense on platforms like
Windows and macOS where QEMU is compiled without KVM so basically
everywhere except Linux.
Regards,
BALATON Zoltan