From: Paolo Bonzini <pbonzini@redhat.com>
To: Leonardo Bras <leobras@redhat.com>,
Sean Christopherson <seanjc@google.com>,
Vitaly Kuznetsov <vkuznets@redhat.com>,
Wanpeng Li <wanpengli@tencent.com>,
Jim Mattson <jmattson@google.com>, Joerg Roedel <joro@8bytes.org>,
Thomas Gleixner <tglx@linutronix.de>,
Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
Dave Hansen <dave.hansen@linux.intel.com>,
x86@kernel.org, "H. Peter Anvin" <hpa@zytor.com>
Cc: kvm@vger.kernel.org, linux-kernel@vger.kernel.org,
kernel test robot <lkp@intel.com>
Subject: Re: [PATCH v1 1/1] x86/kvm: Fix compilation warning in non-x86_64 builds
Date: Fri, 18 Feb 2022 09:36:01 +0100 [thread overview]
Message-ID: <49dcda6e-adf8-4e56-3525-ad5fbf371880@redhat.com> (raw)
In-Reply-To: <20220218034100.115702-1-leobras@redhat.com>
On 2/18/22 04:41, Leonardo Bras wrote:
> On non-x86_64 builds, the helper gtod_is_based_on_tsc() is defined but
> never used, which results in an warning with -Wunused-function, and
> becomes an error if -Werror is present.
>
> Add #ifdef so gtod_is_based_on_tsc() is only defined in x86_64 builds.
>
> Reported-by: kernel test robot <lkp@intel.com>
> Signed-off-by: Leonardo Bras <leobras@redhat.com>
> ---
> arch/x86/kvm/x86.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
> index ca0fae020961..b389517aa6ed 100644
> --- a/arch/x86/kvm/x86.c
> +++ b/arch/x86/kvm/x86.c
> @@ -2363,10 +2363,12 @@ static u64 compute_guest_tsc(struct kvm_vcpu *vcpu, s64 kernel_ns)
> return tsc;
> }
>
> +#ifdef CONFIG_X86_64
> static inline int gtod_is_based_on_tsc(int mode)
> {
> return mode == VDSO_CLOCKMODE_TSC || mode == VDSO_CLOCKMODE_HVCLOCK;
> }
> +#endif
>
> static void kvm_track_tsc_matching(struct kvm_vcpu *vcpu)
> {
More precisely, this is an "inline" in a .c (main compilation unit)
file. clang warns on them even though it doesn't do that on a .h
(included) file.
I tend not to rewind kvm/master and kvm/next unless absolutely
necessary, so I pushed an incremental fix for kvm_guest_supported_xfd()
as well.
Paolo
prev parent reply other threads:[~2022-02-18 8:36 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-18 3:41 Leonardo Bras
2022-02-18 8:36 ` Paolo Bonzini [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=49dcda6e-adf8-4e56-3525-ad5fbf371880@redhat.com \
--to=pbonzini@redhat.com \
--cc=bp@alien8.de \
--cc=dave.hansen@linux.intel.com \
--cc=hpa@zytor.com \
--cc=jmattson@google.com \
--cc=joro@8bytes.org \
--cc=kvm@vger.kernel.org \
--cc=leobras@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=lkp@intel.com \
--cc=mingo@redhat.com \
--cc=seanjc@google.com \
--cc=tglx@linutronix.de \
--cc=vkuznets@redhat.com \
--cc=wanpengli@tencent.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®