From nobody Thu Nov 25 17:59:18 2021 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 2ADB218BD19C; Thu, 25 Nov 2021 17:59:21 +0000 (UTC) (envelope-from allanjude@freebsd.org) Received: from tor1-11.mx.scaleengine.net (tor1-11.mx.scaleengine.net [209.51.186.6]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4J0QcT0V7tz3sVr; Thu, 25 Nov 2021 17:59:21 +0000 (UTC) (envelope-from allanjude@freebsd.org) Received: from [10.1.1.3] (Seawolf.HML3.ScaleEngine.net [209.51.186.28]) (Authenticated sender: allanjude.freebsd@scaleengine.com) by tor1-11.mx.scaleengine.net (Postfix) with ESMTPSA id 206BE33F43; Thu, 25 Nov 2021 17:59:20 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.10.3 tor1-11.mx.scaleengine.net 206BE33F43 Message-ID: <9284fa68-0ff1-ebae-3fdf-82049b1fee61@freebsd.org> Date: Thu, 25 Nov 2021 12:59:18 -0500 List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.3.1 Subject: Re: git: 32a2fed6e71f - stable/13 - openssl: Fix detection of ARMv7 and ARM64 CPU features Content-Language: en-US To: Helge Oldach Cc: manu@bidouilliste.com, src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org References: <202111251716.1APHGsC7018508@nuc.oldach.net> From: Allan Jude In-Reply-To: <202111251716.1APHGsC7018508@nuc.oldach.net> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4J0QcT0V7tz3sVr X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-ThisMailContainsUnwantedMimeParts: N On 11/25/2021 12:16 PM, Helge Oldach wrote: > Allan Jude wrote on Thu, 25 Nov 2021 17:54:06 +0100 (CET): >> On 11/25/2021 10:31 AM, Helge Oldach wrote: >>> Allan Jude wrote on Thu, 25 Nov 2021 16:09:25 +0100 (CET): >>>> On 11/25/2021 2:38 AM, Helge Oldach wrote: >>>>> hmo@p48 ~ $ for f in 0 1 2 3 8 16 32 64 128 ; do echo -n $f:; env OPENSSL_armcap=$f openssl speed -evp aes-256-gcm 2>&1 | tail -1 | cut -wf7; done >>>>> 0:42295.15k >>>>> 1:23891.19k >>>>> 2:42208.57k >>>>> 3:23970.56k >>>>> 8:42354.98k >>>>> 16:42199.06k >>>>> 32:size >>>>> Illegal instruction (core dumped) >>>>> 64:42322.42k >>>>> 128:42275.00k >>>>> hmo@p48 ~ $ >>>>> >>>>> So I guess HWCAP_FP is the culprit? Maybe related to hard/soft floating >>>>> point math which indeed is kind of special on the Pi? >>>> >>>> So yeah, the issue seems to be that floating point on the RPi4 is slower >>>> than not, but now openssl (properly) detects that the CPU advertises >>>> support for it. >>>> >>>> As seen elsewhere in the thread, most other ARM platforms get a very >>>> significant speed boost. >>> >>> So can we disable FP within OpenSSL for the RPi by default? This commit >>> basically introduced a regression for this platform and I think that >>> should be fixed. >>> >>> Or it the root cause a suboptimal FP implementation that is not adequate >>> for the RPi? >>> >>> Kind regards >>> Helge >>> >> >> The root cause is that the RPi4 advertises support for FP, but its FP is >> slow. >> >> I don't know that there is an easy way to detect the RPi4 specifically. >> You might be able to just disable the FP bit by setting >> OPENSSL_armcap=~1 globally, or maybe via openssl.conf? > > Sure can do that locally - but again: This commit is basically a > regression which IMHO should be fixed in a way not requiring users to > tweak things? > > Kind regards > Helge > It is only a regression to RPi4's, but a massive improvement to every other bit of ARM hardware that has been tested. The error that made OpenSSL disable FP before, was an error (it was calling AT_CANARY instead of AT_HWCAP). So, your issue with openssl being slow on the RPi4 will need to be taken up with OpenSSL. -- Allan Jude