Received: by 10.192.165.156 with SMTP id m28csp199369imm; Tue, 17 Apr 2018 08:42:45 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/eHKizWox36LZg3uKDwiz69Pz4Zt6FNFEAj4FTu0OinKiVXB7z9Upmox9vl60kqcX2iqKo X-Received: by 10.167.128.71 with SMTP id y7mr2457171pfm.12.1523979765375; Tue, 17 Apr 2018 08:42:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523979765; cv=none; d=google.com; s=arc-20160816; b=1IBygiipoawZPk4ZBZCBleEu2ZBSsATg7ilt+gVnc7lEiAlMQTwI3ULuMJf5Xtvhas W/q6tcILZjqK3g4UjeLbqQ5i5anjTMHsS8GTNfJa2QcqCa8n0JRxYVoIJRIsmTuPB272 F3ApxC092aEI8XNrII8NUyWQBlgZD74yTCE7qdkOmuWlI+vSVChjIGtkQEFouoEOtaqY g4F+bl7bZCSDucpuTgw00u6PWv9uQwQqIiIaGu02uY69JwuTO/1bK6snjUNpD5Xsj/8y GJd75n5mHsoGBhbcwmCm0kAxkrR4QvyHGjNBvJB3/ZXir5YHiikN47Pc1D7CX/igtZCR Xo4A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:arc-authentication-results; bh=vmcb480exWK5RTC/EZ5jVXinJJF6sspmVUxkQNMyC7I=; b=N0IhKUqOY8D5DerapNgxsqc9n0IFaSmbiFwTIMJ45wFYH8SqUDHn2A4aNXVP4yMGfI 3dClGfPQMJRe/YQgTLyYkcklZnELVEbbDhNGJisarKm/3Jj+f9WBHztAIfkqd5RqbB1R VfDq2W0bm6LOQYM0qpIxEOSRGU+o5J1Bu2UeCc7Z/LZ26Re++a9M7ehhiP6TYyM9vOY1 2P448wMzm0qpVD18hXXhoaQb/1LUdcFdx3b4Wn/65jYYV9TZo3lEcBEZQbLdckbMWbqx SnyHLzQLnaTf+FtbPTk6kLIODmQAHz1eoyYVRuV3URyfYoGqxoTx4VRG4gLw73QFdng4 H8NA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z12si5257319pgv.226.2018.04.17.08.42.31; Tue, 17 Apr 2018 08:42:45 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752769AbeDQPlD (ORCPT + 99 others); Tue, 17 Apr 2018 11:41:03 -0400 Received: from 9pmail.ess.barracuda.com ([64.235.150.224]:41722 "EHLO 9pmail.ess.barracuda.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752619AbeDQPlB (ORCPT ); Tue, 17 Apr 2018 11:41:01 -0400 Received: from MIPSMAIL01.mipstec.com (mailrelay.mips.com [12.201.5.28]) by mx30.ess.sfj.cudaops.com (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NO); Tue, 17 Apr 2018 15:40:14 +0000 Received: from mredfearn-linux.mipstec.com (192.168.155.41) by MIPSMAIL01.mipstec.com (10.20.43.31) with Microsoft SMTP Server (TLS) id 14.3.361.1; Tue, 17 Apr 2018 08:40:31 -0700 From: Matt Redfearn To: James Hogan , Ralf Baechle CC: , Matt Redfearn , , , Al Viro Subject: [PATCH v2 2/4] MIPS: uaccess: Add micromips clobbers to bzero invocation Date: Tue, 17 Apr 2018 16:40:01 +0100 Message-ID: <1523979603-492-2-git-send-email-matt.redfearn@mips.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1523979603-492-1-git-send-email-matt.redfearn@mips.com> References: <1523979603-492-1-git-send-email-matt.redfearn@mips.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [192.168.155.41] X-BESS-ID: 1523979613-637140-28836-247121-1 X-BESS-VER: 2018.4-r1804121647 X-BESS-Apparent-Source-IP: 12.201.5.28 X-BESS-Outbound-Spam-Score: 0.00 X-BESS-Outbound-Spam-Report: Code version 3.2, rules version 3.2.2.192083 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------- 0.00 BSF_BESS_OUTBOUND META: BESS Outbound X-BESS-Outbound-Spam-Status: SCORE=0.00 using account:ESS59374 scores of KILL_LEVEL=7.0 tests=BSF_BESS_OUTBOUND X-BESS-BRTS-Status: 1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The micromips implementation of bzero additionally clobbers registers t7 & t8. Specify this in the clobbers list when invoking bzero. Reported-by: James Hogan Fixes: 26c5e07d1478 ("MIPS: microMIPS: Optimise 'memset' core library function.") Cc: stable@vger.kernel.org Signed-off-by: Matt Redfearn --- Changes in v2: None arch/mips/include/asm/uaccess.h | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/arch/mips/include/asm/uaccess.h b/arch/mips/include/asm/uaccess.h index b71306947290..06629011a434 100644 --- a/arch/mips/include/asm/uaccess.h +++ b/arch/mips/include/asm/uaccess.h @@ -654,6 +654,13 @@ __clear_user(void __user *addr, __kernel_size_t size) { __kernel_size_t res; +#ifdef CONFIG_CPU_MICROMIPS +/* micromips memset / bzero also clobbers t7 & t8 */ +#define bzero_clobbers "$4", "$5", "$6", __UA_t0, __UA_t1, "$15", "$24", "$31" +#else +#define bzero_clobbers "$4", "$5", "$6", __UA_t0, __UA_t1, "$31" +#endif /* CONFIG_CPU_MICROMIPS */ + if (eva_kernel_access()) { __asm__ __volatile__( "move\t$4, %1\n\t" @@ -663,7 +670,7 @@ __clear_user(void __user *addr, __kernel_size_t size) "move\t%0, $6" : "=r" (res) : "r" (addr), "r" (size) - : "$4", "$5", "$6", __UA_t0, __UA_t1, "$31"); + : bzero_clobbers); } else { might_fault(); __asm__ __volatile__( @@ -674,7 +681,7 @@ __clear_user(void __user *addr, __kernel_size_t size) "move\t%0, $6" : "=r" (res) : "r" (addr), "r" (size) - : "$4", "$5", "$6", __UA_t0, __UA_t1, "$31"); + : bzero_clobbers); } return res; -- 2.7.4