blob: 28b9dc5d08e0795804373fa17874ef84ea406e23 [file] [log] [blame]
Joel Stanley876a7fb2017-06-27 18:18:08 +09301From a74562d710c07c1dd2e510fd2c9c259f1f72e4ce Mon Sep 17 00:00:00 2001
2From: Joel Stanley <joel.stanley@au1.ibm.com>
3Date: Tue, 27 Jun 2017 18:00:09 +0930
4Subject: [PATCH] kernel: Update assembly for modern binutils
5
6From Linux 80f23935cadb ("powerpc: Convert cmp to cmpd in idle enter sequence"):
7
8 PowerPC's "cmp" instruction has four operands. Normally people write
9 "cmpw" or "cmpd" for the second cmp operand 0 or 1. But, frequently
10 people forget, and write "cmp" with just three operands.
11
12 With older binutils this is silently accepted as if this was "cmpw",
13 while often "cmpd" is wanted. With newer binutils GAS will complain
14 about this for 64-bit code. For 32-bit code it still silently assumes
15 "cmpw" is what is meant.
16
17The first two instances are dealing with SPRs, which are 32-bit, so cmpw is correct.
18
19It is not clear what to do in the third use of cmp, but given old toolchains
20have generated cmpw lets assume that we should maintain the behaviour.
21
22Change-Id: Iee5dd5903dcd7ac4028bab0176e08ce3db23b2d5
23Signed-off-by: Joel Stanley <joel.stanley@au1.ibm.com>
24---
25 src/kernel/shutdown.S | 8 ++++----
26 1 file changed, 4 insertions(+), 4 deletions(-)
27
28diff --git a/src/kernel/shutdown.S b/src/kernel/shutdown.S
29index b3c47725ae79..0c42a19cfbfe 100644
30--- a/src/kernel/shutdown.S
31+++ b/src/kernel/shutdown.S
32@@ -5,7 +5,7 @@
33 #
34 # OpenPOWER HostBoot Project
35 #
36-# Contributors Listed Below - COPYRIGHT 2012,2016
37+# Contributors Listed Below - COPYRIGHT 2012,2017
38 # [+] International Business Machines Corp.
39 #
40 #
41@@ -94,7 +94,7 @@ kernel_shutdown_ea0_1_mode:
42 ;// as it was the one that updated the cpu_count & lowest_pir
43 ;// barrier - 1 wait for all nodes to report
44 mfspr r10, PIR
45- cmp cr0, r10, r7
46+ cmpw cr0, r10, r7
47 bne+ 2f ;// inside KERNEL_BARRIER below
48
49 ;// Perform barrier - 1
50@@ -132,7 +132,7 @@ kernel_shutdown_ea0_1_mode:
51 addi r8, r8, 8
52 ;// Check for PIR == r7.
53 mfspr r10, PIR
54- cmp cr0, r10, r7
55+ cmpw cr0, r10, r7
56 beq 3f
57 ;// Increment thread count.
58 1:
59@@ -165,7 +165,7 @@ kernel_shutdown_ea0_1_mode:
60 1:
61 or 1,1,1
62 ld r11, 0(r8)
63- cmp cr0, r3, r11
64+ cmpw cr0, r3, r11
65 bne+ 1b
66 isync
67 ;// All other threads have left, so wait a little bit...
68--
692.13.1
70