Skip to contentSkip to conversation

xilinx: Speed up the build

PATCH Applied Andreas Färber 3 participants 15 messages Jun 9, 2012 – Jun 16, 2012

lore
Share & tools
lore
#0 lore raw

cover xilinx: Speed up the build

Hello Edgar and Peter,

With the Makefile refactoring applied now, here's the Makefile improvements for MicroBlaze I mentioned.

All Xilinx devices that are used for more than one softmmu are compiled once in libhw32. Actually some also in libhw64 due to ppc440 being compiled into ppc64, but we can fix that in a second step via Alex' ppc-next, we're already down from thrice to twice.

The middle patch is extracted from Blue's logging refactoring.

Please test and apply. Your s3adp1800 and virtel_ml507 test images complain both with and without patches about not finding "eth0". Selftest completes ok except for not finding /usr/bin/sha1test on ppc440.

xilinx_ethlite.c uses tswap32(). Have you ever tested this device to work on microblazeel? I wonder if we could change the device from DEVICE_NATIVE_ENDIAN to DEVICE_BIG_ENDIAN and in place of tswap32() use a bswap32() conditional on HOST_WORDS_BIGENDIAN so that it becomes independent of the target, too?

Instead of adding random devices to hw/microblaze/Makefile.objs in new series, they should be added to hw/Makefile.objs with appropriate CONFIG_* options set in default-configs/microblaze[el]-softmmu.mak as demonstrated here, easy to do and also ensures that the appropriate poisoning is applied.

Regards,
Andreas

Cc Edgar E. Iglesias <[email protected]>
Cc Peter A. G. Crosthwaite <[email protected]>
Cc Alexander Graf <[email protected]>
Cc Blue Swirl <[email protected]>

Andreas Färber (3):
hw/xilinx_*: Share Xilinx devices between ppc and microblaze
qemu-log: Allow usage in libhw
xilinx_axi*: Share devices between microblaze and microblazeel

 default-configs/microblaze-softmmu.mak   |    2 ++
 default-configs/microblazeel-softmmu.mak |    2 ++
 default-configs/ppc-softmmu.mak          |    1 +
 default-configs/ppc64-softmmu.mak        |    1 +
 default-configs/ppcemb-softmmu.mak       |    1 +
 hw/Makefile.objs                         |    7 +++++++
 hw/microblaze/Makefile.objs              |    5 -----
 hw/ppc/Makefile.objs                     |    3 ---
 qemu-log.h                               |    2 ++
 9 files changed, 16 insertions(+), 8 deletions(-)
Signature · 1 line
1.7.7
#1 lore raw

PATCH 1/3 hw/xilinx_*: Share Xilinx devices between ppc and microblaze

Speeds up the build.

xilinx_ethlite uses tswap32() and is thus target-dependent.

---
 default-configs/microblaze-softmmu.mak   |    1 +
 default-configs/microblazeel-softmmu.mak |    1 +
 default-configs/ppc-softmmu.mak          |    1 +
 default-configs/ppc64-softmmu.mak        |    1 +
 default-configs/ppcemb-softmmu.mak       |    1 +
 hw/Makefile.objs                         |    5 +++++
 hw/microblaze/Makefile.objs              |    3 ---
 hw/ppc/Makefile.objs                     |    3 ---
 8 files changed, 10 insertions(+), 6 deletions(-)
default-configs/microblaze-softmmu.mak +1 -0
index 613edab..08e7449 100644
@@ -3,3 +3,4 @@
 CONFIG_PTIMER=y
 CONFIG_PFLASH_CFI01=y
 CONFIG_SERIAL=y
+CONFIG_XILINX=y
default-configs/microblazeel-softmmu.mak +1 -0
index 4b40fb2..a9578e1 100644
@@ -3,3 +3,4 @@
 CONFIG_PTIMER=y
 CONFIG_PFLASH_CFI01=y
 CONFIG_SERIAL=y
+CONFIG_XILINX=y
default-configs/ppc-softmmu.mak +1 -0
index 1a768fc..d0fde7b 100644
@@ -36,3 +36,4 @@ CONFIG_PFLASH_CFI01=y
 CONFIG_PFLASH_CFI02=y
 CONFIG_PTIMER=y
 CONFIG_I8259=y
