Skip to contentSkip to conversation

powerpc: process.c: fix Kconfig typo

PATCH Applied Valentin Rothberg 3 participants 9 messages Oct 5, 2016 – Oct 27, 2016 PowerPC

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 powerpc: process.c: fix Kconfig typo

s/ALIVEC/ALTIVEC/

---
 arch/powerpc/kernel/process.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/powerpc/kernel/process.c +1 -1
index 9e7c10fe205f..ce6dc61b15b2 100644
@@ -1012,7 +1012,7 @@ void restore_tm_state(struct pt_regs *regs)
 	/* Ensure that restore_math() will restore */
 	if (msr_diff & MSR_FP)
 		current->thread.load_fp = 1;
-#ifdef CONFIG_ALIVEC
+#ifdef CONFIG_ALTIVEC
 	if (cpu_has_feature(CPU_FTR_ALTIVEC) && msr_diff & MSR_VEC)
 		current->thread.load_vec = 1;
 #endif
Signature · 1 line
2.9.3
Reviewed-by on v1 1/1
#1 lore raw
Quoted 2 lines · Valentin Rothberg

s/ALIVEC/ALTIVEC/

Oops, nice catch

Quoted 1 line
Quoted 18 lines

---
 arch/powerpc/kernel/process.c | 2 +-

 1 file changed, 1 insertion(+), 1 deletion(-)
arch/powerpc/kernel/process.c +1 -1
index 9e7c10fe205f..ce6dc61b15b2 100644
@@ -1012,7 +1012,7 @@ void restore_tm_state(struct pt_regs *regs)
  	/* Ensure that restore_math() will restore */
  	if (msr_diff & MSR_FP)
  		current->thread.load_fp = 1;
-#ifdef CONFIG_ALIVEC
+#ifdef CONFIG_ALTIVEC
  	if (cpu_has_feature(CPU_FTR_ALTIVEC) && msr_diff & MSR_VEC)
  		current->thread.load_vec = 1;
  #endif
#2 lore raw
Quoted 9 lines · Cyril Bur
Quoted 2 lines · Valentin Rothberg

s/ALIVEC/ALTIVEC/

Oops, nice catch

Quoted 1 line

How did we not notice? Sounds like we need a new selftest.

Looks like this should have:

Fixes dc16b553c949 ("powerpc: Always restore FPU/VEC/VSX if hardware transactional memory in use")

And I guess I need to start running checkkconfigsymbols.py on every commit.

cheers

#3 lore raw
Quoted 14 lines · Michael Ellerman
Quoted 9 lines · Cyril Bur
Quoted 2 lines · Valentin Rothberg

s/ALIVEC/ALTIVEC/

Oops, nice catch

Quoted 1 line

How did we not notice? Sounds like we need a new selftest.

Quoted 7 lines

Looks like this should have:

Fixes dc16b553c949 ("powerpc: Always restore FPU/VEC/VSX if hardware transactional memory in use")

And I guess I need to start running checkkconfigsymbols.py on every commit.

Happy to find a new user :-) You can also run the script on a range of commits via '--diff commitA..commitB', which can safe some time.

Best regards,
Valentin

Quoted 1 line

cheers

#4 lore raw
Quoted 17 lines · Valentin Rothberg
Quoted 16 lines · Michael Ellerman
Quoted 9 lines · Cyril Bur
Quoted 2 lines · Valentin Rothberg

s/ALIVEC/ALTIVEC/

Oops, nice catch

Quoted 1 line

How did we not notice? Sounds like we need a new selftest.

Looks like this should have:

Quoted 8 lines
Quoted 5 lines
Fixes dc16b553c949 ("powerpc: Always restore FPU/VEC/VSX if hardware transactional memory in use")

And I guess I need to start running checkkconfigsymbols.py on every commit.

Happy to find a new user :-) You can also run the script on a range of commits via '--diff commitA..commitB', which can safe some time.

Yeah I just discovered that, very useful.

But my instinct was to do:

$ ./scripts/checkkconfigsymbols.py --diff HEAD^^^..HEAD

Which didn't work, the regexp is a bit tight, fixed by:

scripts/checkkconfigsymbols.py +1 -1
index a32e4da4c117..3820f00b066a 100755
@@ -88,7 +88,7 @@ def parse_options():
     if args.commit and args.diff:
         sys.exit("Please specify only one option at once.")
 
