Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1411537imu; Thu, 13 Dec 2018 14:52:14 -0800 (PST) X-Google-Smtp-Source: AFSGD/XV7cVpDVFRcocdXSWrfmDyDOFhGyMPcrXgDYOQVCvXGOJSPbza7k7ae3V5wOfD3CtuF3w/ X-Received: by 2002:a17:902:14b:: with SMTP id 69mr657123plb.52.1544741534779; Thu, 13 Dec 2018 14:52:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544741534; cv=none; d=google.com; s=arc-20160816; b=g4xNvR+eMpI8sCKmbf5LEPOAhUdMEEDpCALdnTTlEId5xVa6Ye4Jc+tQdXXh2dd+EK hWOs7BQgoBuXHaggfMiRRmT2bBBDhGXxIBgLcHWnOx6ODmonhOdNUFwaPsIkh8CHpIiZ 81oWU3rTliQ4VAdWJ/DHkhXBz1nLefmGmGnL16IOgLZTpcCDAzh5ikJ1ZnpS43kXqav7 DX+kezvVH/od9sA2tztAzlak6F7u190HzG45CtfRmhJZVEvt+7HVplHrrNEVXx3WE6ER XnN9zlagGmFaA0wX7viJ61JU9lxApBqw6Zd1tcrY5j41qjNMJdheVWCaOUOS3ypyT2fO 9zuQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=b7ZWapmgqwZYxgdgzsl5YHXp/8yKJ02V/MZCVjD0614=; b=vROvB9qYMRMMVVnqPiy+yele4mPhKTLcZBNwnv3POBvu2ftzu+7klr8cvyIYyhilHC cVJrDVxMxZ2NJ+UuGOjHUBedX270hiY3igd2r0FH8pbo3nowCLRhvCEkfvxxOyHGsKzH O9Da3nScE4NTDS3SQWi/XAAoM23xbKhnz0H2qJq/Y2PUrPr8/LkSVvxhUyk5ttHPcPfh QFgfluvT/V26Mji+JcpPPJb3llC20wc59i3Bz3OMZzlz4HUBEdkVAXMAfFAunz+HGTjE i0MkyH3Q7LwnxdgEwTBqd3uh/9ZLXolosVi9Qk11SxU/yD5+1mBxgYrMoNWYAD4RS/aR kAeA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=HFfzGchL; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s19si2433747plp.151.2018.12.13.14.51.59; Thu, 13 Dec 2018 14:52:14 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=HFfzGchL; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728415AbeLMWuE (ORCPT + 99 others); Thu, 13 Dec 2018 17:50:04 -0500 Received: from mail.kernel.org ([198.145.29.99]:55188 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726813AbeLMWuE (ORCPT ); Thu, 13 Dec 2018 17:50:04 -0500 Received: from [192.168.1.112] (c-24-9-64-241.hsd1.co.comcast.net [24.9.64.241]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 4483520851; Thu, 13 Dec 2018 22:50:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1544741403; bh=KOLyTbt2eJZVTQoX46XCSKQoQ0awCa1Lgzc2sFY6Qm0=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=HFfzGchLILxHJ9nU1SBjFriTv/fM6Lee/l4SClyy4NeCgcYcXzjuEjqk0hkptBwac 4uVtSG61uPWa4+4/eu2c1/RzYtz0lQ+6wCAli+IWEdAg0yXGcmzN4YQ3HALbqGk6zN uKFm6f5dxXrbZ/mCw/Ajp61tsNQ1ixTQRG4dny0A= Subject: Re: [PATCH] selftests: Fix test errors related to lib.mk khdr target To: Paolo Bonzini , tglx@linutronix.de, mingo@redhat.com, peterz@infradead.org, dvhart@infradead.org, bamv2005@gmail.com, brgl@bgdev.pl, fathi.boudra@linaro.org, anders.roxell@linaro.org, daniel.diaz@linaro.org, pintu.ping@gmail.com, drjones@redhat.com, hofsass@google.com, peterx@redhat.com, peng.hao2@zte.com.cn, wei@redhat.com, davem@davemloft.net, dcaratti@redhat.com, akpm@linux-foundation.org, mhocko@suse.com, khalid.aziz@oracle.com, mpe@ellerman.id.au, aneesh.kumar@linux.vnet.ibm.com, dima@arista.com Cc: linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org, stable@vger.kernel.org, shuah References: <20181213200011.10779-1-shuah@kernel.org> <623cdf7b-fc3c-2a93-c61a-a043e3d7f75b@redhat.com> From: shuah Message-ID: <25593aa4-a2a7-6567-11f2-b702b6e5563c@kernel.org> Date: Thu, 13 Dec 2018 15:50:01 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 In-Reply-To: <623cdf7b-fc3c-2a93-c61a-a043e3d7f75b@redhat.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 12/13/18 3:40 PM, Paolo Bonzini wrote: > On 13/12/18 21:00, shuah@kernel.org wrote: >> From: Shuah Khan >> >> Commit b2d35fa5fc80 ("selftests: add headers_install to lib.mk") added >> khdr target to run headers_install target from the main Makefile. The >> logic uses KSFT_KHDR_INSTALL and top_srcdir as controls to initialize >> variables and include files to run headers_install from the top level >> Makefile. There are a few problems with this logic. >> >> 1. Exposes top_srcdir to all tests >> 2. Common logic impacts all tests >> 3. Uses KSFT_KHDR_INSTALL, top_srcdir, and khdr in an adhoc way. Tests >> add "khdr" dependency in their Makefiles to TEST_PROGS_EXTENDED in >> some cases, and STATIC_LIBS in other cases. This makes this framework >> confusing to use. >> >> The common logic that runs for all tests even when KSFT_KHDR_INSTALL >> isn't defined by the test. top_srcdir is initialized to a default value >> when test doesn't initialize it. It works for all tests without a sub-dir >> structure and tests with sub-dir structure fail to build. >> >> e.g: make -C sparc64/drivers/ or make -C drivers/dma-buf >> >> ../../lib.mk:20: ../../../../scripts/subarch.include: No such file or directory >> make: *** No rule to make target '../../../../scripts/subarch.include'. Stop. >> >> There is no reason to require all tests to define top_srcdir and there is >> no need to require tests to add khdr dependency using adhoc changes to >> TEST_* and other variables. >> >> Fix it with a consistent use of KSFT_KHDR_INSTALL and top_srcdir from tests >> that have the dependency on headers_install. >> >> Change common logic to include khdr target define and "all" target with >> dependency on khdr when KSFT_KHDR_INSTALL is defined. >> >> Only tests that have dependency on headers_install have to define just >> the KSFT_KHDR_INSTALL, and top_srcdir variables and there is no need to >> specify khdr dependency in the test Makefiles. > > Looks good. Could you please provide a topic branch so that we can > avoid conflicts between our trees at the next merge window. > Thanks. The topic branch is git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest.git next I will apply it in a day or two to get ready for the merge window. thanks, -- Shuah