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 X-Spam-Level: X-Spam-Status: No, score=-5.7 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 20A3EC433E6 for ; Fri, 19 Mar 2021 13:54:03 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A1DE564EF6 for ; Fri, 19 Mar 2021 13:54:02 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A1DE564EF6 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:Reply-To:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=FK9ckRFzrsOomjuZwzBuifOmuOi8oiGYQXbU4Yk5zLQ=; b=Fr2uFY5RjCjoc2KZrUYKMBt49 TRO23XsLsRAitD8rei9CxjsA5CNEZOAueA/BoUFS4t6M+ePU0ofAX/+jsuTwH3uPXw13WO9yIhQ63 o6XZkiioKnXJyXnQVUtcP/kOJC1hO3UC+3drMdZJ8zAtjtja3MS1HLjNkou70qhnt8gSrLtF516xd JFN1J0qaWNKCdhFlD0Z5SwwcAwPgHELFj5POnFDfJVhWaSidh5bTfImDI6mmLEy9AqwakYQ4wmjw2 HmpTlEXCAZMVyzKhayP8w8suQAqzfko3xpPSpvjinUlKRCTtOYa/g2XJBIenWSgtp4ycHIMtcMXPI hmcvqlAyA==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lNFYM-007V7U-UQ; Fri, 19 Mar 2021 13:52:39 +0000 Received: from mail.kernel.org ([198.145.29.99]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lNFYH-007V6l-Fg for linux-arm-kernel@lists.infradead.org; Fri, 19 Mar 2021 13:52:35 +0000 Received: by mail.kernel.org (Postfix) with ESMTPSA id 471DA64F11; Fri, 19 Mar 2021 13:52:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1616161950; bh=eXYRVG8V5cFHhvvCxRCR6CpklONXTFOtZAF1rugeN1k=; h=Date:From:To:Cc:Subject:Reply-To:References:In-Reply-To:From; b=aaSzKBB6WrtY0zuvqawgEQnvaHKWbIGyDSanjQm7iV2Hcw4DpxMYu7Sd7V6odgg36 4H80Ac4DMy3kMqPBNzLlh89krAyZacKoDjKmYE8NpYvm5LtiY/OZxsp4yKwJsKtZBP wlr5FlyjFQwaObt+oYxx9QHXq3wsDA1DiIwPyyzan6HPv7x/PA04UWLXNtPrdHD3R4 PdvbSoE+EV7KI+YhGn9fwJLQfUPLf9wx6R4vniJavbHlIcpxtdnRLj3zRh5QBV7qH6 Ixfc08P6a7WhWsOYuphp4RNLt25LV7Cws1jcVyVLFxW//GX7LfY43IUZaas4Zx7nSq t7ZgtZaxjhaIQ== Received: by paulmck-ThinkPad-P72.home (Postfix, from userid 1000) id 00923352261C; Fri, 19 Mar 2021 06:52:29 -0700 (PDT) Date: Fri, 19 Mar 2021 06:52:29 -0700 From: "Paul E. McKenney" To: Peter Zijlstra Cc: Sami Tolvanen , Kees Cook , Nathan Chancellor , Nick Desaulniers , Masahiro Yamada , Will Deacon , Jessica Yu , Arnd Bergmann , Tejun Heo , Christoph Hellwig , bpf , linux-hardening@vger.kernel.org, linux-arch , linux-arm-kernel , linux-kbuild , PCI , LKML Subject: Re: [PATCH v2 01/17] add support for Clang CFI Message-ID: <20210319135229.GJ2696@paulmck-ThinkPad-P72> References: <20210318171111.706303-1-samitolvanen@google.com> <20210318171111.706303-2-samitolvanen@google.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210319_135233_833874_A95EE04D X-CRM114-Status: GOOD ( 19.76 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: paulmck@kernel.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Fri, Mar 19, 2021 at 01:26:59PM +0100, Peter Zijlstra wrote: > On Thu, Mar 18, 2021 at 04:48:43PM -0700, Sami Tolvanen wrote: > > On Thu, Mar 18, 2021 at 3:29 PM Peter Zijlstra wrote: > > > > > > On Thu, Mar 18, 2021 at 10:10:55AM -0700, Sami Tolvanen wrote: > > > > +static void update_shadow(struct module *mod, unsigned long base_addr, > > > > + update_shadow_fn fn) > > > > +{ > > > > + struct cfi_shadow *prev; > > > > + struct cfi_shadow *next; > > > > + unsigned long min_addr, max_addr; > > > > + > > > > + next = vmalloc(SHADOW_SIZE); > > > > + > > > > + mutex_lock(&shadow_update_lock); > > > > + prev = rcu_dereference_protected(cfi_shadow, > > > > + mutex_is_locked(&shadow_update_lock)); > > > > + > > > > + if (next) { > > > > + next->base = base_addr >> PAGE_SHIFT; > > > > + prepare_next_shadow(prev, next); > > > > + > > > > + min_addr = (unsigned long)mod->core_layout.base; > > > > + max_addr = min_addr + mod->core_layout.text_size; > > > > + fn(next, mod, min_addr & PAGE_MASK, max_addr & PAGE_MASK); > > > > + > > > > + set_memory_ro((unsigned long)next, SHADOW_PAGES); > > > > + } > > > > + > > > > + rcu_assign_pointer(cfi_shadow, next); > > > > + mutex_unlock(&shadow_update_lock); > > > > + synchronize_rcu_expedited(); > > > > > > expedited is BAD(tm), why is it required and why doesn't it have a > > > comment? > > > > Ah, this uses synchronize_rcu_expedited() because we have a case where > > synchronize_rcu() hangs here with a specific SoC family after the > > vendor's cpu_pm driver powers down CPU cores. > > Broken vendor drivers seem like an exceedingly poor reason for this. The vendor is supposed to make sure that RCU sees the CPU cores as either deep idle or offline before powering them down. My guess is that the CPU is powered down, but RCU (and probably much else in the system) thinks that the CPU is still up and running. So I bet that you are seeing other issues as well. I take it that the IPIs from synchronize_rcu_expedited() have the effect of momentarily powering up those CPUs? Thanx, Paul _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel