From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1FE54C4332F for ; Mon, 19 Dec 2022 16:15:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232083AbiLSQPa (ORCPT ); Mon, 19 Dec 2022 11:15:30 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50610 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232169AbiLSQO5 (ORCPT ); Mon, 19 Dec 2022 11:14:57 -0500 Received: from mail-pj1-x102e.google.com (mail-pj1-x102e.google.com [IPv6:2607:f8b0:4864:20::102e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9B69F13D7E for ; Mon, 19 Dec 2022 08:14:39 -0800 (PST) Received: by mail-pj1-x102e.google.com with SMTP id o12so9555708pjo.4 for ; Mon, 19 Dec 2022 08:14:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=5dL/5e66Q421m8/scPuFx+mndERQbshrnwDDg3EMSsc=; b=qR+VevN661+iIuH02xO+YfS45M/ZR1cMO1J/nhGa4mYsarAqugAWZG0qrD9QBtNOqq bgY55YbQrxbEodLAWCRxjZ30qiz20kG2kkiyqLGZiq4y+APUg8E7MO6Hj95aTsqIPGq5 23+V/eLiiE6BUDMXkf4hGBHJ0OKt1CTHWIy1v+s5SYaOHRL7Zp382cc7tiKdmgTrGMGN vBvJ704/VmBjE0Q5uP1wKCoKsT3d56s8AqLGjc1+MtYpEaebR3g/OcBBORdjU/4zg68l H+A0Jcyw8ZnHeQhVVFU5KMKc+DS4DpewNIt15/TmFdvVK5XxMkX/PNZqEk/65c7dE94O Kxzg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=5dL/5e66Q421m8/scPuFx+mndERQbshrnwDDg3EMSsc=; b=oSf5+M3G8LN1IrK6/4HR66aXE39abkF6dNjjQH0gBWcmEZ8V4zJcjf3rnYvBFULHAE bYmk7Vty9X0oej1vTcWFDuSoiBR3z40rM91enqJNj4FFxE+pOmJcNNzlfSyHtI+MoM0M gp8YcaklvmSgXDxjZJOODpqokX8Z4GbAXiu63S36LFTIWe2Q1ybuBIA2DaGtStx5hXAI obRivw6LTs3T/GDLVksc+ucRneVUYI7KMQlb7FHwq9lmOkH2fXL+YIH9f3hVY+7Dl0oI H0lutrTvp81EhgmuZG3UA+3FI/IRauj/JzE+tOSIdu6NwgkW6kc2jNhSs4Dg2Pzd+ii4 oouA== X-Gm-Message-State: AFqh2kpz0FrOYmByUN23foRQZjadO1K6Q+afXrb0aFZPCItsdAEdnoyG hnnh/oEQe849+sC9kxZJXPqaS2TBBiIRcm7I X-Google-Smtp-Source: AMrXdXvmp3Jyv+LOxgrryADAvlI8P5f1UyM6BBcn0v37B0TGn7ATjOYxPhmskeOx8cTau2VjzR025A== X-Received: by 2002:a17:90a:e28d:b0:218:84a0:65eb with SMTP id d13-20020a17090ae28d00b0021884a065ebmr1217698pjz.1.1671466478651; Mon, 19 Dec 2022 08:14:38 -0800 (PST) Received: from google.com (7.104.168.34.bc.googleusercontent.com. [34.168.104.7]) by smtp.gmail.com with ESMTPSA id pw6-20020a17090b278600b00213c7cf21c0sm6113969pjb.5.2022.12.19.08.14.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Dec 2022 08:14:38 -0800 (PST) Date: Mon, 19 Dec 2022 16:14:34 +0000 From: Sean Christopherson To: Like Xu Cc: Paolo Bonzini , Shuah Khan , 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 Message-ID: References: <20221219095540.52208-1-likexu@tencent.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20221219095540.52208-1-likexu@tencent.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Dec 19, 2022, Like Xu wrote: > From: Like Xu > > 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 > Signed-off-by: Like Xu > --- > 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