From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from fhigh7-smtp.messagingengine.com (fhigh7-smtp.messagingengine.com [103.168.172.158]) (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 488A21CA96 for ; Thu, 27 Jun 2024 06:46:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.168.172.158 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719470806; cv=none; b=cDRa2ugbLgtxoGaYtHKKf5psJ9epbUUgVNLzLnIGv+o63vCZlgfCjqVkmbm4JuD4BR6E9u0Gg5FZctgCmX1UllNUefq6KGxDx6Z5/W2z4eVQ545P9ZewHrFoaGOHmgXBMtAMJKb/TKTGyBaaAGtP3NR9AQcdZYwL83DI9aoXhbM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719470806; c=relaxed/simple; bh=59yHLOAL0r7lbk5fzQyapZJtsEqdJTadNmnTZvypfXk=; h=MIME-Version:Message-Id:In-Reply-To:References:Date:From:To:Cc: Subject:Content-Type; b=syqyuVvotRyc3c1oUaYFVgFb8WNH8UT2H9hKlCFclIBPaZIWPVNyv6pa2vhJxA7uLjomJUbnbdcqm0wThsgzXJh7xgeRfYLH6vZvIIJQJFSXwSF87HJ+rwwPyQ6pnapy3XPIrXgvEkg8rvvhW5wQ/QijjmRitkDVTR6IMshQUFk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arndb.de; spf=pass smtp.mailfrom=arndb.de; dkim=pass (2048-bit key) header.d=arndb.de header.i=@arndb.de header.b=xPDWkjwt; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=sxaZLSry; arc=none smtp.client-ip=103.168.172.158 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arndb.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arndb.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=arndb.de header.i=@arndb.de header.b="xPDWkjwt"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="sxaZLSry" Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailfhigh.nyi.internal (Postfix) with ESMTP id 45CB011402E3; Thu, 27 Jun 2024 02:46:43 -0400 (EDT) Received: from imap51 ([10.202.2.101]) by compute5.internal (MEProxy); Thu, 27 Jun 2024 02:46:43 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arndb.de; h=cc :cc: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=1719470803; x=1719557203; bh=21wogX4lZL dYQzweo1UR0890OgNIFA+e+je+r+/6fNo=; b=xPDWkjwtCkBAdcU9N6if4TzWrN vUs8YLMoBJAVLOj1Z/FJsYOqnp6vwWWIVQYZ68IUodxGb78SaKLP1xrQjhyYCGuX vgnOy6sau+lE9q128THuLtp/vOJQLVzUxXxoTec3ndCloeISEGofE3CMlPptEw3k VuVPj01e7/zEFeKngp/zsIcDNup1QOHv6QPSd+Row4oBRensqIERKQpI+ahCEAU9 S+UWw3TTjO8pbJHdyZEDWpjI8eQqnmkbI6hBD+qngT/jdI3zD0hX/pHWVlFSq0Qu CrnW6zH89vQUgiIWGQQybh3MTDdmFc5d+keb4WNXxqKBrctPB+sGX1zHwXfA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc: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= fm2; t=1719470803; x=1719557203; bh=21wogX4lZLdYQzweo1UR0890OgNI FA+e+je+r+/6fNo=; b=sxaZLSryANyxwV5Q7pSihncMz03TjU1gZUQintd8piDq lSAOqaaW2VUzN/4xSK9TAA0/76S6coZL1E4JpBOHFvE4go8gP0bcy8fvEL1XCt0w InpS28YpmcURU6KR4DyIHV8meRJdun5xQxNhg9H7iEXT0tlokrZuK42xgMgWoOWw JwZrnFnl4BCWUm5mJHW7V9XLg1CO0ICZtp03fS8U/MU4MPSXtJmKHVmIVD575LTL Ea+P+f5zVwRwOSiaoqq+Ft6qQQtqOVFYiQrDPKcdQ8OfRbep05dtfydssiRlexbZ DO2J6DFeJGtRGgiwa7IWbSuPuXKZrmY/FFMs1QoZ5Q== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrtdefgdduuddvucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepofgfggfkjghffffhvfevufgtsehttdertderredtnecuhfhrohhmpedftehr nhguuceuvghrghhmrghnnhdfuceorghrnhgusegrrhhnuggsrdguvgeqnecuggftrfgrth htvghrnhepffehueegteeihfegtefhjefgtdeugfegjeelheejueethfefgeeghfektdek teffnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprg hrnhgusegrrhhnuggsrdguvg X-ME-Proxy: Feedback-ID: i56a14606:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id 347EAB6008D; Thu, 27 Jun 2024 02:46:42 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.11.0-alpha0-538-g1508afaa2-fm-20240616.001-g1508afaa Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: In-Reply-To: References: <20240625040500.1788-1-jszhang@kernel.org> <20240625040500.1788-3-jszhang@kernel.org> Date: Thu, 27 Jun 2024 08:46:19 +0200 From: "Arnd Bergmann" To: "Jisheng Zhang" Cc: "Andreas Schwab" , "Paul Walmsley" , "Palmer Dabbelt" , "Albert Ou" , linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 2/4] riscv: uaccess: use input constraints for ptr of __put_user Content-Type: text/plain On Wed, Jun 26, 2024, at 18:02, Jisheng Zhang wrote: > > "m" version is better than "r", usually can save one > instruction. > I will try to combine other constraints with "r" to > see whether we can still generate the sd with offset > instruction. If can't, seems sticking with "m" and keeping > output constraints is better Ah, I see. > You only mention "user space access", so just curious, does > arm64 version still correctly work with below __put_kernel_nofault() > example? No, I think the example I gave would break for both x86 and arm64 without adding an output constraint. My main concern about using an input constraint was that it doesn't match what the code does. Maybe there is a way to make it use the correct "=m" output when CONFIG_CC_HAS_ASM_GOTO_OUTPUT is set but use either "r" or "m" inputs on older gcc releases. After gcc-11 becomes the minimum in a few years, the hack can be removed. Arnd