Re: [PATCH] Fix ARM64/MSVC atomic memory ordering issues on Win11 by adding explicit DMB barriers

Dave Cramer <davecramer@gmail.com>

From: Dave Cramer <davecramer@gmail.com>
To: Nathan Bossart <nathandbossart@gmail.com>
Cc: Greg Burd <greg@burd.me>, Peter Eisentraut <peter@eisentraut.org>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2025-11-21T09:46:13Z
Lists: pgsql-hackers

Commits

Same data as JSON: GET /api/v1/messages/:b64id/commits the thread's linked commits as JSON, with link sources. API reference →
  1. MSVC: Support building for AArch64.

On Thu, 20 Nov 2025 at 17:36, Nathan Bossart <nathandbossart@gmail.com>
wrote:

> I took a quick look at 0001.
>
> +#ifdef _MSC_VER
> +#include <intrin.h>
> +#else
>  #include <arm_acle.h>
>  unsigned int crc;
>
> I think you can remove this since we unconditionally do the runtime check
> for MSVC.  In any case, the missing #endif seems likely to cause
> problems.
>
> --- a/src/port/pg_crc32c_armv8.c
> +++ b/src/port/pg_crc32c_armv8.c
> @@ -14,7 +14,9 @@
>   */
>  #include "c.h"
>
> +#ifndef _MSC_VER
>  #include <arm_acle.h>
> +#endif
>
> Hm.  Doesn't MSVC require intrin.h?
>
> --
> nathan
>

I  posted this as a bug with Microsoft
https://developercommunity.visualstudio.com/t/MSVCs-_InterlockedCompareExchange-doe/11004239

Dave