Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp19107969rwd; Wed, 28 Jun 2023 05:18:18 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6LKZrCqEpJrL70vqFCown5xtjMLNbSFCtXIADOx5s6AO4yrulnD3AiqpHlEhpQlhmpbAUu X-Received: by 2002:a05:6a20:158f:b0:126:bd71:b941 with SMTP id h15-20020a056a20158f00b00126bd71b941mr8029120pzj.45.1687954698107; Wed, 28 Jun 2023 05:18:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687954698; cv=none; d=google.com; s=arc-20160816; b=qVZ2sleQWCA/zcOUQ4RtCq6+RhuSwI/6N6Op/31brsNVD/ikG7GR2nOygzCCXADKCc bBP6BVL/c06j+x20BLLUmuC7zAHAm0ee+tvV/XcI7j4uLzczUyT4rvIoBu1M1SHuFg/f O2AoyE/nvpn9Lhik2m1mHERUAEv/giijv/qlH8lloFnPWbxXlMOxDkMUd4aC0BZ6YHjQ aAMG/5buPEq93n5iHhOzt1ioVUsgTZXAuLmTj4h+V2QwdezfeTQhqrqMC1AWQqwf13tD Qm9RDJTEdAiEOkvOx3NoAXWp5/kuSNWdC4e5iv0Nv25RlgTF+ROo4zwVITDNqsuzWzDM MYbw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=txuZggBGh21j7GCSjauQXHjKLjeOyzt1QTzSV6PqLf8=; fh=5yZCkUb683Alkz57M9N9XOT08apWLBem2/A2JMWABN0=; b=vhYAp3kjbU2YFNHsGrlpIjIGoOx2rwH9OzgHXxCjvryT0h1Uh5dIMsgfzJdxgGMcrc 5erIij9o4cHSQ6UT/od3+xvBl39b8MaUFmIbr/qDSdYqhpYJUPcgpuAMYI8a1xf2mQxY TDrGcKxHcREQZ13h0U8NKKFCm+FFcmiuEZ/Qunq73aM+LFxDYYHYzvEfgyJtHwnGdhLl 7NngXnSP6MUTwCKm62nmxW2puUXHOtqH6mELPIeStUoScqQ8BCih6yvF4nd38Kk5ONMU Mt6hUs9CfctztXFdd6vIfTmMPyrWGZyJeBbTeSXmrJMXw7OD1uxZ8QbDFGDyHyAMwdl8 590g== 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=NONE dis=NONE) header.from=arm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id cj22-20020a056a00299600b006634db9e11dsi4287090pfb.313.2023.06.28.05.18.05; Wed, 28 Jun 2023 05:18:18 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231185AbjF1Lmu (ORCPT + 99 others); Wed, 28 Jun 2023 07:42:50 -0400 Received: from foss.arm.com ([217.140.110.172]:54076 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231578AbjF1Lmj (ORCPT ); Wed, 28 Jun 2023 07:42:39 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 84BC9C14; Wed, 28 Jun 2023 04:43:21 -0700 (PDT) Received: from FVFF77S0Q05N (unknown [10.57.29.147]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 9EED83F663; Wed, 28 Jun 2023 04:42:35 -0700 (PDT) Date: Wed, 28 Jun 2023 12:42:32 +0100 From: Mark Rutland To: Guenter Roeck Cc: linux-kernel@vger.kernel.org, akiyks@gmail.com, boqun.feng@gmail.com, corbet@lwn.net, keescook@chromium.org, linux@armlinux.org.uk, linux-doc@vger.kernel.org, mchehab@kernel.org, paulmck@kernel.org, peterz@infradead.org, rdunlap@infradead.org, sstabellini@kernel.org, will@kernel.org Subject: Re: [PATCH v2 04/27] locking/atomic: make atomic*_{cmp,}xchg optional Message-ID: References: <20230605070124.3741859-1-mark.rutland@arm.com> <20230605070124.3741859-5-mark.rutland@arm.com> <32395f1f-19e4-41da-9f67-68c7d21cf9b2@roeck-us.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <32395f1f-19e4-41da-9f67-68c7d21cf9b2@roeck-us.net> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jun 27, 2023 at 10:07:07AM -0700, Guenter Roeck wrote: > Hi, Hi Guenter, > On Mon, Jun 05, 2023 at 08:01:01AM +0100, Mark Rutland wrote: > > Most architectures define the atomic/atomic64 xchg and cmpxchg > > operations in terms of arch_xchg and arch_cmpxchg respectfully. > > > > Add fallbacks for these cases and remove the trivial cases from arch > > code. On some architectures the existing definitions are kept as these > > are used to build other arch_atomic*() operations. > > > > Signed-off-by: Mark Rutland > > Reviewed-by: Kees Cook > > Cc: Boqun Feng > > Cc: Paul E. McKenney > > Cc: Peter Zijlstra > > Cc: Will Deacon > > This patch results in: > > ERROR: modpost: "__xchg_called_with_bad_pointer" [lib/atomic64_test.ko] undefined! > > when trying to build sparc64:allmodconfig. Hmm... it seems that in that configuration, the compiler decides to place __arch_xchg() out-of-line, and hence can't remove the call to __xchg_called_with_bad_pointer() via dead code elimination. So this is due to tickling the compiler into making a different inlining decision rather than due to a semantic issue in the patch. Marking __arch_xchg() as __always_inline solves that in local testing, and we should do likewise for the other bits used under the arch_ atomics. I'll try to spin a patch for that soon, unless someone beats me to it. Thanks, Mark. > > Guenter > > --- > bisect log: > > # bad: [60e7c4a25da68cd826719b685babbd23e73b85b0] Add linux-next specific files for 20230626 > # good: [45a3e24f65e90a047bef86f927ebdc4c710edaa1] Linux 6.4-rc7 > git bisect start 'HEAD' 'v6.4-rc7' > # good: [1fc7b1b3c9c3211898874f51919fcb1cf6f1cc79] Merge branch 'main' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next.git > git bisect good 1fc7b1b3c9c3211898874f51919fcb1cf6f1cc79 > # good: [4fce1fc9cf89412590fb681fa480cde0b23b3381] Merge branch 'for-next' of git://git.kernel.dk/linux-block.git > git bisect good 4fce1fc9cf89412590fb681fa480cde0b23b3381 > # bad: [cf1a0283badf6d0bfb91876583c24ef535a3c04c] Merge branch 'driver-core-next' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core.git > git bisect bad cf1a0283badf6d0bfb91876583c24ef535a3c04c > # bad: [3c5388e722ea98022b4d557ab33acca2eb16c4f0] Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git > git bisect bad 3c5388e722ea98022b4d557ab33acca2eb16c4f0 > # good: [997730bdbf14f352ab03e42461f500aafdabc03e] Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git > git bisect good 997730bdbf14f352ab03e42461f500aafdabc03e > # bad: [6fd8266556af196763b9f876ed682873e605469b] Merge branch into tip/master: 'ras/core' > git bisect bad 6fd8266556af196763b9f876ed682873e605469b > # good: [37380ea71463658934c2d3167d559d4034ea1c5b] Merge branch into tip/master: 'irq/core' > git bisect good 37380ea71463658934c2d3167d559d4034ea1c5b > # bad: [a967852939f864c35f155a2f431292ad6fc3fed9] Merge branch into tip/master: 'locking/core' > git bisect bad a967852939f864c35f155a2f431292ad6fc3fed9 > # bad: [e50f06ce2d876c740993b5e3d01e203520391ccd] locking/atomic: m68k: add preprocessor symbols > git bisect bad e50f06ce2d876c740993b5e3d01e203520391ccd > # good: [b1fe7f2cda2a003afe316ce8dfe8d3645694a67e] x86,intel_iommu: Replace cmpxchg_double() > git bisect good b1fe7f2cda2a003afe316ce8dfe8d3645694a67e > # good: [14d72d4b6f0e88b5f683c1a5b7a876a55055852d] locking/atomic: remove fallback comments > git bisect good 14d72d4b6f0e88b5f683c1a5b7a876a55055852d > # bad: [f739287ef57bc01155e556033462e9a6ff020c97] locking/atomic: arc: add preprocessor symbols > git bisect bad f739287ef57bc01155e556033462e9a6ff020c97 > # bad: [d12157efc8e083c77d054675fcdd594f54cc7e2b] locking/atomic: make atomic*_{cmp,}xchg optional > git bisect bad d12157efc8e083c77d054675fcdd594f54cc7e2b > # good: [a7bafa7969da1c0e9c342c792d8224078d1c491c] locking/atomic: hexagon: remove redundant arch_atomic_cmpxchg > git bisect good a7bafa7969da1c0e9c342c792d8224078d1c491c > # first bad commit: [d12157efc8e083c77d054675fcdd594f54cc7e2b] locking/atomic: make atomic*_{cmp,}xchg optional >