Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp3168881rdb; Tue, 26 Dec 2023 20:22:59 -0800 (PST) X-Google-Smtp-Source: AGHT+IFlkLgpbdMbBOyvJ3PgDP3a1BENkJNBDK+9EJfWrUkEdZZIAHDvcaHcKFy7k93kkJAe2UJx X-Received: by 2002:a17:902:dccb:b0:1d3:b542:1f0f with SMTP id t11-20020a170902dccb00b001d3b5421f0fmr9026954pll.18.1703650979128; Tue, 26 Dec 2023 20:22:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703650979; cv=none; d=google.com; s=arc-20160816; b=z79HjaU5/j9MxdRa1ioAU+6m23v4+JpVGxVs3e3yruI/E5AV8j+sfZw+P3bksB04I9 tuVW8whH++qN1bnVSEeNGMayDF0S2wB5CVqS9fipUm2pQMyPQkpFBZctIS/WSVGRLOgl +PSmlNM2IgrCpmLQUDSWL2nSGtFCpx98ZrgIZ7Mm3zMmoCv1Q6Olj06VJCa/0VdkWPh0 skVSUfgPiICs1sQIf5n3p7NazEY7gRSoO0hEkHWnnc/CUH3sezxZpkzTkgrHxAt2eRWm UU7lbMH7wYIgBi/sXY1KGS+yXnkh2I5/CS3TdefNvi7E++6M1YRmwOniK8ID+YWZckPK DkGQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=nepDFcZeo9EedEMl+V4H6BK3dZNGubaNzPnctwVJsnQ=; fh=SyfprRekxCLtQaqZFlthxsArgkPZDyi6GQ31relEVXA=; b=vh3boaE6DONMmQfD6nIRI04VMFCXt5P2L7TuxaYpXjIe6ZRIfqt1Q456uzfztJy35S BcEYFlUM8MaQ+lBRHu8F1L8TaapJV79H+sVKcMcXNZVndmKcBpggLH01NZH/Q+qJiM2Q /Cm60Os8IRiG2I4MsDyg7kaMinE2r/TLUZsYbUcBst24P2yPKEfn6Doi0qeAsH7Y6XG4 3tNM8bEGeyTAhWI2tDQ9kDkesGE5Mc3vqnMtAJez/o5fCw8+6C3XxvNWnhbipYAyw2be 2QlSGtK94Q1jlPKtpuWLrtF7alqJCt4MOxDWDRpsVEn1xLdu36l1tODKRN8N4bJfS5Cw rE2g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=pu7JWQd4; spf=pass (google.com: domain of linux-kernel+bounces-11817-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-11817-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id y70-20020a638a49000000b005ce0892982csi6032842pgd.842.2023.12.26.20.22.58 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Dec 2023 20:22:59 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-11817-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=pu7JWQd4; spf=pass (google.com: domain of linux-kernel+bounces-11817-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-11817-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org 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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 9DF88B2124E for ; Wed, 27 Dec 2023 04:22:54 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 349923C30; Wed, 27 Dec 2023 04:22:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="pu7JWQd4" X-Original-To: linux-kernel@vger.kernel.org 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) 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