From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail.zytor.com (terminus.zytor.com [198.137.202.136]) (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 7F20012FF69 for ; Sun, 26 Jul 2026 02:58:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.137.202.136 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785034712; cv=none; b=LBltBRpaRDoTbPG73j4SL2B2p9SRaqPjPt3Nx0oo/dH/3KtJoRT4t2ITw3p6fO1f92b3zLnhhc7tCiSFYU2SOgHY6NmIYHDa5YLzTyvpfxGJLTIzyNZUkQ56AWNsD6l4Bw7EbjethNjKr/nEuQi2hSv2jd0rMCr07sGnU64LMNQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785034712; c=relaxed/simple; bh=jQGLBK5zo8tfhndi9QQiiSppe4Me/2PlTcfbKRWSvts=; h=Date:From:To:CC:Subject:In-Reply-To:References:Message-ID: MIME-Version:Content-Type; b=ICV28J8IptLz/+AZVOTHKlyun0Uti6v1J8yZpnOZ4IMaL4NQsKH16O1927k9lehzrs4UFV4vp2r8hwuLxKWBOSfh/xyzsIVaCZ/p8WSX0qSn/MvO9tvih3Wcv5zmcP8kiOoBjZRVGcNjhttS+xpSEAG0jeVcAWAcrQfZW25r8GM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=zytor.com; spf=pass smtp.mailfrom=zytor.com; dkim=pass (2048-bit key) header.d=zytor.com header.i=@zytor.com header.b=CzFeaLEG; arc=none smtp.client-ip=198.137.202.136 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=zytor.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=zytor.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=zytor.com header.i=@zytor.com header.b="CzFeaLEG" Received: from ehlo.thunderbird.net (c-76-133-66-138.hsd1.ca.comcast.net [76.133.66.138]) (authenticated bits=0) by mail.zytor.com (8.18.1/8.17.1) with ESMTPSA id 66Q2vYTD536917 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NO); Sat, 25 Jul 2026 19:57:34 -0700 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.zytor.com 66Q2vYTD536917 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zytor.com; s=2026062701; t=1785034657; bh=kGfV63mG7ZtSeWXvQizP6lBB+RX//0RIPDV16FrvT8o=; h=Date:From:To:CC:Subject:In-Reply-To:References:From; b=CzFeaLEG7P1llSpI85KnYi3kxWtJskBiLEMhU/11u0bTwFa+S944ciWeeOT09G5G4 NxRbhl3v5aD4E0613dQrnMo3S/XL2Ep3yIFR39jxuZ2lVQbNO8CpadPbv1LxM3+LIU Md9ScDJh8hqFr4xqODekGpblooPPAKy9V5tAKQXYxMWUj6Ig5tuKhr06gHc+CHeT0y bwD1DorQ076tIwD2QEZ57Z4dPT0/6O8H7txlqmqBytE3MYPKau0x+3iFl6ggGzh7R8 3QtnUaSRAHN4pGUEnJsKO2rww+3QOC38dRRIeQT5kYGTXB0yWoQzkYuKHcJhY03hXO LyvQ3gFnQZwow== Date: Sat, 25 Jul 2026 19:57:29 -0700 From: "H. Peter Anvin" To: David Laight , Brian Gerst CC: Borislav Petkov , Mauricio Faria de Oliveira , Thomas Gleixner , Ingo Molnar , Dave Hansen , x86@kernel.org, Juergen Gross , Alexey Dobriyan , Boris Ostrovsky , kernel-dev@igalia.com, linux-kernel@vger.kernel.org, xen-devel@lists.xenproject.org Subject: =?US-ASCII?Q?Re=3A_=5BPATCH_v7_2/5=5D_x86/asm=3A_add_volatile=2C_cl?= =?US-ASCII?Q?obbers_and_zero-length_check_in_inline_memcmp?= User-Agent: K-9 Mail for Android In-Reply-To: <20260725113445.14ccf42f@pumpkin> References: <20260721-pvh-kasan-inline-v7-0-38979a50cef0@igalia.com> <20260721-pvh-kasan-inline-v7-2-38979a50cef0@igalia.com> <20260722170334.GCamD35gwrCng30WH1@fat_crate.local> <0F3A1121-208F-4F71-8C88-BEAE7CB50E75@zytor.com> <2f22094d-b8c5-46ec-92b9-dd6752a8dc2e@zytor.com> <20260725113445.14ccf42f@pumpkin> Message-ID: 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=utf-8 Content-Transfer-Encoding: quoted-printable On July 25, 2026 3:34:45 AM PDT, David Laight wrote: >On Thu, 23 Jul 2026 20:49:13 -0400 >Brian Gerst wrote: > >=2E=2E=2E >> I had originally thought that the test for RCX=3D=3D0 was also at the e= nd >> of the loop, after the decrement=2E But a closer look at the >> pseudo-code in the SDM does show that the test is at the start of the >> loop=2E Starting with RCX=3D=3D0 does indeed skip the comparison and d= oes >> not touch ZF=2E Your suggestion is good, but should have a comment >> explaining why it's there to someone reading the code in the future=2E > >I have a feeling that was a change between the 8086 and 80286=2E >I don't have an 8086 book (any more) but I'm sure I remember fixing >bugs where %cx of zero caused 65536 iterations=2E >(Fun to find because the vector table is 'first in the line to be >overwritten=2E) > > David No, but on the Z80 0 meant 64K=2E