mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 1/2] [for 3.4] drivers/virt: the Freescale hypervisor driver doesn't need to check MSR[GS]
@ 2012-05-17 19:10 Timur Tabi
  2012-05-17 19:10 ` [PATCH 2/2] [for 3.4] powerpc/512x: don't compile any platform DIU code if the DIU is not enabled Timur Tabi
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Timur Tabi @ 2012-05-17 19:10 UTC (permalink / raw)
  To: linuxppc-dev, Kumar Gala, Scott Wood, Anatolij Gustschin, geert,
	Benjamin Herrenschmidt, linux-kernel

The MSR[GS] bit indicates whether the kernel is running in processor guest
state mode, but such a check is unnecessary.  The driver already checks
for the /hypervisor node and the fsl,hv-version property, so it already
knows that it's running under the Freescale hypervisor.

There is nothing in the driver that inherently requires guest state,
anyway.

This fixes a break that can occur in some randconfig builds.

Signed-off-by: Timur Tabi <timur@freescale.com>
---
 drivers/virt/fsl_hypervisor.c |    3 ---
 1 files changed, 0 insertions(+), 3 deletions(-)

diff --git a/drivers/virt/fsl_hypervisor.c b/drivers/virt/fsl_hypervisor.c
index 4939e0c..d294f67 100644
--- a/drivers/virt/fsl_hypervisor.c
+++ b/drivers/virt/fsl_hypervisor.c
@@ -796,9 +796,6 @@ static int has_fsl_hypervisor(void)
 	struct device_node *node;
 	int ret;
 
-	if (!(mfmsr() & MSR_GS))
-		return 0;
-
 	node = of_find_node_by_path("/hypervisor");
 	if (!node)
 		return 0;
-- 
1.7.3.4



^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 2/2] [for 3.4] powerpc/512x: don't compile any platform DIU code if the DIU is not enabled
  2012-05-17 19:10 [PATCH 1/2] [for 3.4] drivers/virt: the Freescale hypervisor driver doesn't need to check MSR[GS] Timur Tabi
@ 2012-05-17 19:10 ` Timur Tabi
  2012-10-15 15:03 ` [PATCH 1/2] [for 3.4] drivers/virt: the Freescale hypervisor driver doesn't need to check MSR[GS] Tabi Timur-B04825
  2012-11-25 13:07 ` Kumar Gala
  2 siblings, 0 replies; 4+ messages in thread
From: Timur Tabi @ 2012-05-17 19:10 UTC (permalink / raw)
  To: linuxppc-dev, Kumar Gala, Scott Wood, Anatolij Gustschin, geert,
	Benjamin Herrenschmidt, linux-kernel

If the DIU framebuffer driver is not enabled, then there's no point in
compiling any platform DIU code, because it will never be used.  Most of
the platform code was protected in the appropriate #ifdef, but not all.
This caused a break in some randconfig builds.

This is only a problem on the 512x platforms.  The P1022DS and MPC8610HPCD
platforms are already correct.

Signed-off-by: Timur Tabi <timur@freescale.com>
---
 arch/powerpc/platforms/512x/mpc5121_ads.c     |    5 +++++
 arch/powerpc/platforms/512x/mpc5121_generic.c |    2 ++
 arch/powerpc/platforms/512x/mpc512x.h         |    8 ++++++--
 arch/powerpc/platforms/512x/mpc512x_shared.c  |    7 ++++---
 arch/powerpc/platforms/512x/pdm360ng.c        |    4 +++-
 5 files changed, 20 insertions(+), 6 deletions(-)

diff --git a/arch/powerpc/platforms/512x/mpc5121_ads.c b/arch/powerpc/platforms/512x/mpc5121_ads.c
index dcef6ad..bd6b28a 100644
--- a/arch/powerpc/platforms/512x/mpc5121_ads.c
+++ b/arch/powerpc/platforms/512x/mpc5121_ads.c
@@ -42,7 +42,10 @@ static void __init mpc5121_ads_setup_arch(void)
 	for_each_compatible_node(np, "pci", "fsl,mpc5121-pci")
 		mpc83xx_add_bridge(np);
 #endif
+
+#if defined(CONFIG_FB_FSL_DIU) || defined(CONFIG_FB_FSL_DIU_MODULE)
 	mpc512x_setup_diu();
+#endif
 }
 
 static void __init mpc5121_ads_init_IRQ(void)