-    if args.diff and not re.match(r"^[\w\-\.]+\.\.[\w\-\.]+$", args.diff):
+    if args.diff and not re.match(r"^[\w\-\.\^]+\.\.[\w\-\.\^]+$", args.diff):
         sys.exit("Please specify valid input in the following format: "
                  "\'commit1..commit2\'")
 

cheers

#5 lore raw
Quoted 41 lines · Michael Ellerman
Quoted 17 lines · Valentin Rothberg
Quoted 16 lines · Michael Ellerman
Quoted 9 lines · Cyril Bur
Quoted 2 lines · Valentin Rothberg

s/ALIVEC/ALTIVEC/

Oops, nice catch

Quoted 1 line

How did we not notice? Sounds like we need a new selftest.

Looks like this should have:

Quoted 8 lines
Quoted 5 lines
Fixes dc16b553c949 ("powerpc: Always restore FPU/VEC/VSX if hardware transactional memory in use")

And I guess I need to start running checkkconfigsymbols.py on every commit.

Happy to find a new user :-) You can also run the script on a range of commits via '--diff commitA..commitB', which can safe some time.

Yeah I just discovered that, very useful.

But my instinct was to do:

$ ./scripts/checkkconfigsymbols.py --diff HEAD^^^..HEAD

Which didn't work, the regexp is a bit tight, fixed by:

scripts/checkkconfigsymbols.py +0 -0
index a32e4da4c117..3820f00b066a 100755

scripts/checkkconfigsymbols.py def parse_options(): · line 93

Quoted 7 lines
scripts/checkkconfigsymbols.py +1 -1
@@ -88,7 +88,7 @@ def parse_options():
     if args.commit and args.diff:
         sys.exit("Please specify only one option at once.")
 
-    if args.diff and not re.match(r"^[\w\-\.]+\.\.[\w\-\.]+$", args.diff):
+    if args.diff and not re.match(r"^[\w\-\.\^]+\.\.[\w\-\.\^]+$", args.diff):
         sys.exit("Please specify valid input in the following format: "
                  "\'commit1..commit2\'")

Looks great. If you agree, I'll pick this up and send the patch to Greg (who takes patches for this script)?

Thanks,
Valentin

#6 lore raw
Quoted 9 lines · Valentin Rothberg
Quoted 8 lines · Michael Ellerman
scripts/checkkconfigsymbols.py +0 -0
index a32e4da4c117..3820f00b066a 100755
@@ -88,7 +88,7 @@ def parse_options():
     if args.commit and args.diff:
         sys.exit("Please specify only one option at once.")
 
Quoted 7 lines

scripts/checkkconfigsymbols.py def parse_options(): · line 93

Quoted 4 lines
scripts/checkkconfigsymbols.py +1 -1
-    if args.diff and not re.match(r"^[\w\-\.]+\.\.[\w\-\.]+$", args.diff):
+    if args.diff and not re.match(r"^[\w\-\.\^]+\.\.[\w\-\.\^]+$", args.diff):
         sys.exit("Please specify valid input in the following format: "
                  "\'commit1..commit2\'")

Looks great. If you agree, I'll pick this up and send the patch to Greg (who takes patches for this script)?

That'd be great, thanks.

cheers

#7 lore raw
In reply to Michael Ellerman
Quoted 6 lines · Michael Ellerman
Quoted 4 lines · Cyril Bur
Quoted 2 lines · Valentin Rothberg

s/ALIVEC/ALTIVEC/

Quoted 8 lines
Quoted 5 lines

Oops, nice catch

Quoted 1 line

How did we not notice? Sounds like we need a new selftest.

Indeed...

Here is probably a good place to say why we didn't catch it and under what circumstances this will have a negative effect.

If a thread performs and transaction with altivec and then gets preempted for whatever reason, this bug may cause the kernel to not reenable altivec when that thread runs again. This will result in an altivec unavailable fault, when these faults happen inside a user transaction the kernel has no choice but enable altivec and doom the transaction.

The result is that transactions using altivec may get aborted more than they should.

The difficulty in catching this with a selftest is my deliberate use of the word may above. Optimisations to avoid FPU/altivec/VSX faults mean that the kernel will always leave them on for 255 switches, this code prevents the kernel turning it off if it got to the 256th switch (and userspace was transactional)...

Cyril

Quoted 10 lines

Looks like this should have:

Fixes dc16b553c949 ("powerpc: Always restore FPU/VEC/VSX if hardware

transactional memory in use")

And I guess I need to start running checkkconfigsymbols.py on every commit.

cheers