[RFC] splitting out LPAR support from CONFIG_PSERIES

Arnd Bergmann arnd at arndb.de
Thu Feb 24 00:25:41 EST 2005


On Middeweken 23 Februar 2005 05:49, Olof Johansson wrote:
> 
> > Obviously, this is not for generic distribution kernels, but I think
> > it makes sense to have the option when you're building for just one
> > machine. It also makes some of my subsequent patches simpler, especially
> > enabling RTAS on non-pSeries machines without requiring LPAR support.
> 
> I don't see how the RTAS-on-other-platforms could be impacted
> significantly by this? Even if you can't share the code at this time,
> could you describe what it enables you to do that you can't with the
> LPAR code there?

It's not really a significant impact for my other patches. The deal is that
I'd like to rename pSeries_smp.c and pSeries_pci.c to rtas_smp.c/rtas_pci.c
to make clear that they are potentially used by other platforms.

To make it work, I need to add some #ifdef around e.g. the call to vpa_init()
in pSeries_smp.c. My idea was that it makes more sense to test for the
if we want to allow LPAR instead of testing for pSeries. And if I introduce
such an option in the first place, I also take advantage of that by allowing
to build a pSeries kernel without any of the LPAR stuff.

RTAS on other platforms doesn't really require much change, the patch in this
mail adds the basic config option.

> I think it's a bad idea, but I don't have any real strong motivations
> for it: Mainly the fact that right now a pSeries kernel will boot
> anywhere, keeping some of the rope away from users to hang themselves
> with by building specialized kernels.

Of course, the pSeries kernel won't boot on all the platforms if you
disable the device driver for the root disk or any other vital option.
I just thought giving this extra option is a nice idea and I had to
do some change here anyway. If nobody else like this patch, I can simply
drop it from my series and update the patches on top of it.

> There's also the ambiguity of what machines require LPAR-enabled
> kernels. Currently any POWER5 machine would do, even HMC-less setups,
> while a HMC-less POWER4 setup runs a native kernel. JS20 has a thin
> firmware layer that emulates an LPAR environment too, which might not
> be obvious to everyone. Of the pSeries machines, only POWER3 and POWER4
> SMP could run a non-LPAR kernel. There's just too much room for
> confusion.

Thanks for that information, I've been looking for that for some time.

	Arnd <><

----

RTAS is not actually pSeries specific, but some PPC64 code that relies
on RTAS is currently protected by CONFIG_PPC_PSERIES.
This introduces a generic configuration option PPC_RTAS that can be used
by other subarchitectures as well. The existing option with the same
name is renamed to the more specific RTAS_PROC.

Signed-off-by: Arnd Bergmann <arndb at de.ibm.com>

Index: linux-2.6-ppc/arch/ppc64/Kconfig
===================================================================
--- linux-2.6-ppc.orig/arch/ppc64/Kconfig	2005-01-07 12:47:39.752931064 -0500
+++ linux-2.6-ppc/arch/ppc64/Kconfig	2005-01-07 12:48:05.167929480 -0500
@@ -245,16 +245,21 @@
 
 
 config PPC_RTAS
-	bool "Proc interface to RTAS"
+	bool
 	depends on PPC_PSERIES
+	default y
+
+config RTAS_PROC
+	bool "Proc interface to RTAS"
+	depends on PPC_RTAS
 
 config RTAS_FLASH
 	tristate "Firmware flash interface"
-	depends on PPC_RTAS
+	depends on RTAS_PROC
 
 config SCANLOG
 	tristate "Scanlog dump interface"
-	depends on PPC_RTAS
+	depends on RTAS_PROC && PPC_PSERIES
 
 config LPARCFG
 	tristate "LPAR Configuration Data"
Index: linux-2.6-ppc/arch/ppc64/kernel/Makefile
===================================================================
--- linux-2.6-ppc.orig/arch/ppc64/kernel/Makefile	2005-01-07 12:48:02.907011000 -0500
+++ linux-2.6-ppc/arch/ppc64/kernel/Makefile	2005-01-07 12:48:05.174928416 -0500
@@ -37,7 +37,7 @@
 obj-$(CONFIG_RTAS_FLASH)	+= rtas_flash.o
 obj-$(CONFIG_SMP)		+= smp.o
 obj-$(CONFIG_MODULES)		+= module.o ppc_ksyms.o
-obj-$(CONFIG_PPC_RTAS)		+= rtas-proc.o
+obj-$(CONFIG_RTAS_PROC)		+= rtas-proc.o
 obj-$(CONFIG_SCANLOG)		+= scanlog.o
 obj-$(CONFIG_VIOPATH)		+= viopath.o
 obj-$(CONFIG_LPARCFG)		+= lparcfg.o
Index: linux-2.6-ppc/arch/ppc64/kernel/entry.S
===================================================================
--- linux-2.6-ppc.orig/arch/ppc64/kernel/entry.S	2005-01-07 12:47:39.754930760 -0500
+++ linux-2.6-ppc/arch/ppc64/kernel/entry.S	2005-01-07 12:48:05.168929328 -0500
@@ -617,7 +617,7 @@
 	bl	.unrecoverable_exception
 	b	unrecov_restore
 
