[PATCH] KVM: Only display message about bios support disabled once

From: Mario Limonciello
Date: Thu May 26 2022 - 17:30:47 EST


On an OEM laptop I see the following message 10 times in my dmesg:
"kvm: support for 'kvm_amd' disabled by bios"

This might be useful the first time, but there really isn't a point
to showing the error 9 more times. The BIOS still has it disabled.
Change the message to only display one time.

Signed-off-by: Mario Limonciello <mario.limonciello@xxxxxxx>
---
arch/x86/kvm/x86.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index 4790f0d7d40b..80a8ea13f09a 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -8887,7 +8887,7 @@ int kvm_arch_init(void *opaque)
goto out;
}
if (ops->disabled_by_bios()) {
- pr_err_ratelimited("kvm: support for '%s' disabled by bios\n",
+ pr_err_once("kvm: support for '%s' disabled by bios\n",
ops->runtime_ops->name);
r = -EOPNOTSUPP;
goto out;
--
2.34.1