<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/tools/testing/selftests/sgx, branch v6.19.11</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v6.19.11</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v6.19.11'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2025-11-27T22:24:31+00:00</updated>
<entry>
<title>selftests: complete kselftest include centralization</title>
<updated>2025-11-27T22:24:31+00:00</updated>
<author>
<name>Bala-Vignesh-Reddy</name>
<email>reddybalavignesh9979@gmail.com</email>
</author>
<published>2025-10-16T10:44:09+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=e6fbd1759c9ece5044d3470f30a5e2166dc9de89'/>
<id>urn:sha1:e6fbd1759c9ece5044d3470f30a5e2166dc9de89</id>
<content type='text'>
This follow-up patch completes centralization of kselftest.h and
ksefltest_harness.h includes in remaining seltests files, replacing all
relative paths with a non-relative paths using shared -I include path in
lib.mk

Tested with gcc-13.3 and clang-18.1, and cross-compiled successfully on
riscv, arm64, x86_64 and powerpc arch.

[reddybalavignesh9979@gmail.com: add selftests include path for kselftest.h]
  Link: https://lkml.kernel.org/r/20251017090201.317521-1-reddybalavignesh9979@gmail.com
Link: https://lkml.kernel.org/r/20251016104409.68985-1-reddybalavignesh9979@gmail.com
Signed-off-by: Bala-Vignesh-Reddy &lt;reddybalavignesh9979@gmail.com&gt;
Suggested-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Link: https://lore.kernel.org/lkml/20250820143954.33d95635e504e94df01930d0@linux-foundation.org/
Reviewed-by: Wei Yang &lt;richard.weiyang@gmail.com&gt;
Cc: David Hildenbrand &lt;david@redhat.com&gt;
Cc: David S. Miller &lt;davem@davemloft.net&gt;
Cc: Eric Dumazet &lt;edumazet@google.com&gt;
Cc: Günther Noack &lt;gnoack@google.com&gt;
Cc: Jakub Kacinski &lt;kuba@kernel.org&gt;
Cc: Liam Howlett &lt;liam.howlett@oracle.com&gt;
Cc: Lorenzo Stoakes &lt;lorenzo.stoakes@oracle.com&gt;
Cc: Michal Hocko &lt;mhocko@suse.com&gt;
Cc: Mickael Salaun &lt;mic@digikod.net&gt;
Cc: Ming Lei &lt;ming.lei@redhat.com&gt;
Cc: Paolo Abeni &lt;pabeni@redhat.com&gt;
Cc: Shuah Khan &lt;shuah@kernel.org&gt;
Cc: Simon Horman &lt;horms@kernel.org&gt;
Cc: Suren Baghdasaryan &lt;surenb@google.com&gt;
Cc: Vlastimil Babka &lt;vbabka@suse.cz&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>selftests: centralize -D_GNU_SOURCE= to CFLAGS in lib.mk</title>
<updated>2024-07-10T19:14:51+00:00</updated>
<author>
<name>Edward Liaw</name>
<email>edliaw@google.com</email>
</author>
<published>2024-06-25T22:34:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=cc937dad85aea4ab9e4f9827d7ea55932c86906b'/>
<id>urn:sha1:cc937dad85aea4ab9e4f9827d7ea55932c86906b</id>
<content type='text'>
Centralize the _GNU_SOURCE definition to CFLAGS in lib.mk.  Remove
redundant defines from Makefiles that import lib.mk.  Convert any usage of
"#define _GNU_SOURCE 1" to "#define _GNU_SOURCE".

This uses the form "-D_GNU_SOURCE=", which is equivalent to
"#define _GNU_SOURCE".

Otherwise using "-D_GNU_SOURCE" is equivalent to "-D_GNU_SOURCE=1" and
"#define _GNU_SOURCE 1", which is less commonly seen in source code and
would require many changes in selftests to avoid redefinition warnings.

