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: <47cc4984-a424-410d-a1b8-9947c1a42ccb@huawei.com>
Date: Tue, 21 Oct 2025 13:15:57 +0800
From: Qinxin Xia <xiaqinxin@...wei.com>
To: Barry Song <21cnbao@...il.com>
CC: <m.szyprowski@...sung.com>, <robin.murphy@....com>,
	<prime.zeng@...wei.com>, <fanghao11@...wei.com>,
	<linux-kernel@...r.kernel.org>, <linuxarm@...wei.com>,
	<wangzhou1@...ilicon.com>
Subject: Re: [PATCH v3] tools/dma: move dma_map_benchmark from selftests to
 tools/dma



On 2025/10/21 10:59:05, Barry Song <21cnbao@...il.com> wrote:
>> @@ -0,0 +1,2 @@
>> +# SPDX-License-Identifier: GPL-2.0-only
>> +dma_map_benchmark
>> diff --git a/tools/dma/Makefile b/tools/dma/Makefile
>> new file mode 100644
>> index 000000000000..4acbd9e00cfa
>> --- /dev/null
>> +++ b/tools/dma/Makefile
>> @@ -0,0 +1,17 @@
>> +# SPDX-License-Identifier: GPL-2.0
>> +bindir ?= /usr/bin
>> +
>> +CFLAGS += -idirafter../../include/uapi
> 
> I'm a bit confused — it seems you haven’t tried to understand what the issue
> was in v1 [1]. You were using -I for kernel header files (under
> include/linux but not uapi), which caused those kernel headers to take
> precedence over the system headers, leading to build errors. The uapi
> headers, however, are specifically designed to be installed into the system by
> the toolchain.
> So that’s no longer the case — -idirafter is not the correct flag for uapi.
> 
Hello Barry :
If I delete -idirafter, like:

CFLAGS += -I../../include/uapi

It will get warning info:

[xiaqinxin@...alhost dma]$ make
cc -I../../include/uapi dma_map_benchmark.c -o dma_map_benchmark
In file included from ../../include/uapi/linux/map_benchmark.h:9,
                  from dma_map_benchmark.c:13:
../../include/uapi/linux/types.h:10:2: warning: #warning "Attempt to use 
kernel headers from user space, see https://kernelnewbies.org/
KernelHeaders" [-Wcpp]
    10 | #warning "Attempt to use kernel headers from user space, see 
https://kernelnewbies.org/KernelHeaders"

So I keep -idirafter there.

There's another way, like:

CFLAGS += -I../../usr/include
(need make headers_install first)

Maybe I haven’t thought it through.
If you have a better way, you can give an example.:)

>> index b12f1f9babf8..5474a450863c 100644
>> --- a/tools/testing/selftests/dma/dma_map_benchmark.c
>> +++ b/tools/dma/dma_map_benchmark.c
>> @@ -10,7 +10,6 @@
>>   #include <unistd.h>
>>   #include <sys/ioctl.h>
>>   #include <sys/mman.h>
>> -#include <linux/types.h>
> 
> What’s the reason for this? Is it to work around a build error?
> If so, no — please keep it.
> 
>>   #include <linux/map_benchmark.h>
> 
> Thanks
> Barry

Moved it to map_benchmark.h, otherwise some x86_64 build errors
would occur.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