lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <aH_KDFJsH3i7xF-e@google.com>
Date: Tue, 22 Jul 2025 10:27:40 -0700
From: Sean Christopherson <seanjc@...gle.com>
To: lirongqing <lirongqing@...du.com>
Cc: pbonzini@...hat.com, vkuznets@...hat.com, tglx@...utronix.de, 
	mingo@...hat.com, bp@...en8.de, dave.hansen@...ux.intel.com, x86@...nel.org, 
	hpa@...or.com, kvm@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] x86/kvm: Downgrade host poll messages to pr_debug_once()

On Tue, Jul 22, 2025, lirongqing wrote:
> From: Li RongQing <lirongqing@...du.com>
> 
> The current host-side polling messages are misleading, as they will be
> printed when the hypervisor intentionally disables polling (by providing
> MWAIT to the guest) rather than due to version incompatibility. so
> Downgrade to pr_debug_once() to prevent spurious log messages.

I agree the messages are unfortunate, but the guest can't possibly know that the
host is correctly configured.  E.g. if MWAIT is allowed, but the host is still
intercepting HLT and the guest happens to choose HLT for idling, then the guest
is absolutely right to complain.

And there's really no reason for the host to NOT provide KVM_FEATURE_POLL_CONTROL.
The only thing the guest can do with MSR_KVM_POLL_CONTROL is to disable host-side
halt-polling, and for a KVM_HINTS_REALTIME vCPU, single_task_running() should hold
true the vast majority of the time.  I.e. a properly configured host won't actually
poll anyways, so providing KVM_FEATURE_POLL_CONTROL is basically a nop.

In other words, I agree using pr_err is annoying, but I don't think downgrading
it is quite right either.

> Signed-off-by: Li RongQing <lirongqing@...du.com>
> ---
>  arch/x86/kernel/kvm.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/x86/kernel/kvm.c b/arch/x86/kernel/kvm.c
> index 9cda79f..c5f96ee 100644
> --- a/arch/x86/kernel/kvm.c
> +++ b/arch/x86/kernel/kvm.c
> @@ -1136,8 +1136,8 @@ static void kvm_enable_host_haltpoll(void *i)
>  void arch_haltpoll_enable(unsigned int cpu)
>  {
>  	if (!kvm_para_has_feature(KVM_FEATURE_POLL_CONTROL)) {
> -		pr_err_once("host does not support poll control\n");
> -		pr_err_once("host upgrade recommended\n");
> +		pr_debug_once("host does not support poll control\n");
> +		pr_debug_once("host upgrade recommended\n");
>  		return;
>  	}
>  
> -- 
> 2.9.4
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