Link: https://lkml.kernel.org/r/20240625223454.1586259-2-edliaw@google.com
Signed-off-by: Edward Liaw &lt;edliaw@google.com&gt;
Suggested-by: John Hubbard &lt;jhubbard@nvidia.com&gt;
Acked-by: Shuah Khan &lt;skhan@linuxfoundation.org&gt;
Reviewed-by: Muhammad Usama Anjum &lt;usama.anjum@collabora.com&gt;
Cc: Albert Ou &lt;aou@eecs.berkeley.edu&gt;
Cc: André Almeida &lt;andrealmeid@igalia.com&gt;
Cc: Darren Hart &lt;dvhart@infradead.org&gt;
Cc: Dave Hansen &lt;dave.hansen@linux.intel.com&gt;
Cc: Davidlohr Bueso &lt;dave@stgolabs.net&gt;
Cc: David S. Miller &lt;davem@davemloft.net&gt;
Cc: Eric Dumazet &lt;edumazet@google.com&gt;
Cc: Eric W. Biederman &lt;ebiederm@xmission.com&gt;
Cc: Fenghua Yu &lt;fenghua.yu@intel.com&gt;
Cc: Ingo Molnar &lt;mingo@redhat.com&gt;
Cc: Jakub Kicinski &lt;kuba@kernel.org&gt;
Cc: Jarkko Sakkinen &lt;jarkko@kernel.org&gt;
Cc: Jason Gunthorpe &lt;jgg@ziepe.ca&gt;
Cc: Kees Cook &lt;kees@kernel.org&gt;
Cc: Kevin Tian &lt;kevin.tian@intel.com&gt;
Cc: Palmer Dabbelt &lt;palmer@dabbelt.com&gt;
Cc: Paolo Abeni &lt;pabeni@redhat.com&gt;
Cc: Paolo Bonzini &lt;pbonzini@redhat.com&gt;
Cc: Paul Walmsley &lt;paul.walmsley@sifive.com&gt;
Cc: Peter Zijlstra &lt;peterz@infradead.org&gt;
Cc: Reinette Chatre &lt;reinette.chatre@intel.com&gt;
Cc: Sean Christopherson &lt;seanjc@google.com&gt;
Cc: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>Revert "selftests/sgx: Include KHDR_INCLUDES in Makefile"</title>
<updated>2024-05-20T15:00:06+00:00</updated>
<author>
<name>Shuah Khan</name>
<email>skhan@linuxfoundation.org</email>
</author>
<published>2024-05-17T02:58:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=3da164023582969280df17636a9d829752787b1c'/>
<id>urn:sha1:3da164023582969280df17636a9d829752787b1c</id>
<content type='text'>
This reverts commit 2c3b8f8f37c6c0c926d584cf4158db95e62b960c.

The framework change to add D_GNU_SOURCE to KHDR_INCLUDES
to Makefile, lib.mk, and kselftest_harness.h is reverted
as it is causing build failures and warnings.

Revert this change as this change depends on the framework
change.

Reported-by: Mark Brown &lt;broonie@kernel.org&gt;
Signed-off-by: Shuah Khan &lt;skhan@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>selftests/sgx: Include KHDR_INCLUDES in Makefile</title>
<updated>2024-05-08T23:08:46+00:00</updated>
<author>
<name>Edward Liaw</name>
<email>edliaw@google.com</email>
</author>
<published>2024-05-07T21:38:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=2c3b8f8f37c6c0c926d584cf4158db95e62b960c'/>
<id>urn:sha1:2c3b8f8f37c6c0c926d584cf4158db95e62b960c</id>
<content type='text'>
Add KHDR_INCLUDES to the CFLAGS to pull in the kselftest harness
dependencies (-D_GNU_SOURCE).

Also, remove redefinitions of _GNU_SOURCE in the source code.

