Skip to content

Commit 0a3f29b

Browse files
Sean Christophersonbonzini
authored andcommitted
KVM: selftests: explicitly disable PIE for tests
KVM selftests embed the guest "image" as a function in the test itself and extract the guest code at runtime by manually parsing the elf headers. The parsing is very simple and doesn't supporting fancy things like position independent executables. Recent versions of gcc enable pie by default, which results in triple fault shutdowns in the guest due to the virtual address in the headers not matching up with the virtual address retrieved from the function pointer. Signed-off-by: Sean Christopherson <sean.j.christopherson@intel.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
1 parent 8df98ae commit 0a3f29b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tools/testing/selftests/kvm/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ LIBKVM += $(LIBKVM_$(UNAME_M))
2929
INSTALL_HDR_PATH = $(top_srcdir)/usr
3030
LINUX_HDR_PATH = $(INSTALL_HDR_PATH)/include/
3131
LINUX_TOOL_INCLUDE = $(top_srcdir)/tools/include
32-
CFLAGS += -O2 -g -std=gnu99 -I$(LINUX_TOOL_INCLUDE) -I$(LINUX_HDR_PATH) -Iinclude -I$(<D) -Iinclude/$(UNAME_M) -I..
32+
CFLAGS += -O2 -g -std=gnu99 -no-pie -I$(LINUX_TOOL_INCLUDE) -I$(LINUX_HDR_PATH) -Iinclude -I$(<D) -Iinclude/$(UNAME_M) -I..
3333
LDFLAGS += -pthread
3434

3535
# After inclusion, $(OUTPUT) is defined and

0 commit comments

Comments
 (0)