-#ifdef CONFIG_PPC_PSERIES
+#ifdef CONFIG_PPC_RTAS
 /*
  * On CHRP, the Run-Time Abstraction Services (RTAS) have to be
  * called with the MMU off.
@@ -754,7 +754,7 @@
 	mtlr    r0
         blr				/* return to caller */
 
-#endif /* CONFIG_PPC_PSERIES */
+#endif /* CONFIG_PPC_RTAS */
 
 #ifdef CONFIG_PPC_MULTIPLATFORM
 
Index: linux-2.6-ppc/arch/ppc64/kernel/misc.S
===================================================================
--- linux-2.6-ppc.orig/arch/ppc64/kernel/misc.S	2005-01-07 12:47:39.757930304 -0500
+++ linux-2.6-ppc/arch/ppc64/kernel/misc.S	2005-01-07 12:48:05.169929176 -0500
@@ -680,7 +680,7 @@
 	ld	r30,-16(r1)
 	blr
 
-#ifndef CONFIG_PPC_PSERIES	/* hack hack hack */
+#ifdef CONFIG_PPC_RTAS /* hack hack hack */
 #define ppc_rtas	sys_ni_syscall
 #endif
 
Index: linux-2.6-ppc/arch/ppc64/kernel/prom.c
===================================================================
--- linux-2.6-ppc.orig/arch/ppc64/kernel/prom.c	2005-01-07 12:47:39.759930000 -0500
+++ linux-2.6-ppc/arch/ppc64/kernel/prom.c	2005-01-07 12:48:05.171928872 -0500
@@ -890,7 +890,7 @@
 	if (get_flat_dt_prop(node, "linux,iommu-force-on", NULL) != NULL)
 		iommu_force_on = 1;
 
-#ifdef CONFIG_PPC_PSERIES
+#ifdef CONFIG_PPC_RTAS
 	/* To help early debugging via the front panel, we retreive a minimal
 	 * set of RTAS infos now if available
 	 */
@@ -906,7 +906,7 @@
 			rtas.size = *prop;
 		}
 	}
-#endif /* CONFIG_PPC_PSERIES */
+#endif /* CONFIG_PPC_RTAS */
 
 	/* break now */
 	return 1;
Index: linux-2.6-ppc/arch/ppc64/kernel/rtc.c
===================================================================
--- linux-2.6-ppc.orig/arch/ppc64/kernel/rtc.c	2005-01-07 12:47:39.761929696 -0500
+++ linux-2.6-ppc/arch/ppc64/kernel/rtc.c	2005-01-07 12:48:05.172928720 -0500
@@ -337,7 +337,7 @@
 }
 #endif
 
-#ifdef CONFIG_PPC_PSERIES
+#ifdef CONFIG_PPC_RTAS
 #define MAX_RTC_WAIT 5000	/* 5 sec */
 #define RTAS_CLOCK_BUSY (-2)
 void pSeries_get_boot_time(struct rtc_time *rtc_tm)
Index: linux-2.6-ppc/arch/ppc64/kernel/setup.c
===================================================================
--- linux-2.6-ppc.orig/arch/ppc64/kernel/setup.c	2005-01-07 12:47:39.763929392 -0500
+++ linux-2.6-ppc/arch/ppc64/kernel/setup.c	2005-01-07 12:48:05.173928568 -0500
@@ -603,12 +603,12 @@
 	 */
 	initialize_cache_info();
 
-#ifdef CONFIG_PPC_PSERIES
+#ifdef CONFIG_PPC_RTAS
 	/*
 	 * Initialize RTAS if available
 	 */
 	rtas_initialize();
-#endif /* CONFIG_PPC_PSERIES */
+#endif /* CONFIG_PPC_RTAS */
 
 	/*
 	 * Check if we have an initrd provided via the device-tree
Index: linux-2.6-ppc/arch/ppc64/oprofile/op_model_power4.c
===================================================================
--- linux-2.6-ppc.orig/arch/ppc64/oprofile/op_model_power4.c	2005-01-07 12:47:39.765929088 -0500
+++ linux-2.6-ppc/arch/ppc64/oprofile/op_model_power4.c	2005-01-07 12:48:05.174928416 -0500
@@ -224,7 +224,7 @@
 	if (mmcra & MMCRA_SIPR)
 		return pc;
 
-#ifdef CONFIG_PPC_PSERIES
+#ifdef CONFIG_PPC_RTAS
 	/* Were we in RTAS? */
 	if (pc >= rtas.base && pc < (rtas.base + rtas.size))
 		/* function descriptor madness */


-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: signature
Url : http://ozlabs.org/pipermail/linuxppc64-dev/attachments/20050223/39620ede/attachment.pgp 


More information about the Linuxppc64-dev mailing list