Skip to content

Commit 70c7b70

Browse files
committed
KVM: selftests: Avoid using forced target for generating arm64 headers
The 'prepare' target that generates the arm64 sysreg headers had no prerequisites, so it wound up forcing a rebuild of all KVM selftests each invocation. Add a rule for the generated headers and just have dependents use that for a prerequisite. Reported-by: Nina Schoetterl-Glausch <nsg@linux.ibm.com> Fixes: 9697d84 ("KVM: selftests: Generate sysreg-defs.h and add to include path") Tested-by: Nina Schoetterl-Glausch <nsg@linux.ibm.com> Link: https://lore.kernel.org/r/20231027005439.3142015-3-oliver.upton@linux.dev Signed-off-by: Oliver Upton <oliver.upton@linux.dev>
1 parent fbb075c commit 70c7b70

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

tools/testing/selftests/kvm/Makefile

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,8 @@ arm64_tools_dir := $(top_srcdir)/tools/arch/arm64/tools/
2222
GEN_HDRS := $(top_srcdir)/tools/arch/arm64/include/generated/
2323
CFLAGS += -I$(GEN_HDRS)
2424

25-
prepare:
25+
$(GEN_HDRS): $(wildcard $(arm64_tools_dir)/*)
2626
$(MAKE) -C $(arm64_tools_dir)
27-
else
28-
prepare:
2927
endif
3028

3129
LIBKVM += lib/assert.c
@@ -276,10 +274,10 @@ EXTRA_CLEAN += $(GEN_HDRS) \
276274
cscope.*
277275

278276
x := $(shell mkdir -p $(sort $(dir $(LIBKVM_C_OBJ) $(LIBKVM_S_OBJ))))
279-
$(LIBKVM_C_OBJ): $(OUTPUT)/%.o: %.c prepare
277+
$(LIBKVM_C_OBJ): $(OUTPUT)/%.o: %.c $(GEN_HDRS)
280278
$(CC) $(CFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c $< -o $@
281279

282-
$(LIBKVM_S_OBJ): $(OUTPUT)/%.o: %.S prepare
280+
$(LIBKVM_S_OBJ): $(OUTPUT)/%.o: %.S $(GEN_HDRS)
283281
$(CC) $(CFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c $< -o $@
284282

285283
# Compile the string overrides as freestanding to prevent the compiler from
@@ -289,9 +287,10 @@ $(LIBKVM_STRING_OBJ): $(OUTPUT)/%.o: %.c
289287
$(CC) $(CFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c -ffreestanding $< -o $@
290288

291289
x := $(shell mkdir -p $(sort $(dir $(TEST_GEN_PROGS))))
290+
$(SPLIT_TESTS_OBJS): $(GEN_HDRS)
292291
$(TEST_GEN_PROGS): $(LIBKVM_OBJS)
293292
$(TEST_GEN_PROGS_EXTENDED): $(LIBKVM_OBJS)
294-
$(TEST_GEN_OBJ): prepare
293+
$(TEST_GEN_OBJ): $(GEN_HDRS)
295294

296295
cscope: include_paths = $(LINUX_TOOL_INCLUDE) $(LINUX_HDR_PATH) include lib ..
297296
cscope:

0 commit comments

Comments
 (0)