From: Sean Christopherson <seanjc@google.com>
To: Like Xu <like.xu.linux@gmail.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>,
Shuah Khan <shuah@kernel.org>,
kvm@vger.kernel.org, linux-kselftest@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] KVM: selftests: Install sanitised kernel headers before compilation
Date: Mon, 19 Dec 2022 16:14:34 +0000 [thread overview]
Message-ID: <Y6CN6kWo+KPD5wOi@google.com> (raw)
In-Reply-To: <20221219095540.52208-1-likexu@tencent.com>
On Mon, Dec 19, 2022, Like Xu wrote:
> From: Like Xu <likexu@tencent.com>
>
> On many automated test boxes, selftests in a completely clean src tree
> will be compiled independently: "make -j -C tools/testing/selftests/kvm".
> Sometimes the compilation will fail and produce a false positive just
> due to missing kernel headers (or others hidden behind the complete
> kernel compilation or installation).
>
> Optimize this situation by explicitly adding the installation of sanitised
> kernel headers before compilation to the Makefile.
>
> Reported-by: Sean Christopherson <seanjc@google.com>
> Signed-off-by: Like Xu <likexu@tencent.com>
> ---
> tools/testing/selftests/kvm/Makefile | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/tools/testing/selftests/kvm/Makefile b/tools/testing/selftests/kvm/Makefile
> index 947676983da1..a33e2f72d745 100644
> --- a/tools/testing/selftests/kvm/Makefile
> +++ b/tools/testing/selftests/kvm/Makefile
> @@ -202,6 +202,11 @@ TEST_GEN_PROGS_EXTENDED += $(TEST_GEN_PROGS_EXTENDED_$(UNAME_M))
> LIBKVM += $(LIBKVM_$(UNAME_M))
>
> INSTALL_HDR_PATH = $(top_srcdir)/usr
> +
> +ifeq ($(shell make -j -C ../../../.. headers_install),)
> + $(error "Please install sanitised kernel headers manually.")
> +endif
Auto-installation of headers was recently removed[*], presumably whatever problem
existed with KSFT_KHDR_INSTALL also exists with this approach.
FWIW, I also find the need to manually do headers_install annoying, but it's easy
to workaround via bash aliases.
[*] https://lore.kernel.org/lkml/cover.1657296695.git.guillaume.tucker@collabora.com
prev parent reply other threads:[~2022-12-19 16:15 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-19 9:55 [PATCH] KVM: selftests: Install sanitised kernel headers before compilation Like Xu
2022-12-19 16:14 ` 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=Y6CN6kWo+KPD5wOi@google.com \
--to=seanjc@google.com \
--cc=kvm@vger.kernel.org \
--cc=like.xu.linux@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=pbonzini@redhat.com \
--cc=shuah@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