Received: by 2002:ab2:3350:0:b0:1f4:6588:b3a7 with SMTP id o16csp2119642lqe; Tue, 9 Apr 2024 10:01:28 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWkD/fiC+F1XZZj1B9rTiPw/Px2OPYrWuvJ+usJi6Non0TWqAH8a616B1LIXm6U7DKIa6dHod3qJaboL4WjWcIyhy1N8oCgC8CE2MM4/A== X-Google-Smtp-Source: AGHT+IGXN4bV74Sxk59STeGYEO9PAPTN1F34zLuIVpWwCx+FHWdVXJiqUzbMF8OayCrMBpbLdm78 X-Received: by 2002:a05:6512:241:b0:515:bee6:5e8c with SMTP id b1-20020a056512024100b00515bee65e8cmr22197lfo.40.1712682088278; Tue, 09 Apr 2024 10:01:28 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712682088; cv=pass; d=google.com; s=arc-20160816; b=nSJiN3hgdiMvN5qhgFuEIZg3/LWyHshWmGBkDFp5COC66z4ZC+mO3MteMuWF/93Cic cRLGXiJx4eUcc7asi+uMQmFUFMV7wogSinsPc+S1c5rxWQPRo/AZ27EtJchjZcNEdK0h iaFa3jxILdx0we9CWTPE5tXHXqk/TmHliUkbECH4oO00/vLqG/7y9mxeRAkwvhEGpnUt ouPiq2z3N/OMRwZUxZA9418J3qNO6gv+nB8lW+vA8Ah88bBgLwkTL22jmYZ7yoG/WymF 4NzJzhFnsKTkFxHErEmz+Mn/Q8iuE0NbADjU0NYZ44oac+26SjqWCH45oVkWYV1WGDOS Snow== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:message-id:subject:cc:to:from:date:dkim-signature; bh=5gwQXphKq8wIcm3rI6FngSOniZwK/MLp7ssc6A27W+k=; fh=CdFLmrSM+Qy9DyB1s1n/6v+S+oOPUZUFaMvrcFMWNIA=; b=VTlF9zzh5+ZmFAaoVQUdUFhC++cIUISNUeTZWVPRwmgtqPePMH2a1f+p7MbV3a1pd7 zM4GYVcylGP0mLRb/US4fiUAeqHM3JsnuoWP/aoJA/aLiwLxHAjNmBB6j3w+TJeZEN5p rqypg/PPzMwLaPvbEeqyeQFgc/CURZDY2K8oBUIqXEwlRou+CQIV7KTA+NVov9vtHVHt MM+Fms3jlFCojr7u/Q2j+f9m+D9LtlXQUn7YZc8fS8ZvxdMh0wCv5zFRAXv+fWgpYCtx Wf009lvhwyFdw3Dvt2pTj/Oi2nfntS1WeMBkhfd2kgbYok0mcC5TLiEV9HAS73SBl1KZ SfUA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=MgYtO5Tj; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-137350-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-137350-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id f11-20020a50d54b000000b0056be437d0c4si4804602edj.172.2024.04.09.10.01.28 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Apr 2024 10:01:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-137350-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=MgYtO5Tj; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-137350-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-137350-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 0266E1F24243 for ; Tue, 9 Apr 2024 17:01:28 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id BE250155393; Tue, 9 Apr 2024 17:00:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="MgYtO5Tj" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D454E155313; Tue, 9 Apr 2024 17:00:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712682058; cv=none; b=KF4i6bieNB8B2Pwb/1QPYWTILQkZVfUM1A//F2tmgbIXi/YR7HtGIwODOPR0guHCuWqZRVft2qMtqz3Mm1n9Gbt2024f6RhWplL3BUpjWVLVhBJULiGsCkJWYzOAoiEA1QuYlqFyOzPlVf9lW223zmkA/30QdijQ8RX+y6SQ5cc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712682058; c=relaxed/simple; bh=4WrtbOs8msag5qvCpx6Nx6EDmYJtha46rksweGE/IUg=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=Ki8m+6gv42S09ECSHGiA7PJ9738QAdGqppWRLr6BGBEF6To8Vu3b8DXVEAZ6uQyreg0d9xifDe6Jm9hLNm2BOJHuMcmY7xAmyMeNqgCWPAk0PIiCkXVtaC3/btNNcqbEpxB9Cy+0KiO4sqx8fQAcaWKHdBS4BGK1GKRIrmH0ObE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=MgYtO5Tj; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 36113C433B1; Tue, 9 Apr 2024 17:00:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1712682058; bh=4WrtbOs8msag5qvCpx6Nx6EDmYJtha46rksweGE/IUg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=MgYtO5Tj2EoU/v1AvFrGNp8xJ8FBv7ZUQrP9IrkGf8gFF0Wewc2uyF3jdNxNbApkI Cmi45Fh24KdIDPs+RVXnjEc4VHazHSPw0iCqDakt3IMufLEb0ESclkjlkNCZRg9qjG x6xl5THoYixhoTQej9s12kSr033vdeKGMpb0ErzR0djdcukweuz63kACjq79TJOg0o 9RIDZ316Bec+NnDjBJMwWfBxhcwB/H7QB8cv+0lPQ+Hz9xZsFGJnpyDUrgam6eBPXA vZklfbulNp0Zc0UoORNPGHZjsefhYZk7OQI5/4rqipKXvYabOAKYBiBg2gWK4YlFYG 999SQuF2Bw3Qw== Date: Tue, 9 Apr 2024 14:00:55 -0300 From: Arnaldo Carvalho de Melo To: Namhyung Kim Cc: Jani Nikula , Ingo Molnar , Ian Rogers , Kan Liang , Jiri Olsa , Adrian Hunter , Peter Zijlstra , LKML , linux-perf-users@vger.kernel.org, Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter , dri-devel@lists.freedesktop.org Subject: Re: [PATCH 1/9] tools/include: Sync uapi/drm/i915_drm.h with the kernel sources Message-ID: References: <20240408185520.1550865-1-namhyung@kernel.org> <20240408185520.1550865-2-namhyung@kernel.org> <874jcb9etk.fsf@intel.com> <87pluy972m.fsf@intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: On Tue, Apr 09, 2024 at 08:58:55AM -0700, Namhyung Kim wrote: > Hello, > > On Tue, Apr 9, 2024 at 3:14 AM Jani Nikula wrote: > > > > On Tue, 09 Apr 2024, Ingo Molnar wrote: > > > * Jani Nikula wrote: > > > > > >> On Mon, 08 Apr 2024, Namhyung Kim wrote: > > >> > To pick up changes from: > > >> > > > >> > b112364867499 ("drm/i915: Add GuC submission interface version query") > > >> > 5cf0fbf763741 ("drm/i915: Add some boring kerneldoc") > > >> > > > >> > This should be used to beautify DRM syscall arguments and it addresses > > >> > these tools/perf build warnings: > > >> > > > >> > Warning: Kernel ABI header differences: > > >> > diff -u tools/include/uapi/drm/i915_drm.h include/uapi/drm/i915_drm.h > > >> > > >> All these years and I never realized there are header copies > > >> there. But... why copies? > > > > > > It's better than all the alternatives we tried so far: > > > > > > - Symbolic links and direct #includes: this was the original approach but > > > was pushed back on from the kernel side, when tooling modified the > > > headers and broke them accidentally for kernel builds. > > > > > > - Duplicate self-defined ABI headers like glibc: double the maintenance > > > burden, double the chance for mistakes, plus there's no tech-driven > > > notification mechanism to look at new kernel side changes. > > > > > > What we are doing now is a third option: > > > > > > - A software-enforced copy-on-write mechanism of kernel headers to > > > tooling, driven by non-fatal warnings on the tooling side build when > > > kernel headers get modified: > > > > > > Warning: Kernel ABI header differences: > > > diff -u tools/include/uapi/drm/i915_drm.h include/uapi/drm/i915_drm.h > > > diff -u tools/include/uapi/linux/fs.h include/uapi/linux/fs.h > > > diff -u tools/include/uapi/linux/kvm.h include/uapi/linux/kvm.h > > > ... > > > > > > The tooling policy is to always pick up the kernel side headers as-is, > > > and integate them into the tooling build. The warnings above serve as a > > > notification to tooling maintainers that there's changes on the kernel > > > side. > > > > > > We've been using this for many years now, and it might seem hacky, but > > > works surprisingly well. > > > > > > Does this make sense to you? > > > > Yes, although there are probably pieces of the puzzle I'm missing. > > Thanks for the explanation! (That might work almost as-is copied to > > tools/include/uapi/README. ;) > > > > It's also kind of funny to find this kind of back alleys of the kernel > > repo I've never wandered to before. > > I have some explanation in the cover letter of the series but I forgot > to mention that in each commit message. Probably I can update the > explanation with Ingo's reply. I think we can combine Ingo's with the reply I used and you adopted and continue to have it when sending the update messages, probably keep it in the cover letter (the combined text) and add a link to each individual update: "Please see tools/include/README.kernel-copies." The recommendation that developers shouldn't update the copy seems important to have there as well. - Arnaldo