Received: by 10.223.164.221 with SMTP id h29csp188904wrb; Tue, 31 Oct 2017 16:51:45 -0700 (PDT) X-Google-Smtp-Source: ABhQp+SDupBbIGj1CMXzr+xbS1nfGBR11/gm0oOfth8QvPHpHqtX0LJ2T0ztFEyPRiVXyZx8d1qh X-Received: by 10.99.55.77 with SMTP id g13mr3618005pgn.209.1509493905761; Tue, 31 Oct 2017 16:51:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1509493905; cv=none; d=google.com; s=arc-20160816; b=HOC62yZIKAtJB8ObsZANCxu9F1/pGoegf/mOkhvJpgmThO/TYdLtD6iTWPFR26z7Tg Sr841MPyGg+Y+9REzPXBcVkOa7s4OiqVnkSZY9T3CDWvJ71FDIBNZ4HA7Zvg7tRci1x/ 1DeeGBcIVZDOUYcbnYhmIuKzah1bTnYJp0meTPzqZA2aUTev3UgFxnJjLgo8VfxcOMYa 7+DY12SvGe5K1zVupz/jYzE1EIfmdH37gn9SwIqlxW4T+rQODt47LAE7mwnAGYkyb+il bDIuQmd3fr/I3pPzP/HnIY30UQM2b/DUpig3Nujkm7ime34++5mTJawcCY3O6yKp424v y3uw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=XKx/ZxPVYGoKQcXTya6o5H+GETMuwcDx3ZezQdjQ9SQ=; b=DPUjct9t5WLYBc7+yXrKM0B6nVhoIOebYtsADxeQFbT4Q0H4HmXfyF1gFABMyRtr5A Ks1RZZ4AxxMADuJ0/NZEt61MMzPUcEncfUg9FoGAMXEZcRj1PCMS8VsWOalPqDuPtSs8 8SsEbDoG0DBCROBQs/xzx8Zoag0vP78AzpjDh+y0r7qyRoWyWxNm08iCiT8Tkwq9ny38 89/tWJbMQS1hzCk1JqKQH3aX120Ao615Jp9PnWq1AH17lDzjYJqYOjllsw8ghGPBg4eJ 16gFp99KsNooheISLnuXEEcSTW9z9pHLdYnmDW5SrvOSgAWIAIuFKJU/oR4UO4ocfmLe TKVw== 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 r26si2921849pfg.11.2017.10.31.16.51.32; Tue, 31 Oct 2017 16:51: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 S932833AbdJaXtZ (ORCPT + 99 others); Tue, 31 Oct 2017 19:49:25 -0400 Received: from 19pmail.ess.barracuda.com ([64.235.150.245]:46151 "EHLO 19pmail.ess.barracuda.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752859AbdJaXtY (ORCPT ); Tue, 31 Oct 2017 19:49:24 -0400 Received: from MIPSMAIL01.mipstec.com (mailrelay.mips.com [12.201.5.28]) by mx29.ess.sfj.cudaops.com (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NO); Tue, 31 Oct 2017 23:48:58 +0000 Received: from localhost (192.168.154.110) by MIPSMAIL01.mipstec.com (10.20.43.31) with Microsoft SMTP Server (TLS) id 14.3.361.1; Tue, 31 Oct 2017 16:48:07 -0700 Date: Tue, 31 Oct 2017 23:48:53 +0000 From: James Hogan To: Corey Minyard CC: Matt Redfearn , Ralf Baechle , Matthew Fortune , , , "Jason A. Donenfeld" , Paul Burton Subject: Re: [PATCH] MIPS: Fix exception entry when CONFIG_EVA enabled Message-ID: <20171031234853.GD15260@jhogan-linux> References: <1507712360-20657-1-git-send-email-matt.redfearn@mips.com> <605f6a96-a843-085c-efc6-a2c0f2afd84a@mvista.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="ABTtc+pdwF7KHXCz" Content-Disposition: inline In-Reply-To: <605f6a96-a843-085c-efc6-a2c0f2afd84a@mvista.com> User-Agent: Mutt/1.7.2 (2016-11-26) X-Originating-IP: [192.168.154.110] X-BESS-ID: 1509493723-637139-14738-368075-4 X-BESS-VER: 2017.12-r1710252241 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.186465 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 --ABTtc+pdwF7KHXCz Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Oct 11, 2017 at 08:12:31AM -0500, Corey Minyard wrote: > On 10/11/2017 03:59 AM, Matt Redfearn wrote: > > Commit 9fef68686317b ("MIPS: Make SAVE_SOME more standard") made several > > changes to the order in which registers are saved in the SAVE_SOME > > macro, used by exception handlers to save the processor state. In > > particular, it removed the > > move k1, sp > > in the delay slot of the branch testing if the processor is already in > > kernel mode. This is replaced later in the macro by a > > move k0, sp > > When CONFIG_EVA is disabled, this instruction actually appears in the > > delay slot of the branch. However, when CONFIG_EVA is enabled, instead > > the RPS workaround of > > MFC0 k0, CP0_ENTRYHI > > appears in the delay slot. This results in k0 not containing the stack > > pointer, but some unrelated value, which is then saved to the kernel > > stack. On exit from the exception, this bogus value is restored to the > > stack pointer, resulting in an OOPS. > > > > Fix this by moving the save of SP in k0 explicitly in the delay slot of > > the branch, outside of the CONFIG_EVA section, restoring the expected > > instruction ordering when CONFIG_EVA is active. > > > > Fixes: 9fef68686317b ("MIPS: Make SAVE_SOME more standard") > > Signed-off-by: Matt Redfearn > > Reported-by: Vladimir Kondratiev >=20 > I looked this over pretty carefully and it looks correct to me.=C2=A0 It= =20 > makes no difference > in the instructions generated by the non-EVA case.=C2=A0 I shouldn't have= =20 > missed this :(. >=20 > Reviewed-by: Corey Minyard Yeh, having stared at it for a little while it looks correct to me too. Reviewed-by: James Hogan Cheers James --ABTtc+pdwF7KHXCz Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEd80NauSabkiESfLYbAtpk944dnoFAln5C90ACgkQbAtpk944 dnoa+g//bueyNffOEKJETzj+ErDTSSO0WpbJRJKK0AfKoct54YFUbr37ErVGUb/L MkMtgyfqdm4uutAhCp90Jn70ZOEAlheb2MjbnHvp5oNJ7PgohJkzocc3x5xA2B3F YbuIaTmfUa1W93h3+YSmE0DYYN7uas+j6AFoGf9Q6KryRoKbrHwnxEy8vhLJGFvd 7szraNYk37S/nKTASAQmznNrAkjWeAbJ5qSvzPh0Ll3WDPGMPq6tAs+WoZrS1pmr 23GLs+Jc8y2LLlMFjRiid1majATC9kcljlXSC8diq9b8TopPRhRx2ciuiaLeK2P9 IkriDqu/313ADgi9/3UdJK/UBwz4nYbwo9z++Xv8DQzSH4RwDm/UDr9cJK1xBJm7 kZ2s8/z2i5KFne9kqEOs1AjqhRWQtt4P6AnDY3b75/109wQB6zk2m3RtezB8DBP3 qOhrCecCnnyk6RrenuQm9yXYAnH83GVVWUmN7z0mtAaeNZCcDFZckvGILM8evRvI A66/xSg3ACmOJbKS1XCtXwmKoLDdieKstmZCWSFmBXNHmzye4343RG6dZeWD3FvD hhaKWoTKl3VpKoyA3trnCulPhTrX6heuIJF+Jyah+0sZjOiCtlFDQN8J58k755XY mgb2xe9jiUw+qU6v4GMQ6Fuw3fh/PxLsTUAc7XZYFfI58HxB+0g= =/GEg -----END PGP SIGNATURE----- --ABTtc+pdwF7KHXCz-- From 1581618262558997178@xxx Wed Oct 18 17:45:15 +0000 2017 X-GM-THRID: 1580951206118155742 X-Gmail-Labels: Inbox,Category Forums