All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Disable VSX instruction
@ 2014-09-25 22:33 Paulo Flabiano Smorigo
  2014-09-26 10:14 ` Colin Watson
  0 siblings, 1 reply; 6+ messages in thread
From: Paulo Flabiano Smorigo @ 2014-09-25 22:33 UTC (permalink / raw)
  To: grub-devel

VSX bit is enabled by default for Power7 and Power8 CPU models,
so we need to disable them in order to avoid instruction exceptions.
Kernel will activate it when necessary.

* grub-core/kern/powerpc/ieee1275/startup.S: Disable VSX.

Also-By: Adhemerval Zanella <azanella@linux.vnet.ibm.com>
---
 ChangeLog                                 | 10 ++++++++++
 grub-core/kern/powerpc/ieee1275/startup.S | 10 ++++++++++
 2 files changed, 20 insertions(+)

diff --git a/ChangeLog b/ChangeLog
index 192e8bc..c1b0637 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2014-09-25  Paulo Flabiano Smroigo  <pfsmorigo@linux.vnet.ibm.com>
+
+	Disable VSX instruction
+
+	VSX bit is enabled by default for Power7 and Power8 CPU models, so we
+	need to disable	them in order to avoid instruction exceptions. Kernel
+	will activate it when necessary.
+
+	* grub-core/kern/powerpc/ieee1275/startup.S: Disable VSX.
+
 2014-09-25  Colin Watson  <cjwatson@ubuntu.com>
 
 	Fix in-tree --platform=none
diff --git a/grub-core/kern/powerpc/ieee1275/startup.S b/grub-core/kern/powerpc/ieee1275/startup.S
index 21c884b..c4621a6 100644
--- a/grub-core/kern/powerpc/ieee1275/startup.S
+++ b/grub-core/kern/powerpc/ieee1275/startup.S
@@ -20,6 +20,8 @@
 #include <grub/symbol.h>
 #include <grub/offsets.h>
 
+#define MSR_VSX 0x80
+
 .extern __bss_start
 .extern _end
 
@@ -28,6 +30,14 @@
 	.globl	start, _start
 start:
 _start:
+ _start:
+
+    /* Disable VSX instruction */
+	mfmsr  0
+	oris   0,0,MSR_VSX
+	mtmsrd 0
+	isync
+
 	li      2, 0
 	li      13, 0
 
-- 
1.8.1.4


-- 
Paulo Flabiano Smorigo
IBM Linux Technology Center



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

* Re: [PATCH] Disable VSX instruction
  2014-09-25 22:33 [PATCH] Disable VSX instruction Paulo Flabiano Smorigo
@ 2014-09-26 10:14 ` Colin Watson
  2014-09-26 13:52   ` Paulo Flabiano Smorigo
  0 siblings, 1 reply; 6+ messages in thread
From: Colin Watson @ 2014-09-26 10:14 UTC (permalink / raw)
  To: The development of GNU GRUB

On Thu, Sep 25, 2014 at 07:33:39PM -0300, Paulo Flabiano Smorigo wrote:
> @@ -28,6 +30,14 @@
>  	.globl	start, _start
>  start:
>  _start:
> + _start:
> +
> +    /* Disable VSX instruction */

Isn't the second _start: label here redundant?

-- 
Colin Watson                                       [cjwatson@ubuntu.com]


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

* Re: [PATCH] Disable VSX instruction
  2014-09-26 10:14 ` Colin Watson
@ 2014-09-26 13:52   ` Paulo Flabiano Smorigo
  2014-09-27  4:41     ` Andrei Borzenkov
  0 siblings, 1 reply; 6+ messages in thread
From: Paulo Flabiano Smorigo @ 2014-09-26 13:52 UTC (permalink / raw)
  To: The development of GNU GRUB

Fri, Sep 26, 2014 at 11:14:00AM +0100, Colin Watson wrote:
> On Thu, Sep 25, 2014 at 07:33:39PM -0300, Paulo Flabiano Smorigo wrote:
> > @@ -28,6 +30,14 @@
> >  	.globl	start, _start
> >  start:
> >  _start:
> > + _start:
> > +
> > +    /* Disable VSX instruction */
> 
> Isn't the second _start: label here redundant?

yes, sorry. I will remove it from the patch.

Tks!

> 
> -- 
> Colin Watson                                       [cjwatson@ubuntu.com]
> 
> _______________________________________________
> Grub-devel mailing list
> Grub-devel@gnu.org
> https://lists.gnu.org/mailman/listinfo/grub-devel
> 

-- 
Paulo Flabiano Smorigo
IBM Linux Technology Center



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

* Re: [PATCH] Disable VSX instruction
  2014-09-26 13:52   ` Paulo Flabiano Smorigo
@ 2014-09-27  4:41     ` Andrei Borzenkov
  2014-09-29 12:14       ` Paulo Flabiano Smorigo
  0 siblings, 1 reply; 6+ messages in thread
From: Andrei Borzenkov @ 2014-09-27  4:41 UTC (permalink / raw)
  To: The development of GNU GRUB; +Cc: pfsmorigo

В Fri, 26 Sep 2014 10:52:02 -0300
Paulo Flabiano Smorigo <pfsmorigo@linux.vnet.ibm.com> пишет:

> Fri, Sep 26, 2014 at 11:14:00AM +0100, Colin Watson wrote:
> > On Thu, Sep 25, 2014 at 07:33:39PM -0300, Paulo Flabiano Smorigo wrote:
> > > @@ -28,6 +30,14 @@
> > >  	.globl	start, _start
> > >  start:
> > >  _start:
> > > + _start:
> > > +
> > > +    /* Disable VSX instruction */
> > 
> > Isn't the second _start: label here redundant?
> 
> yes, sorry. I will remove it from the patch.
> 

Is it still needs? I tested "Add flags for powerpc in order to avoid
exceptions" and it works, so I assume this patch is obsolete?

> Tks!
> 
> > 
> > -- 
> > Colin Watson                                       [cjwatson@ubuntu.com]
> > 
> > _______________________________________________
> > Grub-devel mailing list
> > Grub-devel@gnu.org
> > https://lists.gnu.org/mailman/listinfo/grub-devel
> > 
> 



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

* Re: [PATCH] Disable VSX instruction
  2014-09-27  4:41     ` Andrei Borzenkov
