Received: by 2002:a05:7412:bbc7:b0:fc:a2b0:25d7 with SMTP id kh7csp1824153rdb; Sun, 4 Feb 2024 03:03:33 -0800 (PST) X-Google-Smtp-Source: AGHT+IGbtFJEiSacmSFs3zbjiqKJLeikyN9z5zVfdg9Uqoa4hk3iCxvHZLHQn1fznkEYMjjXgZLU X-Received: by 2002:a05:6870:9691:b0:218:e9f0:b1b with SMTP id o17-20020a056870969100b00218e9f00b1bmr5174796oaq.49.1707044612681; Sun, 04 Feb 2024 03:03:32 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707044612; cv=pass; d=google.com; s=arc-20160816; b=A9824IBKDsPpETgPq5HjILTlKBQVcgzFnwmTYVwDMrUri2fd+NM6pOvW9OZGxzZBeg bgzSYsZlS+VEyejIXnUjUDL1Yzc+Zfcsn6Hy+MwLt/C87j6eljx89zfRAD/IJzKohhjF n1RKGKMDm0+VSnTy8CfOeWAV6TPbi3hZwGqCUT6MMdfTG5FD3KFm/WRi6q/mPV5uYm9t 4wwcFjyL4bX1Lhi8lg02/63zCS2/XhFbjT78RAuSdGkAxzYS/qx5i+DqvczODPn832e/ C3lTTA0tKF8h5UkQ6ozeUC7qVHiIV6dvm0p3pRlNDWbwHOqgYbBKY2juU+gOEFfJQh+D 0WGA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:autocrypt:from:references:cc :to:content-language:subject:user-agent:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:date:message-id :feedback-id:dkim-signature:dkim-signature; bh=Bf+fUOrYXcGEM/eDTspqcwbDeCrIad7HJCkL0vJjXLo=; fh=Ah7iedfGkVYMXRRhSZiPnG5FR2vemThRcET7tB+YNJ8=; b=GQOKzJN2AVy8A7z1ayzVp9nznQI4999BIg7AkPMu5FdySm+qq1Ute+rIrUX5D6POkv k6DQWXSU9puOcMxmrFz/tCBcvaaxn4ShTwTzRsIYqZhluPdXv2nCh9uci3R2X8Hh7N/2 rEe/8uWUHVKwNJEO0I7pO0uVluCZa9NCeVW229l6zUketuHeyhDqoYJxvlN508QrjdST vBlGRxXMkVhf43Jp9dh1fA1v3eBOjt7qBp6l5RY3VQnXn5/xq7WNfDwJ4vlO1JRheNqC cUNYEjnOgSK6B7P6yobaPEhGZ54n6zrt1AjabNsijKndTF+plRWDVE2yQYeH4gtMeieV h5FA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@flygoat.com header.s=fm1 header.b=klD336ts; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=JgyI4Lqb; 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-51596-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-51596-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; AJvYcCV5eHIts0qWX5fECa5JIYKCcHTa0ij927TlSxVGYYEYmfyrjg4QudVDAdWzBVp672Vfr2lpK1HfU+AYlFLxFTqIlFa85i27Blc601QFTg== Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id e15-20020ac8598f000000b0042c1acc6e56si1440499qte.287.2024.02.04.03.03.32 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 04 Feb 2024 03:03:32 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-51596-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@flygoat.com header.s=fm1 header.b=klD336ts; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=JgyI4Lqb; 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-51596-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-51596-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 5B4EB1C21695 for ; Sun, 4 Feb 2024 11:03:32 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A1DF72208A; Sun, 4 Feb 2024 11:03:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=flygoat.com header.i=@flygoat.com header.b="klD336ts"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="JgyI4Lqb" 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 4BFEA219EB; Sun, 4 Feb 2024 11:03:19 +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=1707044601; cv=none; b=ED+XEE1oSZvn/cIkevynK/AnlaNdcMqAprdoYtt+mHekOSopU3qvv2bJbuLs//cW6JGOLRgOGxu6ikDc06J2WnvCEgEOcassnUfpY7k9rkHBGU4Kmkwssz8AFh4Ed4a+w5R2GRse4nNtPQjOfwWX6sEpdt+sVj+xpVCA017dAcw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707044601; c=relaxed/simple; bh=Y2D//G+8jRO7QyOnjxy4nQr1hf6l/qJNHpnyOYklcGc=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=IsE/EXB7UJE2xGJ07CCuB+FUkIaDzX7mLy1r7ohrklkiHgbniiTRCcmonC3854o8hGnD08x8JnuScNa3Sjdj6Myv9f3Z9tWJ86aFm8TJlu+rBp2L6KNC3RgkAs9/5+u7HYsODnuqr4jsj3jlnwFLlwGk8zVtpBGn7Dp/UYigtn8= 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=klD336ts; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=JgyI4Lqb; 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 compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id 31F905C00D1; Sun, 4 Feb 2024 06:03:18 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute3.internal (MEProxy); Sun, 04 Feb 2024 06:03:18 -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=1707044598; x=1707130998; bh=Bf+fUOrYXcGEM/eDTspqcwbDeCrIad7HJCkL0vJjXLo=; b= klD336tsM1X2o9/VFc1F2tiyrPMCN8vuP1BjytGFIGBJ2Rxb6lHcG6Me/Ha3i3Uh S+nERwVD4tqcNLb6cHAY9q4XCdA3LV7MMa2d4ELjiej+BZZaN/NgNaBo1CS0/PWo zc23jK3N5jqKT06eN35uWiOsqGNGOmW87/mQEne68vI9D7wjsYWy6JkeYnYk8yR/ vSOsLLd8m5Sr9il4Sdh4K/RG2/BZ0U9545PTRgKJlOtQwkhQDEVdt6OF9/1BvRqg FCpLP+9017MxqjF81tLyXFsCSNnmY47CmuR4e9FKfanzOdJ7Aa6hfLqX408qPDZv M/kipRaZCnX85eXc5Wkt/Q== 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=1707044598; x= 1707130998; bh=Bf+fUOrYXcGEM/eDTspqcwbDeCrIad7HJCkL0vJjXLo=; b=J gyI4Lqb8jFaFM6HQMVA+uf8nSiSvbsykpqRFok0ht0Nz1lM48osxHhH+Jdjmk3Es +iz/gr39XspwzhpwifTFJcL6Ki4Y/HXAmT6SVzPEQjvWqDuZtrJvpnr4jJVc8aIL 7MB7PHU9WmcbzB3WdAdsIj3KeIlw10sNsn3zTcZnRpxGGwYpn9iyQBrsMAL3q53E vTclfAnK+diImUUk5L6rZV0gioei3wO5lP6i7gPq87Pcd9l6GpBRMn7OObC2tcu8 LZ4vp0Wf4jEUVe6V4fHID9Q1hX7xsTIcHYR2iFJKaZru6jaQxjzHClqIpT92kEX5 0JhLy2Lqfz6NSMIhgU4Tw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrfedukedgvdefucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepkfffgggfuffvvehfhfgjtgfgsehtkeertddtvdejnecuhfhrohhmpeflihgr gihunhcujggrnhhguceojhhirgiguhhnrdihrghnghesfhhlhihgohgrthdrtghomheqne cuggftrfgrthhtvghrnhepleeuffehheegleeuvdelgffhueekjeetueevuefhffdtgfeu hfeggfeukefffedtnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilh hfrhhomhepjhhirgiguhhnrdihrghnghesfhhlhihgohgrthdrtghomh X-ME-Proxy: Feedback-ID: ifd894703:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 4 Feb 2024 06:03:16 -0500 (EST) Message-ID: <716af17c-136b-4852-86ce-a23bafe34fbb@flygoat.com> Date: Sun, 4 Feb 2024 11:03:15 +0000 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 0/3] Handle delay slot for extable lookup Content-Language: en-US To: Linus Torvalds Cc: Oleg Nesterov , Thomas Bogendoerfer , Andrew Morton , Ben Hutchings , linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mips@vger.kernel.org, linux-mm@kvack.org, Xi Ruoyao References: <20240202-exception_ip-v2-0-e6894d5ce705@flygoat.com> From: Jiaxun Yang Autocrypt: addr=jiaxun.yang@flygoat.com; keydata= xsFNBFnp/kwBEADEHKlSYJNLpFE1HPHfvsxjggAIK3ZtHTj5iLuRkEHDPiyyiLtmIgimmD3+ XN/uu2k1FFbrYiYgMjpGCXeRtdCLqkd+g9V4kYMlgi4MPHLt3XEuHcoKD1Yd2qYPT/OiQeGM 6bPtGUZlgfOpze1XuqHQ2VMWATL+kLYzk6FUUL715t8J5J9TgZBvSy8zc6gvpp3awsCwjFSv X3fiPMTC2dIiiMh4rKQKGboI1c7svgu6blHpy/Q5pXlEVqfLc7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content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit 在 2024/2/4 07:41, Linus Torvalds 写道: [...] > The thing is, the only reason for the code in > get_mmap_lock_carefully() is for kernel bugs. IOW, some kernel bug > with a wild pointer, and we do not want to deadlock on the mm > semaphore, we want to get back to the fault handler and it should > report an oops. > > ... and one of the "wild pointers" might in fact be the instruction > pointer, in case we've branched through a NULL function pointer or > similar. IOW, the exception *source* might be the instruction pointer > itself. Well this is the tricky part of my assumption. In `exception_epc()` `__isa_exception_epc()` stuff is only called if we are in delay slot. It is impossible for a invalid instruction_pointer to be considered as "in delay slot" by hardware. I'd agree that sounds fragile though. Thanks > > So I realy think that MIPS needs to have some kind of "safe kernel > exception pointer" helper. One that is guaranteed not to fault when > evaluating the exception pointer. > > Assuming the kernel itself is never built with MIPS16e instructions, > maybe that's a safe assumption thanks to the "get_isa16_mode()" check > of EPC. But all of this makes me nervous. > > Linus -- --- Jiaxun Yang