Skip to contentSkip to conversation

powerpc/e500: move qemu machine spec together with the rest

PATCH In review Laurentiu Tudor 3 participants 6 messages Sep 4, 2015 – Sep 14, 2015

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 powerpc/e500: move qemu machine spec together with the rest

This way we get rid of an entire file with mostly duplicated code plus a Kconfig option that you always had to take care to check it in order for kvm to work.

---
 arch/powerpc/platforms/85xx/Kconfig           | 15 -----
 arch/powerpc/platforms/85xx/Makefile          |  1 -
 arch/powerpc/platforms/85xx/corenet_generic.c |  1 +
 arch/powerpc/platforms/85xx/qemu_e500.c       | 85 ---------------------------
 4 files changed, 1 insertion(+), 101 deletions(-)
 delete mode 100644 arch/powerpc/platforms/85xx/qemu_e500.c
arch/powerpc/platforms/85xx/Kconfig +0 -15
index 97915fe..0c1ce10 100644
@@ -249,21 +249,6 @@ config MVME2500
 
 endif # PPC32
 
-config PPC_QEMU_E500
-	bool "QEMU generic e500 platform"
-	select DEFAULT_UIMAGE
-	help
-	  This option enables support for running as a QEMU guest using
-	  QEMU's generic e500 machine.  This is not required if you're
-	  using a QEMU machine that targets a specific board, such as
-	  mpc8544ds.
-
-	  Unlike most e500 boards that target a specific CPU, this
-	  platform works with any e500-family CPU that QEMU supports.
-	  Thus, you'll need to make sure CONFIG_PPC_E500MC is set or
-	  unset based on the emulated CPU (or actual host CPU in the case
-	  of KVM).
-
 config CORENET_GENERIC
 	bool "Freescale CoreNet Generic"
 	select DEFAULT_UIMAGE
arch/powerpc/platforms/85xx/Makefile +0 -1
index 1fe7fb9..33fbfb8 100644
@@ -29,6 +29,5 @@ obj-$(CONFIG_SOCRATES)    += socrates.o socrates_fpga_pic.o
 obj-$(CONFIG_KSI8560)	  += ksi8560.o
 obj-$(CONFIG_XES_MPC85xx) += xes_mpc85xx.o
 obj-$(CONFIG_GE_IMP3A)	  += ge_imp3a.o
-obj-$(CONFIG_PPC_QEMU_E500) += qemu_e500.o
 obj-$(CONFIG_SGY_CTS1000) += sgy_cts1000.o
 obj-$(CONFIG_MVME2500)	  += mvme2500.o
arch/powerpc/platforms/85xx/corenet_generic.c +1 -0
index bd839dc..85078ee 100644
@@ -159,6 +159,7 @@ static const char * const boards[] __initconst = {
 	"fsl,T1042RDB",
 	"fsl,T1042RDB_PI",
 	"keymile,kmcoge4",
+	"fsl,qemu-e500",
 	NULL
 };
 
arch/powerpc/platforms/85xx/qemu_e500.c deleted +0 -85

85 lines not on this page · raw message

Signature · 1 line
1.8.3.1
#1 lore raw
Quoted 10 lines · Laurentiu Tudor

This way we get rid of an entire file with mostly duplicated code plus a Kconfig option that you always had to take care to check it in order for kvm to work.

---
 arch/powerpc/platforms/85xx/Kconfig           | 15 -----
 arch/powerpc/platforms/85xx/Makefile          |  1 -
 arch/powerpc/platforms/85xx/corenet_generic.c |  1 +
 arch/powerpc/platforms/85xx/qemu_e500.c       | 85 ------------------------

