Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp5564850rwl; Tue, 11 Apr 2023 07:11:59 -0700 (PDT) X-Google-Smtp-Source: AKy350aiiCQPGlsDmUjVDGp8ws7upsTSGDyAawkaxBbFt+yFeIYWl+okTFx4TMALxymi9ro7kQR1 X-Received: by 2002:a17:90b:3909:b0:234:d78:9b4c with SMTP id ob9-20020a17090b390900b002340d789b4cmr4370184pjb.18.1681222318586; Tue, 11 Apr 2023 07:11:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681222318; cv=none; d=google.com; s=arc-20160816; b=FcFAicgG4p5cC5AvB8SUU5QMTfzWydZWsNcLz4ED6yDfZTLaJF8M+DBLOOjdYvmj3r QBUrx5eMpDcgU9shYcpz5BMV92scmnCrch5yYYhU97lMwOGkrff3+Q6bpj8h52CCMxw9 Yz4qdQbt51SgTyLje8IscMc9G9ellUR7kBPoAx9ZVKfjReCG4ZCyDhjugopeOcZKQ5qk l6LwkV32U8RigVsYlWDwBxgCmx2XvvDVohtlzZokkrRj2BqMe5436gxRkrhZUNP9YgI2 oO1OUlH/3urGVUjcfnR1sPPFlrkRU41x0Lz+HvCBgcZ4bIzWs+BYZKlsw0jl//ZLxC4d 709w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=iwXMraFk3rEELAWbRtbHrkEz6gUhWBvUZKer76tBfNQ=; b=t1cYmCnuO6pvLrVTC7TPZNPkkry6GyydcrxAKHpvXAU3aMAiZTGntXuxdFj+6igUm5 Y0+TzUw1YtnW4YAF83XhmXPxT0EVVuSmK+VY75e9tYKyo4K3OvQbaYZbRLNRfb5kU19M 2E4C3Ii1IOBPOhdJgCsDFr3KlsB8wBpxvrP2/1F09vcAO5VNoiEc5GrUCMS2vfbYN/7a zXG3l6CXZBZuVy9Sid2IGVUqRlvY5OojvVYkzO6U5061FFYNSeevYQ/wdTOzPyM/aCFv tCfiUt8ybHtJF5egIpornlLQJJHKDXDl1R84qLW96OtwVgaEyo2wIMw6hCABawS67lR0 q8lA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b=hxYyfBK6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=microchip.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o34-20020a17090a0a2500b002469ec5e212si5599458pjo.177.2023.04.11.07.11.35; Tue, 11 Apr 2023 07:11:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b=hxYyfBK6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=microchip.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229450AbjDKOHL (ORCPT + 99 others); Tue, 11 Apr 2023 10:07:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36602 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229595AbjDKOHK (ORCPT ); Tue, 11 Apr 2023 10:07:10 -0400 Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.153.233]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 956C419C; Tue, 11 Apr 2023 07:07:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1681222029; x=1712758029; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=iwXMraFk3rEELAWbRtbHrkEz6gUhWBvUZKer76tBfNQ=; b=hxYyfBK6gnN44LuVjpjcWE7/3btCqyNo88aYI+IpCLVnsvqUu4EbUp2t yYuL4hl9BTGH0BK5Yf6zRASqf/L+ZD6y/R83M832ZKoBTX2JK2cQTXb6X dOobPUMoWKpzVmUQoYHuuyanZx4NkTAMvZGvYybjxMSmuiGcj6pL3KkgS +FaZtM5dnC+lVC5Kl0MY3c0A91RqVapqcu0b1VNlGs6mixiNFUo/iZ8vl HWLF9We7FCrSQ4OSoGEf7gHCns3JB5WY0ToKI4jIELPmBq5p1odsKNi/Y 6Mc2byM2id37epODVcON8yCqJPfXAlVfWDxC4nwmnyMZnpJCQu/zbdOIz g==; X-IronPort-AV: E=Sophos;i="5.98,336,1673938800"; d="asc'?scan'208";a="220369799" Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa1.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 11 Apr 2023 07:07:08 -0700 Received: from chn-vm-ex04.mchp-main.com (10.10.85.152) by chn-vm-ex03.mchp-main.com (10.10.85.151) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.21; Tue, 11 Apr 2023 07:07:08 -0700 Received: from wendy (10.10.115.15) by chn-vm-ex04.mchp-main.com (10.10.85.152) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.21 via Frontend Transport; Tue, 11 Apr 2023 07:07:04 -0700 Date: Tue, 11 Apr 2023 15:06:49 +0100 From: Conor Dooley To: Evan Green CC: Palmer Dabbelt , , , Conor Dooley , , Heiko Stuebner , Albert Ou , Andrew Bresticker , Andrew Jones , Atish Patra , Celeste Liu , Guo Ren , Jisheng Zhang , Jonathan Corbet , Ley Foon Tan , Palmer Dabbelt , Paul Walmsley , Philipp Tomsich , Samuel Holland , Sunil V L , , , Subject: Re: [PATCH v6 4/6] RISC-V: hwprobe: Support probing of misaligned access performance Message-ID: <20230411-prefix-rename-71ab4af0324a@wendy> References: <20230407231103.2622178-1-evan@rivosinc.com> <20230407231103.2622178-5-evan@rivosinc.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="YDuEwp07zFXzbIC1" Content-Disposition: inline In-Reply-To: <20230407231103.2622178-5-evan@rivosinc.com> X-Spam-Status: No, score=-2.5 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --YDuEwp07zFXzbIC1 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Apr 07, 2023 at 04:11:01PM -0700, Evan Green wrote: > This allows userspace to select various routines to use based on the > performance of misaligned access on the target hardware. >=20 > Rather than adding DT bindings, this change taps into the alternatives > mechanism used to probe CPU errata. Add a new function pointer alongside > the vendor-specific errata_patch_func() that probes for desirable errata > (otherwise known as "features"). Unlike the errata_patch_func(), this > function is called on each CPU as it comes up, so it can save > feature information per-CPU. >=20 > The T-head C906 has fast unaligned access, both as defined by GCC [1], > and in performing a basic benchmark, which determined that byte copies > are >50% slower than a misaligned word copy of the same data size (source > for this test at [2]): >=20 > bytecopy size f000 count 50000 offset 0 took 31664899 us > wordcopy size f000 count 50000 offset 0 took 5180919 us > wordcopy size f000 count 50000 offset 1 took 13416949 us >=20 > [1] https://github.com/gcc-mirror/gcc/blob/master/gcc/config/riscv/riscv.= cc#L353 > [2] https://pastebin.com/EPXvDHSW >=20 > Co-developed-by: Palmer Dabbelt > Signed-off-by: Palmer Dabbelt > Signed-off-by: Evan Green > Reviewed-by: Heiko Stuebner > Tested-by: Heiko Stuebner I think I had given you an R-b a few versions back, guess it was dropped due to changes or w/e :) Reviewed-by: Conor Dooley Perhaps at some point the "errata" naming of those files should change, but today is not that day. Cheers, Conor. --YDuEwp07zFXzbIC1 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYIAB0WIQRh246EGq/8RLhDjO14tDGHoIJi0gUCZDVpeQAKCRB4tDGHoIJi 0t7jAQDMNiwdcIYzMff2OO0oRagi00n+9SjD1CMom7IerxVzoQD8DNnuZQ82JyZU KaysKejn3MqblyvB0zU+J9PRFOQyJA8= =Skce -----END PGP SIGNATURE----- --YDuEwp07zFXzbIC1--