selftests: tdx: Use installed kernel headers search path
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fri, 27 Jan 2023 13:57:55 +0000 (08:57 -0500)
committerShuah Khan <skhan@linuxfoundation.org>
Mon, 13 Feb 2023 16:09:46 +0000 (09:09 -0700)
Use $(KHDR_INCLUDES) as lookup path for installed kernel headers rather
than using kernel headers in include/uapi from the source kernel tree
kernel headers.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Cc: Shuah Khan <shuah@kernel.org>
Cc: linux-kselftest@vger.kernel.org
Cc: Ingo Molnar <mingo@redhat.com>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
tools/testing/selftests/tdx/Makefile
tools/testing/selftests/tdx/tdx_guest_test.c

index 8dd43517cd55d31c353cf2929727d99789c8e05a..306e9c4d5ef7ca519260c164e49eb93f972fb830 100644 (file)
@@ -1,6 +1,6 @@
 # SPDX-License-Identifier: GPL-2.0
 
-CFLAGS += -O3 -Wl,-no-as-needed -Wall -static
+CFLAGS += -O3 -Wl,-no-as-needed -Wall $(KHDR_INCLUDES) -static
 
 TEST_GEN_PROGS := tdx_guest_test
 
index 2a2afd856798b4bcf74820709796c1b5f0187579..81d8cb88ea1ad9bd358523beb68d32b73b28e0f3 100644 (file)
@@ -12,8 +12,8 @@
 #include <errno.h>
 #include <fcntl.h>
 
+#include <linux/tdx-guest.h>
 #include "../kselftest_harness.h"
-#include "../../../../include/uapi/linux/tdx-guest.h"
 
 #define TDX_GUEST_DEVNAME "/dev/tdx_guest"
 #define HEX_DUMP_SIZE 8