Skip to contentSkip to conversation

Clean up the ppc default configs

PATCH Superseded Thomas Huth 5 participants 13 messages Jan 15, 2018 – Jan 16, 2018

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

cover Clean up the ppc default configs

ppc64-softmmu is a superset of ppc-softmmu which in turn is a superset of ppcemb-softmmu. But since the config files are currently independent from each other, we missed to define some CONFIG switches in the super-
sets: CONFIG_SUNGEM is missing from the ppc64-softmmu config, and the CONFIG_IDE_SII3112 switch is only defined in ppcemb-softmmu.

Let's fix this by including the subsets instead of duplicating all the switches all over the place.

(off-topic question: Do we still need a separate ppcemb-softmmu nowadays? It seemed to be useful 10 years ago when everybody was doing KVM on embedded PPC, but these days seem to be pretty much over now, so IMHO just using ppc-softmmu for embedded should be enough nowadays? We could save quite some compilation- and "make check"-time if we could finally get rid of ppcemb-softmmu again...)

Thomas Huth (2):
default-configs/ppc64-softmmu: Include 32-bit configs instead of
copying them
default-configs/ppc-softmmu: Restructure the switches according to the
machines

 default-configs/ppc-softmmu.mak   | 59 +++++++++++++++----------------------
 default-configs/ppc64-softmmu.mak | 61 +++++----------------------------------
 2 files changed, 32 insertions(+), 88 deletions(-)
Signature · 1 line
1.8.3.1
#1 lore raw

PATCH 1/2 default-configs/ppc64-softmmu: Include 32-bit configs instead of copying them

qemu-softmmu-ppc64 is supposed to be a superset of qemu-softmmu-ppc. However, instead of simply including the 32-bit config file, we've duplicated all CONFIG_xxx settings there instead. This way, we've missed some CONFIG switches in ppc64-softmmu.mak which were only added to the 32-bit config file (e.g. CONFIG_SUNGEM). Let's fix this problem by including the 32-bit config file into the 64-bit config file instead of duplicating all the CONFIG switches there.

---
 default-configs/ppc64-softmmu.mak | 61 +++++----------------------------------
 1 file changed, 8 insertions(+), 53 deletions(-)
default-configs/ppc64-softmmu.mak +8 -53
index d1b3a6d..b94af6c 100644
@@ -1,64 +1,19 @@
 # Default configuration for ppc64-softmmu
 
-include pci.mak
-include sound.mak
-include usb.mak
-CONFIG_PPC4XX=y
-CONFIG_VIRTIO_VGA=y
-CONFIG_ESCC=y
-CONFIG_M48T59=y
+# Include all 32-bit boards
+include ppc-softmmu.mak
+
+# For PowerNV
+CONFIG_POWERNV=y
 CONFIG_IPMI=y
 CONFIG_IPMI_LOCAL=y
 CONFIG_IPMI_EXTERN=y
 CONFIG_ISA_IPMI_BT=y
-CONFIG_SERIAL=y
-CONFIG_PARALLEL=y
-CONFIG_I8254=y
-CONFIG_PCKBD=y
-CONFIG_FDC=y
-CONFIG_I8257=y
-CONFIG_I82374=y
-CONFIG_OPENPIC=y
-CONFIG_PREP_PCI=y
-CONFIG_I82378=y
-CONFIG_PC87312=y
-CONFIG_MACIO=y
-CONFIG_PCSPK=y
-CONFIG_CUDA=y
-CONFIG_ADB=y
-CONFIG_MAC_NVRAM=y
-CONFIG_MAC_DBDMA=y
-CONFIG_HEATHROW_PIC=y
-CONFIG_GRACKLE_PCI=y
-CONFIG_UNIN_PCI=y
-CONFIG_DEC_PCI=y
-CONFIG_PPCE500_PCI=y
-CONFIG_IDE_ISA=y
-CONFIG_IDE_CMD646=y
-CONFIG_IDE_MACIO=y
-CONFIG_NE2000_ISA=y
-CONFIG_PFLASH_CFI01=y
-CONFIG_PFLASH_CFI02=y
-CONFIG_PTIMER=y
-CONFIG_I8259=y
-CONFIG_XILINX=y
-CONFIG_XILINX_ETHLITE=y
-CONFIG_PSERIES=y
-CONFIG_POWERNV=y
-CONFIG_PREP=y
-CONFIG_MAC=y
-CONFIG_E500=y
-CONFIG_OPENPIC_KVM=$(call land,$(CONFIG_E500),$(CONFIG_KVM))
-CONFIG_PLATFORM_BUS=y
-CONFIG_ETSEC=y
-CONFIG_SM501=y
+
 # For pSeries
