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: 339745 Delivered-To: patches@linaro.org Received: by 2002:a02:85a7:0:0:0:0:0 with SMTP id d36csp3738951jai; Tue, 8 Dec 2020 06:32:53 -0800 (PST) X-Received: by 2002:adf:d0c6:: with SMTP id z6mr25653728wrh.10.1607437973683; Tue, 08 Dec 2020 06:32:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607437973; cv=none; d=google.com; s=arc-20160816; b=oShDfMiceBCLFIRqY9b9mhdWg5OrdshCAxjGhyT91bfR9aE/hIxv0MiiNFm9wWqrYA /JPFePPmYDdnJXCutFD1HBcN1uhxmoNt1waAi9O+fOuUBcGoeol3VI68cpn0FPQjzK2Q xuIdX5k0MgFbnx1yIR4HxbVAwy20GQHwnD+53MSmwE+Gqpf4APqvDMRleWl7mKg/SfHw +3PIcKhMH7nXSf7celcfHCXvt3zz7CQttcHGxzpBrnLv1S/mK2kwHe9sR57LDz8oQRXE ehhFMt7OD/PfZbXHgeyNApMX2m/S7DpcrHWQa4DidYnpt98H/yyII1DFHGWVfLhyRBWI HRCw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:dkim-signature; bh=FhwBnGH/U8Xqw28a+YdxdYYHy57oO21DeTW4Enf63Uw=; b=ZFh6BCkJSipBVXEJIe3wN+cdezEtMTU5F78d3yDbYgKmKUUzlEFOTMhEzppX7Q7JHN nwTw94e84e34OBqKZ2YbGfpZCQeXGW7oMwOpt+eKw1JItH4X7IM1xvSBSSwcKSqvhtPw 9ZPGbXCc3LjN2U2+UOJU3m/QPmgZTvj62UavCPPPMf8wWu/gdmcSqwHS6Ke2f/hPpxig DxYxLnwi3t1WpzR5QEvQ4EEAuLoNBLmTcmYOEXUZeqn4/SKjijl2nREvY6y1W+Rf5VbM ovMUz/sSLenMtSn/wCnWgofgCJncqkK0+lJ5zziFRyf9mCHNTFRE1eoZ/TFHBiMh7vb5 BwnQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=lRZz4Rbs; spf=pass (google.com: domain of daniel.thompson@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=daniel.thompson@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id a16sor5837499wrg.29.2020.12.08.06.32.53 for (Google Transport Security); Tue, 08 Dec 2020 06:32:53 -0800 (PST) Received-SPF: pass (google.com: domain of daniel.thompson@linaro.org designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=lRZz4Rbs; spf=pass (google.com: domain of daniel.thompson@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=daniel.thompson@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org 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=jA66m4cPc0dkUCmM6SGvlGGj/GmLsiN6Rc+u/G/bF8Hdt2ipfeXqpmBSXywD2Smu+2 Y5UeMBijfivXpye+LDUla82BkWqT5pST8CjzsKYXMdmOFxrmd3D7yMMO7HtSIGa0wsMN ldF6odVo0/eP2KZ+EVL+G5Mi3NhtuUVfaUVhB5nROEfXZ5UHEdUTWUtDAFav59xpQPlM t53vu4i7rFeLGvtyTeqoQmHKG+unEXIhO5iyWSq9BteYgf2ZyS8HKrfSVNCA6WqKUfff lliuMqzu5mBafyYy9VxyUYA7Jdu5ZhN0FrAOMxCTtzp8wQcXnLBc3t0AqdsBHIVbGSaE FBYA== X-Gm-Message-State: AOAM533MPffmfa4RaV2Ckui98nDB17UOuDwv0EzQwH2/Crj3GtvrKD3V xJB2C6CorcI0wU1diWgIra7Ca9zO 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) Return-Path: 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 Cc: Daniel Thompson , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, patches@linaro.org 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 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