Message ID | 20221219095540.52208-1-likexu@tencent.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:e747:0:0:0:0:0 with SMTP id c7csp2297785wrn; Mon, 19 Dec 2022 02:03:46 -0800 (PST) X-Google-Smtp-Source: AMrXdXuVY6L55St4GsKRUd6e9GoiPHpdH8E4ZkEymj+j0Udw56UPMSII3ykNIEtnxrctRuAXCnzd X-Received: by 2002:a17:906:910:b0:7ac:2db9:6f4d with SMTP id i16-20020a170906091000b007ac2db96f4dmr795451ejd.8.1671444225928; Mon, 19 Dec 2022 02:03:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671444225; cv=none; d=google.com; s=arc-20160816; b=I7H4Ak0WCBAKsxVNQvweA+MFz80hyyLhOFPXOWnnY0o+kC9g1oA1gW7JZBHNNf2r0M JpZv+mSqEO+AueD0XgCB8mGOUkZ5K/Jbv0m82kkFdswDdxGNxNdWKKbtHMeqf46Yll1g atPhoG6vBEjp4NhE4PJnR0n01ocKkFsjMUQBX3az67H+362Vt1jemG/qfZZVWEBKUS+L Xa0GBWRZtZMmJDnsvUmCBme1X9ESI5vedTjAKzxRO4pRfwXWPJtNQgmWu4E1U42UrDDP YO34iyRVUrPf5LGnS80sJ7wILTWk0Lk2z6def4TfXxiQbC+cnt28EoGJHZsSclKLofmz IRzA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=cTKkiNJMpOFSsx1JCeP3l8G+Rk8WYwK/ABRWtBWukFU=; b=rrd5y5o2Mrr+JEWjbyxeN4mQtDztiNqr8KQ1ThuLpOisBbT5MBwDtsNKftKtrN8AkC 5RCMfc8c26ODQQP92JOm+yIhrj1Y+tHySDR6KsnQYTWjArUdK3wqDmADWzAqpYGvtjpF eZZVxIbrBR1gWtSpeHsCMm7eXDfXL/J7Jgd/qVHB01t8NYVvEISCKN9JwPKHjbGqhfN/ a3CVgqfosncF4MxO9Km47wss3KNDGoQ72dKDRllmkBZSKddhDj1hVzM0bkNsoi+neVTt G0nvERt8nE4Fs6DE+J8x2P/HgZIc058BaSH3UYOtMM+39D2OJ1JUv9OssFXlE801BwIX QgxA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=fNK93FQs; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ww2-20020a170907084200b00780805b99ccsi9320546ejb.648.2022.12.19.02.03.21; Mon, 19 Dec 2022 02:03:45 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=fNK93FQs; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231178AbiLSJ4M (ORCPT <rfc822;peekingduck44@gmail.com> + 99 others); Mon, 19 Dec 2022 04:56:12 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56584 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231136AbiLSJ4G (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Mon, 19 Dec 2022 04:56:06 -0500 Received: from mail-pj1-x1031.google.com (mail-pj1-x1031.google.com [IPv6:2607:f8b0:4864:20::1031]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 32636B1A; Mon, 19 Dec 2022 01:56:01 -0800 (PST) Received: by mail-pj1-x1031.google.com with SMTP id q17-20020a17090aa01100b002194cba32e9so12456859pjp.1; Mon, 19 Dec 2022 01:56:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=cTKkiNJMpOFSsx1JCeP3l8G+Rk8WYwK/ABRWtBWukFU=; b=fNK93FQsqBdLmtHBhN0aS5FflWsLrRbFl8eih1AzXBNOTYfhrP/t832X9iem3Xnem4 M16jNxEAEPJzjbjtWAHZswURdsNSk410HQIjPX82/kT+GWdNnfIlY8SdXw9sozZmWuCI Ze3OAojpulo57cov9Xe/BOtQ/nZ9gSn2gFLjxSbVzqKwHzsift264ndAaq6nIszDERt3 17NDtehjWkssb4EtNJg/TYuYyMRgRou/hHcC8lH/WNhBlaLgqEzSeTPPhAS863j7CfxQ lY6UxcEmbr4vC5yZUPvmVvO6k6IFli7J8FUKUrspcB1dUFBngph4Q+VBBEH7NufLUiCm trBA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=cTKkiNJMpOFSsx1JCeP3l8G+Rk8WYwK/ABRWtBWukFU=; b=LRqDq2ETlPwhXjb0uGGxdIjNmjHMLG9m0EOTskuvXHE9Huf+DtGbeidjIEQ6jxTUIn JFupoq/VhDN0rok6lgRLCa/6f7UzCKEvrnmhe4JcYH5p+sGn7dl9qUZ1W7koXM1vJssu 5GB1KIbwzCpjJ2Vj+ECE3W1qKfxVRAAXzNP+Ec+BaGWca4NI9fy6pxwWNVciXiLMtXDq 4/uWM3zimPfBgp8e/4jgVlozMc3BycCkdF24WPLzs9fBrLtR+JLoPfdvvw67he1cbHCg 6ziLvuBSKLLlwvSoD+l9sexPvdncrmLQJWJvSVTQKofh/vZGhwiFtSwmErRxwPZTSpPf ooqQ== X-Gm-Message-State: ANoB5pmMKjIFjyubsj7M6iKKfc7Ra5PZUhnS/Hr3ebH0IklEkBVfwufN HhCMS8FsBKEWcWQR45RT0QE= X-Received: by 2002:a17:903:2689:b0:189:5265:a647 with SMTP id jf9-20020a170903268900b001895265a647mr38637186plb.41.1671443760463; Mon, 19 Dec 2022 01:56:00 -0800 (PST) Received: from localhost.localdomain ([103.7.29.32]) by smtp.gmail.com with ESMTPSA id c8-20020a170902b68800b00188f3970d4asm6619540pls.163.2022.12.19.01.55.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Dec 2022 01:55:59 -0800 (PST) From: Like Xu <like.xu.linux@gmail.com> X-Google-Original-From: Like Xu <likexu@tencent.com> To: seanjc@google.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: [PATCH] KVM: selftests: Install sanitised kernel headers before compilation Date: Mon, 19 Dec 2022 17:55:40 +0800 Message-Id: <20221219095540.52208-1-likexu@tencent.com> X-Mailer: git-send-email 2.39.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1752636300400110789?= X-GMAIL-MSGID: =?utf-8?q?1752636300400110789?= |
Series |
KVM: selftests: Install sanitised kernel headers before compilation
|
|
Commit Message
Like Xu
Dec. 19, 2022, 9:55 a.m. UTC
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(+)
Comments
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
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 + LINUX_HDR_PATH = $(INSTALL_HDR_PATH)/include/ LINUX_TOOL_INCLUDE = $(top_srcdir)/tools/include ifeq ($(ARCH),x86_64)