From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?UTF-8?Q?Emilio_L=c3=b3pez?= Subject: Re: [RFC PATCH v1 1/9] selftest: sync: basic tests for sw_sync framework Date: Mon, 4 Apr 2016 01:12:15 -0300 Message-ID: <5701E99F.5030102@collabora.co.uk> References: <1457537342-678-1-git-send-email-emilio.lopez@collabora.co.uk> <1457537342-678-2-git-send-email-emilio.lopez@collabora.co.uk> <56F92196.6040604@collabora.co.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: QUOTED-PRINTABLE Return-path: In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org To: Emil Velikov Cc: Shuah Khan , devel@driverdev.osuosl.org, Daniel Stone , Daniel Vetter , =?UTF-8?Q?Arve_Hj=c3=b8nnev=c3=a5g?= , "Linux-Kernel@Vger. Kernel. Org" , ML dri-devel , Riley Andrews , linux-kselftest@vger.kernel.org, Gustavo Padovan , John Harrison List-Id: dri-devel@lists.freedesktop.org Hi, El 28/03/16 a las 10:48, Emil Velikov escribi=C3=B3: >>>> These tests are based on the libsync test suite from Android. >>>> This commit lays the ground for future tests, as well as includes >>>> tests for a variety of basic allocation commands. >>>> >>>> Signed-off-by: Gustavo Padovan >>>> Signed-off-by: Emilio L=C3=B3pez >>>> --- >>>> >>> >>>> tools/testing/selftests/sync/sync.h | 119 +++++++++++++++= +++ >>> >>> Admittedly I know nothing about the kernel selftests although copyi= ng >>> the UAPI header, seems to defeat the purpose of this exercise. >>> Shouldn't one reuse the existing header ? It would even cause issue= s >>> as the interface gets updated (iirc Gustavo changed the ioctl numbe= rs >>> and/or header name with latter series). >> >> >> The problem is that one cannot use the system header without having = built >> and installed the kernel first, which is rather problematic for eg. >> crosscompiling or virtualization. I discussed this with Gustavo and = we >> agreed that the best way forward would be to copy the interfaces, as >> suggested by kernelnewbies' wiki[0]: >> > In the case of using a system header one can just `make > headers_install' without building the kernel, as mentioned in the ver= y > same page ;-) Although I wasn't thinking that one should be using the > header already available in tree. After all this series is not > supposed to land before Gustavo's work, is it ? > > From a quick skim though the selftests, I cannot see cases where UAP= I > headers are copied/duplicated. > >> """ >> The correct way to address this problem is to isolate the specific >> interfaces that you need, e.g. a single header file that is patched = in a new >> kernel providing the ioctl numbers for a character device used by yo= ur >> program. In your own program, add a copy of that source file, with a= notice >> that it should be kept in sync with new kernel versions. >> """ > My understanding of the article is that it refers to building user > space programs that do _not_ live in the same tree as the kernel. Am = I > missing something ? When I tried using the header directly from the kernel tree, the=20 compiler told me not to do that and pointed me to that kernelnewbies=20 page; I could try overriding the check like I see memfd does[0] but I=20 don't know if that's the way to go. Shuah, what's your thoughts on this= ? Thanks, Emilio [0]=20 https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/to= ols/testing/selftests/memfd/memfd_test.c#n2