lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1071313434.33305.1441127478843.JavaMail.zimbra@efficios.com>
Date:	Tue, 1 Sep 2015 17:11:18 +0000 (UTC)
From:	Mathieu Desnoyers <mathieu.desnoyers@...icios.com>
To:	Michael Ellerman <mpe@...erman.id.au>
Cc:	Andrew Morton <akpm@...ux-foundation.org>,
	linux-kernel@...r.kernel.org,
	linux-api <linux-api@...r.kernel.org>,
	Pranith Kumar <bobby.prani@...il.com>
Subject: Re: [PATCH 2/3] selftests: add membarrier syscall test

----- On Aug 31, 2015, at 2:54 AM, Michael Ellerman mpe@...erman.id.au wrote:

> On Fri, 2015-07-10 at 16:58 -0400, Mathieu Desnoyers wrote:
>> From: Pranith Kumar <bobby.prani@...il.com>
>> 
>> This patch adds a self test for the membarrier system call.
>> 
>> CC: Michael Ellerman <mpe@...erman.id.au>
> 
> Sorry I only just saw this due to some over zealous filtering on my end.
> 
> 
>> diff --git a/tools/testing/selftests/membarrier/Makefile
>> b/tools/testing/selftests/membarrier/Makefile
>> new file mode 100644
>> index 0000000..877a503
>> --- /dev/null
>> +++ b/tools/testing/selftests/membarrier/Makefile
>> @@ -0,0 +1,11 @@
>> +CFLAGS += -g -I../../../../usr/include/
>> +
>> +all:
>> +	$(CC) $(CFLAGS) membarrier_test.c -o membarrier_test
>>
>> +TEST_PROGS := membarrier_test
> 
> You don't need to specify the rule, the implict one will do exactly the same,
> so you can just do:
> 
> TEST_PROGS := membarrier_test
> 
> all: $(TEST_PROGS)
> 
>> 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 ?

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.

Thanks,

Mathieu

> 
>> +
>> +#include <linux/membarrier.h>
>> +#include <asm-generic/unistd.h>
> 
> This should just be <unistd.h>
> 
> 
> cheers

-- 
Mathieu Desnoyers
EfficiOS Inc.
http://www.efficios.com
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