+CONFIG_XILINX=y
default-configs/ppc64-softmmu.mak +1 -0
index f490368..e4265b4 100644
@@ -33,3 +33,4 @@ CONFIG_PFLASH_CFI01=y
 CONFIG_PFLASH_CFI02=y
 CONFIG_PTIMER=y
 CONFIG_I8259=y
+CONFIG_XILINX=y
default-configs/ppcemb-softmmu.mak +1 -0
index 829f462..aaa9cdc 100644
@@ -33,3 +33,4 @@ CONFIG_PFLASH_CFI01=y
 CONFIG_PFLASH_CFI02=y
 CONFIG_PTIMER=y
 CONFIG_I8259=y
+CONFIG_XILINX=y
hw/Makefile.objs +5 -0
index 7e17504..102ebcf 100644
@@ -59,6 +59,11 @@ hw-obj-$(CONFIG_PIIX4) += piix4.o
 hw-obj-$(CONFIG_G364FB) += g364fb.o
 hw-obj-$(CONFIG_JAZZ_LED) += jazz_led.o
 
+# Xilinx devices
+hw-obj-$(CONFIG_XILINX) += xilinx_intc.o
+hw-obj-$(CONFIG_XILINX) += xilinx_timer.o
+hw-obj-$(CONFIG_XILINX) += xilinx_uartlite.o
+
 # PCI watchdog devices
 hw-obj-$(CONFIG_PCI) += wdt_i6300esb.o
 
hw/microblaze/Makefile.objs +0 -3
index 020f7b6..59ea20f 100644
@@ -3,9 +3,6 @@ obj-y += petalogix_ml605_mmu.o
 obj-y += microblaze_boot.o
 
 obj-y += microblaze_pic_cpu.o
-obj-y += xilinx_intc.o
-obj-y += xilinx_timer.o
-obj-y += xilinx_uartlite.o
 obj-y += xilinx_ethlite.o
 obj-y += xilinx_axidma.o
 obj-y += xilinx_axienet.o
hw/ppc/Makefile.objs +0 -3
index 842e7b9..6f5757f 100644
@@ -24,9 +24,6 @@ obj-y += openpic.o
 obj-$(CONFIG_FDT) += ../device_tree.o
 
 # Xilinx PPC peripherals
-obj-y += xilinx_intc.o
-obj-y += xilinx_timer.o
-obj-y += xilinx_uartlite.o
 obj-y += xilinx_ethlite.o
 
 obj-y := $(addprefix ../,$(obj-y))
Signature · 1 line
1.7.7
#2 lore raw

Re: [Qemu-devel] [PATCH 1/3] hw/xilinx_*: Share Xilinx devices between ppc and microblaze

Quoted 69 lines · Andreas Färber

Speeds up the build.

xilinx_ethlite uses tswap32() and is thus target-dependent.

---
 default-configs/microblaze-softmmu.mak   |    1 + default-configs/microblazeel-softmmu.mak |    1 + default-configs/ppc-softmmu.mak          |    1 + default-configs/ppc64-softmmu.mak        |    1 + default-configs/ppcemb-softmmu.mak       |    1 + hw/Makefile.objs                         |    5 +++++ hw/microblaze/Makefile.objs              |    3 --- hw/ppc/Makefile.objs                     |    3 ---

 8 files changed, 10 insertions(+), 6 deletions(-)
default-configs/microblaze-softmmu.mak +0 -0
index 613edab..08e7449 100644
@@ -3,3 +3,4 @@

 CONFIG_PTIMER=y
 CONFIG_PFLASH_CFI01=y
 CONFIG_SERIAL=y

default-configs/microblaze-softmmu.mak +1 -0
+CONFIG_XILINX=y
default-configs/microblazeel-softmmu.mak +0 -0
index 4b40fb2..a9578e1 100644
@@ -3,3 +3,4 @@

 CONFIG_PTIMER=y
 CONFIG_PFLASH_CFI01=y
 CONFIG_SERIAL=y

default-configs/microblazeel-softmmu.mak +1 -0
+CONFIG_XILINX=y
default-configs/ppc-softmmu.mak +0 -0
index 1a768fc..d0fde7b 100644
@@ -36,3 +36,4 @@ CONFIG_PFLASH_CFI01=y

 CONFIG_PFLASH_CFI02=y
 CONFIG_PTIMER=y
 CONFIG_I8259=y

