qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[RFC PATCH 6/6] tests/tcg/ppc64: add rules to build PowerNV tests


From: Leandro Lupori
Subject: [RFC PATCH 6/6] tests/tcg/ppc64: add rules to build PowerNV tests
Date: Thu, 24 Mar 2022 16:08:54 -0300

Each Microwatt/PowerNV test use its own head.S file and thus needs
different build rules.

Signed-off-by: Leandro Lupori <leandro.lupori@eldorado.org.br>
---
 tests/tcg/ppc64/Makefile.softmmu-target | 33 +++++++++++++++++++------
 tests/tcg/ppc64/system/mmu-head.S       |  1 +
 2 files changed, 27 insertions(+), 7 deletions(-)

diff --git a/tests/tcg/ppc64/Makefile.softmmu-target 
b/tests/tcg/ppc64/Makefile.softmmu-target
index 511b6322df..47343d64aa 100644
--- a/tests/tcg/ppc64/Makefile.softmmu-target
+++ b/tests/tcg/ppc64/Makefile.softmmu-target
@@ -35,24 +35,43 @@ CFLAGS = -O -g -Wall -std=c99 -msoft-float -mno-vsx 
-mno-altivec \
          -I $(PPC64_SYSTEM_SRC)/include $(MINILIB_INC) \
          -mcpu=power8
 
+# Each Microwatt/PowerNV test use its own head.S file and thus needs
+# different rules.
+PPC64_PNV_TESTS = mmu
+PPC64_PNV_ELFS = $(addsuffix .elf,$(PPC64_PNV_TESTS))
+TESTS += $(PPC64_PNV_TESTS)
+
 # Leave the .elf files, to make debugging easier
 .PRECIOUS: $(CRT_OBJS) $(addsuffix .elf,$(TESTS))
 
-# Build CRT objects
+# Build CRT and test objects
 %.o: $(CRT_PATH)/%.S
        $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -x assembler-with-cpp -c $< -o $@
 
+%.o: %.S
+       $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -x assembler-with-cpp -c $< -o $@
+
 %.o: $(CRT_PATH)/%.c
        $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -c $< -o $@
 
-# Build and link the tests
+%.o: %.c
+       $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -c $< -o $@
+
+# Build .elf files for debugging
+%.elf: %.o $(LINK_SCRIPT) $(CRT_OBJS) $(MINILIB_OBJS)
+       $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -o $@ $< $(LDFLAGS)
+
+$(PPC64_PNV_ELFS): %.elf: %-head.o %.o $(LINK_SCRIPT) $(CRT_OBJS) 
$(MINILIB_OBJS)
+       $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -o $@ $< $*.o $(LDFLAGS)
 
-# The .elf files are just for debugging
-%.elf: %.c $(LINK_SCRIPT) $(CRT_OBJS) $(MINILIB_OBJS)
-       $(CC) $(CFLAGS) $(EXTRA_CFLAGS) $< -o $@ $(LDFLAGS)
+# Build test binaries
+%: %.o $(LINK_SCRIPT) $(CRT_OBJS) $(MINILIB_OBJS) %.elf
+       $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -o $@ $< $(LDFLAGS) -Wl,--oformat=binary
 
-%: %.c %.elf $(LINK_SCRIPT) $(CRT_OBJS) $(MINILIB_OBJS)
-       $(CC) $(CFLAGS) $(EXTRA_CFLAGS) $< -o $@ $(LDFLAGS) -Wl,--oformat=binary
+# NOTE: %-head.o replaces boot.o
+$(PPC64_PNV_TESTS): CRT_OBJS = console.o
+$(PPC64_PNV_TESTS): %: %-head.o %.o $(LINK_SCRIPT) $(CRT_OBJS) $(MINILIB_OBJS) 
%.elf
+       $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -o $@ $< $*.o $(LDFLAGS) 
-Wl,--oformat=binary
 
 memory: CFLAGS+=-DCHECK_UNALIGNED=1
 
diff --git a/tests/tcg/ppc64/system/mmu-head.S 
b/tests/tcg/ppc64/system/mmu-head.S
index b7fb99c379..a3f23fcb17 100644
--- a/tests/tcg/ppc64/system/mmu-head.S
+++ b/tests/tcg/ppc64/system/mmu-head.S
@@ -65,6 +65,7 @@ FUNCTION(test_exec)
 
 #define EXCEPTION(nr)        \
     .= nr                   ;\
+    li      %r3, (nr >> 4)  ;\
     attn
 
     /* DSI vector - skip the failing instruction + the next one */
-- 
2.25.1




reply via email to

[Prev in Thread] Current Thread [Next in Thread]