+CONFIG_PSERIES=y
+CONFIG_VIRTIO_VGA=y
 CONFIG_XICS=$(CONFIG_PSERIES)
 CONFIG_XICS_SPAPR=$(CONFIG_PSERIES)
 CONFIG_XICS_KVM=$(call land,$(CONFIG_PSERIES),$(CONFIG_KVM))
-# For PReP
-CONFIG_SERIAL_ISA=y
-CONFIG_MC146818RTC=y
-CONFIG_ISA_TESTDEV=y
 CONFIG_MEM_HOTPLUG=y
-CONFIG_RS6000_MC=y
Signature · 1 line
1.8.3.1
#2 lore raw

PATCH 2/2 default-configs/ppc-softmmu: Restructure the switches according to the machines

In reply to Thomas Huth

Order the CONFIG switches in ppc-softmmu.mak according to the machine classes where they are used (embedded, Mac or PReP), so that it is easier for the users to disable a set of switches completely if they are not needed.

For the embedded part, we now also include ppcemb-softmmu.mak instead of duplicating all the CONFIG switches again, to make sure that the ppc-softmmu build always contains all switches from ppcemb-softmmu (e.g. the switch CONFIG_IDE_SII3112 from ppcemb was missing in ppc-softmmu).

While we're at it, also remove the CONFIG_IDE_CMD646 since this controller does not seem to be used by any ppc machine in QEMU.

---
 default-configs/ppc-softmmu.mak | 59 +++++++++++++++++------------------------
 1 file changed, 24 insertions(+), 35 deletions(-)
default-configs/ppc-softmmu.mak +24 -35
index bb225c6..460e6f4 100644
@@ -1,26 +1,18 @@
 # Default configuration for ppc-softmmu
 
-include pci.mak
-include sound.mak
-include usb.mak
-CONFIG_PPC4XX=y
+# For embedded PPCs:
+include ppcemb-softmmu.mak
+CONFIG_E500=y
+CONFIG_ETSEC=y
+CONFIG_PLATFORM_BUS=y
+CONFIG_PPCE500_PCI=y
+CONFIG_OPENPIC_KVM=$(call land,$(CONFIG_E500),$(CONFIG_KVM))
+
+# For Macs
+CONFIG_MAC=y
 CONFIG_ESCC=y
-CONFIG_M48T59=y
-CONFIG_SERIAL=y
-CONFIG_PARALLEL=y
-CONFIG_I8254=y
-CONFIG_PCKBD=y
-CONFIG_FDC=y
-CONFIG_I8257=y
-CONFIG_I82374=y
-CONFIG_OPENPIC=y
-CONFIG_PREP_PCI=y
-CONFIG_I82378=y
-CONFIG_PC87312=y
 CONFIG_MACIO=y
 CONFIG_SUNGEM=y
-CONFIG_PCSPK=y
-CONFIG_CS4231A=y
 CONFIG_CUDA=y
 CONFIG_ADB=y
 CONFIG_MAC_NVRAM=y
@@ -29,26 +21,23 @@ CONFIG_HEATHROW_PIC=y
 CONFIG_GRACKLE_PCI=y
 CONFIG_UNIN_PCI=y
 CONFIG_DEC_PCI=y
-CONFIG_PPCE500_PCI=y
-CONFIG_IDE_ISA=y
-CONFIG_IDE_CMD646=y
 CONFIG_IDE_MACIO=y
-CONFIG_NE2000_ISA=y
-CONFIG_PFLASH_CFI01=y
-CONFIG_PFLASH_CFI02=y
-CONFIG_PTIMER=y
-CONFIG_I8259=y
-CONFIG_XILINX=y
-CONFIG_XILINX_ETHLITE=y
-CONFIG_PREP=y
-CONFIG_MAC=y
-CONFIG_E500=y
-CONFIG_OPENPIC_KVM=$(call land,$(CONFIG_E500),$(CONFIG_KVM))
-CONFIG_PLATFORM_BUS=y
-CONFIG_ETSEC=y
-CONFIG_SM501=y
+
 # For PReP
