Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vVwMI-009vPN-2Z for pgsql-hackers@arkaria.postgresql.org; Wed, 17 Dec 2025 18:34:48 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vVwMH-00Finj-1i for pgsql-hackers@arkaria.postgresql.org; Wed, 17 Dec 2025 18:34:46 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vVwMG-00FinH-1k for pgsql-hackers@lists.postgresql.org; Wed, 17 Dec 2025 18:34:46 +0000 Received: from fout-b7-smtp.messagingengine.com ([202.12.124.150]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vVwMF-001CBv-1w for pgsql-hackers@lists.postgresql.org; Wed, 17 Dec 2025 18:34:44 +0000 Received: from phl-compute-02.internal (phl-compute-02.internal [10.202.2.42]) by mailfout.stl.internal (Postfix) with ESMTP id 9BD6B1D000B2; Wed, 17 Dec 2025 13:34:41 -0500 (EST) Received: from phl-imap-14 ([10.202.2.87]) by phl-compute-02.internal (MEProxy); Wed, 17 Dec 2025 13:34:41 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=burd.me; h=cc:cc :content-transfer-encoding:content-type:content-type:date:date :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm1; t=1765996481; x=1766082881; bh=gBS6nCaLauQN4ELzh7U6N2ius+MYWVQzLQSecnPngjg=; b= QUYfTdYer4U5YlD0ZnPJX18C7Tve8X/KZqx82wbapsoplrA0PMrDayQodhGRQVBK O7QwVOYVIy//O+6FNCIexVi/AfoaoqPbjKajOwsW2oFiRnPPo5fqvBuKDPXVeMr/ ms3kaSHVuKsUWGxx3akGc2GYx4t3I+uJPMSI7dexNuZvKd6zlmkpDxky+hZmSRd+ SZ7UpT6yDzVhXA6ZV4peZT3Lwgrf06TFNDaseD0UctS72v3OpTQxqNpAvSxzEjtx WIYjj5pr/bM6iBA3uDVy8nGKPMUcscgJbMGsazTwFy4tFyLFbfe+htJp6wT+H4c0 TCGZI7TZWA63Xc7gJP4IbQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1765996481; x= 1766082881; bh=gBS6nCaLauQN4ELzh7U6N2ius+MYWVQzLQSecnPngjg=; b=P PoD+8Mfe4B+B3xpc3x8Dawt85R+gIwIjPnwUAzVqSmZr5wrzUI7vlAe145nV/ijJ jXpMfo2Zc7SIic7CAlx5lpJaMuFpWO2Z1ypz96L76vYdmFbk0aWpdGC5CrYrnLsX tBNGpoqLKVXaNFtdUGSj410QSig/7REIpWxkEIth5CWEURqMo7kb5AjSq5eCYcBd uN5QjYHz9GVZH3tNwfrQ0+ZkaIK4aRf+VmkRj9EHamONc003lq0mWFM296MGT+yo aZ28sS55jW8SQ/VAxNbUZYOuUP3MeaXjL6u80j4ZLqhxyliaZghOXzBcHvk3y2ir wY3U+1AT+I2rmjMvhhmqg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefgedrtddtgdegfedvlecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpuffrtefokffrpgfnqfghnecuuegr ihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjug hrpefoggffhffvvefkjghfufgtgfesthhqredtredtjeenucfhrhhomhepfdfirhgvghcu uehurhgufdcuoehgrhgvghessghurhgurdhmvgeqnecuggftrfgrthhtvghrnhepgffhfe fgfedukeeghfekkeejjeduvdffgfelveelgedvjedthfefvefhffeuteefnecuffhomhgr ihhnpehjuhhsiihkihgvfihitgiirdgtohhmrdhplhenucevlhhushhtvghrufhiiigvpe dtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehgrhgvghessghurhgurdhmvgdpnhgspghr tghpthhtohepiedpmhhouggvpehsmhhtphhouhhtpdhrtghpthhtoheprghnughrvghsse grnhgrrhgriigvlhdruggvpdhrtghpthhtohepphgvthgvrhesvghishgvnhhtrhgruhht rdhorhhgpdhrtghpthhtohepuggrvhgvtghrrghmvghrsehgmhgrihhlrdgtohhmpdhrtg hpthhtohepnhgrthhhrghnuggsohhsshgrrhhtsehgmhgrihhlrdgtohhmpdhrtghpthht ohepthhhohhmrghsrdhmuhhnrhhosehgmhgrihhlrdgtohhmpdhrtghpthhtohepphhgsh hqlhdqhhgrtghkvghrsheslhhishhtshdrphhoshhtghhrvghsqhhlrdhorhhg X-ME-Proxy: Feedback-ID: i675e48f3:Fastmail Received: by mailuser.phl.internal (Postfix, from userid 501) id D3740C4007B; Wed, 17 Dec 2025 13:34:40 -0500 (EST) X-Mailer: MessagingEngine.com Webmail Interface MIME-Version: 1.0 X-ThreadId: Atr_W4N1XYlB Date: Wed, 17 Dec 2025 13:34:13 -0500 From: "Greg Burd" To: "Thomas Munro" , "Nathan Bossart" Cc: "Andres Freund" , "PostgreSQL Hackers" , "Peter Eisentraut" , "Dave Cramer" Message-Id: <2f1e1872-9ab5-4082-bedf-8dee269152c2@app.fastmail.com> In-Reply-To: References: <8e926f26-0a97-434f-a665-8bb6f9159b08@app.fastmail.com> <6646f9f4-3609-41e2-8d9f-dcd63e9f915e@app.fastmail.com> Subject: Re: [PATCH] Fix ARM64/MSVC atomic memory ordering issues on Win11 by adding explicit DMB ?barriers Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Tue, Dec 16, 2025, at 8:57 PM, Thomas Munro wrote: > On Wed, Dec 17, 2025 at 10:40=E2=80=AFAM Nathan Bossart > wrote: Hey Nathan, Thomas, thanks for your continued investment of time in this= patch. More thoughts below, but I wonder if the thing to do is to comm= it this and then for me to follow-on with a few more targeted changes to= round out this platform combo? >> Hm. I think the USE_LLVM_BACKPORT_SECTION_MEMORY_MANAGER thing might= need >> work, too. We don't have any Windows buildfarm machines with LLVM en= abled, >> but IIUC it should be possible. Perhaps we can add that to unicorn. > > The LLVM code has never run on Windows and will likely need > patching... I know of at least one change required and will write > about that. I think it would be amazing to support this eventually, but as I'm not a= MSVC or Win11 guru this feels like a longer term patch. I'm still stru= ggling with simpler things at the moment. The platform is not well esta= blished so some libraries are missing or out of date. There's no ARM64-= native Perl either. >> > Also, while the patch >> > is targeting Windows 11 (IIUC), there are some notes in the docs th= at give >> > the impression Windows 10 is supported, too [0]. I could easily ch= ange it >> > to say that AArch64 requires Windows 11, but I don't know what to d= o with >> > the references to specific versions of Visual Studio and the Window= s SDK. When I get a chance I'll post a docs patch for debate/review. >> Actually, I'm not sure there's anything specific to Windows 11 in this >> patch, besides perhaps the choice to set USE_ARMV8_CRC32C uncondition= ally. >> I don't know how likely it is that someone will try to run Postgres on >> Windows on an AArch64 machine without CRC extension support, though. > > Assuming you haven't blocked OS updates, Windows stopped booting on > pre-ARMv8.1 hardware a while back. RPi4's Broadcom chip and the > Snapdragon 835 (found in the oldest Windows laptops, according to a > quick Google search) are ARMv8-A only, but did actually have the CRC32 > instructions, so it would actually work anyway. They also have the > optional NEON SIMD stuff, which we use unconditionally: > > /* > * We use the Neon instructions if the compiler provides access to the= m (as > * indicated by __ARM_NEON) and we are on aarch64. While Neon support= is > * technically optional for aarch64, it appears that all available 64-= bit > * hardware does have it. Neon exists in some 32-bit hardware too, bu= t we > * could not realistically use it there without a run-time check, whic= h seems > * not worth the trouble for now. > */ > > A single chip in this report lacked FEAT_CRC32, the X-Gene 1 from 2012: > > https://gpages.juszkiewicz.com.pl/arm-socs-table/arm-socs.html > > So I don't think it's worth worrying about, I was just mentioning the > "Windows 11 requires CRC32, Windows 10 is dead" thing to avoid Greg > being forced to waste time researching the missing feature test code > :-) The reason Windows can't boot on old ARM chips probably has more > to do with the modern atomics needed for decent lock performance, > which every kernel wants. I think there are a few things to offer up in the next few weeks: * docs * popcnt * SIMD * wiki page with HOWTO info for the next "brave" soul to give this a go * what else? What this patch does is get "unicorn" off the dead list, which would be = nice. -greg