Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp998943pxb; Fri, 1 Apr 2022 01:37:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzcvbx4wFP9SjRN/LOq5L0Iz1qOB5djWOCV3+29K1+zPUU23IaMaYDg7zIUQevgC2IRbodY X-Received: by 2002:a17:906:7307:b0:6da:92db:c78f with SMTP id di7-20020a170906730700b006da92dbc78fmr8474135ejc.35.1648802234497; Fri, 01 Apr 2022 01:37:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648802234; cv=none; d=google.com; s=arc-20160816; b=wq0O8HgJr2fhc0bkrffeCFCK41mf1yaOiYNVJZEt4qBSPZmisy6xrC0wZfOsIP3BwX +Vmzn3qdot+PNpBsLCs2g3ySFp+fLUlfw+rIWCxNnunOQonVhr0aSP9g37FkT/KT41XG 2J0GnfMbAln79koWClTfTcJud69Kg+ujZKdwjULybyXBPAf3kN6XuwowcM28pk2Ac7EC B2rkpWWgMg1oAmCVIFsM7poi0/TDEHw1ym6EBfLDfKCirIpVBVplEaaGYtq/Ufo5PTL6 T+KarTAgY0OIMaRLVlTIEd9ObSBaETjemf46VviSfdcJHH1Q+YkDVRcMcX4xWOUojXej 1Myg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=MzYA4iiLXFXxONXLynk0oAqOaEcdWHqmlT94Qw6bjj0=; b=tDddLpv5n6+OLKq4phGyTvmIoM+GY78mV9cnMPnV9WdOSJshBj87cQFHcYEBcuEQyO RgHB8/bY5ERh57K9K9EulHSHlbNC5sot8l2MqE5cFPRUbSR3I2Ct6PqFq3ekKIWeWnq7 ORARr5jar7dwRheACJcAn1EWXsIjO9oafN/W62ZPC8H1X+8t5XGvcfGePu8pnoSCqNi2 2eBbyC95p2kBZtp/M2CaECYS1dNW2L+qSj+5IiRHc2t3QychkIEzdVZ2EoZbsUQtF0Wg AEvanZ1aVaebY5DR7xsa9y4Bc5eTEqn54HeN45Gt3+Z+GaB1czYCI4TuX7IVgFt8RWdX nppQ== 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w11-20020a056402268b00b00418c2b5bdaesi1248678edd.144.2022.04.01.01.36.47; Fri, 01 Apr 2022 01:37:14 -0700 (PDT) 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236170AbiCaMfR (ORCPT + 99 others); Thu, 31 Mar 2022 08:35:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55768 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235086AbiCaMfQ (ORCPT ); Thu, 31 Mar 2022 08:35:16 -0400 Received: from verein.lst.de (verein.lst.de [213.95.11.211]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1A2482602 for ; Thu, 31 Mar 2022 05:33:29 -0700 (PDT) Received: by verein.lst.de (Postfix, from userid 2407) id A77D068AFE; Thu, 31 Mar 2022 14:33:22 +0200 (CEST) Date: Thu, 31 Mar 2022 14:33:22 +0200 From: Christoph Hellwig To: Heiko =?iso-8859-1?Q?St=FCbner?= Cc: Christoph Hellwig , palmer@dabbelt.com, paul.walmsley@sifive.com, aou@eecs.berkeley.edu, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, wefu@redhat.com, liush@allwinnertech.com, guoren@kernel.org, atishp@atishpatra.org, anup@brainfault.org, drew@beagleboard.org, arnd@arndb.de, wens@csie.org, maxime@cerno.tech, gfavor@ventanamicro.com, andrea.mondelli@huawei.com, behrensj@mit.edu, xinhaoqu@huawei.com, mick@ics.forth.gr, allen.baum@esperantotech.com, jscheid@ventanamicro.com, rtrauben@gmail.com, samuel@sholland.org, cmuellner@linux.com, philipp.tomsich@vrull.eu, Atish Patra Subject: Re: [PATCH v8 01/14] riscv: prevent null-pointer dereference with sbi_remote_fence_i Message-ID: <20220331123322.GA26378@lst.de> References: <20220324000710.575331-1-heiko@sntech.de> <20220324000710.575331-2-heiko@sntech.de> <20220331095155.GA23422@lst.de> <2260961.n0HT0TaD9V@diego> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <2260961.n0HT0TaD9V@diego> User-Agent: Mutt/1.5.17 (2007-11-01) X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_NONE,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 Thu, Mar 31, 2022 at 02:28:06PM +0200, Heiko St?bner wrote: > so essentially flushes the _local_ icache first and then tries to flush > caches on other cores, either via an ipi or via sbi. > > The remote-fence callback is set correctly during sbi_init(). > The other cores are only brought up after sbi-init is done. > > So it's not really about error reporting but making sure that flush_icache_all() > does something sane even when still running on the first core. > As I assume the "all" means on all available cores (which would be the > core the system booted on). > > Does this make it clearer what this tries to solve? A little. Whatever code calls this early still seems broken to me and just just do a local flush, though.