Fixes: 809216233555 ("selftests/harness: remove use of LINE_MAX")
Reported-by: kernel test robot &lt;oliver.sang@intel.com&gt;
Closes: https://lore.kernel.org/oe-lkp/202404301040.3bea5782-oliver.sang@intel.com
Signed-off-by: Edward Liaw &lt;edliaw@google.com&gt;
Reviewed-by: Muhammad Usama Anjum &lt;usama.anjum@collabora.com&gt;
Acked-by: Dave Hansen &lt;dave.hansen@linux.intel.com&gt;
Reviewed-by: Jarkko Sakkinen &lt;jarkko@kernel.org&gt;
Tested-by: Jarkko Sakkinen &lt;jarkko@kernel.org&gt;
Reviewed-by: John Hubbard &lt;jhubbard@nvidia.com&gt;
Signed-off-by: Shuah Khan &lt;skhan@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>selftests/sgx: Skip non X86_64 platform</title>
<updated>2023-12-08T18:08:17+00:00</updated>
<author>
<name>Zhao Mengmeng</name>
<email>zhaomengmeng@kylinos.cn</email>
</author>
<published>2023-12-06T02:56:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=981cf568a8644161c2f15c02278ebc2834b51ba6'/>
<id>urn:sha1:981cf568a8644161c2f15c02278ebc2834b51ba6</id>
<content type='text'>
When building whole selftests on arm64, rsync gives an erorr about sgx:

rsync: [sender] link_stat "/root/linux-next/tools/testing/selftests/sgx/test_encl.elf" failed: No such file or directory (2)
rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1327) [sender=3.2.5]

The root casue is sgx only used on X86_64, and shall be skipped on other
platforms.

Fix this by moving TEST_CUSTOM_PROGS and TEST_FILES inside the if check,
then the build result will be "Skipping non-existent dir: sgx".

Fixes: 2adcba79e69d ("selftests/x86: Add a selftest for SGX")
Signed-off-by: Zhao Mengmeng &lt;zhaomengmeng@kylinos.cn&gt;
Signed-off-by: Dave Hansen &lt;dave.hansen@linux.intel.com&gt;
Reviewed-by: Jarkko Sakkinen &lt;jarkko@kernel.org&gt;
Link: https://lore.kernel.org/all/20231206025605.3965302-1-zhaomzhao%40126.com
</content>
</entry>
<entry>
<title>selftests/sgx: Remove incomplete ABI sanitization code in test enclave</title>
<updated>2023-12-08T18:05:28+00:00</updated>
<author>
<name>Jo Van Bulck</name>
<email>jo.vanbulck@cs.kuleuven.be</email>
</author>
<published>2023-10-05T15:38:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=886c5be0b12e89b2905c26c4f24d50ae91f261da'/>
<id>urn:sha1:886c5be0b12e89b2905c26c4f24d50ae91f261da</id>
<content type='text'>
As the selftest enclave is *not* intended for production, simplify the
code by not initializing CPU configuration registers as expected by the
ABI on enclave entry or cleansing caller-save registers on enclave exit.

Signed-off-by: Jo Van Bulck &lt;jo.vanbulck@cs.kuleuven.be&gt;
Signed-off-by: Dave Hansen &lt;dave.hansen@linux.intel.com&gt;
Reviewed-by: Jarkko Sakkinen &lt;jarkko@kernel.org&gt;
Link: https://lore.kernel.org/all/da0cfb1e-e347-f7f2-ac72-aec0ee0d867d@intel.com/
Link: https://lore.kernel.org/all/20231005153854.25566-14-jo.vanbulck%40cs.kuleuven.be
</content>
</entry>
<entry>
<title>selftests/sgx: Discard unsupported ELF sections</title>
<updated>2023-12-08T18:05:28+00:00</updated>
<author>
<name>Jo Van Bulck</name>
<email>jo.vanbulck@cs.kuleuven.be</email>
</author>
<published>2023-10-05T15:38:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=ec44ca1e34bc3a9864a8c1bf8636066ec6d5d2e5'/>
<id>urn:sha1:ec44ca1e34bc3a9864a8c1bf8636066ec6d5d2e5</id>
<content type='text'>
Building the test enclave with -static-pie may produce a dynamic symbol
table, but this is not supported for enclaves and any relocations need to
happen manually (e.g., as for "encl_op_array"). Thus, opportunistically
discard ".dyn*" and ".gnu.hash" which the enclave loader cannot handle.