default-configs/ppc-softmmu.mak +1 -0
+CONFIG_XILINX=y
default-configs/ppc64-softmmu.mak +0 -0
index f490368..e4265b4 100644
@@ -33,3 +33,4 @@ CONFIG_PFLASH_CFI01=y

 CONFIG_PFLASH_CFI02=y
 CONFIG_PTIMER=y
 CONFIG_I8259=y

default-configs/ppc64-softmmu.mak +1 -0
+CONFIG_XILINX=y
default-configs/ppcemb-softmmu.mak +0 -0
index 829f462..aaa9cdc 100644
@@ -33,3 +33,4 @@ CONFIG_PFLASH_CFI01=y

 CONFIG_PFLASH_CFI02=y
 CONFIG_PTIMER=y
 CONFIG_I8259=y

default-configs/ppcemb-softmmu.mak +1 -0
+CONFIG_XILINX=y
hw/Makefile.objs +0 -0
index 7e17504..102ebcf 100644
@@ -59,6 +59,11 @@ hw-obj-$(CONFIG_PIIX4) += piix4.o

 hw-obj-$(CONFIG_G364FB) += g364fb.o
 hw-obj-$(CONFIG_JAZZ_LED) += jazz_led.o

hw/Makefile.objs hw-obj-$(CONFIG_PIIX4) += piix4.o · line 66

Quoted 5 lines
hw/Makefile.objs +5 -0
+# Xilinx devices
+hw-obj-$(CONFIG_XILINX) += xilinx_intc.o
+hw-obj-$(CONFIG_XILINX) += xilinx_timer.o
+hw-obj-$(CONFIG_XILINX) += xilinx_uartlite.o
+

Hi Andreas,

whats the plan with xilinx_axidma xilinx_axienet and xilinx_ethlite? Should be fold them into this CONFIG_ or are these the exceptions to the rule as they are the annoying endian dependent ones?

Regards,
Peter

Quoted 35 lines

 # PCI watchdog devices
 hw-obj-$(CONFIG_PCI) += wdt_i6300esb.o

hw/microblaze/Makefile.objs +0 -0
index 020f7b6..59ea20f 100644
@@ -3,9 +3,6 @@ obj-y += petalogix_ml605_mmu.o

 obj-y += microblaze_boot.o

 obj-y += microblaze_pic_cpu.o

hw/microblaze/Makefile.objs +0 -3
-obj-y += xilinx_intc.o
-obj-y += xilinx_timer.o
-obj-y += xilinx_uartlite.o

 obj-y += xilinx_ethlite.o
 obj-y += xilinx_axidma.o
 obj-y += xilinx_axienet.o

hw/ppc/Makefile.objs +0 -0
index 842e7b9..6f5757f 100644
@@ -24,9 +24,6 @@ obj-y += openpic.o

 obj-$(CONFIG_FDT) += ../device_tree.o

 # Xilinx PPC peripherals

hw/ppc/Makefile.objs +0 -3
-obj-y += xilinx_intc.o
-obj-y += xilinx_timer.o
-obj-y += xilinx_uartlite.o

 obj-y += xilinx_ethlite.o

 obj-y := $(addprefix ../,$(obj-y))
--
1.7.7

#3 lore raw

Re: [Qemu-devel] [PATCH 1/3] hw/xilinx_*: Share Xilinx devices between ppc and microblaze

Hi,

Am 09.06.2012 04:15, schrieb Peter Crosthwaite:

Quoted 6 lines · Andreas Färber
Quoted 5 lines

Speeds up the build.

xilinx_ethlite uses tswap32() and is thus target-dependent.

[...]

Quoted 6 lines
Quoted 6 lines
hw/Makefile.objs +0 -0
@@ -59,6 +59,11 @@ hw-obj-$(CONFIG_PIIX4) += piix4.o
 hw-obj-$(CONFIG_G364FB) += g364fb.o
 hw-obj-$(CONFIG_JAZZ_LED) += jazz_led.o
 
Quoted 9 lines

hw/Makefile.objs hw-obj-$(CONFIG_PIIX4) += piix4.o · line 66

Quoted 5 lines
hw/Makefile.objs +5 -0
+# Xilinx devices
+hw-obj-$(CONFIG_XILINX) += xilinx_intc.o
+hw-obj-$(CONFIG_XILINX) += xilinx_timer.o
+hw-obj-$(CONFIG_XILINX) += xilinx_uartlite.o
+