+CONFIG_PREP=y
+CONFIG_PREP_PCI=y
 CONFIG_SERIAL_ISA=y
 CONFIG_MC146818RTC=y
 CONFIG_ISA_TESTDEV=y
 CONFIG_RS6000_MC=y
+CONFIG_PARALLEL=y
+CONFIG_I82374=y
+CONFIG_I82378=y
+CONFIG_I8254=y
+CONFIG_FDC=y
+CONFIG_PCKBD=y
+CONFIG_NE2000_ISA=y
+CONFIG_PCSPK=y
+CONFIG_PC87312=y
+CONFIG_IDE_ISA=y
+CONFIG_CS4231A=y
Signature · 1 line
1.8.3.1
#3 lore raw
In reply to Thomas Huth
Quoted 1 line · On Mon, 15 Jan 2018 10:30:53 +0100 Thomas Huth <[email protected]> wrote:

ppc64-softmmu is a superset of ppc-softmmu which in turn is a superset

Hi Thomas,

Per curiosity. I understand that a 64-bit ppc CPU is expected to support 32-bit ppc code, but does QEMU really need to emulate setups that likely never existed in real life (like a PowerMac G5 or a pSeries with an internal floppy disk controller for example) ?

I ask because Murilo and I had a chat about removing CONFIG_FDC from default-configs/ppc64-softmmu.mak the other day :)

Cheers,

--
Greg

Quoted 25 lines

of ppcemb-softmmu. But since the config files are currently independent from each other, we missed to define some CONFIG switches in the super-
sets: CONFIG_SUNGEM is missing from the ppc64-softmmu config, and the CONFIG_IDE_SII3112 switch is only defined in ppcemb-softmmu.

Let's fix this by including the subsets instead of duplicating all the switches all over the place.

(off-topic question: Do we still need a separate ppcemb-softmmu nowadays? It seemed to be useful 10 years ago when everybody was doing KVM on embedded PPC, but these days seem to be pretty much over now, so IMHO just using ppc-softmmu for embedded should be enough nowadays? We could save quite some compilation- and "make check"-time if we could finally get rid of ppcemb-softmmu again...)

Thomas Huth (2):
default-configs/ppc64-softmmu: Include 32-bit configs instead of
copying them
default-configs/ppc-softmmu: Restructure the switches according to the
machines

 default-configs/ppc-softmmu.mak   | 59 +++++++++++++++----------------------
 default-configs/ppc64-softmmu.mak | 61 +++++----------------------------------
 2 files changed, 32 insertions(+), 88 deletions(-)
#4 lore raw
Quoted 11 lines · Greg Kurz
Quoted 1 line · On Mon, 15 Jan 2018 10:30:53 +0100 Thomas Huth <[email protected]> wrote:

ppc64-softmmu is a superset of ppc-softmmu which in turn is a superset

Hi Thomas,

Per curiosity. I understand that a 64-bit ppc CPU is expected to support 32-bit ppc code, but does QEMU really need to emulate setups that likely never existed in real life (like a PowerMac G5 or a pSeries with an internal floppy disk controller for example) ?

I think the CONFIG_FDC switch is there for the PReP machine, not for the Macs.

Thomas

#5 lore raw
In reply to Thomas Huth
Quoted 5 lines · Thomas Huth

ppc64-softmmu is a superset of ppc-softmmu which in turn is a superset of ppcemb-softmmu. But since the config files are currently independent from each other, we missed to define some CONFIG switches in the super-
sets: CONFIG_SUNGEM is missing from the ppc64-softmmu config, and the CONFIG_IDE_SII3112 switch is only defined in ppcemb-softmmu.

I'm not sure about this. The Sun GEM network interface is a device typically found on Apple PowerMacs but also seems to be found on G5 based Macs so it's probably OK to add. The SiI3112 is now only used on the (not yet fully merged) Sam460EX emulation which is to be added to ppcemb, that's why I've only added it to that target. Defining it on other targets does no harm (other than making the binary bigger) just maybe not necessary. If you think this makes the configs simpler I'm OK with this change just note that it probably makes it impossible to add options only for ppcemb without also adding them to ppc and ppc64. If that's OK then go ahead.

Quoted 6 lines

