From patchwork Fri Feb 2 12:30:27 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiaxun Yang X-Patchwork-Id: 195846 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:9bc1:b0:106:209c:c626 with SMTP id op1csp395459dyc; Fri, 2 Feb 2024 04:37:15 -0800 (PST) X-Google-Smtp-Source: AGHT+IG0snj41qbnOUhVBEHmD8sRudmKtKPEe7CHWNnLvKXyiwBd3kIDtJQq51s+z/1ZJandg3BN X-Received: by 2002:a17:90a:528a:b0:295:d223:ad11 with SMTP id w10-20020a17090a528a00b00295d223ad11mr7405644pjh.36.1706877434806; Fri, 02 Feb 2024 04:37:14 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706877434; cv=pass; d=google.com; s=arc-20160816; b=B58tRitFKlm53TaaEE//QV8OTCp8Bo6Dj+bRPNnVbfc8Zwst+o33U8VtSeVdX3eAFr q+uwWTYM6Kp9t3AI458p/7GtRJrXvL8VuvJ3MQgCfL1KoEQAelug4pKxiMzjdrBhHBYj 7tzbijqrBKNuFrwtyIK5pXMNVD4S3d2Tenl69fjHloZlsnULibyPOXwtUVHKT0+uTVfo EmJwHe1Qc5d+4xiMnS1jVOGDtaiaUSvKv8pwLQW93Wwrv7wnEaiAciSbjkSdTILOF1ot 25On8s/0+G7usHiavRSyBwoiNFES83Cdi1fOQtbswnPBzftoeE+/IttZAPRhaEN/gQ9R rSWw== 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=ZN7jK2UX0ftnYkhO0oYtkAaBih5uPEeWijKjGgdRuuQ=; b=lKUpPDbuugxFE/jBS/KzHV/eESKnkPEJVjvj4WQQYm5tOOh3G/mDOIov8xnmxMnn78 mOyhpaB8xXIgc3kfy9crLkTq98W3xN+95rNn/mJ6c/d1FIOZrv9Le3mKw2qKQHldUhO7 t8ClUFyoRK2SsMR2cgzmuP9TB/6eiLtShPOxikqePNTo49aVqwIoN9d88ruf01w/JJFi R44VEzGzB+uy1d8trK1gWn1aqol9gPNELFmKsgYWq897VA1ew0RfsC1/s+nTF0bYh6gy ls2idmylfXyAY4E1tsW02+A5Q5zRiD2+BU1NPy9Jj/AecpeK9HJlwC49MPcYAcu4SeAG zIkA==; 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-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-49841-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=flygoat.com X-Forwarded-Encrypted: i=1; AJvYcCWlikzz7lQS2r/eUOXZFTTzof5NpFWs/kJVwEIpFcFzFlfMqFAAaErkvrgevsHRE6PwsA1csNutjUYP8+7bFIiKYPjPqQ== Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id ns21-20020a17090b251500b00295f2e592ddsi1634962pjb.69.2024.02.02.04.37.14 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Feb 2024 04:37:14 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-49841-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; 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-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-49841-ouuuleilei=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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 705CF296A54 for ; Fri, 2 Feb 2024 12:31:48 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 506F91468E7; Fri, 2 Feb 2024 12:30:46 +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 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 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1789790712661770591 X-GMAIL-MSGID: 1789790712661770591 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 */