Signed-off-by: Jo Van Bulck &lt;jo.vanbulck@cs.kuleuven.be&gt;
Signed-off-by: Dave Hansen &lt;dave.hansen@linux.intel.com&gt;
Reviewed-by: Jarkko Sakkinen &lt;jarkko@kernel.org&gt;
Link: https://lore.kernel.org/all/20231005153854.25566-13-jo.vanbulck%40cs.kuleuven.be
</content>
</entry>
<entry>
<title>selftests/sgx: Ensure expected location of test enclave buffer</title>
<updated>2023-12-08T18:05:27+00:00</updated>
<author>
<name>Jo Van Bulck</name>
<email>jo.vanbulck@cs.kuleuven.be</email>
</author>
<published>2023-10-05T15:38:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=022416496008bd51cb7b33975cc0008749329a86'/>
<id>urn:sha1:022416496008bd51cb7b33975cc0008749329a86</id>
<content type='text'>
The external tests manipulating page permissions expect encl_buffer to be
placed at the start of the test enclave's .data section. As this is not
guaranteed per the C standard, explicitly place encl_buffer in a separate
section that is explicitly placed at the start of the .data segment in the
linker script to avoid the compiler placing it somewhere else in .data.

Signed-off-by: Jo Van Bulck &lt;jo.vanbulck@cs.kuleuven.be&gt;
Signed-off-by: Dave Hansen &lt;dave.hansen@linux.intel.com&gt;
Reviewed-by: Jarkko Sakkinen &lt;jarkko@kernel.org&gt;
Acked-by: Kai Huang &lt;kai.huang@intel.com&gt;
Link: https://lore.kernel.org/all/20231005153854.25566-12-jo.vanbulck%40cs.kuleuven.be
</content>
</entry>
<entry>
<title>selftests/sgx: Ensure test enclave buffer is entirely preserved</title>
<updated>2023-12-08T18:05:27+00:00</updated>
<author>
<name>Jo Van Bulck</name>
<email>jo.vanbulck@cs.kuleuven.be</email>
</author>
<published>2023-10-05T15:38:51+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=a4c39ef4ed43103caef80029cd30427a9ff342d8'/>
<id>urn:sha1:a4c39ef4ed43103caef80029cd30427a9ff342d8</id>
<content type='text'>
Attach the "used" attribute to instruct the compiler to preserve the static
encl_buffer, even if it appears it is not entirely referenced in the enclave
code, as expected by the external tests manipulating page permissions.

Signed-off-by: Jo Van Bulck &lt;jo.vanbulck@cs.kuleuven.be&gt;
Signed-off-by: Dave Hansen &lt;dave.hansen@linux.intel.com&gt;
Reviewed-by: Jarkko Sakkinen &lt;jarkko@kernel.org&gt;
Acked-by: Kai Huang &lt;kai.huang@intel.com&gt;
Link: https://lore.kernel.org/all/a2732938-f3db-a0af-3d68-a18060f66e79@cs.kuleuven.be/
Link: https://lore.kernel.org/all/20231005153854.25566-11-jo.vanbulck%40cs.kuleuven.be
</content>
</entry>
<entry>
<title>selftests/sgx: Fix linker script asserts</title>
<updated>2023-12-08T18:05:27+00:00</updated>
<author>
<name>Jo Van Bulck</name>
<email>jo.vanbulck@cs.kuleuven.be</email>
</author>
<published>2023-10-05T15:38:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=9fd552ee32c6c1e27c125016b87d295bea6faea7'/>
<id>urn:sha1:9fd552ee32c6c1e27c125016b87d295bea6faea7</id>
<content type='text'>
DEFINED only considers symbols, not section names. Hence, replace the
check for .got.plt with the _GLOBAL_OFFSET_TABLE_ symbol and remove other
(non-essential) asserts.

Signed-off-by: Jo Van Bulck &lt;jo.vanbulck@cs.kuleuven.be&gt;
Signed-off-by: Dave Hansen &lt;dave.hansen@linux.intel.com&gt;
Reviewed-by: Jarkko Sakkinen &lt;jarkko@kernel.org&gt;
Link: https://lore.kernel.org/all/20231005153854.25566-10-jo.vanbulck%40cs.kuleuven.be
</content>
</entry>
</feed>
