Skip to contentSkip to conversation

Disable VSX instruction

PATCH In review Paulo Flabiano Smorigo 3 participants 5 messages Sep 25, 2014 – Sep 29, 2014

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

---
 ChangeLog                                 | 10 ++++++++++
 grub-core/kern/powerpc/ieee1275/startup.S | 10 ++++++++++
 2 files changed, 20 insertions(+)
ChangeLog +10 -0
index 192e8bc..c1b0637 100644
@@ -1,3 +1,13 @@
+2014-09-25  Paulo Flabiano Smroigo  <[email protected]>
+
+	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  <[email protected]>
 
 	Fix in-tree --platform=none
grub-core/kern/powerpc/ieee1275/startup.S +10 -0
index 21c884b..c4621a6 100644
@@ -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
 
Signature · 6 lines
1.8.1.4


-- 
Paulo Flabiano Smorigo
IBM Linux Technology Center
#1 lore raw

grub-core/kern/powerpc/ieee1275/startup.S line 35

Quoted 7 lines · Paulo Flabiano Smorigo
grub-core/kern/powerpc/ieee1275/startup.S +3 -0
@@ -28,6 +30,14 @@
 	.globl	start, _start
 start:
 _start:
+ _start:
+
+    /* Disable VSX instruction */

Isn't the second _start: label here redundant?

Signature · 1 line
Colin Watson                                       [[email protected]]
#2 lore raw
Quoted 10 lines · Colin Watson

grub-core/kern/powerpc/ieee1275/startup.S line 35

Quoted 7 lines · Paulo Flabiano Smorigo
grub-core/kern/powerpc/ieee1275/startup.S +3 -0
@@ -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!

Quoted 9 lines
Signature · 7 lines
-- 
Colin Watson                                       [[email protected]]

_______________________________________________
Grub-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/grub-devel
Signature · 2 lines
Paulo Flabiano Smorigo
IBM Linux Technology Center
#3 lore raw

В Fri, 26 Sep 2014 10:52:02 -0300
Paulo Flabiano Smorigo <[email protected]> пишет:

Quoted 12 lines
Quoted 10 lines · Colin Watson

grub-core/kern/powerpc/ieee1275/startup.S line 35

Quoted 7 lines · Paulo Flabiano Smorigo
grub-core/kern/powerpc/ieee1275/startup.S +3 -0
@@ -28,6 +30,14 @@
 	.globl	start, _start
 start:
 _start:
+ _start:
+
+    /* Disable VSX instruction */

Isn't the second _start: label here redundant?

Quoted 2 lines

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?

Quoted 12 lines

Tks!

Quoted 9 lines
Signature · 7 lines
-- 
Colin Watson                                       [[email protected]]

_______________________________________________
Grub-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/grub-devel
#4 lore raw
Quoted 15 lines · Andrei Borzenkov

В Fri, 26 Sep 2014 10:52:02 -0300
Paulo Flabiano Smorigo <[email protected]> пишет:

Quoted 12 lines
Quoted 10 lines · Colin Watson

grub-core/kern/powerpc/ieee1275/startup.S line 35

Quoted 7 lines · Paulo Flabiano Smorigo
grub-core/kern/powerpc/ieee1275/startup.S +3 -0
@@ -28,6 +30,14 @@
 	.globl	start, _start
 start:
 _start:
+ _start:
+
+    /* Disable VSX instruction */

Isn't the second _start: label here redundant?

Quoted 5 lines
Quoted 2 lines

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.

Quoted 19 lines
Quoted 13 lines

Tks!

Quoted 9 lines
Signature · 7 lines
-- 
Colin Watson                                       [[email protected]]

_______________________________________________
Grub-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/grub-devel

_______________________________________________
Grub-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/grub-devel

Signature · 2 lines
Paulo Flabiano Smorigo
IBM Linux Technology Center