From patchwork Thu Feb 1 15:46:28 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiaxun Yang X-Patchwork-Id: 13541302 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6DD92C4828F for ; Thu, 1 Feb 2024 15:46:40 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 1FC736B0089; Thu, 1 Feb 2024 10:46:38 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 185716B008C; Thu, 1 Feb 2024 10:46:38 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id F19506B0092; Thu, 1 Feb 2024 10:46:37 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id DE1E76B0089 for ; Thu, 1 Feb 2024 10:46:37 -0500 (EST) Received: from smtpin26.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id A4798160E6B for ; Thu, 1 Feb 2024 15:46:37 +0000 (UTC) X-FDA: 81743662434.26.F7BEB8F Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com [66.111.4.25]) by imf06.hostedemail.com (Postfix) with ESMTP id 6C14B180017 for ; Thu, 1 Feb 2024 15:46:35 +0000 (UTC) Authentication-Results: imf06.hostedemail.com; dkim=pass header.d=flygoat.com header.s=fm1 header.b=OcTC9QfL; dkim=pass header.d=messagingengine.com header.s=fm3 header.b="u NT7zrO"; dmarc=pass (policy=none) header.from=flygoat.com; spf=pass (imf06.hostedemail.com: domain of jiaxun.yang@flygoat.com designates 66.111.4.25 as permitted sender) smtp.mailfrom=jiaxun.yang@flygoat.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1706802395; a=rsa-sha256; cv=none; b=hilpUSkbRdOgolrMO1r7OQzGvUxingaznTmoqpvmGAT7zWugiE8kZnY1jhpeTNzF25YbAD 4nVSOEtFRBR8l7IKx4qo9guKbbPgPYdPaV+HMTGFAeBjKgOYGiHS86/80J1oTYi5fTXOAt LbgsU7tqyeOcxQeBFyJs3qW+PW+Oafk= ARC-Authentication-Results: i=1; imf06.hostedemail.com; dkim=pass header.d=flygoat.com header.s=fm1 header.b=OcTC9QfL; dkim=pass header.d=messagingengine.com header.s=fm3 header.b="u NT7zrO"; dmarc=pass (policy=none) header.from=flygoat.com; spf=pass (imf06.hostedemail.com: domain of jiaxun.yang@flygoat.com designates 66.111.4.25 as permitted sender) smtp.mailfrom=jiaxun.yang@flygoat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1706802395; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=i1v7gjbWYtUmewWLy9Kvlb4tyH5uqfyNj8gU9rtRY70=; b=q5rKYgqD9/ne2o5DODEAI6zYtb5zstyEqbZKFIFJUpD3MzvmXrbHSOiOoJr2kwck4TrSig VcrvW+ULccktSjeJPoazWXBLHn0BeHJ2pog4Q9oST5R21+R+4DPMgQnfcVyviOxronzz3a 0/xar3BMWloXwGwObbUXnhtZk9iQK6A= Received: from compute7.internal (compute7.nyi.internal [10.202.2.48]) by mailout.nyi.internal (Postfix) with ESMTP id C35AC5C0080; Thu, 1 Feb 2024 10:46:34 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute7.internal (MEProxy); Thu, 01 Feb 2024 10:46:34 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=flygoat.com; h= cc:cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm1; t=1706802394; x=1706888794; bh=i1v7gjbWYtUmewWLy9Kvlb4tyH5uqfyNj8gU9rtRY70=; b= OcTC9QfL162gZptSWEDjPWdZnEazNy9ME14ocM4u4Hqg32ZxHXv86zGSpg1ANxrp y85+SHbIXplcptG1iu9QbpHDlIeWxrmmNxDtRWQRjB+GrMNAXbg0gjdoyiRkzveT RbPTIm1lL940KAuRgcszRYHYUjqyGaeWna6/r4ikauCbuoxp9SZueRiDIsUfUTbQ lLFeaRdYgU+Iful3+CVSJnsV+NbWTarlf/iXjvb66r48+k+fLozytYBianvvo6wf WS/vAa3CAsR+79V2NZvjF/LS1Gzt7DlyZZxQzBe+e+yuZKWGY1CKyNnRRwLbi3u5 QQB9Iw/7y92B4ZcU+gLr1A== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t=1706802394; x= 1706888794; bh=i1v7gjbWYtUmewWLy9Kvlb4tyH5uqfyNj8gU9rtRY70=; b=u NT7zrODxo1yyqBsfvZZE8jEgzkBEg4zm7mB0qJkNoo+cH7BOocaIMy8zJZoRIOhH 46YaWAexAN5A0SHU+Rfm3Ga+RIGesj+AvHsz0inE1ZD5zknUM5MiLnoiUKSo8hYW TSlSu33ESAm+VxKElQ7IBNKmzEtc526+wJgLUTACSRkGAgBoHG6zOgl0ejytcCzH XliM963BvsNuxXClnE1HOhNEuI7kq+NkGrTIcqD4pUBTuoKnr/481Z8m2mTTRrYD sbr9mvEU3osslGFafQqC+ckc6J64sgiPUeGYa6SkOzJAs13dXdKKbe3cxijujbUC dvaqenrCgk/Gub5tGP4wA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrfeduuddgjeeiucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephfffufggtgfgkfhfjgfvvefosehtjeertdertdejnecuhfhrohhmpeflihgr gihunhcujggrnhhguceojhhirgiguhhnrdihrghnghesfhhlhihgohgrthdrtghomheqne cuggftrfgrthhtvghrnhepvdekiefhfeevkeeuveetfeelffekgedugefhtdduudeghfeu veegffegudekjeelnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilh hfrhhomhepjhhirgiguhhnrdihrghnghesfhhlhihgohgrthdrtghomh X-ME-Proxy: Feedback-ID: ifd894703:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 1 Feb 2024 10:46:33 -0500 (EST) From: Jiaxun Yang Date: Thu, 01 Feb 2024 15:46:28 +0000 Subject: [PATCH 2/3] MIPS: Clear Cause.BD in instruction_pointer_set MIME-Version: 1.0 Message-Id: <20240201-exception_ip-v1-2-aa26ab3ee0b5@flygoat.com> References: <20240201-exception_ip-v1-0-aa26ab3ee0b5@flygoat.com> In-Reply-To: <20240201-exception_ip-v1-0-aa26ab3ee0b5@flygoat.com> To: Oleg Nesterov , Thomas Bogendoerfer , Andrew Morton , Ben Hutchings Cc: linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mips@vger.kernel.org, linux-mm@kvack.org, Jiaxun Yang X-Mailer: b4 0.12.4 X-Developer-Signature: v=1; a=openpgp-sha256; l=860; i=jiaxun.yang@flygoat.com; h=from:subject:message-id; bh=NiHFyPPrD5sK3tKmsstYY6GfrHgdKmJEsdk12grutnA=; b=owGbwMvMwCXmXMhTe71c8zDjabUkhtTde64yuL1SSV4UOF9DePOkzgsnGSd6LJDLjxSMtNtSb F0aeTKso5SFQYyLQVZMkSVEQKlvQ+PFBdcfZP2BmcPKBDaEi1MAJmIdxMjwTTn6ttlZ/av+3xp3 Pe7ZFsP1s/eGc6bPToN79bsYuU7OY2Q45vFTKG7j7El89pddzOYxbdN/9LVUT2PVZknNzeInBAo 4AA== X-Developer-Key: i=jiaxun.yang@flygoat.com; a=openpgp; fpr=980379BEFEBFBF477EA04EF9C111949073FC0F67 X-Rspam-User: X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: 6C14B180017 X-Stat-Signature: b4jjihk9woasi3ityc6tjrzq6hyxk8xa X-HE-Tag: 1706802395-510846 X-HE-Meta: U2FsdGVkX18SAlnsvTpZsacyOaAcl2UxK7oH+QCJ2tZdrCWNBFrfXFnXyhkHW4VsMZLaz9+eXlQJeto6j6t1vymYJpI1eSasowKDR5rL4hIxFUTPso9pptx5UrzfEgG2YFEL3USM7uPmIJ6I6L6E8kWScyXIt9TyUUxpFZelVVKWYHm6bZXR9OfTqSNa6oja+xuY2XSUfxOb+I/SV1IBRhRX8SMpe94iP4yOJ2tpfCevCsUxRC8anaePWKNB/OG9AFbaPsJdowcbuQQ6hEoanx495yWwvlQNfI1i428YwSzGxKr3t4NTW1Jmt1V2BjsQH0chGmIAjYi6X6ZNq/mJ5PqrWwrDXMUDxd5FN4vpaJJ1PbCqPYe4ztqX8luqiLj/YQpkP/wO16muTaNRi9atYK7H2wrOlB+5pcXFvF/6xALnw5MW9Rp791bZykbKLSriOASNIH20AyR6AG67Z456NqPQl421U9NVT3YQB2TNe8LgTqo1bQqG20RBznNgY0Kpg/pzDUCNcvNf8tGpUnkj07dOrNnBVflhkP4L/O+sZ9ZQ31ARNHbHm9xXWAkCv4nABIjQQhItfgDGQdjNwXLPplg53z4dQsKX/lMkTBPceEtsiM6QFnm0g7DdMOVFohkWPnL74zeeBPrYp/Rmie3GS9oSrJldF5zA+lgRxO7pq4ZnGxHs9dWa3q/ARYfGmQ2xua0ZJBgsEIUSdv8qGlYqBSW9PDJaO7Ss4sLwT3aIYtSq3tk0Odn5sRYFx2gzfSz9EztC+tu8cUokoMy0o1HvFuV/yRqHxRVhb8dIEPqmmptVI71KEz40CcPMcsDysELdMecreEa2+SeboVSNKLDZS1YW3R9LYLN4F3clcg9R7j4KEQCV7WDfxglYehYLRkhxWpcoOaMLaEls0ip+gyLf98ZiZX3maAFyuQ2GmkNPG/JWiGkzCixcllJtMx2rzUmaRhqE2lTFRChXwUgx8CP CuD/MtWK k/r3mM82gN6Qf/BUGudOyINl224jmoyYRVGt8e/MQlAR/+xMT42yAGePigcWSCva+3Ug9U1HZXVq52fDu5gvAZjQ47ifOm+T+ixJihFc+Q7b0yGvT0wHRBgvdb6IdG39ZlMh4tPK9yJVKw7PriRZzWOqAPsFc+0/whDqd+TfLjA+K27gl7/BvX4TegdrhJkD8OR9XGf1sfRCGa8HN3LzMAM0mYX/Vxd+Jwy9ZFKSMC+KTXjkmteR6hY0/Tu4GlBSDP8wwsCAf4v9vOTc1rSAVXKJWmvWmTig0WRJRCs/6WZBOfE6hmYP6uFIyDcu5pySAIzZNlH18jwftveciKPXbK6mXgWKRz67oJXWFpNxbdOUvKjoazNu54F3t4Q== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: Clear Cause.BD after we use instruction_pointer_set to override EPC. This can prevent exception_epc check against instruction code at new return address. It won't be considered as "in delay slot" after epc being overridden anyway. Signed-off-by: Jiaxun Yang --- arch/mips/include/asm/ptrace.h | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/mips/include/asm/ptrace.h b/arch/mips/include/asm/ptrace.h index 97589731fd40..845508008e90 100644 --- a/arch/mips/include/asm/ptrace.h +++ b/arch/mips/include/asm/ptrace.h @@ -60,6 +60,7 @@ static inline void instruction_pointer_set(struct pt_regs *regs, unsigned long val) { regs->cp0_epc = val; + regs->cp0_cause &= ~CAUSEF_BD; } /* Query offset/name of register from its name/offset */