Received: by 2002:a05:6358:bb9e:b0:b9:5105:a5b4 with SMTP id df30csp74456rwb; Fri, 2 Sep 2022 10:23:07 -0700 (PDT) X-Google-Smtp-Source: AA6agR74f0qfXk9x29Al9FrYmQF6z/Hpm9+/epx21B2ho347X51YRaMQNq2xIEQjvdq6/zhRG6fJ X-Received: by 2002:a17:90b:3d01:b0:1fe:682:6517 with SMTP id pt1-20020a17090b3d0100b001fe06826517mr5928530pjb.215.1662139387186; Fri, 02 Sep 2022 10:23:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662139387; cv=none; d=google.com; s=arc-20160816; b=rzyNTtqOVBpatdTHSBEUSRi+TozHrbcS5C+OKd/qy5D96wa50NlilKSAH/MPiIlFMy iKBnQNUH/pYRG+PB1mpjdxLAPK2l9rRCzZYU+6fWJF5uDmA4siI8z9YNK2IhTy0bE0ex zxnft2oQldLwn001laBPk+RAVDfR8UNDpA1LxcjnNR2mV5SE0bY26ObaB1KxnyiVyWCc HU1heQPwYRkHylP4YpcFoWknTcbtGw3VsyTd0CoSz1S57XdOPjx/4l6d3+X7iJoOrg1r 5lTysXlmmEdOM9BlliFK2OQylvTmt3BZA7neFAfs+roZS6lwn4hh/j37FTsZA3HGNir5 TJ5g== 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-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=QEmshmn2hTW3BQT/fgW+CBYftCWDcBtiOJ1q67Pmp6k=; b=Z3x7njBzUcqaseZR9pN8mfgyZKixWS87FyB4zCakyM4nGsz+ZidMjjHQLW0osKuBlD t76hxxOYTVOk2AGdYCBmhkJkJlwaQaUx3/fsvkK1Wh25xG5eoijUMzqox0ao61umihps +942O5t25W/ZHly/gSk5R0UmzCcEq8pd7QW88enmZZVlW0GJDwa4jTjQZSL4vFXu4LNP 3Tg/O6E63Y0DlfakFaURwg10+AfQgjpMnUxXsDdqeFe96cQ2zdDPpK+IF9wFO9OftFPt 80XbGbmU0LXqRxzVEjZa8WEyd9j5gC0IL619CfFnkkXmCbs01GhePJ/mj1FcViQ+AOoP EttQ== 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 w29-20020aa79a1d000000b0052d9edab4e1si2509943pfj.86.2022.09.02.10.22.54; Fri, 02 Sep 2022 10:23:07 -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 S236255AbiIBROD (ORCPT + 99 others); Fri, 2 Sep 2022 13:14:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47508 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233264AbiIBROC (ORCPT ); Fri, 2 Sep 2022 13:14:02 -0400 Received: from gate.crashing.org (gate.crashing.org [63.228.1.57]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 51F57112EED for ; Fri, 2 Sep 2022 10:14:01 -0700 (PDT) Received: from gate.crashing.org (localhost.localdomain [127.0.0.1]) by gate.crashing.org (8.14.1/8.14.1) with ESMTP id 282HAqvu018556; Fri, 2 Sep 2022 12:10:52 -0500 Received: (from segher@localhost) by gate.crashing.org (8.14.1/8.14.1/Submit) id 282HApOJ018555; Fri, 2 Sep 2022 12:10:51 -0500 X-Authentication-Warning: gate.crashing.org: segher set sender to segher@kernel.crashing.org using -f Date: Fri, 2 Sep 2022 12:10:51 -0500 From: Segher Boessenkool To: Peter Bergner Cc: Christophe Leroy , "linuxppc-dev@lists.ozlabs.org" , "linux-kernel@vger.kernel.org" , Nicholas Piggin , Zhouyi Zhou Subject: Re: [PATCH v2] powerpc: Fix irq_soft_mask_set() and irq_soft_mask_return() with sanitizer Message-ID: <20220902171051.GU25951@gate.crashing.org> References: <7c11b659-5b8e-256c-508e-39395041fccb@csgroup.eu> <20220831224522.GX25951@gate.crashing.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.3i X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_PASS, 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 Fri, Sep 02, 2022 at 10:57:27AM -0500, Peter Bergner wrote: > On 8/31/22 5:45 PM, Segher Boessenkool wrote: > > Yes, this is guaranteed. > > Agree with Segher here. That said, there was a gcc bug a looooong time > ago where gcc copied r13 into a temporary register and used it from there. r13 is a fixed register on most of our ABIs (everything that is not AIX or Darwin, even), so this can never happen. Except if there are bugs, of course ;-) > That's ok (correctness wise, but not ideal) from user land standpoint, > but we took a context switch after the reg copy and it was restarted on > a different cpu, so differnt local_paca and r13 value. We went boom > because the copy wasn't pointing to the correct local_paca anymore. > So it is very important the compiler always use r13 when accessing > the local_paca. Yes. So we either whould use -ffixed-r13, or just not use unsupported compilers. powerpc*-linux and powerpc*-elf work fine for example :-) Segher