summaryrefslogtreecommitdiffstats
path: root/src/runtime/rt_start.S
diff options
context:
space:
mode:
authorJoel Stanley <joel@jms.id.au>2017-06-22 13:43:47 +0930
committerDaniel M. Crowell <dcrowell@us.ibm.com>2017-06-26 10:05:11 -0400
commit10983d35f568cad17b2550635eddb3c11606aab9 (patch)
tree465ad853e000c6bd3d52289320b7124da08df928 /src/runtime/rt_start.S
parent44a6ca80921a6747129a2ba5c1853146823a5acb (diff)
downloadtalos-hostboot-10983d35f568cad17b2550635eddb3c11606aab9.tar.gz
talos-hostboot-10983d35f568cad17b2550635eddb3c11606aab9.zip
Convert cmpi to cmpwi to fix build for modern binutils
From Linux 80f23935cadb ("powerpc: Convert cmp to cmpd in idle enter sequence"): PowerPC's "cmp" instruction has four operands. Normally people write "cmpw" or "cmpd" for the second cmp operand 0 or 1. But, frequently people forget, and write "cmp" with just three operands. With older binutils this is silently accepted as if this was "cmpw", while often "cmpd" is wanted. With newer binutils GAS will complain about this for 64-bit code. For 32-bit code it still silently assumes "cmpw" is what is meant. In this instance the code comes directly from ISA v2.07, including the cmp, but cmpd is correct. Backport to stable so that new toolchains can build old kernels. This is change is a noop with the existing toolchain. We change from implicitly generating the cmpwi to explicitly stating in for compatibility with newer toolchains. With gcc 4.9.3, binutils 2.25.2: $ cat asm-test.S .text .global test cmpi 0, 8, 1 $ powerpc64-linux-gcc -c asm-test.S $ objdump -d asm-test.o 0000000000000000 <.text>: 2c 08 00 01 cmpwi r8,1 Old compiler, updated instruction: $ cat asm-test.S .text .global test cmpwi 0, 8, 1 $ powerpc64-linux-gcc -c asm-test.S $ objdump -d asm-test.o 0000000000000000 <.text>: 2c 08 00 01 cmpwi r8,1 And then the new toolchain (gcc 6.3.0, binutils 2.28) with the updated asm: $ cat asm-test.S .text .global test cmpwi 0, 8, 1 $ powerpc64-linux-gnu-gcc -c asm-test.S $ objdump -d asm-test.o 0000000000000000 <.text>: 2c 08 00 01 cmpwi r8,1 Change-Id: If981e20a578ec98ede68a31eee2888c27d5c3d10 Signed-off-by: Joel Stanley <joel@jms.id.au> Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/42259 Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com> Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com> Reviewed-by: STEWART E. SMITH <stewart@linux.vnet.ibm.com> Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Diffstat (limited to 'src/runtime/rt_start.S')
-rw-r--r--src/runtime/rt_start.S7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/runtime/rt_start.S b/src/runtime/rt_start.S
index d69184aef..ba1a975d7 100644
--- a/src/runtime/rt_start.S
+++ b/src/runtime/rt_start.S
@@ -5,7 +5,10 @@
#
# OpenPOWER HostBoot Project
#
-# COPYRIGHT International Business Machines Corp. 2013,2014
+# Contributors Listed Below - COPYRIGHT 2013,2017
+# [+] International Business Machines Corp.
+# [+] Joel Stanley
+#
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -47,7 +50,7 @@ _init:
ld r8, 0(r10) # Get count of relocations.
- cmpi cr0, r8, 0 # Perform relocations (if any).
+ cmpwi cr0, r8, 0 # Perform relocations (if any).
beq 2f
mtctr r8
1:
OpenPOWER on IntegriCloud