All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sean Christopherson <seanjc@google.com>
To: lirongqing <lirongqing@baidu.com>
Cc: pbonzini@redhat.com, vkuznets@redhat.com, tglx@linutronix.de,
	 mingo@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com,
	x86@kernel.org,  hpa@zytor.com, kvm@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] x86/kvm: Downgrade host poll messages to pr_debug_once()
Date: Tue, 22 Jul 2025 10:27:40 -0700	[thread overview]
Message-ID: <aH_KDFJsH3i7xF-e@google.com> (raw)
In-Reply-To: <20250722074958.2567-1-lirongqing@baidu.com>

On Tue, Jul 22, 2025, lirongqing wrote:
> From: Li RongQing <lirongqing@baidu.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@baidu.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
> 

      reply	other threads:[~2025-07-22 17:27 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-22  7:49 [PATCH] x86/kvm: Downgrade host poll messages to pr_debug_once() lirongqing
2025-07-22 17:27 ` Sean Christopherson [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aH_KDFJsH3i7xF-e@google.com \
    --to=seanjc@google.com \
    --cc=bp@alien8.de \
    --cc=dave.hansen@linux.intel.com \
    --cc=hpa@zytor.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lirongqing@baidu.com \
    --cc=mingo@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=tglx@linutronix.de \
    --cc=vkuznets@redhat.com \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.