From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 5E4A83C0D for ; Wed, 27 Dec 2023 04:22:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="pu7JWQd4" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5B23DC433C9; Wed, 27 Dec 2023 04:22:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1703650966; bh=ves+k/ehF5nuuuhN50R9kvbHrix4q/GEBWsuYo+6QBU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=pu7JWQd4VQVUFDQTyU5rIq+MCb8fqqlKDBlpMOhyq5hKNo2cG1dn6F2xB7X7LEZKo Njni9Lh9davLmG6kwNdl2rR59xpQSAgMhy1Pk9JGsgK1rx1nSSYlVCjjDrh9hjXsug NFVhLDk0LZAVGFnEEU7WdZe+kbl6zFW5WMCV7XGoA2YdB2UMVga0ZunN37G7/+NDh4 hGVJndS6mpTRzyZkiHQRiwTU1d86DSsUmNhn29GCPdAMUW9eiVJLSWgXmpR7NzUw/g gcA23+iYcfcTBMNzR68pDLid3r71deJADwncSxcRux4MaKxIOrFC8DO1GJptKA2dZs HFEG56rIMN4Mg== Date: Tue, 26 Dec 2023 22:22:42 -0600 From: Eric Biggers To: Jisheng Zhang Cc: Paul Walmsley , Palmer Dabbelt , Albert Ou , linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, Conor Dooley , Qingfang DENG , Charlie Jenkins Subject: Re: [PATCH v4 1/2] riscv: introduce RISCV_EFFICIENT_UNALIGNED_ACCESS Message-ID: <20231227042242.GA4240@quark.localdomain> References: <20231225044207.3821-1-jszhang@kernel.org> <20231225044207.3821-2-jszhang@kernel.org> 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=us-ascii Content-Disposition: inline In-Reply-To: <20231225044207.3821-2-jszhang@kernel.org> On Mon, Dec 25, 2023 at 12:42:06PM +0800, Jisheng Zhang wrote: > Some riscv implementations such as T-HEAD's C906, C908, C910 and C920 > support efficient unaligned access, for performance reason we want > to enable HAVE_EFFICIENT_UNALIGNED_ACCESS on these platforms. To > avoid performance regressions on other non efficient unaligned access > platforms, HAVE_EFFICIENT_UNALIGNED_ACCESS can't be globally selected. > > To solve this problem, runtime code patching based on the detected > speed is a good solution. But that's not easy, it involves lots of > work to modify vairous subsystems such as net, mm, lib and so on. > This can be done step by step. > > So let's take an easier solution: add support to efficient unaligned > access and hide the support under NONPORTABLE. > > Now let's introduce RISCV_EFFICIENT_UNALIGNED_ACCESS which depends on > NONPORTABLE, if users know during config time that the kernel will be > only run on those efficient unaligned access hw platforms, they can > enable it. Obviously, generic unified kernel Image shouldn't enable it. > > Signed-off-by: Jisheng Zhang > Reviewed-by: Charlie Jenkins > --- > arch/riscv/Kconfig | 13 +++++++++++++ > arch/riscv/Makefile | 2 ++ > 2 files changed, 15 insertions(+) Reviewed-by: Eric Biggers - Eric