whats the plan with xilinx_axidma xilinx_axienet and xilinx_ethlite? Should be fold them into this CONFIG_ or are these the exceptions to the rule as they are the annoying endian dependent ones?

The axi ones are in patch 3/3 as they are only used for microblaze, not ppc, and they use qemu-log.h. Designed for pick-from-the-front*. :)

The ethlite has the endianness issue described in the cover letter. Once solved, I'd expect it to be folded into CONFIG_XILINX as well, yes.

Obviously if you have better variable naming, feel free to suggest or to change before Edgar applies, my stake is only that the variable names match in both places and that we achieve some deduplification.

Cheers,
Andreas

* Depending on whether this or Blue's series goes in first, in which case 2/3 gets obsoleted.

Signature · 2 lines
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg
#4 lore raw

Re: [Qemu-devel] [PATCH 1/3] hw/xilinx_*: Share Xilinx devices between ppc and microblaze

Quoted 26 lines · Andreas Färber

Hi,

Am 09.06.2012 04:15, schrieb Peter Crosthwaite:

Quoted 6 lines · Andreas Färber
Quoted 5 lines

Speeds up the build.

xilinx_ethlite uses tswap32() and is thus target-dependent.

[...]

Quoted 6 lines
Quoted 6 lines
hw/Makefile.objs +0 -0
@@ -59,6 +59,11 @@ hw-obj-$(CONFIG_PIIX4) += piix4.o

 hw-obj-$(CONFIG_G364FB) += g364fb.o
 hw-obj-$(CONFIG_JAZZ_LED) += jazz_led.o

Quoted 9 lines

hw/Makefile.objs hw-obj-$(CONFIG_PIIX4) += piix4.o · line 66

Quoted 5 lines
hw/Makefile.objs +5 -0
+# Xilinx devices
+hw-obj-$(CONFIG_XILINX) += xilinx_intc.o
+hw-obj-$(CONFIG_XILINX) += xilinx_timer.o
+hw-obj-$(CONFIG_XILINX) += xilinx_uartlite.o
+

whats the plan with xilinx_axidma xilinx_axienet and  xilinx_ethlite? Should be fold them into this CONFIG_  or are these the exceptions to the rule as they are the annoying endian dependent ones?

Quoted 7 lines

The axi ones are in patch 3/3 as they are only used for microblaze, not ppc, and they use qemu-log.h. Designed for pick-from-the-front*. :)

The ethlite has the endianness issue described in the cover letter. Once solved, I'd expect it to be folded into CONFIG_XILINX as well, yes.

Obviously if you have better variable naming,

CONFIG_XILINX is kinda vague, this is really referring to the XILINX EDK IP suite. Now that zynq has landed "xilinx" is ambiguous between the two platform families. Edgar do you have any preference? perhaps CONFIG_XILINX_IP?

feel free to suggest or to

Quoted 12 lines

change before Edgar applies, my stake is only that the variable names match in both places and that we achieve some deduplification.

Cheers,
Andreas

* Depending on whether this or Blue's series goes in first, in which case 2/3 gets obsoleted.

--
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg

#5 lore raw

PATCH 2/3 qemu-log: Allow usage in libhw

In reply to Andreas Färber

Add #ifdef to avoid complaint about use of poisoned "env".

---
 qemu-log.h |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
qemu-log.h +2 -0
index fccfb110..a9b3ca4 100644
@@ -50,6 +50,7 @@ extern int loglevel;
 
 /* Special cases: */
 
+#ifdef NEED_CPU_H
 /* cpu_dump_state() logging functions: */
 #define log_cpu_state(env, f) cpu_dump_state((env), logfile, fprintf, (f));
 #define log_cpu_state_mask(b, env, f) do {           \
@@ -64,6 +65,7 @@ extern int loglevel;
 
 /* page_dump() output to the log file: */
 #define log_page_dump() page_dump(logfile)
+#endif
 
 
 
Signature · 1 line
1.7.7
#6 lore raw

PATCH 3/3 xilinx_axi*: Share devices between microblaze and microblazeel

In reply to Andreas Färber

Speeds up the build.

---
 default-configs/microblaze-softmmu.mak   |    1 +
 default-configs/microblazeel-softmmu.mak |    1 +
 hw/Makefile.objs                         |    2 ++
 hw/microblaze/Makefile.objs              |    2 --
 4 files changed, 4 insertions(+), 2 deletions(-)
