Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp585749rdb; Thu, 21 Dec 2023 21:04:19 -0800 (PST) X-Google-Smtp-Source: AGHT+IGVN2nvmpt+Bcfci5osJ2QrYhlsRfoHkR6z9vfaSiaA/GIr7VSUUzYWArZ6umGB1qLCHLeN X-Received: by 2002:a05:6a00:b4b:b0:6d9:6992:3a99 with SMTP id p11-20020a056a000b4b00b006d969923a99mr972959pfo.48.1703221459400; Thu, 21 Dec 2023 21:04:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703221459; cv=none; d=google.com; s=arc-20160816; b=GJOo/D/htHOLpR6PdVwntGOHA79DZ9HEMiRogkYyxfv2BKCThZ1HwH8r0Z9/mWqA+T XjALVVMnqWLASOheX74vpIcvru43m4ejMlm1s4sYNnyS0DS6bCCVajl9T7DgE21DSLyb kbTwd7N8fQhm0GtZlTraD+kFlQXp3j0P2bY8VSS4QbqYLKYwayoeZZiH5LbI8nbWFgkT N0xYprcnqsMFxxex28Vyapq37wLllNNZFko/61W0XsyAdJRM4j4waOjrh4JhMOmSqHIr 4lOxlR2UPkJXasCPUDtDIdgauPb5kua+Xfa2jokbGGxxRn4wpW/wbVe20I9xzalB77lV M8nw== 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=wY8ToEnRq+vI6zqb2PigsZsQbu52I+4f3lvwrSgw7OQ=; fh=VaU3+YNfR8ofOs2topSyArlhwxd/f0cI6NtLNx8qW2k=; b=nslkPSFMgxmCbWo0O1U593RZH9hFkrsaLSzKSTen/v2wqb1xq7FujY9GWKAqcAn6Rx Ha4f+pO7wjroDTQYX1kzSI0rMKg1C2pfIgPK4KBOIV3tiWF2EzdKfsx+5QAeissAv5+l Wix8H2qrkJraN3HcoX2WTJsEYHR3cJcT1+MAxFJQ8rYJpSP9SzX+s9V+TjYzDoUAeqlq 1n3YQphnjT+7OPlBiT82rEXWZdh1aAog+qLN9vv5N3W/U5DN7uFWZdWEwDVZXwu6bFSQ +HFJtFpdsAqGqInCgBtWFQotUKcnJAXkgPDzDjuTRTgz8Sbs0S2Cn7EdK1BAhWleWAtm DFtA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=YOt2YZlQ; spf=pass (google.com: domain of linux-kernel+bounces-9357-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-9357-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. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id c19-20020aa78813000000b006ce707e00d3si2665498pfo.241.2023.12.21.21.04.18 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Dec 2023 21:04:19 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-9357-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=YOt2YZlQ; spf=pass (google.com: domain of linux-kernel+bounces-9357-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-9357-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 AE3C6B213A1 for ; Fri, 22 Dec 2023 05:04:16 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5363C5686; Fri, 22 Dec 2023 05:04:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="YOt2YZlQ" 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 827AB5390 for ; Fri, 22 Dec 2023 05:04:08 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 70588C433C8; Fri, 22 Dec 2023 05:04:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1703221448; bh=q+FYm6cQEIsutbwAwEytF6Eg5VuS0ddDhi1Ombl5s9I=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=YOt2YZlQ+xmRpHLj1toDmZoHJdAoZk86pfDaQMl4wB1nr4gqR2dbtnTovUR/EQfMc fbY29i5kenMonsJ4FRNh3HoeNo/6e/wBRec5popMPubuqZ8Qm5+dGLjIkVyRudJ+gU e02T6o/cJAEXChPKRpzT+FzEMATR+iqkhZBLara3zTmxicW8CNyfh7mXRDkQVB9mqz wt69BT6h4Rske+FjNS8kQoigoVYZ89V4R8SNX1nLBlTA8jGxGaF4jCTqdHOfnEjHHw gdDDsErpbBk+bxPeIXs481IT1eXcSQKmViZMh7Jyn4Lf8QcGxoPL5T57kJ3fCcOTDn Hjg7EdOgszf+g== Date: Thu, 21 Dec 2023 23:04:03 -0600 From: Eric Biggers To: Qingfang DENG Cc: Paul Walmsley , Palmer Dabbelt , Albert Ou , Conor Dooley , linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, Jisheng Zhang Subject: Re: [PATCH v2 1/2] riscv: introduce RISCV_EFFICIENT_UNALIGNED_ACCESS Message-ID: <20231222050403.GB52600@quark.localdomain> References: <20231203135753.1575-2-jszhang@kernel.org> <20231203135753.1575-1-jszhang@kernel.org> <20231205083924.48933-1-dqfext@gmail.com> 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: <20231205083924.48933-1-dqfext@gmail.com> On Tue, Dec 05, 2023 at 04:39:24PM +0800, Qingfang DENG wrote: > Hi, > > You may as well remove the -mstrict-align CFLAGS in the Makefile, if > this option is enabled: > > --- a/arch/riscv/Makefile > +++ b/arch/riscv/Makefile > @@ -108,7 +108,9 @@ KBUILD_AFLAGS_MODULE += $(call as-option,-Wa$(comma)-mno-relax) > # unaligned accesses. While unaligned accesses are explicitly allowed in the > # RISC-V ISA, they're emulated by machine mode traps on all extant > # architectures. It's faster to have GCC emit only aligned accesses. > +ifneq ($(CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS),y) > KBUILD_CFLAGS += $(call cc-option,-mstrict-align) > +endif > Agreed. When CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y, we shouldn't use -mstrict-align, so that the compiler can actually use unaligned memory accesses. If I understand correctly, beyond the change requested above, people seem to be happy with this patch. Jisheng, can you resend it with the above feedback addressed? Thanks! - Eric