From patchwork Wed Nov 23 13:02:07 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicholas Piggin X-Patchwork-Id: 698233 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [103.22.144.68]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3tP2d9470Dz9ryv for ; Thu, 24 Nov 2016 00:05:33 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="igb/zAqP"; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 3tP2d92qD5zDw3G for ; Thu, 24 Nov 2016 00:05:33 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="igb/zAqP"; dkim-atps=neutral X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Received: from mail-pg0-x241.google.com (mail-pg0-x241.google.com [IPv6:2607:f8b0:400e:c05::241]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 3tP2Yg3zXTzDw0t for ; Thu, 24 Nov 2016 00:02:31 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="igb/zAqP"; dkim-atps=neutral Received: by mail-pg0-x241.google.com with SMTP id x23so1085967pgx.3 for ; Wed, 23 Nov 2016 05:02:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=eakkFNKy7t4GwbxCUBYK4+sAqafABkBNrt4r/GkoucE=; b=igb/zAqPYfD0AREveOzZBJ22bQ08uoFfIkL+aDnk7B73xT4e1pyBw9ncyBU09klbQR sYgdZknmpIvkzyqnhxrr9goZPBIbaR8eps5QhJ/Zn5wYB2NJ97hLJZw4yL9vT7F3Sw0e Rb8cEKQoZGqxHRiON32nv9Rq8PiwQRYvvG9EV2n0yjTDzukHlzlxC8Zd/kqqfNdTxHjD UFyUUOlb7u1ikfSRLjWPh4j3M//d4sLB2nzLF5o0yK2vJOHFkZhFjEUINs94yPlH1HyE bZZud5/3hUeZkhEPwpVP7m3493YgnBstwhIZ4p3I6TTeMx5DgjLyJo60Y80l4O6Qu+6i DEwA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=eakkFNKy7t4GwbxCUBYK4+sAqafABkBNrt4r/GkoucE=; b=jocDfM4S6ZKn0dJ8XsgoDA3g7MxgvnR2mBLTaeF8nwANeE+Ankv94Um7RznJMNhhS0 wVW8tnjss2cehdEXvQBhnSB6exL11z124pbDbZQxjc/xk/C15rG8YMRt80+ycyb/7hPv /KlcD+hjTIBb8fBEE0jC0nOMZr79+k3q54Z6OF35uetO8xaeXdoRPVuY4pLex/trMjAm 44l5pLyZf1GtOpPLHuadbSOq1Ormki3rDQgdlYwyBH4OCJoW/aYmE0AHy4ncM/3Rm0D3 vr2hf4E4gMKQzME407CDIUjpbBfdAhR/EtlIfKLTkBOm9GzUrsNtrZDnMjyzZmaF4VKB nAJA== X-Gm-Message-State: AKaTC00f5v8GoyZjkFkdvWf3NlwmL9WQiTuC3tojxYfwoFd9wmbdiqWiN+Nyuhuqj1o3Cg== X-Received: by 10.99.38.3 with SMTP id m3mr4985759pgm.113.1479906149636; Wed, 23 Nov 2016 05:02:29 -0800 (PST) Received: from roar.au.ibm.com (27-33-21-189.tpgi.com.au. [27.33.21.189]) by smtp.gmail.com with ESMTPSA id y73sm52880789pfa.68.2016.11.23.05.02.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 23 Nov 2016 05:02:29 -0800 (PST) From: Nicholas Piggin To: linuxppc-dev@lists.ozlabs.org Subject: [PATCH 1/3] powerpc/64e: convert cmpi to cmpwi in head_64.S Date: Thu, 24 Nov 2016 00:02:07 +1100 Message-Id: <20161123130209.1667-2-npiggin@gmail.com> X-Mailer: git-send-email 2.10.2 In-Reply-To: <20161123130209.1667-1-npiggin@gmail.com> References: <20161123130209.1667-1-npiggin@gmail.com> X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Nicholas Piggin , Alan Modra Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" From 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. In this case, cmpwi is called for, so this is just a build fix for new toolchians. Stable: v3.0 Cc: Segher Boessenkool Signed-off-by: Nicholas Piggin --- arch/powerpc/kernel/head_64.S | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/arch/powerpc/kernel/head_64.S b/arch/powerpc/kernel/head_64.S index 04c546e..1f7f908 100644 --- a/arch/powerpc/kernel/head_64.S +++ b/arch/powerpc/kernel/head_64.S @@ -214,9 +214,9 @@ booting_thread_hwid: */ _GLOBAL(book3e_start_thread) LOAD_REG_IMMEDIATE(r5, MSR_KERNEL) - cmpi 0, r3, 0 + cmpwi r3, 0 beq 10f - cmpi 0, r3, 1 + cmpwi r3, 1 beq 11f /* If the thread id is invalid, just exit. */ b 13f @@ -241,9 +241,9 @@ _GLOBAL(book3e_start_thread) * r3 = the thread physical id */ _GLOBAL(book3e_stop_thread) - cmpi 0, r3, 0 + cmpwi r3, 0 beq 10f - cmpi 0, r3, 1 + cmpwi r3, 1 beq 10f /* If the thread id is invalid, just exit. */ b 13f