default-configs/microblaze-softmmu.mak +1 -0
index 08e7449..64c9485 100644
@@ -4,3 +4,4 @@ CONFIG_PTIMER=y
 CONFIG_PFLASH_CFI01=y
 CONFIG_SERIAL=y
 CONFIG_XILINX=y
+CONFIG_XILINX_AXI=y
default-configs/microblazeel-softmmu.mak +1 -0
index a9578e1..a962276 100644
@@ -4,3 +4,4 @@ CONFIG_PTIMER=y
 CONFIG_PFLASH_CFI01=y
 CONFIG_SERIAL=y
 CONFIG_XILINX=y
+CONFIG_XILINX_AXI=y
hw/Makefile.objs +2 -0
index 102ebcf..3d77259 100644
@@ -63,6 +63,8 @@ hw-obj-$(CONFIG_JAZZ_LED) += jazz_led.o
 hw-obj-$(CONFIG_XILINX) += xilinx_intc.o
 hw-obj-$(CONFIG_XILINX) += xilinx_timer.o
 hw-obj-$(CONFIG_XILINX) += xilinx_uartlite.o
+hw-obj-$(CONFIG_XILINX_AXI) += xilinx_axidma.o
+hw-obj-$(CONFIG_XILINX_AXI) += xilinx_axienet.o
 
 # PCI watchdog devices
 hw-obj-$(CONFIG_PCI) += wdt_i6300esb.o
hw/microblaze/Makefile.objs +0 -2
index 59ea20f..274d2c5 100644
@@ -4,8 +4,6 @@ obj-y += microblaze_boot.o
 
 obj-y += microblaze_pic_cpu.o
 obj-y += xilinx_ethlite.o
-obj-y += xilinx_axidma.o
-obj-y += xilinx_axienet.o
 obj-$(CONFIG_FDT) += ../device_tree.o
 
 obj-y := $(addprefix ../,$(obj-y))
Signature · 1 line
1.7.7
#7 lore raw

Re: [Qemu-devel] [PATCH 3/3] xilinx_axi*: Share devices between microblaze and microblazeel

Quoted 37 lines · Andreas Färber

Speeds up the build.

---
 default-configs/microblaze-softmmu.mak   |    1 + default-configs/microblazeel-softmmu.mak |    1 + hw/Makefile.objs                         |    2 ++ hw/microblaze/Makefile.objs              |    2 --

 4 files changed, 4 insertions(+), 2 deletions(-)
default-configs/microblaze-softmmu.mak +0 -0
index 08e7449..64c9485 100644
@@ -4,3 +4,4 @@ CONFIG_PTIMER=y

 CONFIG_PFLASH_CFI01=y
 CONFIG_SERIAL=y
 CONFIG_XILINX=y

default-configs/microblaze-softmmu.mak +1 -0
+CONFIG_XILINX_AXI=y
default-configs/microblazeel-softmmu.mak +0 -0
index a9578e1..a962276 100644
@@ -4,3 +4,4 @@ CONFIG_PTIMER=y

 CONFIG_PFLASH_CFI01=y
 CONFIG_SERIAL=y
 CONFIG_XILINX=y

default-configs/microblazeel-softmmu.mak +1 -0
+CONFIG_XILINX_AXI=y
hw/Makefile.objs +0 -0
index 102ebcf..3d77259 100644
@@ -63,6 +63,8 @@ hw-obj-$(CONFIG_JAZZ_LED) += jazz_led.o

 hw-obj-$(CONFIG_XILINX) += xilinx_intc.o
 hw-obj-$(CONFIG_XILINX) += xilinx_timer.o
 hw-obj-$(CONFIG_XILINX) += xilinx_uartlite.o

hw/Makefile.objs hw-obj-$(CONFIG_JAZZ_LED) += jazz_led.o · line 67

Quoted 2 lines
hw/Makefile.objs +2 -0
+hw-obj-$(CONFIG_XILINX_AXI) += xilinx_axidma.o
+hw-obj-$(CONFIG_XILINX_AXI) += xilinx_axienet.o

Ahh nvm, got it.

Quoted 19 lines

 # PCI watchdog devices
 hw-obj-$(CONFIG_PCI) += wdt_i6300esb.o

hw/microblaze/Makefile.objs +0 -0
index 59ea20f..274d2c5 100644
@@ -4,8 +4,6 @@ obj-y += microblaze_boot.o
 

 obj-y += microblaze_pic_cpu.o
 obj-y += xilinx_ethlite.o

