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: <20200326030750.173972-4-xiaoyao.li@intel.com>
Date:   Thu, 26 Mar 2020 11:07:50 +0800
From:   Xiaoyao Li <xiaoyao.li@...el.com>
To:     Paolo Bonzini <pbonzini@...hat.com>, Shuah Khan <shuah@...nel.org>
Cc:     kvm@...r.kernel.org, linux-kselftest@...r.kernel.org,
        linux-kernel@...r.kernel.org, Xiaoyao Li <xiaoyao.li@...el.com>
Subject: [RFC v3 3/3] kvm: selftests: Fix header path when built from parent level with O specified

When build kvm selftests in tools/testing/selftests directory with

	make O=/home/lxy/kselftests TARGETS=kvm

it fails building some kvm test binaries due to lack of header files,
e.g.,

  x86_64/vmx_set_nested_state_test.c: In function ‘set_default_vmx_state’:
  x86_64/vmx_set_nested_state_test.c:85:7: error: ‘struct
  kvm_nested_state’ has no member named ‘hdr’
    state->hdr.vmx.vmxon_pa = 0x1000;
  ...

With "O" is specified, it also takes effect on "make headers_install",
which causes no header files generated in "kernel-src/usr".

Fix INSTALL_HDR_PATH with correct path for this case.

Opportunistically fix the case when KBUILD_OUTPUT specified as well,
even though it can work currently.

Signed-off-by: Xiaoyao Li <xiaoyao.li@...el.com>
---
 tools/testing/selftests/kvm/Makefile | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/tools/testing/selftests/kvm/Makefile b/tools/testing/selftests/kvm/Makefile
index 6a95878b2ab7..bf8f56488914 100644
--- a/tools/testing/selftests/kvm/Makefile
+++ b/tools/testing/selftests/kvm/Makefile
@@ -50,7 +50,11 @@ ifeq (0,$(MAKELEVEL))
 	INSTALL_HDR_PATH := $(top_srcdir)/usr
     endif
 else
+    ifneq ($(O)$(KBUILD_OUTPUT),)
+	INSTALL_HDR_PATH := $(BUILD)/usr
+    else
 	INSTALL_HDR_PATH := $(top_srcdir)/usr
+    endif
 endif
 LINUX_HDR_PATH = $(INSTALL_HDR_PATH)/include/
 LINUX_TOOL_INCLUDE = $(top_srcdir)/tools/include
-- 
2.20.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