Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp1998439pxm; Sun, 27 Feb 2022 08:29:46 -0800 (PST) X-Google-Smtp-Source: ABdhPJzfu+2dFJT6hLDcc8UUy8R03t21587an5O6LlDabT+YtDcptzA/gasJqYi0n9936R/sba78 X-Received: by 2002:a63:f10d:0:b0:370:14d9:c1ce with SMTP id f13-20020a63f10d000000b0037014d9c1cemr14154980pgi.50.1645979386404; Sun, 27 Feb 2022 08:29:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645979386; cv=none; d=google.com; s=arc-20160816; b=qvv2QhhMBz8w7hVReSLBnuFnGpWWdgptUMU2ExBcMM/QV1/ttK28XrC52KUlpGCiwh JhN6uLQf3x74c8rIAyZLo2IGtNkLSWH0WR4CVEyJzRgAR5Jw5q+8u+4CLuC/v4LTaKBU JLKGSB+zkbawqURxhuDbdHx4c6BzOQ/jCAPqAc4CoZkmJCDZuHScn4MIGFC63XE8Zqqm VBBr4nWAD6TQlpFUM2hKbrNU9IgSNd9nZBpeNge36vIzS4966sWSjrsN4sJFgr/m7sHR 3sSafjkzAe6nwiC5MuZA8lVjFcZjL+dhKUoQ+tlUJMtbaBN1fDZlf3yIRfopOkUuNNJu Ku+Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:subject:from :references:cc:to; bh=Q9un8W4AHrcsrV+4eFdpeR2MS9bXFplIexubj2C7d7c=; b=OLOdR3G5tWXxm4+0/tnTl3oGvee7lJgUaSe94HzBB3bjN2qahAIyNgXf6AxRCTCyUC b2UoAQG/KIMjpDvcAbWaohasnmkLhsofssuXkAZ4sNzIhvW+xNDG3An3yfebGulKBeWt 40vxdySQhJY7+Q71AYTZ/fg4gNAbWsAP+PPJf1cFfYyK1tU56zNG6X2b3iXVW2xzeVVq bFM3HhWBIV912Rut/O6mGOkGqMeA9DVOHiDR9IJKv+YsNleB/5NTzGCFZE2A2lhMGHBJ ukPNuZeR3Gcs3AUNjVdPW90M//JibY42C3cCh30vTksKqQ8HZ9/74ntVMrTt75LKSxB5 usmw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=marcan.st Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a24-20020a056a001d1800b004e1da0265c0si6474789pfx.265.2022.02.27.08.29.04; Sun, 27 Feb 2022 08:29:46 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=marcan.st Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230331AbiB0Pel (ORCPT + 99 others); Sun, 27 Feb 2022 10:34:41 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51030 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229501AbiB0Pej (ORCPT ); Sun, 27 Feb 2022 10:34:39 -0500 Received: from mail.marcansoft.com (marcansoft.com [212.63.210.85]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7588747065; Sun, 27 Feb 2022 07:34:01 -0800 (PST) Received: from [127.0.0.1] (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: marcan@marcan.st) by mail.marcansoft.com (Postfix) with ESMTPSA id E09D3423CD; Sun, 27 Feb 2022 15:33:56 +0000 (UTC) To: Marc Zyngier Cc: Thomas Gleixner , Rob Herring , Sven Peter , Alyssa Rosenzweig , Mark Kettenis , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org References: <20220224130741.63924-1-marcan@marcan.st> <20220224130741.63924-4-marcan@marcan.st> <87mtif2eoz.wl-maz@kernel.org> From: Hector Martin Subject: Re: [PATCH v2 3/7] irqchip/apple-aic: Add Fast IPI support Message-ID: Date: Mon, 28 Feb 2022 00:33:54 +0900 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 MIME-Version: 1.0 In-Reply-To: <87mtif2eoz.wl-maz@kernel.org> Content-Type: text/plain; charset=utf-8 Content-Language: es-ES Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,NICE_REPLY_A, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 25/02/2022 23.39, Marc Zyngier wrote: > On Thu, 24 Feb 2022 13:07:37 +0000, >> if (!(pending & irq_bit) && >> - (atomic_read(per_cpu_ptr(&aic_vipi_enable, cpu)) & irq_bit)) >> - send |= AIC_IPI_SEND_CPU(cpu); >> + (atomic_read(per_cpu_ptr(&aic_vipi_enable, cpu)) & irq_bit)) { >> + if (static_branch_likely(&use_fast_ipi)) >> + aic_ipi_send_fast(cpu); > > OK, this is suffering from the same issue that GICv3 has, which is > that memory barriers don't provide order against sysregs. You need a > DSB for that, which is a pain. Something like this: Doesn't the control flow here guarantee the ordering? atomic_read() must complete before the sysreg is written since there is a control flow dependency, and the prior atomic/barrier dance ensures that read is ordered properly with everything that comes before it. -- Hector Martin (marcan@marcan.st) Public Key: https://mrcn.st/pub