Received: from localhost (localhost [127.0.0.1]) by mail.netbsd.org (Postfix) with ESMTP id A63E584EA6 for ; Wed, 6 Sep 2023 08:03:46 +0000 (UTC) X-Virus-Scanned: amavisd-new at netbsd.org Received: from mail.netbsd.org ([IPv6:::1]) by localhost (mail.netbsd.org [IPv6:::1]) (amavisd-new, port 10025) with ESMTP id A6LBnUgmd_nF for ; Wed, 6 Sep 2023 08:03:45 +0000 (UTC) Received: from cvs.NetBSD.org (ivanova.NetBSD.org [IPv6:2001:470:a085:999:28c:faff:fe03:5984]) by mail.netbsd.org (Postfix) with ESMTP id AE32784D4A for ; Wed, 6 Sep 2023 08:03:45 +0000 (UTC) Received: by cvs.NetBSD.org (Postfix, from userid 500) id AB6FFFBDB; Wed, 6 Sep 2023 08:03:45 +0000 (UTC) Content-Disposition: inline Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII" MIME-Version: 1.0 Date: Wed, 6 Sep 2023 08:03:45 +0000 From: "Martin Husemann" Subject: CVS commit: [netbsd-8] src/crypto/external/bsd/openssl/dist/crypto To: source-changes@NetBSD.org Approved: for-source-only Reply-To: martin@netbsd.org X-Mailer: log_accum Message-Id: <20230906080345.AB6FFFBDB@cvs.NetBSD.org> Module Name: src Committed By: martin Date: Wed Sep 6 08:03:45 UTC 2023 Modified Files: src/crypto/external/bsd/openssl/dist/crypto [netbsd-8]: sparccpuid.S Log Message: Pull up following revision(s) (requested by mrg in ticket #1895): crypto/external/bsd/openssl/dist/crypto/sparccpuid.S: revision 1.11 fix SPARC v8/v9 detection code. this code uses a trick where the encoding on both v8 and v9 are the same, and are not illegal instructions, but that the v9 one has a detectable difference than v8. the idea is that we perform a "subcc" (set condition codes) which sets "%ccr" on v9, which is an unimplemented "%asr2" on v8, then we read %ccr (v9) or %asr2 (v8), which will always be 0x99 on v9, and .. is non-trapping but impleentation defined on v8. for many implementations this returns the value of the %y reg. as nothing actually sets %y in this path, it remains the value it was most recently set to by something (anything), and if it just happens to be 0x99 then the v9 paths will be taken on v8. fix this by clearing the %y register before the potential read. fixes PR port-sparc/57594. tested on ss20 and in qemu. this version of the patch has been submitted upstream. To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.6.6.1 \ src/crypto/external/bsd/openssl/dist/crypto/sparccpuid.S Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.