From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id EA498C4332F for ; Fri, 14 Oct 2022 19:40:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231145AbiJNTki (ORCPT ); Fri, 14 Oct 2022 15:40:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41486 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229964AbiJNTkh (ORCPT ); Fri, 14 Oct 2022 15:40:37 -0400 Received: from mail.skyhub.de (mail.skyhub.de [IPv6:2a01:4f8:190:11c2::b:1457]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 45298A837C; Fri, 14 Oct 2022 12:40:36 -0700 (PDT) Received: from zn.tnic (p200300ea9733e7ed329c23fffea6a903.dip0.t-ipconnect.de [IPv6:2003:ea:9733:e7ed:329c:23ff:fea6:a903]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.skyhub.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id 70C4B1EC0745; Fri, 14 Oct 2022 21:40:30 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1665776430; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:in-reply-to:in-reply-to: references:references; bh=gS8YSB+heQVRjPD7iCJnDYGh7BxBWDNwHZ4jNTcuxBU=; b=M13u7k0pbfrU8wuADrTQVEqpeI8Y0B1I2VnJS6/MfDuTuPQeeTjPsITS+TOuwdYOTpOdCR K+MtYZU6CRQJI6NenTPCibhr5fig4MWHCBgylAWQ+84EBneoWZYlZ5gpswz3V/6bhYznaT z9QvCCxrpJZxIHRAtnhiDcRJ9c6TXEY= Date: Fri, 14 Oct 2022 21:40:26 +0200 From: Borislav Petkov To: Ard Biesheuvel Cc: Peter Zijlstra , Huang Ying , Justin He , Len Brown , James Morse , Tony Luck , Mauro Carvalho Chehab , Robert Richter , Robert Moore , Qiuxu Zhuo , Yazen Ghannam , Jan Luebbe , Khuong Dinh , Kani Toshi , "linux-acpi@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "linux-edac@vger.kernel.org" , "devel@acpica.org" , "Rafael J . Wysocki" , Shuai Xue , Jarkko Sakkinen , "linux-efi@vger.kernel.org" , nd , kernel test robot Subject: Re: [PATCH v8 6/7] apei/ghes: Use unrcu_pointer for cmpxchg Message-ID: References: <20221010023559.69655-7-justin.he@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-efi@vger.kernel.org On Fri, Oct 14, 2022 at 11:40:39AM +0200, Ard Biesheuvel wrote: > The cache struct pointer should not be published until after the > struct itself is fully populated. So on the producer side, some kind > of hardware barrier is definitely needed, or the struct may appear > half-baked to other cores that can read the updated pointer. Ah, right you are, ghes_estatus_cached() is called in all kinds of contexts and by other cores, sure. > OTOH the code seems to be working fine as is, so why modify it at all? > (apart from the purely cosmetic changes) peterz questioned that smp_wmb() there and then we started digging. And frankly, even if removing that barrier won't make any difference, I'd still prefer it gone and have the code simpler and cleaner. Thx. -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette