From patchwork Tue Dec 8 14:32:39 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Thompson X-Patchwork-Id: 11958745 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=-16.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham 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 2231DC4361B for ; Tue, 8 Dec 2020 14:34:16 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (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 D390D23A5B for ; Tue, 8 Dec 2020 14:34:15 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D390D23A5B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.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=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:To:From: Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender :Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=MtYtdI2NPUzolPTI9FJDKPxnw/Q2sGEjvDB6ZniwBcs=; b=zHKbYZsmNWB9xFOqbuB797lzT+ z7XlCnTjzdmcXdDrvVo2xoGifRmGaZK+Qo2DecQnFL/nJjv5k6N5wAWq/FQQMdiEu6IGlvvzcQQKQ 9cvqGjGmVAkJ2caKv38zJIIMq2MiyXtIW2Q7qjyhAJbdd8vVOju0fQiBJrAXj1UCMV9Izyb/8P/zK OOY0B3b1fQKDYahxxgaFWYJwPxP0JMG9JmwYGi1M2FwxWBS7KxVeZa30azqOAd3QmemtBhSJ8mLKb 1F46/aod1d27OKiSMZ4VGN2KtkbEUBxpXIBm150/PDJz2PG3FSGOKE5VZVc6lmxY+7f7FsW+G5H+n TwPAWd6A==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kme32-0000PL-J1; Tue, 08 Dec 2020 14:33:00 +0000 Received: from mail-wr1-x442.google.com ([2a00:1450:4864:20::442]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kme30-0000OO-3B for linux-arm-kernel@lists.infradead.org; Tue, 08 Dec 2020 14:32:59 +0000 Received: by mail-wr1-x442.google.com with SMTP id r7so5186870wrc.5 for ; Tue, 08 Dec 2020 06:32:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=FhwBnGH/U8Xqw28a+YdxdYYHy57oO21DeTW4Enf63Uw=; b=lRZz4RbsIt4fuy9Ur8pDp8z200Zy/sUksg2tsbV8Tqj3DYjRArrUidclWk8POzjSnb U1wxN4637eCzRvJBWP2kQhfGRDuRF9ER/k7UZlLSSdui4zN3hfGcwYXbT/nGtAUImUr7 USxfwW+8GXMGlqnGTHWwdYRnOZTZ6tjpmNNePuHMEftY/EUsGFXwJUj8ucLBVg0XL+wN 0+FARj7duaovx+DWp8RNHKlRAn3Oz0cDSegO+H0FzAOC0Eetas/7X53PLW2an/Kackm/ 8IP/OOur3rUgeNlVAVL8HbozvwU0RwQV5qgYKSoQ1oQFP0yj3AHLK7BZT2BaKWbO/SNk OqCQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=FhwBnGH/U8Xqw28a+YdxdYYHy57oO21DeTW4Enf63Uw=; b=S01KreW52VKjBmq5WQV5nfmSxbtH6/yk9sSdpeIAixIU9xpFVLvwvoQWQK29U0NJOc 54RmStoS/3lEoEY5LX2ZZaSAOkKGvR0R6pHnlVt9q1mSXqJ1NZziY71ShTjAffEn3dK2 gDGJNWa8Pg1VKnXcu3+fZ9hIn+Rhzzo5rRSHcWwBj0IbMGEzn0VzUYjVGiuXaqiQsaLz o4usWCTZPdYpMKl9XRx9ZKyt42U86hFLSoafV4EwNGtJtmCLPYovrqijVUjyu+4G2eZi aStQU8ZbJzc+zRo98SNme5DpF/XPyzR4QSkCa4wgHjpSgSOrtQ4pP3/4eLXQR9oORzlC MJrw== X-Gm-Message-State: AOAM531t5pJzEwqRhVH/6KISUDCUkR4H9JhmYuh9tvmwBvzG/b3hCDqh IChjGQjaHgdU014Mb+rJw5LWOA== X-Google-Smtp-Source: ABdhPJwIc5kylMIuDFq9ZYONlAB6VjiAUSMzZXmTAnNv/IwaI5Ky33Y71CefkSvTy38yNymoNNLKrg== X-Received: by 2002:a5d:474d:: with SMTP id o13mr8886153wrs.379.1607437973309; Tue, 08 Dec 2020 06:32:53 -0800 (PST) Received: from holly.lan (cpc141216-aztw34-2-0-cust174.18-1.cable.virginm.net. [80.7.220.175]) by smtp.gmail.com with ESMTPSA id g192sm4030847wme.48.2020.12.08.06.32.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Dec 2020 06:32:52 -0800 (PST) From: Daniel Thompson To: Russell King Subject: [PATCH] ARM: Kconfig: Select ARCH_HAVE_NMI_SAFE_CMPXCHG where possible Date: Tue, 8 Dec 2020 14:32:39 +0000 Message-Id: <20201208143239.1129168-1-daniel.thompson@linaro.org> X-Mailer: git-send-email 2.28.0 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201208_093258_285867_6E6E153F X-CRM114-Status: GOOD ( 13.51 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Daniel Thompson , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, patches@linaro.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Currently ARCH_HAVE_NMI_SAFE_CMPXCHG is not set on Arm systems and this makes it impossible to enable features such as ftrace histogram triggers on Arm platforms. Most Arm systems are NMI safe simply because there is no NMI but this isn't universally true meaning we cannot set ARCH_HAVE_NMI_SAFE_CMPXCHG for all Arm devices. However the load/store exclusive implementation of cmpxchg is NMI-safe and this implementation is used ARMv6k and later. Let's select ARCH_HAVE_NMI_SAFE_CMPXCHG for these systems. Note that ARMv6 uses load/store exclusive for 32-bit cmpxchg but relies on interrupt masking for 8- and 16-bit operations. This patch is conservative and does not change behaviour for CPU_V6. Signed-off-by: Daniel Thompson --- arch/arm/Kconfig | 1 + 1 file changed, 1 insertion(+) base-commit: 0477e92881850d44910a7e94fc2c46f96faa131f -- 2.28.0 diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index 002e0cf025f59..fd434c5958b62 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -24,6 +24,7 @@ config ARM select ARCH_HAS_TEARDOWN_DMA_OPS if MMU select ARCH_HAS_TICK_BROADCAST if GENERIC_CLOCKEVENTS_BROADCAST select ARCH_HAVE_CUSTOM_GPIO_H + select ARCH_HAVE_NMI_SAFE_CMPXCHG if CPU_V7 || CPU_V7M || CPU_V6K select ARCH_HAS_GCOV_PROFILE_ALL select ARCH_KEEP_MEMBLOCK if HAVE_ARCH_PFN_VALID || KEXEC select ARCH_MIGHT_HAVE_PC_PARPORT