qemu_e500 is not only for corenet chips. We can add it to the defconfig (in fact I've been meaning to do so).

arch/powerpc/platforms/85xx/qemu_e500.c line 47

Quoted 6 lines
arch/powerpc/platforms/85xx/qemu_e500.c deleted +0 -6
-static void __init qemu_e500_setup_arch(void)
-{
-     ppc_md.progress("qemu_e500_setup_arch()", 0);
-
-     fsl_pci_assign_primary();
-     swiotlb_detect_4g();

Where is fsl_pci_assign_primary() in corenet_generic.c? At one point this was needed for QEMU's PCI implementation -- have you tested QEMU PCI without it?

-Scott

#2 lore raw
In reply to Laurentiu Tudor
Quoted 13 lines · Scott Wood
Quoted 10 lines · Laurentiu Tudor

This way we get rid of an entire file with mostly duplicated code plus a Kconfig option that you always had to take care to check it in order for kvm to work.

---
 arch/powerpc/platforms/85xx/Kconfig           | 15 -----
 arch/powerpc/platforms/85xx/Makefile          |  1 -
 arch/powerpc/platforms/85xx/corenet_generic.c |  1 +
 arch/powerpc/platforms/85xx/qemu_e500.c       | 85 ------------------------
Quoted 1 line

qemu_e500 is not only for corenet chips.

That's too bad. :-(
I remember discussions on dropping the e500v2 support at some point in time?

Quoted 1 line

We can add it to the defconfig (in fact I've been meaning to do so).

Or maybe just drop de KConfig option and
wrap the file in an #ifdef CONFIG_KVM or something along these lines?

Quoted 8 lines

arch/powerpc/platforms/85xx/qemu_e500.c line 47

Quoted 6 lines
arch/powerpc/platforms/85xx/qemu_e500.c deleted +0 -6
-static void __init qemu_e500_setup_arch(void)
-{
-     ppc_md.progress("qemu_e500_setup_arch()", 0);
-
-     fsl_pci_assign_primary();
-     swiotlb_detect_4g();

Where is fsl_pci_assign_primary() in corenet_generic.c?

This commit claims it's not needed and drops it:
http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id}4d595dad30328bc6153e235d90f54c918fc127

Quoted 3 lines

At one point this
was needed for QEMU's PCI implementation -- have you tested QEMU PCI without it?

Well, somehow i've (embarrassingly) messed up my initial tests.
I've retested after seeing your comment and indeed this breaks pci under qemu. Adding to the confusion, the commit above made me think that the removal was safe. Why pci qemu doesn't work without the call to fsl_pci_assign_primary() is an interesting subject.

---
Best Regards, Laurentiu

#3 lore raw
In reply to Laurentiu Tudor
Quoted 20 lines

Am 14.09.2015 um 15:17 schrieb Laurentiu Tudor <[email protected]>:

Quoted 14 lines · Scott Wood
Quoted 11 lines · Laurentiu Tudor

This way we get rid of an entire file with mostly duplicated code plus a Kconfig option that you always had to take care to check it in order for kvm to work.

---

arch/powerpc/platforms/85xx/Kconfig           | 15 -----
arch/powerpc/platforms/85xx/Makefile          |  1 -
arch/powerpc/platforms/85xx/corenet_generic.c |  1 +
arch/powerpc/platforms/85xx/qemu_e500.c       | 85 ------------------------
Quoted 1 line

qemu_e500 is not only for corenet chips.

Quoted 7 lines

That's too bad. :-(
I remember discussions on dropping the e500v2 support at some point in time?

Quoted 1 line

We can add it to the defconfig (in fact I've been meaning to do so).

Or maybe just drop de KConfig option and
wrap the file in an #ifdef CONFIG_KVM or something along these lines?

CONFIG_KVM is for host support though. This is for the guest kernel.

Alex

#4 lore raw
In reply to Laurentiu Tudor
Quoted 23 lines · Alexander Graf
Quoted 23 lines

Am 14.09.2015 um 15:17 schrieb Laurentiu Tudor <[email protected]>:

Quoted 15 lines · Scott Wood
Quoted 5 lines · Laurentiu Tudor

This way we get rid of an entire file with mostly duplicated code plus a Kconfig option that you always had to take care to check it in order for kvm to work.

Quoted 7 lines

---

arch/powerpc/platforms/85xx/Kconfig           | 15 -----
arch/powerpc/platforms/85xx/Makefile          |  1 -
arch/powerpc/platforms/85xx/corenet_generic.c |  1 +
arch/powerpc/platforms/85xx/qemu_e500.c       | 85 -------------------

-----

Quoted 1 line

qemu_e500 is not only for corenet chips.

That's too bad. :-(
I remember discussions on dropping the e500v2 support at some point in time?

Quoted 6 lines
Quoted 4 lines
Quoted 1 line

We can add it to the defconfig (in fact I've been meaning to do so).

Or maybe just drop de KConfig option and
wrap the file in an #ifdef CONFIG_KVM or something along these lines?

CONFIG_KVM is for host support though. This is for the guest kernel.

CONFIG_QEMU_E500 can also be used with TCG -- it's not KVM-specific.

-Scott

#5 lore raw
In reply to Laurentiu Tudor
Quoted 34 lines · Laurentiu Tudor
Quoted 14 lines · Scott Wood
Quoted 11 lines · Laurentiu Tudor

This way we get rid of an entire file with mostly duplicated code plus a Kconfig option that you always had to take care to check it in order for kvm to work.

---
 arch/powerpc/platforms/85xx/Kconfig           | 15 -----
 arch/powerpc/platforms/85xx/Makefile          |  1 -
 arch/powerpc/platforms/85xx/corenet_generic.c |  1 +
 arch/powerpc/platforms/85xx/qemu_e500.c       | 85 --------------------

----

Quoted 1 line

qemu_e500 is not only for corenet chips.

That's too bad. :-(
I remember discussions on dropping the e500v2 support at some point in time?

Quoted 1 line

We can add it to the defconfig (in fact I've been meaning to do so).

Or maybe just drop de KConfig option and
wrap the file in an #ifdef CONFIG_KVM or something along these lines?

Quoted 8 lines

arch/powerpc/platforms/85xx/qemu_e500.c line 47

Quoted 6 lines
arch/powerpc/platforms/85xx/qemu_e500.c deleted +0 -6
-static void __init qemu_e500_setup_arch(void)
-{
-     ppc_md.progress("qemu_e500_setup_arch()", 0);
-
-     fsl_pci_assign_primary();
-     swiotlb_detect_4g();

Where is fsl_pci_assign_primary() in corenet_generic.c?

Quoted 2 lines

This commit claims it's not needed and drops it:
http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id}4d595dad30328bc6153e235d90f54c918fc127

That commit has nothing to do with QEMU.

Quoted 5 lines
Quoted 4 lines

At one point this
was needed for QEMU's PCI implementation -- have you tested QEMU PCI without
it?

Quoted 7 lines

Well, somehow i've (embarrassingly) messed up my initial tests. I've retested after seeing your comment and indeed this breaks pci under qemu.
Adding to the confusion, the commit above made me think that the removal was safe.
Why pci qemu doesn't work without the call to fsl_pci_assign_primary() is an interesting subject.

IIRC it has to do with QEMU not liking a BAR set to zero.

-Scott