Received: by 2002:a05:7412:bbc7:b0:fc:a2b0:25d7 with SMTP id kh7csp795995rdb; Fri, 2 Feb 2024 04:31:33 -0800 (PST) X-Google-Smtp-Source: AGHT+IHDlwk7iCmouBduLlmOGg4QcW0Og4L5q/VB3dFNizMyHBQpYNUu1nnwifdibBNU3XJNtUwq X-Received: by 2002:aa7:d5c6:0:b0:55e:dcdf:50b0 with SMTP id d6-20020aa7d5c6000000b0055edcdf50b0mr5258449eds.15.1706877093217; Fri, 02 Feb 2024 04:31:33 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706877093; cv=pass; d=google.com; s=arc-20160816; b=BPmQe1dhBff9SSfuSzlGlH2sveetKhwuBuaMZiqyTxMJY5RidfhwY1iAO3e6yXn3TC sqJYptYUx7s96EFQatKud/+hKv9kaOOU9iaaRr0ywU7FRfDCRp0NpAYp8eq96dT8uxuW MHHHDB/ZTEHTFiY+NYdAKZ68W4svHD6zy3PfOli4qGQPi6I8a9WnevRIIp+7wrI3VkHB rzEEfvVwD49WGDaHRQOw/zGfERi4EkTjQzDj90tN3V1BcBS8VdwjrZwHPJ1dpaQt0BnH mWt4vETEHN6EuiyQITrMG0HTkq8bbv4pOh53OA3gruTVObhAi02hAJ00ERnD2tCHH6ar QS8g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :subject:date:from:feedback-id:dkim-signature:dkim-signature; bh=w2r17fGseyKoUkYg1Q+CG1Kwf5xRgoFxjWp3QiPCMOY=; fh=wkfTjVtWdhG8j1q7Se5/B+OZQzGJzL1qXJZDOeNGTkA=; b=qFT5jGKOTPz64za5cIGMa/w6RJWE8oDS61KXeBPChRM/xmaDEY1Fu6T1gZ77rpiekD K+mGFigyCx+m61a0yunzCOW6pUAaHOqNsut2Rlkqx2EfI95wdUgdWzAqv57B0RxLqdcS 8pCUWx8LX6mLkdz7CYvhZ+kRsFe3EZPVUc0Sut2g2rFodhXk1sgFx14HmUAsfGxSvwAz 8sivSOQTV0U9ANc21vRN3KEdyOA/U8i1MUfb9/eXkjYecCwZV7wKUCEwaraTNlmq1Duv hW3lZWW6HdIZIIrrZ3G9Yn6+9RcC1Pg1V5b8flgU12hKLVeqs6JC04Tcn4eRQbu8U80b KMgQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@flygoat.com header.s=fm1 header.b=KPCaY3+u; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=yPVF2ep6; arc=pass (i=1 spf=pass spfdomain=flygoat.com dkim=pass dkdomain=flygoat.com dkim=pass dkdomain=messagingengine.com dmarc=pass fromdomain=flygoat.com); spf=pass (google.com: domain of linux-kernel+bounces-49841-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-49841-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=flygoat.com X-Forwarded-Encrypted: i=1; AJvYcCW01BeDuPgeDWCX705Yd37Nmn1NPh2jGLpWTL44Rev165kqD+Znq6h4CN/J1/9KnrWbqGfk4mZX6yUJ9l4BghAFkxIQ/w6IYuwPe4XCXw== Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id v8-20020a50d588000000b0055d360393e4si786215edi.6.2024.02.02.04.31.33 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Feb 2024 04:31:33 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-49841-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@flygoat.com header.s=fm1 header.b=KPCaY3+u; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=yPVF2ep6; arc=pass (i=1 spf=pass spfdomain=flygoat.com dkim=pass dkdomain=flygoat.com dkim=pass dkdomain=messagingengine.com dmarc=pass fromdomain=flygoat.com); spf=pass (google.com: domain of linux-kernel+bounces-49841-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-49841-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=flygoat.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id C68A71F2257C for ; Fri, 2 Feb 2024 12:31:13 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C1C66145B03; Fri, 2 Feb 2024 12:30:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=flygoat.com header.i=@flygoat.com header.b="KPCaY3+u"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="yPVF2ep6" Received: from out4-smtp.messagingengine.com (out4-smtp.messagingengine.com [66.111.4.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0876E144624; Fri, 2 Feb 2024 12:30:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=66.111.4.28 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706877042; cv=none; b=QrR/p5Ii9vUhOem+mKTaAVGUWV7TcThpN/L3WQqkSPDC6xyVOKwb1w12e+J3ge+hOLB2asR0DS4IVyD7YjxwUO6HTd5gQcgfLPKla4TGu9Rq4PO2D2TC+mXY0c2dM7Xt24ceUKHuteCiWYQ4Go8uccoHVLBbNPtE1SYqZluKFfU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706877042; c=relaxed/simple; bh=eEckd5oJQ3BVb3TI50bExWCbMqs/5XPSjzMz9OXoNmg=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=uKRvbo9xfnaECIYJ0xjdS3yZMpX/Efrgw5sXqpTTrvvQOMveQylOfSbgW/p5GNIU6PzO/6ka9lh9d2pSVmk9QrpPG33l/R5blPEqMFvce1WxwBZLzs+GCIw6cOxeuRYmvjqmTfhDh3j8PCgVqIwG7M9rbTEHdlWo9uCpTPAvOUY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=flygoat.com; spf=pass smtp.mailfrom=flygoat.com; dkim=pass (2048-bit key) header.d=flygoat.com header.i=@flygoat.com header.b=KPCaY3+u; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=yPVF2ep6; arc=none smtp.client-ip=66.111.4.28 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=flygoat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flygoat.com Received: from compute6.internal (compute6.nyi.internal [10.202.2.47]) by mailout.nyi.internal (Postfix) with ESMTP id 00D0A5C00C0; Fri, 2 Feb 2024 07:30:38 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute6.internal (MEProxy); Fri, 02 Feb 2024 07:30:38 -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=1706877037; x=1706963437; bh=w2r17fGseyKoUkYg1Q+CG1Kwf5xRgoFxjWp3QiPCMOY=; b= KPCaY3+uIJ73xN9kmYWwqgB93DBfywxqEdTVF6jc120MMGM0qem41ii6ITXekWMz VBrSyQbOQFobNNMOYtJbqvUhxmtWSVWUogeU9JxxLmq05JvxZetbuaVM8hFwtZc7 B+dlZAVTfVuWDfXAy6QGqW6YSij16X4jDd73BiueETOXlSy2csX5Su4y+mBe6Zue FDZIj8Mk8xs4vvI5W7S86b8zCJauqXvPqpGTya19/yJvq6dKYZb1UvcYAbflthp9 2Su/6ZEeuTXPGiTorKVckNAGL24Jk3/kE/y84EUkHooM9TkQQjIHzagTBvRaad5M m2bsiZJgHM3sTlhiUx3AYg== 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=1706877037; x= 1706963437; bh=w2r17fGseyKoUkYg1Q+CG1Kwf5xRgoFxjWp3QiPCMOY=; b=y PVF2ep61M5MoWsoGtC6vryilWqWoSPCuYHTkRIUxkp2m+XgU2WglQGeTgqMRkWen z3n/xeXDSYWxohz/3+6PfCnngrXxukbjVlgRq/M3TbTRhIytfk3C52Q8reQIwY8Y LhlxM1J1GBRMp/5yY34id+Y/jJyXHDFlIlQBTxxvsK3b/y3sZ1oWp3d4a0ZCGQBd mhawXZ3huHsn/FEiDGAcrMNf/6j2mYVmMK5GbdhWDvMmIja2QU72CFCs32FpS54m c4y9+s/rCgzw3TAy1OwJ8QsuYM1UPwOcZ8zjmbL3cQNTtwI77TfFYR1dyB59Btly nIU18gB2KMbJuwqTFfCsg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrfedugedggedtucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephfffufggtgfgkfhfjgfvvefosehtjeertdertdejnecuhfhrohhmpeflihgr gihunhcujggrnhhguceojhhirgiguhhnrdihrghnghesfhhlhihgohgrthdrtghomheqne cuggftrfgrthhtvghrnhepvdekiefhfeevkeeuveetfeelffekgedugefhtdduudeghfeu veegffegudekjeelnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilh hfrhhomhepjhhirgiguhhnrdihrghnghesfhhlhihgohgrthdrtghomh X-ME-Proxy: Feedback-ID: ifd894703:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 2 Feb 2024 07:30:36 -0500 (EST) From: Jiaxun Yang Date: Fri, 02 Feb 2024 12:30:27 +0000 Subject: [PATCH v2 2/3] MIPS: Clear Cause.BD in instruction_pointer_set Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20240202-exception_ip-v2-2-e6894d5ce705@flygoat.com> References: <20240202-exception_ip-v2-0-e6894d5ce705@flygoat.com> In-Reply-To: <20240202-exception_ip-v2-0-e6894d5ce705@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=eEckd5oJQ3BVb3TI50bExWCbMqs/5XPSjzMz9OXoNmg=; b=owGbwMvMwCXmXMhTe71c8zDjabUkhtQ9D9KbxBb5s2avMMxZk/Fa1OTF/ICgHV78MjaFTJtvf f35OXBNRykLgxgXg6yYIkuIgFLfhsaLC64/yPoDM4eVCWQIAxenAEzE9Dsjwz6v/vdH3Fze1/99 FOW6+OMuxxvHUq8msNTf6zrBPE9PsIThr3h4jgr7uXVaRkt3sXl2P3nPWfRUcFd+muzkppu3Vhz /zQAA X-Developer-Key: i=jiaxun.yang@flygoat.com; a=openpgp; fpr=980379BEFEBFBF477EA04EF9C111949073FC0F67 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 701a233583c2..d14d0e37ad02 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 */ -- 2.43.0