Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp1214594imm; Tue, 2 Oct 2018 04:50:56 -0700 (PDT) X-Google-Smtp-Source: ACcGV61sAKT9Z3RS/8maIdx0UOReHDLGVU9i55aLA2Zd7lOk7LgvKlQs/Lz8T1zcK+CeXlHm1zOZ X-Received: by 2002:a17:902:9a98:: with SMTP id w24-v6mr16630369plp.109.1538481056370; Tue, 02 Oct 2018 04:50:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538481056; cv=none; d=google.com; s=arc-20160816; b=aAnrJsGq9BMUxLf0CsdvqaS5ICqpAiX4ecLzQl9mhhE2Dng6kSxobaMRzs9IGmve3Z N4xGFE0/Qn2bD931zufECKBlqi4fMwj64EaNQ98Dv4SCd90vSj5KwtNthdYOLVa5ZxEE FRv4zhDHAuqQcO/FgpZdMUFQaL75nM+g54WcACJrpaL1+oHlW1p7DcYY9HTaLZQPnmG4 bM+A8/vqN+FKirr/vFW2FIvsVukvErllGnIs0FBDALnx729XaZ7iiu2X3s2pWxum0gVb Dv8AzpsGOHiCSZWRIg+kYxMgTZ3NJMuV/yqUZFrYDBDS0IxMErWvcP97Vcbv9gtgdd/B qcEg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date; bh=2AM/BNnMT36QZmAop6T/n9lq9QL7amIDe4m8FHhR46Q=; b=0C3IE15OtG/DMk3Toe85socMwIgcLbg4QRb7b9HC4dUwRvnadsJS+/kaqksQ2tIv4s H6oCOIeePSm1AWZnyaMLnXnuma2tQi7ZnFAFa0vQTTo3gkXZxXP94+9SkSRbpNzBpPHS ivb+MjXW4vimm9axgTKr8Nx1GPl1OQUGqpfEmZ6a8rOnjOq48l109DQN7RQ9iu+OM7Q0 upx/WRl3fFAQmDylFPYDMiiG1w1dQHA4PNogJmoj9Q/+wY29zqFdoIuOWIioSJawOWGG SvL1J6t9xCqpRZY+taPX5Q0KQeu0G8vVgDm6KiyTsiWemGLbxc9ukHBLaevFCwFXvzzF QjAg== 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 20-v6si9964620pfk.287.2018.10.02.04.50.41; Tue, 02 Oct 2018 04:50:56 -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 S1727645AbeJBSdI (ORCPT + 99 others); Tue, 2 Oct 2018 14:33:08 -0400 Received: from eddie.linux-mips.org ([148.251.95.138]:36828 "EHLO cvs.linux-mips.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727434AbeJBSdI (ORCPT ); Tue, 2 Oct 2018 14:33:08 -0400 Received: (from localhost user: 'macro', uid#1010) by eddie.linux-mips.org with ESMTP id S23994599AbeJBLuLnL3lM (ORCPT + 1 other); Tue, 2 Oct 2018 13:50:11 +0200 Date: Tue, 2 Oct 2018 12:50:11 +0100 (BST) From: "Maciej W. Rozycki" To: Ralf Baechle , Paul Burton cc: linux-mips@linux-mips.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org Subject: [PATCH 1/2] MIPS: memset: Fix CPU_DADDI_WORKAROUNDS `small_fixup' regression In-Reply-To: Message-ID: References: User-Agent: Alpine 2.21 (LFD 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Fix a commit 8a8158c85e1e ("MIPS: memset.S: EVA & fault support for small_memset") regression and remove assembly warnings: arch/mips/lib/memset.S: Assembler messages: arch/mips/lib/memset.S:243: Warning: Macro instruction expanded into multiple instructions in a branch delay slot triggering with the CPU_DADDI_WORKAROUNDS option set and this code: PTR_SUBU a2, t1, a0 jr ra PTR_ADDIU a2, 1 This is because with that option in place the DADDIU instruction, which the PTR_ADDIU CPP macro expands to, becomes a GAS macro, which in turn expands to an LI/DADDU (or actually ADDIU/DADDU) sequence: 13c: 01a4302f dsubu a2,t1,a0 140: 03e00008 jr ra 144: 24010001 li at,1 148: 00c1302d daddu a2,a2,at ... Correct this by switching off the `noreorder' assembly mode and letting GAS schedule this jump's delay slot, as there is nothing special about it that would require manual scheduling. With this change in place correct code is produced: 13c: 01a4302f dsubu a2,t1,a0 140: 24010001 li at,1 144: 03e00008 jr ra 148: 00c1302d daddu a2,a2,at ... Signed-off-by: Maciej W. Rozycki Fixes: 8a8158c85e1e ("MIPS: memset.S: EVA & fault support for small_memset") Cc: stable@vger.kernel.org # 4.17+ --- arch/mips/lib/memset.S | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) linux-mips-memset-jr-ra-nodaddi-fix.patch Index: linux-20180930-3maxp-defconfig/arch/mips/lib/memset.S =================================================================== --- linux-20180930-3maxp-defconfig.orig/arch/mips/lib/memset.S +++ linux-20180930-3maxp-defconfig/arch/mips/lib/memset.S @@ -280,9 +280,11 @@ * unset_bytes = end_addr - current_addr + 1 * a2 = t1 - a0 + 1 */ + .set reorder PTR_SUBU a2, t1, a0 + PTR_ADDIU a2, 1 jr ra - PTR_ADDIU a2, 1 + .set noreorder .endm