@ 2014-09-29 12:14       ` Paulo Flabiano Smorigo
  0 siblings, 0 replies; 6+ messages in thread
From: Paulo Flabiano Smorigo @ 2014-09-29 12:14 UTC (permalink / raw)
  To: The development of GNU GRUB

Sat, Sep 27, 2014 at 08:41:40AM +0400, Andrei Borzenkov wrote:
> В Fri, 26 Sep 2014 10:52:02 -0300
> Paulo Flabiano Smorigo <pfsmorigo@linux.vnet.ibm.com> пишет:
> 
> > Fri, Sep 26, 2014 at 11:14:00AM +0100, Colin Watson wrote:
> > > On Thu, Sep 25, 2014 at 07:33:39PM -0300, Paulo Flabiano Smorigo wrote:
> > > > @@ -28,6 +30,14 @@
> > > >  	.globl	start, _start
> > > >  start:
> > > >  _start:
> > > > + _start:
> > > > +
> > > > +    /* Disable VSX instruction */
> > > 
> > > Isn't the second _start: label here redundant?
> > 
> > yes, sorry. I will remove it from the patch.
> > 
> 
> Is it still needs? I tested "Add flags for powerpc in order to avoid
> exceptions" and it works, so I assume this patch is obsolete?

Friday we discovered that this asm stills enables vsx so we think that the
flags are the right way to do it.

I talked with some toolchain experts and add two more flags that can
cause the problem as well.

> 
> > Tks!
> > 
> > > 
> > > -- 
> > > Colin Watson                                       [cjwatson@ubuntu.com]
> > > 
> > > _______________________________________________
> > > Grub-devel mailing list
> > > Grub-devel@gnu.org
> > > https://lists.gnu.org/mailman/listinfo/grub-devel
> > > 
> > 
> 
> 
> _______________________________________________
> Grub-devel mailing list
> Grub-devel@gnu.org
> https://lists.gnu.org/mailman/listinfo/grub-devel

-- 
Paulo Flabiano Smorigo
IBM Linux Technology Center



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

* [PATCH] Disable VSX instruction
@ 2014-09-25 21:28 Paulo Flabiano Smorigo
  0 siblings, 0 replies; 6+ messages in thread
From: Paulo Flabiano Smorigo @ 2014-09-25 21:28 UTC (permalink / raw)
  To: grub-devel; +Cc: Paulo Flabiano Smorigo

VSX bit is enabled by default for Power7 and Power8 CPU models,
so we need to disable them in order to avoid instruction exceptions.
Kernel will activate it when necessary.

Also-By: Adhemerval Zanella <azanella@linux.vnet.ibm.com>
---
 ChangeLog                                 | 10 ++++++++++
 grub-core/kern/powerpc/ieee1275/startup.S | 10 ++++++++++
 2 files changed, 20 insertions(+)

diff --git a/ChangeLog b/ChangeLog
index 192e8bc..c1b0637 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2014-09-25  Paulo Flabiano Smroigo  <pfsmorigo@linux.vnet.ibm.com>
+
+	Disable VSX instruction
+
+	VSX bit is enabled by default for Power7 and Power8 CPU models, so we
+	need to disable	them in order to avoid instruction exceptions. Kernel
+	will activate it when necessary.
+
+	* grub-core/kern/powerpc/ieee1275/startup.S: Disable VSX.
+
 2014-09-25  Colin Watson  <cjwatson@ubuntu.com>
 
 	Fix in-tree --platform=none
diff --git a/grub-core/kern/powerpc/ieee1275/startup.S b/grub-core/kern/powerpc/ieee1275/startup.S
index 21c884b..c4621a6 100644
--- a/grub-core/kern/powerpc/ieee1275/startup.S
+++ b/grub-core/kern/powerpc/ieee1275/startup.S
@@ -20,6 +20,8 @@
 #include <grub/symbol.h>
 #include <grub/offsets.h>
 
+#define MSR_VSX 0x80
+
 .extern __bss_start
 .extern _end
 
@@ -28,6 +30,14 @@
 	.globl	start, _start
 start:
 _start:
+ _start:
+
+    /* Disable VSX interrupt instruction */
+	mfmsr  0
+	oris   0,0,MSR_VSX
+	mtmsrd 0
+	isync
+
 	li      2, 0
 	li      13, 0
 
-- 
1.8.1.4



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

end of thread, other threads:[~2014-09-29 12:14 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-09-25 22:33 [PATCH] Disable VSX instruction Paulo Flabiano Smorigo
2014-09-26 10:14 ` Colin Watson
2014-09-26 13:52   ` Paulo Flabiano Smorigo
2014-09-27  4:41     ` Andrei Borzenkov
2014-09-29 12:14       ` Paulo Flabiano Smorigo
  -- strict thread matches above, loose matches on Subject: below --
2014-09-25 21:28 Paulo Flabiano Smorigo

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.