(off-topic question: Do we still need a separate ppcemb-softmmu nowadays? It seemed to be useful 10 years ago when everybody was doing KVM on embedded PPC, but these days seem to be pretty much over now, so IMHO just using ppc-softmmu for embedded should be enough nowadays? We could save quite some compilation- and "make check"-time if we could finally get rid of ppcemb-softmmu again...)

I've also noticed that most of the boards were available both in ppcemb and ppc targets so maybe these could be merged now to avoid confusion but I don't know the reason why ppcemb existed in the first place so I don't know what other implications dropping ppcemb may have.

Regards,
BALATON Zoltan

#6 lore raw
Quoted 7 lines · BALATON Zoltan
Quoted 5 lines · Thomas Huth

ppc64-softmmu is a superset of ppc-softmmu which in turn is a superset of ppcemb-softmmu. But since the config files are currently independent from each other, we missed to define some CONFIG switches in the super-
sets: CONFIG_SUNGEM is missing from the ppc64-softmmu config, and the CONFIG_IDE_SII3112 switch is only defined in ppcemb-softmmu.

Quoted 5 lines

I'm not sure about this. The Sun GEM network interface is a device typically found on Apple PowerMacs but also seems to be found on G5 based Macs so it's probably OK to add. The SiI3112 is now only used on the (not yet fully merged) Sam460EX emulation which is to be added to ppcemb, that's why I've only added it to that target.

But as I wrote: ppc-softmmu is currently a superset of ppcemb-softmmu. I think people expect to be able to run the same amount of machines with ppc-softmmu than with ppcemb-softmmu, don't they?

Quoted 11 lines
Quoted 6 lines

(off-topic question: Do we still need a separate ppcemb-softmmu nowadays? It seemed to be useful 10 years ago when everybody was doing KVM on embedded PPC, but these days seem to be pretty much over now, so IMHO just using ppc-softmmu for embedded should be enough nowadays? We could save quite some compilation- and "make check"-time if we could finally get rid of ppcemb-softmmu again...)

I've also noticed that most of the boards were available both in ppcemb and ppc targets so maybe these could be merged now to avoid confusion but I don't know the reason why ppcemb existed in the first place so I don't know what other implications dropping ppcemb may have.

An alternative would be to remove the embedded configs from the ppc-softmmu.mak and only include them in ppcemb-softmmu.mak, so that there is a stricter distinction. I think the current situation is rather confusing, where it is possible that the user could try to run a pseries machine with an embedded PPC CPU for example ... so strictly separating the embedded stuff into ppcemb-softmmu would maybe really make sense.

Thomas

#7 lore raw
In reply to BALATON Zoltan

On 15.01.2018 13:00, BALATON Zoltan wrote:
[...]

Quoted 4 lines

I've also noticed that most of the boards were available both in ppcemb and ppc targets so maybe these could be merged now to avoid confusion but I don't know the reason why ppcemb existed in the first place so I don't know what other implications dropping ppcemb may have.

FYI: I've had a chat with Alexander Graf this morning in IRC, and the qemu-system-ppcemb was indeed only created for supporting the CPUs with page sizes < 4k. Everything else is supposed to work with qemu-system-ppc, too. Since likely nobody is using page sizes < 4k on embedded PPCs nowadays anymore (and Alex was also only aware of one home-brew OS that did this in the past is likely not available now anymore), I think we can go forward and start the deprecation of ppcemb.

Thomas

#8 lore raw
Quoted 7 lines · Thomas Huth

On 15.01.2018 13:00, BALATON Zoltan wrote:
[...]

Quoted 4 lines

I've also noticed that most of the boards were available both in ppcemb and ppc targets so maybe these could be merged now to avoid confusion but I don't know the reason why ppcemb existed in the first place so I don't know what other implications dropping ppcemb may have.

Quoted 7 lines

FYI: I've had a chat with Alexander Graf this morning in IRC, and the qemu-system-ppcemb was indeed only created for supporting the CPUs with page sizes < 4k. Everything else is supposed to work with qemu-system-ppc, too. Since likely nobody is using page sizes < 4k on embedded PPCs nowadays anymore (and Alex was also only aware of one home-brew OS that did this in the past is likely not available now anymore), I think we can go forward and start the deprecation of ppcemb.

We do now support runtime-settable page sizes (as a board model property), so you could roll support for 1K pages into ppc-softmmu/ppc64-softmmu if you wanted.

