From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757771AbcBDOcV (ORCPT ); Thu, 4 Feb 2016 09:32:21 -0500 Received: from mailapp01.imgtec.com ([195.59.15.196]:47060 "EHLO mailapp01.imgtec.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755316AbcBDOcT (ORCPT ); Thu, 4 Feb 2016 09:32:19 -0500 From: Paul Burton To: CC: Paul Burton , , James Hogan , Markos Chandras , Ralf Baechle Subject: [PATCH] MIPS: Stop using dla in 32 bit kernels Date: Thu, 4 Feb 2016 14:31:57 +0000 Message-ID: <1454596317-5042-1-git-send-email-paul.burton@imgtec.com> X-Mailer: git-send-email 2.7.0 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.100.200.26] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The instruction_hazard macro made use of the dla pseudo-instruction even for 32 bit kernels. Although it surrounded that use with ".set mips64rX" that isn't sufficient to avoid warnings when built with -mabi=32, as CONFIG_32BIT=y kernels are: CC arch/mips/mm/c-r4k.o {standard input}: Assembler messages: {standard input}:4105: Warning: dla used to load 32-bit register; recommend using la instead {standard input}:4129: Warning: dla used to load 32-bit register; recommend using la instead Avoid this by instead making use of the PTR_LA macro which defines the appropriate variant of the "la" instruction to use. Tested with Codescape GNU Tools 2015.06-05 for MIPS IMG Linux, which includes binutils 2.24.90 & gcc 4.9.2. Signed-off-by: Paul Burton --- arch/mips/include/asm/hazards.h | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/arch/mips/include/asm/hazards.h b/arch/mips/include/asm/hazards.h index 7b99efd..ffe2aaa 100644 --- a/arch/mips/include/asm/hazards.h +++ b/arch/mips/include/asm/hazards.h @@ -11,6 +11,7 @@ #define _ASM_HAZARDS_H #include +#include #include #define ___ssnop \ @@ -54,22 +55,16 @@ /* * gcc has a tradition of misscompiling the previous construct using the - * address of a label as argument to inline assembler. Gas otoh has the - * annoying difference between la and dla which are only usable for 32-bit - * rsp. 64-bit code, so can't be used without conditional compilation. - * The alterantive is switching the assembler to 64-bit code which happens - * to work right even for 32-bit code ... + * address of a label as argument to inline assembler. */ #define instruction_hazard() \ do { \ unsigned long tmp; \ \ __asm__ __volatile__( \ - " .set "MIPS_ISA_LEVEL" \n" \ - " dla %0, 1f \n" \ - " jr.hb %0 \n" \ - " .set mips0 \n" \ - "1: \n" \ + __stringify(PTR_LA) " %0, 1f\n\t" \ + "jr.hb %0\n\t" \ + "1:" \ : "=r" (tmp)); \ } while (0) -- 2.7.0