From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753517AbbICJYw (ORCPT ); Thu, 3 Sep 2015 05:24:52 -0400 Received: from ozlabs.org ([103.22.144.67]:34035 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752971AbbICJYv (ORCPT ); Thu, 3 Sep 2015 05:24:51 -0400 Message-ID: <1441272288.26379.1.camel@ellerman.id.au> Subject: Re: [PATCH 2/3] selftests: add membarrier syscall test From: Michael Ellerman To: Mathieu Desnoyers Cc: Andrew Morton , linux-kernel@vger.kernel.org, linux-api , Pranith Kumar Date: Thu, 03 Sep 2015 19:24:48 +1000 In-Reply-To: <1071313434.33305.1441127478843.JavaMail.zimbra@efficios.com> References: <1436561912-24365-1-git-send-email-mathieu.desnoyers@efficios.com> <1436561912-24365-3-git-send-email-mathieu.desnoyers@efficios.com> <1441004040.5735.7.camel@ellerman.id.au> <1071313434.33305.1441127478843.JavaMail.zimbra@efficios.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.12.11-0ubuntu3 Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 2015-09-01 at 17:11 +0000, Mathieu Desnoyers wrote: > ----- On Aug 31, 2015, at 2:54 AM, Michael Ellerman mpe@ellerman.id.au wrote: > > On Fri, 2015-07-10 at 16:58 -0400, Mathieu Desnoyers wrote: > >> diff --git a/tools/testing/selftests/membarrier/membarrier_test.c > >> b/tools/testing/selftests/membarrier/membarrier_test.c > >> new file mode 100644 > >> index 0000000..3c9f217 > >> --- /dev/null > >> +++ b/tools/testing/selftests/membarrier/membarrier_test.c > >> @@ -0,0 +1,71 @@ > >> +#define _GNU_SOURCE > >> +#define __EXPORTED_HEADERS__ > > > > Why are you exporting that? > > > > I suspect to try and get around the "Attempt to use kernel headers from user > > space" warning. > > > > But you're correctly building against the installed headers, not the kernel > > headers, so you don't need to do that. > > Just to make sure I understand: should we expect that > everyone will issue "make headers_install" on their system > before doing a make kselftest ? Usually yes, but not always. They might be deliberately building the selftests against their installed headers. That's their choice. In a case like this the test will fail to build, which is fine IMHO. > I see that a few selftests (e.g. memfd) are adding the > source tree include paths to the compiler include paths, > which I guess is to ensure that the kselftest will > work even if the system headers are not up to date. Yeah they should be fixed to not do that. The unexported kernel headers are not designed to be used from userspace. It works sometimes on some arches, depending on the exact headers that get included etc. But it's wrong™. cheers