thanks
-- PMM

#9 lore raw
Quoted 16 lines · Peter Maydell
Quoted 7 lines · Thomas Huth

On 15.01.2018 13:00, BALATON Zoltan wrote:
[...]

Quoted 4 lines

I've also noticed that most of the boards were available both in ppcemb and ppc targets so maybe these could be merged now to avoid confusion but I don't know the reason why ppcemb existed in the first place so I don't know what other implications dropping ppcemb may have.

Quoted 7 lines

FYI: I've had a chat with Alexander Graf this morning in IRC, and the qemu-system-ppcemb was indeed only created for supporting the CPUs with page sizes < 4k. Everything else is supposed to work with qemu-system-ppc, too. Since likely nobody is using page sizes < 4k on embedded PPCs nowadays anymore (and Alex was also only aware of one home-brew OS that did this in the past is likely not available now anymore), I think we can go forward and start the deprecation of ppcemb.

Quoted 3 lines

We do now support runtime-settable page sizes (as a board model property), so you could roll support for 1K pages into ppc-softmmu/ppc64-softmmu if you wanted.

Yes, I've noticed this TARGET_PAGE_BITS_VARY stuff in target/arm/ already ... I think that's a good plan B if someone speaks up claiming that <4k page sizes are still required after we've marked ppcemb as deprecated.

Thomas

#10 lore raw
In reply to Thomas Huth
Quoted 6 lines · Thomas Huth

(off-topic question: Do we still need a separate ppcemb-softmmu nowadays? It seemed to be useful 10 years ago when everybody was doing KVM on embedded PPC, but these days seem to be pretty much over now, so IMHO just using ppc-softmmu for embedded should be enough nowadays? We could save quite some compilation- and "make check"-time if we could finally get rid of ppcemb-softmmu again...)

There are some specific differences guarded by TARGET_PPCEMB, like the way it has a different TARGET_PAGE_BITS value, and some code in target/ppc/kvm.c related to telling KVM about interrupts. You would need to make those all be runtime decisions I assume.

thanks
-- PMM

#11 lore raw
Quoted 8 lines · Peter Maydell
Quoted 6 lines · Thomas Huth

(off-topic question: Do we still need a separate ppcemb-softmmu nowadays? It seemed to be useful 10 years ago when everybody was doing KVM on embedded PPC, but these days seem to be pretty much over now, so IMHO just using ppc-softmmu for embedded should be enough nowadays? We could save quite some compilation- and "make check"-time if we could finally get rid of ppcemb-softmmu again...)

Quoted 4 lines

There are some specific differences guarded by TARGET_PPCEMB, like the way it has a different TARGET_PAGE_BITS value, and some code in target/ppc/kvm.c related to telling KVM about interrupts. You would need to make those all be runtime decisions I assume.

True ... but while we maybe could turn those into runtime checks, I now rather think it's maybe better to go the other way round: Maybe we should not include each and everything into ppc64-softmmu, but put the embedded stuff only in ppcemb-softmmu and the 32-bit stuff only in ppc-softmmu instead? That way we could, for example, also make the output of "-cpu help" and "-device help" a little bit more user friendly...

Thomas

#12 lore raw
Quoted 14 lines · Thomas Huth
Quoted 8 lines · Peter Maydell
Quoted 6 lines · Thomas Huth

(off-topic question: Do we still need a separate ppcemb-softmmu nowadays? It seemed to be useful 10 years ago when everybody was doing KVM on embedded PPC, but these days seem to be pretty much over now, so IMHO just using ppc-softmmu for embedded should be enough nowadays? We could save quite some compilation- and "make check"-time if we could finally get rid of ppcemb-softmmu again...)

Quoted 4 lines

There are some specific differences guarded by TARGET_PPCEMB, like the way it has a different TARGET_PAGE_BITS value, and some code in target/ppc/kvm.c related to telling KVM about interrupts. You would need to make those all be runtime decisions I assume.

Quoted 6 lines

True ... but while we maybe could turn those into runtime checks, I now rather think it's maybe better to go the other way round: Maybe we should not include each and everything into ppc64-softmmu, but put the embedded stuff only in ppcemb-softmmu and the 32-bit stuff only in ppc-softmmu instead? That way we could, for example, also make the output of "-cpu help" and "-device help" a little bit more user friendly...

I tend to agree.

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