Skip to contentSkip to conversation

target-ppc Fixes for some missing config dependencies

PATCH Applied David Gibson 4 participants 9 messages Aug 26, 2014 – Sep 8, 2014

lore
Share & tools
lore
#0 lore raw

cover target-ppc Fixes for some missing config dependencies

These 3 patches fix some places where things ought to depend on an existing config variable, but don't.

#1 lore raw

PATCH 1/3 target-ppc: Disable PReP testcases with !CONFIG_PREP

The test suites contain several tests which require the "prep" machine type, which will fail if that is configured out.

---
 tests/boot-order-test.c | 4 ++++
 tests/endianness-test.c | 2 ++
 2 files changed, 6 insertions(+)
tests/boot-order-test.c +4 -0
index 360a691..bff16b5 100644
@@ -112,6 +112,7 @@ static void test_pc_boot_order(void)
     test_boot_orders(NULL, read_boot_order_pc, test_cases_pc);
 }
 
+#ifdef CONFIG_PREP
 static uint8_t read_m48t59(uint64_t addr, uint16_t reg)
 {
     writeb(addr, reg & 0xff);
@@ -135,6 +136,7 @@ static void test_prep_boot_order(void)
 {
     test_boot_orders("prep", read_boot_order_prep, test_cases_prep);
 }
+#endif /* CONFIG_PREP */
 
 static uint64_t read_boot_order_pmac(void)
 {
@@ -194,7 +196,9 @@ int main(int argc, char *argv[])
     if (strcmp(arch, "i386") == 0 || strcmp(arch, "x86_64") == 0) {
         qtest_add_func("boot-order/pc", test_pc_boot_order);
     } else if (strcmp(arch, "ppc") == 0 || strcmp(arch, "ppc64") == 0) {
+#ifdef CONFIG_PREP
         qtest_add_func("boot-order/prep", test_prep_boot_order);
+#endif /* CONFIG_PREP */
         qtest_add_func("boot-order/pmac_oldworld",
                        test_pmac_oldworld_boot_order);
         qtest_add_func("boot-order/pmac_newworld",
tests/endianness-test.c +2 -0
index 92e17d2..0857784 100644
@@ -41,7 +41,9 @@ static const TestCase test_cases[] = {
     { "mips64", "malta", 0x10000000, .bswap = true },
     { "mips64el", "fulong2e", 0x1fd00000 },
     { "ppc", "g3beige", 0xfe000000, .bswap = true, .superio = "i82378" },
+#ifdef CONFIG_PREP
     { "ppc", "prep", 0x80000000, .bswap = true },
+#endif /* CONFIG_PREP */
     { "ppc", "bamboo", 0xe8000000, .bswap = true, .superio = "i82378" },
     { "ppc64", "mac99", 0xf2000000, .bswap = true, .superio = "i82378" },
     { "ppc64", "pseries", 0x10080000000ULL,
Signature · 1 line
1.9.3
#2 lore raw

PATCH 2/3 target-ppc: Disable ppc Mac tests when !CONFIG_MAC

In reply to David Gibson

The testsuites contain several tests which require the "mac99" and "g3beige" machine types, which will fail when CONFIG_MAC is not specified.

---
 tests/boot-order-test.c | 6 ++++++
 tests/endianness-test.c | 4 ++++
 2 files changed, 10 insertions(+)
tests/boot-order-test.c +6 -0
index bff16b5..1a7aa8b 100644
@@ -138,12 +138,14 @@ static void test_prep_boot_order(void)
 }
 #endif /* CONFIG_PREP */
 
+#ifdef CONFIG_MAC
 static uint64_t read_boot_order_pmac(void)
 {
     QFWCFG *fw_cfg = mm_fw_cfg_init(0xf0000510);
 
     return qfw_cfg_get_u16(fw_cfg, FW_CFG_BOOT_DEVICE);
 }
+#endif /* CONFIG_MAC */
 
 static const boot_order_test test_cases_fw_cfg[] = {
     { "", 'c', 'c' },
@@ -153,6 +155,7 @@ static const boot_order_test test_cases_fw_cfg[] = {
     {}
 };
 
+#ifdef CONFIG_MAC
 static void test_pmac_oldworld_boot_order(void)
 {
     test_boot_orders("g3beige", read_boot_order_pmac, test_cases_fw_cfg);
@@ -162,6 +165,7 @@ static void test_pmac_newworld_boot_order(void)
 {
     test_boot_orders("mac99", read_boot_order_pmac, test_cases_fw_cfg);
 }
+#endif /* CONFIG_MAC */
 
 static uint64_t read_boot_order_sun4m(void)
 {
@@ -199,10 +203,12 @@ int main(int argc, char *argv[])
 #ifdef CONFIG_PREP
         qtest_add_func("boot-order/prep", test_prep_boot_order);
 #endif /* CONFIG_PREP */
+#ifdef CONFIG_MAC
         qtest_add_func("boot-order/pmac_oldworld",
                        test_pmac_oldworld_boot_order);
         qtest_add_func("boot-order/pmac_newworld",
                        test_pmac_newworld_boot_order);
+#endif /* CONFIG_MAC */
     } else if (strcmp(arch, "sparc") == 0) {
         qtest_add_func("boot-order/sun4m", test_sun4m_boot_order);
     } else if (strcmp(arch, "sparc64") == 0) {
tests/endianness-test.c +4 -0
index 0857784..73b512b 100644
@@ -40,12 +40,16 @@ static const TestCase test_cases[] = {
     { "mips64", "mips", 0x14000000, .bswap = true },
     { "mips64", "malta", 0x10000000, .bswap = true },
     { "mips64el", "fulong2e", 0x1fd00000 },
+#ifdef CONFIG_MAC
     { "ppc", "g3beige", 0xfe000000, .bswap = true, .superio = "i82378" },
+#endif /* CONFIG_MAC */
 #ifdef CONFIG_PREP
     { "ppc", "prep", 0x80000000, .bswap = true },
 #endif /* CONFIG_PREP */
     { "ppc", "bamboo", 0xe8000000, .bswap = true, .superio = "i82378" },
+#ifdef CONFIG_MAC
     { "ppc64", "mac99", 0xf2000000, .bswap = true, .superio = "i82378" },
+#endif /* CONFIG_MAC */
     { "ppc64", "pseries", 0x10080000000ULL,
       .bswap = true, .superio = "i82378" },
     { "sh4", "r2d", 0xfe240000, .superio = "i82378" },
Signature · 1 line
1.9.3
#3 lore raw

PATCH 3/3 target-ppc: virtex-ml507 machine type should depend on CONFIG_XILINX

In reply to David Gibson

The virtex-ml507 is a Xilinx CPU based system, and requires several sub devices which are only included with CONFIG_XILINX. Therefore, it should only be compiled if CONFIG_XILINX is set.

---
 hw/ppc/Makefile.objs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
hw/ppc/Makefile.objs +1 -1
index edd44d0..19d9920 100644
@@ -20,4 +20,4 @@ obj-$(CONFIG_MAC) += mac_newworld.o
 obj-$(CONFIG_E500) += e500.o mpc8544ds.o e500plat.o
 obj-$(CONFIG_E500) += mpc8544_guts.o ppce500_spin.o
 # PowerPC 440 Xilinx ML507 reference board.
-obj-y += virtex_ml507.o
+obj-$(CONFIG_XILINX) += virtex_ml507.o
Signature · 1 line
1.9.3
Reviewed-by on v1 3/3
#4 lore raw

Re: [Qemu-devel] [PATCH 3/3] target-ppc: virtex-ml507 machine type should depend on CONFIG_XILINX

Quoted 5 lines · David Gibson

The virtex-ml507 is a Xilinx CPU based system, and requires several sub devices which are only included with CONFIG_XILINX. Therefore, it should only be compiled if CONFIG_XILINX is set.

Quoted 18 lines
---
 hw/ppc/Makefile.objs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
hw/ppc/Makefile.objs +1 -2
index edd44d0..19d9920 100644
@@ -20,4 +20,4 @@ obj-$(CONFIG_MAC) += mac_newworld.o
 obj-$(CONFIG_E500) += e500.o mpc8544ds.o e500plat.o
 obj-$(CONFIG_E500) += mpc8544_guts.o ppce500_spin.o
 # PowerPC 440 Xilinx ML507 reference board.
-obj-y += virtex_ml507.o
+obj-$(CONFIG_XILINX) += virtex_ml507.o
--

1.9.3

#5 lore raw

Re: [Qemu-devel] [PATCH 3/3] target-ppc: virtex-ml507 machine type should depend on CONFIG_XILINX

In reply to David Gibson
Quoted 5 lines · David Gibson

The virtex-ml507 is a Xilinx CPU based system, and requires several sub devices which are only included with CONFIG_XILINX. Therefore, it should only be compiled if CONFIG_XILINX is set.

Thanks, applied to ppc-next.

Alex

#6 lore raw
In reply to David Gibson

Il 26/08/2014 06:30, David Gibson ha scritto:

Quoted 2 lines

These 3 patches fix some places where things ought to depend on an existing config variable, but don't.

Which header provdides the #defines?

Paolo

#7 lore raw
Quoted 5 lines · Paolo Bonzini

Il 26/08/2014 06:30, David Gibson ha scritto:

Quoted 2 lines

These 3 patches fix some places where things ought to depend on an existing config variable, but don't.

Which header provdides the #defines?

Ah, crap, none does. So effectively, my patch unconditionally disables those tests.

Have I mentioned that I really hate the fact that qemu has different config variables visible to make and C.

I'll rework, but probably not for a little while, since I have to focus on some kernel work instead for the time being.

Signature · 4 lines
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson
#8 lore raw

Il 27/08/2014 10:22, David Gibson ha scritto:

Quoted 2 lines

Have I mentioned that I really hate the fact that qemu has different config variables visible to make and C.

Yeah, the introduction of config-devices.h was nixed by one of the maintainers a few years ago...

Quoted 2 lines

I'll rework, but probably not for a little while, since I have to focus on some kernel work instead for the time being.

No problem.

Paolo