Re: [PATCH v8 6/7] apei/ghes: Use unrcu_pointer for cmpxchg

From: Borislav Petkov
Date: Tue Oct 11 2022 - 06:34:10 EST


On Mon, Oct 10, 2022 at 02:35:58AM +0000, Jia He wrote:
> ghes_estatus_caches should be add rcu annotation to avoid sparse warnings.
> drivers/acpi/apei/ghes.c:733:25: sparse: sparse: incompatible types in comparison expression (different address spaces):
> drivers/acpi/apei/ghes.c:733:25: sparse: struct ghes_estatus_cache [noderef] __rcu *
> drivers/acpi/apei/ghes.c:733:25: sparse: struct ghes_estatus_cache *
> drivers/acpi/apei/ghes.c:813:25: sparse: sparse: incompatible types in comparison expression (different address spaces):
> drivers/acpi/apei/ghes.c:813:25: sparse: struct ghes_estatus_cache [noderef] __rcu *
> drivers/acpi/apei/ghes.c:813:25: sparse: struct ghes_estatus_cache *
>
> unrcu_pointer is to strip the __rcu in cmpxchg.

Is this only to shut up sparse or actually fixing anything?

--
Regards/Gruss,
Boris.

https://people.kernel.org/tglx/notes-about-netiquette