@@ -66,7 +69,9 @@ define_machine(mpc5121_ads) {
 	.probe			= mpc5121_ads_probe,
 	.setup_arch		= mpc5121_ads_setup_arch,
 	.init			= mpc512x_init,
+#if defined(CONFIG_FB_FSL_DIU) || defined(CONFIG_FB_FSL_DIU_MODULE)
 	.init_early		= mpc512x_init_diu,
+#endif
 	.init_IRQ		= mpc5121_ads_init_IRQ,
 	.get_irq		= ipic_get_irq,
 	.calibrate_decr		= generic_calibrate_decr,
diff --git a/arch/powerpc/platforms/512x/mpc5121_generic.c b/arch/powerpc/platforms/512x/mpc5121_generic.c
index 926731f..e4aa298 100644
--- a/arch/powerpc/platforms/512x/mpc5121_generic.c
+++ b/arch/powerpc/platforms/512x/mpc5121_generic.c
@@ -43,8 +43,10 @@ define_machine(mpc5121_generic) {
 	.name			= "MPC5121 generic",
 	.probe			= mpc5121_generic_probe,
 	.init			= mpc512x_init,
+#if defined(CONFIG_FB_FSL_DIU) || defined(CONFIG_FB_FSL_DIU_MODULE)
 	.init_early		= mpc512x_init_diu,
 	.setup_arch		= mpc512x_setup_diu,
+#endif
 	.init_IRQ		= mpc512x_init_IRQ,
 	.get_irq		= ipic_get_irq,
 	.calibrate_decr		= generic_calibrate_decr,
diff --git a/arch/powerpc/platforms/512x/mpc512x.h b/arch/powerpc/platforms/512x/mpc512x.h
index 1ab6d11..240061a 100644
--- a/arch/powerpc/platforms/512x/mpc512x.h
+++ b/arch/powerpc/platforms/512x/mpc512x.h
@@ -16,6 +16,10 @@ extern void __init mpc512x_init(void);
 extern int __init mpc5121_clk_init(void);
 void __init mpc512x_declare_of_platform_devices(void);
 extern void mpc512x_restart(char *cmd);
-extern void mpc512x_init_diu(void);
-extern void mpc512x_setup_diu(void);
+
+#if defined(CONFIG_FB_FSL_DIU) || defined(CONFIG_FB_FSL_DIU_MODULE)
+void mpc512x_init_diu(void);
+void mpc512x_setup_diu(void);
+#endif
+
 #endif				/* __MPC512X_H__ */
diff --git a/arch/powerpc/platforms/512x/mpc512x_shared.c b/arch/powerpc/platforms/512x/mpc512x_shared.c
index cfe958e..4c65f64 100644
--- a/arch/powerpc/platforms/512x/mpc512x_shared.c
+++ b/arch/powerpc/platforms/512x/mpc512x_shared.c
@@ -58,6 +58,8 @@ void mpc512x_restart(char *cmd)
 		;
 }
 
+#if defined(CONFIG_FB_FSL_DIU) || defined(CONFIG_FB_FSL_DIU_MODULE)
+
 struct fsl_diu_shared_fb {
 	u8		gamma[0x300];	/* 32-bit aligned! */
 	struct diu_ad	ad0;		/* 32-bit aligned! */
@@ -191,8 +193,6 @@ mpc512x_valid_monitor_port(enum fsl_diu_monitor_port port)
 
 static struct fsl_diu_shared_fb __attribute__ ((__aligned__(8))) diu_shared_fb;
 
-#if defined(CONFIG_FB_FSL_DIU) || \
-    defined(CONFIG_FB_FSL_DIU_MODULE)
 static inline void mpc512x_free_bootmem(struct page *page)
 {
 	__ClearPageReserved(page);
@@ -220,7 +220,6 @@ void mpc512x_release_bootmem(void)
 	}
 	diu_ops.release_bootmem	= NULL;
 }
-#endif
 
 /*
  * Check if DIU was pre-initialized. If so, perform steps
@@ -334,6 +333,8 @@ void __init mpc512x_setup_diu(void)
 #endif
 }
 
+#endif
+
 void __init mpc512x_init_IRQ(void)
 {
 	struct device_node *np;
diff --git a/arch/powerpc/platforms/512x/pdm360ng.c b/arch/powerpc/platforms/512x/pdm360ng.c
index 0575e85..2fd937c 100644
--- a/arch/powerpc/platforms/512x/pdm360ng.c
+++ b/arch/powerpc/platforms/512x/pdm360ng.c
@@ -119,9 +119,11 @@ static int __init pdm360ng_probe(void)
 define_machine(pdm360ng) {
 	.name			= "PDM360NG",
 	.probe			= pdm360ng_probe,
-	.setup_arch		= mpc512x_setup_diu,
 	.init			= pdm360ng_init,
+#if defined(CONFIG_FB_FSL_DIU) || defined(CONFIG_FB_FSL_DIU_MODULE)
 	.init_early		= mpc512x_init_diu,
+	.setup_arch		= mpc512x_setup_diu,
+#endif
 	.init_IRQ		= mpc512x_init_IRQ,
 	.get_irq		= ipic_get_irq,
 	.calibrate_decr		= generic_calibrate_decr,
-- 
1.7.3.4



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/2] [for 3.4] drivers/virt: the Freescale hypervisor driver doesn't need to check MSR[GS]
  2012-05-17 19:10 [PATCH 1/2] [for 3.4] drivers/virt: the Freescale hypervisor driver doesn't need to check MSR[GS] Timur Tabi
  2012-05-17 19:10 ` [PATCH 2/2] [for 3.4] powerpc/512x: don't compile any platform DIU code if the DIU is not enabled Timur Tabi
@ 2012-10-15 15:03 ` Tabi Timur-B04825
  2012-11-25 13:07 ` Kumar Gala
  2 siblings, 0 replies; 4+ messages in thread
From: Tabi Timur-B04825 @ 2012-10-15 15:03 UTC (permalink / raw)
  To: Tabi Timur-B04825
  Cc: linuxppc-dev, Kumar Gala, Wood Scott-B07421, Anatolij Gustschin,
	geert, Benjamin Herrenschmidt, linux-kernel

On Thu, May 17, 2012 at 2:10 PM, Timur Tabi <timur@freescale.com> wrote:
> The MSR[GS] bit indicates whether the kernel is running in processor guest
> state mode, but such a check is unnecessary.  The driver already checks
> for the /hypervisor node and the fsl,hv-version property, so it already
> knows that it's running under the Freescale hypervisor.
>
> There is nothing in the driver that inherently requires guest state,
> anyway.
>
> This fixes a break that can occur in some randconfig builds.
>
> Signed-off-by: Timur Tabi <timur@freescale.com>
> ---

Kumar, I posted this patch back in May.  Can you apply it, please?  It
fixes a build break.

-- 
Timur Tabi
Linux kernel developer at Freescale

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/2] [for 3.4] drivers/virt: the Freescale hypervisor driver doesn't need to check MSR[GS]
  2012-05-17 19:10 [PATCH 1/2] [for 3.4] drivers/virt: the Freescale hypervisor driver doesn't need to check MSR[GS] Timur Tabi
  2012-05-17 19:10 ` [PATCH 2/2] [for 3.4] powerpc/512x: don't compile any platform DIU code if the DIU is not enabled Timur Tabi
  2012-10-15 15:03 ` [PATCH 1/2] [for 3.4] drivers/virt: the Freescale hypervisor driver doesn't need to check MSR[GS] Tabi Timur-B04825
@ 2012-11-25 13:07 ` Kumar Gala
  2 siblings, 0 replies; 4+ messages in thread
From: Kumar Gala @ 2012-11-25 13:07 UTC (permalink / raw)
  To: Timur Tabi
  Cc: linuxppc-dev, Scott Wood, Anatolij Gustschin, geert,
	Benjamin Herrenschmidt, linux-kernel


On May 17, 2012, at 2:10 PM, Timur Tabi wrote:

> The MSR[GS] bit indicates whether the kernel is running in processor guest
> state mode, but such a check is unnecessary.  The driver already checks
> for the /hypervisor node and the fsl,hv-version property, so it already
> knows that it's running under the Freescale hypervisor.
> 
> There is nothing in the driver that inherently requires guest state,
> anyway.
> 
> This fixes a break that can occur in some randconfig builds.
> 
> Signed-off-by: Timur Tabi <timur@freescale.com>
> ---
> drivers/virt/fsl_hypervisor.c |    3 ---
> 1 files changed, 0 insertions(+), 3 deletions(-)

applied to next

- k

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-11-25 13:07 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-05-17 19:10 [PATCH 1/2] [for 3.4] drivers/virt: the Freescale hypervisor driver doesn't need to check MSR[GS] Timur Tabi
2012-05-17 19:10 ` [PATCH 2/2] [for 3.4] powerpc/512x: don't compile any platform DIU code if the DIU is not enabled Timur Tabi
2012-10-15 15:03 ` [PATCH 1/2] [for 3.4] drivers/virt: the Freescale hypervisor driver doesn't need to check MSR[GS] Tabi Timur-B04825
2012-11-25 13:07 ` Kumar Gala

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®