hw/microblaze/Makefile.objs +0 -2
-obj-y += xilinx_axidma.o
-obj-y += xilinx_axienet.o

 obj-$(CONFIG_FDT) += ../device_tree.o

 obj-y := $(addprefix ../,$(obj-y))
--
1.7.7

#8 lore raw
In reply to Andreas Färber
Quoted 10 lines · Andreas Färber

Hello Edgar and Peter,

With the Makefile refactoring applied now, here's the Makefile improvements for MicroBlaze I mentioned.

All Xilinx devices that are used for more than one softmmu are compiled once in libhw32. Actually some also in libhw64 due to ppc440 being compiled into ppc64, but we can fix that in a second step via Alex' ppc-next, we're already down from thrice to twice.

Quoted 6 lines

The middle patch is extracted from Blue's logging refactoring.

Please test and apply. Your s3adp1800 and virtel_ml507 test images complain both with and without patches about not finding "eth0". Selftest completes ok except for not finding /usr/bin/sha1test on ppc440.

I am sitting on a microblaze little endian test vector (for petalogix-ml605), which is my primary test. I think that probably needs to go up on qemu.org? Whats the process there?

Quoted 2 lines

xilinx_ethlite.c uses tswap32(). Have you ever tested this device to work on microblazeel?

Yes, we have in our tree, but probably not exactly the mainline version. I am working on a machine model that will bring this in the play, so could we revisit this one shortly?

I wonder if we could change the device from DEVICE_NATIVE_ENDIAN

Quoted 8 lines

to DEVICE_BIG_ENDIAN and in place of tswap32() use a bswap32() conditional on HOST_WORDS_BIGENDIAN so that it becomes independent of the target, too?

Instead of adding random devices to hw/microblaze/Makefile.objs in new series, they should be added to hw/Makefile.objs with appropriate CONFIG_* options set in default-configs/microblaze[el]-softmmu.mak as demonstrated here, easy to do and also ensures that the appropriate poisoning is applied.

Will factor into subsequent revisions of my pending series'.

Regards, Peter

Quoted 28 lines

Regards,
Andreas

Cc Edgar E. Iglesias <[email protected]>
Cc Peter A. G. Crosthwaite <[email protected]>
Cc Alexander Graf <[email protected]>
Cc Blue Swirl <[email protected]>

Andreas Färber (3):
 hw/xilinx_*: Share Xilinx devices between ppc and microblaze
 qemu-log: Allow usage in libhw
 xilinx_axi*: Share devices between microblaze and microblazeel

 default-configs/microblaze-softmmu.mak   |    2 ++ default-configs/microblazeel-softmmu.mak |    2 ++ default-configs/ppc-softmmu.mak          |    1 + default-configs/ppc64-softmmu.mak        |    1 + default-configs/ppcemb-softmmu.mak       |    1 + hw/Makefile.objs                         |    7 +++++++ hw/microblaze/Makefile.objs              |    5 ----- hw/ppc/Makefile.objs                     |    3 --- qemu-log.h                               |    2 ++

 9 files changed, 16 insertions(+), 8 deletions(-)

--
1.7.7

#9 lore raw
In reply to Andreas Färber
Quoted 10 lines · Andreas Färber

Hello Edgar and Peter,

With the Makefile refactoring applied now, here's the Makefile improvements for MicroBlaze I mentioned.

All Xilinx devices that are used for more than one softmmu are compiled once in libhw32. Actually some also in libhw64 due to ppc440 being compiled into ppc64, but we can fix that in a second step via Alex' ppc-next, we're already down from thrice to twice.

Quoted 5 lines

The middle patch is extracted from Blue's logging refactoring.

Please test and apply. Your s3adp1800 and virtel_ml507 test images complain both with and without patches about not finding "eth0". Selftest completes ok except for not finding /usr/bin/sha1test on ppc440.

Thanks, I'll give these a try next week!

Quoted 5 lines

xilinx_ethlite.c uses tswap32(). Have you ever tested this device to work on microblazeel? I wonder if we could change the device from DEVICE_NATIVE_ENDIAN to DEVICE_BIG_ENDIAN and in place of tswap32() use a bswap32() conditional on HOST_WORDS_BIGENDIAN so that it becomes independent of the target, too?

