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

Justin He
2022-10-11T14:33:17Z

Hi Borislav

> -----Original Message-----
> From: Borislav Petkov <bp@alien8.de>
> Sent: Tuesday, October 11, 2022 6:34 PM
> To: Justin He <Justin.He@arm.com>
> Cc: Len Brown <lenb@kernel.org>; James Morse <James.Morse@arm.com>;
> Tony Luck <tony.luck@intel.com>; Mauro Carvalho Chehab
> <mchehab@kernel.org>; Robert Richter <rric@kernel.org>; Robert Moore
> <robert.moore@intel.com>; Qiuxu Zhuo <qiuxu.zhuo@intel.com>; Yazen
> Ghannam <yazen.ghannam@amd.com>; Jan Luebbe <jlu@pengutronix.de>;
> Khuong Dinh <khuong@os.amperecomputing.com>; Kani Toshi
> <toshi.kani@hpe.com>; Ard Biesheuvel <ardb@kernel.org>;
> linux-acpi@vger.kernel.org; linux-kernel@vger.kernel.org;
> linux-edac@vger.kernel.org; devel@acpica.org; Rafael J . Wysocki
> <rafael@kernel.org>; Shuai Xue <xueshuai@linux.alibaba.com>; Jarkko
> Sakkinen <jarkko@kernel.org>; linux-efi@vger.kernel.org; nd <nd@arm.com>;
> kernel test robot <lkp@intel.com>
> Subject: Re: [PATCH v8 6/7] apei/ghes: Use unrcu_pointer for cmpxchg
>
> 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?

My original purpose is to make it pass the sparse checking.

--
Cheers,
Justin (Jia He)