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

From: Greg Burd <greg(at)burd(dot)me>
To: Nathan Bossart <nathandbossart(at)gmail(dot)com>
Cc: Peter Eisentraut <peter(at)eisentraut(dot)org>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Dave Cramer <davecramer(at)gmail(dot)com>
Subject: Re: [PATCH] Fix ARM64/MSVC atomic memory ordering issues on Win11 by adding explicit DMB barriers
Date: 2025-11-21 19:40:37
Message-ID: 6A598039-4EB8-4F33-BEF1-183270F335CC@greg.burd.me
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


On Nov 20 2025, at 5:36 pm, Nathan Bossart <nathandbossart(at)gmail(dot)com> wrote:

> I took a quick look at 0001.

Thanks for taking a second to review!

> +#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?

It does in fact fail to compile without this part of the patch, I think
Dave posted a bug about this. I added the missing endif, thanks!

> --
> nathan

best.

-greg

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Jacob Champion 2025-11-21 19:42:41 Re: RFC 9266: Channel Bindings for TLS 1.3 support
Previous Message Greg Burd 2025-11-21 19:37:08 Re: [PATCH] Fix ARM64/MSVC atomic memory ordering issues on Win11 by adding explicit DMB ​barriers