I don't think that will work. the swap is needed if the endianness of the host is different from the one of the target...

IIRC, the issue is that the device has a built-in RAM mapped so close to the regs that they end up in the same "page". With Avis memory-api maybe it's possible to expose this sub-page area as a memory?

Cheers

#10 lore raw

Am 09.06.2012 17:20, schrieb Edgar E. Iglesias:

Quoted 8 lines · Andreas Färber
Quoted 4 lines

xilinx_ethlite.c uses tswap32(). Have you ever tested this device to work on microblazeel? I wonder if we could change the device from DEVICE_NATIVE_ENDIAN to DEVICE_BIG_ENDIAN and in place of tswap32() use a bswap32() conditional on HOST_WORDS_BIGENDIAN so that it becomes independent of the target, too?

I don't think that will work. the swap is needed if the endianness of the host is different from the one of the target...

My thinking was: If we can force the device endianness to a known value then only the host endianness (not the target endianness) matters because the Memory API will take care of the device endianness.

The question is: Is the device LE for microblazeel or is it always BE?

Quoted 3 lines

IIRC, the issue is that the device has a built-in RAM mapped so close to the regs that they end up in the same "page". With Avis memory-api maybe it's possible to expose this sub-page area as a memory?

Me and Avi fixed some bugs for subpage areas, it should work in theory (for TCG/qtest). Not being aware of a MicroBlaze KVM, if it's a RAM region then we should definitely model it as such.

Cheers,
Andreas

Signature · 2 lines
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg
#11 lore raw
Quoted 7 lines · Andreas Färber

Am 09.06.2012 17:20, schrieb Edgar E. Iglesias:

Quoted 6 lines · Andreas Färber
Quoted 4 lines

xilinx_ethlite.c uses tswap32(). Have you ever tested this device to work on microblazeel? I wonder if we could change the device from DEVICE_NATIVE_ENDIAN to DEVICE_BIG_ENDIAN and in place of tswap32() use a bswap32() conditional on HOST_WORDS_BIGENDIAN so that it becomes independent of the target, too?

Quoted 8 lines
Quoted 2 lines

I don't think that will work. the swap is needed if the endianness of the host is different from the one of the target...

My thinking was: If we can force the device endianness to a known value then only the host endianness (not the target endianness) matters because the Memory API will take care of the device endianness.

The question is: Is the device LE for microblazeel or is it always BE?

It can be both LE and BE

Quoted 8 lines
Quoted 4 lines

IIRC, the issue is that the device has a built-in RAM mapped so close to the regs that they end up in the same "page". With Avis memory-api maybe it's possible to expose this sub-page area as a memory?

Me and Avi fixed some bugs for subpage areas, it should work in theory (for TCG/qtest). Not being aware of a MicroBlaze KVM, if it's a RAM region then we should definitely model it as such.

If that's possible, that would get rid of the swaps

Cheers

#12 lore raw
In reply to Andreas Färber
Quoted 21 lines · Andreas Färber

Hello Edgar and Peter,

With the Makefile refactoring applied now, here's the Makefile improvements for MicroBlaze I mentioned.

All Xilinx devices that are used for more than one softmmu are compiled once in libhw32. Actually some also in libhw64 due to ppc440 being compiled into ppc64, but we can fix that in a second step via Alex' ppc-next, we're already down from thrice to twice.

The middle patch is extracted from Blue's logging refactoring.

Please test and apply. Your s3adp1800 and virtel_ml507 test images complain both with and without patches about not finding "eth0". Selftest completes ok except for not finding /usr/bin/sha1test on ppc440.

xilinx_ethlite.c uses tswap32(). Have you ever tested this device to work on microblazeel? I wonder if we could change the device from DEVICE_NATIVE_ENDIAN to DEVICE_BIG_ENDIAN and in place of tswap32() use a bswap32() conditional on HOST_WORDS_BIGENDIAN so that it becomes independent of the target, too?

Quoted 4 lines

Instead of adding random devices to hw/microblaze/Makefile.objs in new series, they should be added to hw/Makefile.objs with appropriate CONFIG_* options set in default-configs/microblaze[el]-softmmu.mak as demonstrated here, easy to do and also ensures that the appropriate poisoning is applied.

Applied the series, thanks Andreas.

Quoted 28 lines

Regards,
Andreas

Cc Edgar E. Iglesias <[email protected]>
Cc Peter A. G. Crosthwaite <[email protected]>
Cc Alexander Graf <[email protected]>
Cc Blue Swirl <[email protected]>

Andreas Färber (3):
hw/xilinx_*: Share Xilinx devices between ppc and microblaze
qemu-log: Allow usage in libhw
xilinx_axi*: Share devices between microblaze and microblazeel

 default-configs/microblaze-softmmu.mak   |    2 ++
 default-configs/microblazeel-softmmu.mak |    2 ++
 default-configs/ppc-softmmu.mak          |    1 +
 default-configs/ppc64-softmmu.mak        |    1 +
 default-configs/ppcemb-softmmu.mak       |    1 +
 hw/Makefile.objs                         |    7 +++++++
 hw/microblaze/Makefile.objs              |    5 -----
 hw/ppc/Makefile.objs                     |    3 ---
 qemu-log.h                               |    2 ++
 9 files changed, 16 insertions(+), 8 deletions(-)
Signature · 1 line
1.7.7
#13 lore raw

Am 15.06.2012 13:13, schrieb Edgar E. Iglesias:

Quoted 22 lines · Andreas Färber
Quoted 21 lines

Hello Edgar and Peter,

With the Makefile refactoring applied now, here's the Makefile improvements for MicroBlaze I mentioned.

All Xilinx devices that are used for more than one softmmu are compiled once in libhw32. Actually some also in libhw64 due to ppc440 being compiled into ppc64, but we can fix that in a second step via Alex' ppc-next, we're already down from thrice to twice.

The middle patch is extracted from Blue's logging refactoring.

Please test and apply. Your s3adp1800 and virtel_ml507 test images complain both with and without patches about not finding "eth0". Selftest completes ok except for not finding /usr/bin/sha1test on ppc440.

xilinx_ethlite.c uses tswap32(). Have you ever tested this device to work on microblazeel? I wonder if we could change the device from DEVICE_NATIVE_ENDIAN to DEVICE_BIG_ENDIAN and in place of tswap32() use a bswap32() conditional on HOST_WORDS_BIGENDIAN so that it becomes independent of the target, too?

Quoted 6 lines
Quoted 4 lines

Instead of adding random devices to hw/microblaze/Makefile.objs in new series, they should be added to hw/Makefile.objs with appropriate CONFIG_* options set in default-configs/microblaze[el]-softmmu.mak as demonstrated here, easy to do and also ensures that the appropriate poisoning is applied.

Applied the series, thanks Andreas.

Thanks, but didn't you want CONFIG_XILINX renamed? :)

Andreas

Signature · 2 lines
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg
#14 lore raw
Quoted 23 lines · Andreas Färber

Am 15.06.2012 13:13, schrieb Edgar E. Iglesias:

Quoted 22 lines · Andreas Färber
Quoted 21 lines

Hello Edgar and Peter,

With the Makefile refactoring applied now, here's the Makefile improvements for MicroBlaze I mentioned.

All Xilinx devices that are used for more than one softmmu are compiled once in libhw32. Actually some also in libhw64 due to ppc440 being compiled into ppc64, but we can fix that in a second step via Alex' ppc-next, we're already down from thrice to twice.

The middle patch is extracted from Blue's logging refactoring.

Please test and apply. Your s3adp1800 and virtel_ml507 test images complain both with and without patches about not finding "eth0". Selftest completes ok except for not finding /usr/bin/sha1test on ppc440.

xilinx_ethlite.c uses tswap32(). Have you ever tested this device to work on microblazeel? I wonder if we could change the device from DEVICE_NATIVE_ENDIAN to DEVICE_BIG_ENDIAN and in place of tswap32() use a bswap32() conditional on HOST_WORDS_BIGENDIAN so that it becomes independent of the target, too?

Quoted 9 lines
Quoted 6 lines
Quoted 4 lines

Instead of adding random devices to hw/microblaze/Makefile.objs in new series, they should be added to hw/Makefile.objs with appropriate CONFIG_* options set in default-configs/microblaze[el]-softmmu.mak as demonstrated here, easy to do and also ensures that the appropriate poisoning is applied.

Applied the series, thanks Andreas.

Thanks, but didn't you want CONFIG_XILINX renamed? :)

Hi Andreas,

Its a minor issue, probably best fixed incrementally when the need arises.

Regards,
Peter

Quoted 6 lines

Andreas

--
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg