From patchwork Wed Nov 7 16:43:41 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Long X-Patchwork-Id: 150418 Delivered-To: patches@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp5387143ljp; Wed, 7 Nov 2018 08:44:09 -0800 (PST) X-Received: by 2002:ac8:3a64:: with SMTP id w91mr974621qte.70.1541609049191; Wed, 07 Nov 2018 08:44:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541609049; cv=none; d=google.com; s=arc-20160816; b=xS2nMlLfOUg82o4+bOoLoHo686o3+VHiPdVzyepUkRMYIo5aLFFGRf5ORejyDb4JiZ qvvONfkJRzrzD2QSAI7dRFPVbNCgeV4KQbO32PVQ0ApzQ63sjOws3cM9frIXQfzTuki8 db5QUjMpNTpfK97v2Gky666XHN1lywcXIHIG1/gfnvQBfMnvg2lAwyjY3+7EvTLTXM6I SarQ/3POw+4/ot3YEgn33IQ1HIhp2zEfNrHGh3XLuZc4a++9suw/tBI4wR0tmXp99QKP lMaTMEiDKwrpoRFcNAaUhVkm5uMTebduNPVvSDwK6GC84HJ6B/zKW30kyBWM/T2F8d4l s0DA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=V5xqjqmf9Ei8QgO6vxkYp2SthRErBOksFzLb6U6Ipfg=; b=s+6ATrWbE3U4ro3IXGudVMlukGabPXTXpumRkQrcDxpwifdKjC/2CvJuWl368JGH+o +IiuD9tIOh5AIzzu3wpsZ6zUPQBNqFLSkU9zVbX852cFHW2t967i1IoB4EGncRwj6mzi NJbnMF3B0hhqUdJ8ODhysXZouNEKVVtaJe2wo3KyJfs+Z66RT56S5ivSgKJYGcc1RwfW x8uoZ09i0ppL1PBIt53QWqVsX/YZ57pc7RJ8+AA3J0OtMm17/eNUAjI1tD1LnH7ObqBp 3viK2Wb0chtaaAppKCuZFBgViEewNdlB6e6sh09DQAu6tLhP/HQHMWEdGF4jCsCLfOb0 LlVw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=hio8PBDV; spf=pass (google.com: domain of dave.long@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=dave.long@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 p16sor1280252qtn.60.2018.11.07.08.44.09 for (Google Transport Security); Wed, 07 Nov 2018 08:44:09 -0800 (PST) Received-SPF: pass (google.com: domain of dave.long@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=hio8PBDV; spf=pass (google.com: domain of dave.long@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=dave.long@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:in-reply-to:references; bh=V5xqjqmf9Ei8QgO6vxkYp2SthRErBOksFzLb6U6Ipfg=; b=hio8PBDVBAR85PEIWPnFQXpFp6RY6ZhOXRcJPA5JCZov8RbO5HDjTM0/WJG13DA9Qf pGqeAFCzJNapUv63cuUvjV4bpDst19FLUzmgETjBBOOrIWZiCkwP7Ms/nMyj6nB4LW/q 9Mzx4hNGxUh+15HcvZNZwwmTjtI0GUdQkAQR4= 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:in-reply-to :references; bh=V5xqjqmf9Ei8QgO6vxkYp2SthRErBOksFzLb6U6Ipfg=; b=I50cdO5Nxe+6Yj8Z1276+ENzML4hIgVCkQxro8Ga8VB3k5L4kJ1IuDgg0I/mqZIk1M L+YRkggQk8potKubqhILsURpkPIpc200Jg+hvp5rk/VBl+32Q9LwXP7DEnxtlWVKG2El aL+r5ItxII13g1A5BeE4yjCDSKSxfJVc8OQ9A0Mkv/GjwhGBW0fyUv6+8ArdHH0tYklL HD1KlDbzQVchgCQ8gWGCNTGS7VPlXWt1trobM6SA19wtOUn8fZlRjc6qFNMuIhxywq4p JxA7juxN8mTXFsj7IdUSCSVjpQd6/Ousl+c5o3Rr7fOiiCr0RpllLHRPlZqfy3Vp5IP7 Nb8Q== X-Gm-Message-State: AGRZ1gJNy80lxVYx5+/zUP5ceGnZgdMLPhHd85vXE3rgR6mCWUt+7BzK PC7PeaZuQaqG2boaBGSlnblNbYjxcpVunQ== X-Google-Smtp-Source: AJdET5d1yEtvZzELTCvZ60WSKdIRh+kpyvBCUL6r+XbXsbQJwiOtDxw9rHrZ6BzioxJD3lyRyQLTCw== X-Received: by 2002:ac8:d86:: with SMTP id s6mr942137qti.324.1541609048645; Wed, 07 Nov 2018 08:44:08 -0800 (PST) Return-Path: Received: from localhost.localdomain (pool-72-71-243-63.cncdnh.fast00.myfairpoint.net. [72.71.243.63]) by smtp.googlemail.com with ESMTPSA id 96-v6sm681817qtc.56.2018.11.07.08.44.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 07 Nov 2018 08:44:08 -0800 (PST) From: David Long To: stable@vger.kernel.org, Russell King - ARM Linux , Florian Fainelli , Tony Lindgren , Marc Zyngier , Mark Rutland Cc: Greg KH , Mark Brown Subject: [PATCH 4.9 V2 03/24] ARM: bugs: hook processor bug checking into SMP and suspend paths Date: Wed, 7 Nov 2018 11:43:41 -0500 Message-Id: <20181107164402.9380-4-dave.long@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181107164402.9380-1-dave.long@linaro.org> References: <20181107164402.9380-1-dave.long@linaro.org> From: Russell King Commit 26602161b5ba795928a5a719fe1d5d9f2ab5c3ef upstream. Check for CPU bugs when secondary processors are being brought online, and also when CPUs are resuming from a low power mode. This gives an opportunity to check that processor specific bug workarounds are correctly enabled for all paths that a CPU re-enters the kernel. Signed-off-by: Russell King Reviewed-by: Florian Fainelli Boot-tested-by: Tony Lindgren Reviewed-by: Tony Lindgren Acked-by: Marc Zyngier Signed-off-by: David A. Long --- arch/arm/include/asm/bugs.h | 2 ++ arch/arm/kernel/bugs.c | 5 +++++ arch/arm/kernel/smp.c | 4 ++++ arch/arm/kernel/suspend.c | 2 ++ 4 files changed, 13 insertions(+) -- 2.17.1 diff --git a/arch/arm/include/asm/bugs.h b/arch/arm/include/asm/bugs.h index ed122d294f3f..73a99c72a930 100644 --- a/arch/arm/include/asm/bugs.h +++ b/arch/arm/include/asm/bugs.h @@ -14,8 +14,10 @@ extern void check_writebuffer_bugs(void); #ifdef CONFIG_MMU extern void check_bugs(void); +extern void check_other_bugs(void); #else #define check_bugs() do { } while (0) +#define check_other_bugs() do { } while (0) #endif #endif diff --git a/arch/arm/kernel/bugs.c b/arch/arm/kernel/bugs.c index 88024028bb70..16e7ba2a9cc4 100644 --- a/arch/arm/kernel/bugs.c +++ b/arch/arm/kernel/bugs.c @@ -3,7 +3,12 @@ #include #include +void check_other_bugs(void) +{ +} + void __init check_bugs(void) { check_writebuffer_bugs(); + check_other_bugs(); } diff --git a/arch/arm/kernel/smp.c b/arch/arm/kernel/smp.c index 7dd14e8395e6..d2ce37da87d8 100644 --- a/arch/arm/kernel/smp.c +++ b/arch/arm/kernel/smp.c @@ -29,6 +29,7 @@ #include #include +#include #include #include #include @@ -400,6 +401,9 @@ asmlinkage void secondary_start_kernel(void) * before we continue - which happens after __cpu_up returns. */ set_cpu_online(cpu, true); + + check_other_bugs(); + complete(&cpu_running); local_irq_enable(); diff --git a/arch/arm/kernel/suspend.c b/arch/arm/kernel/suspend.c index 9a2f882a0a2d..134f0d432610 100644 --- a/arch/arm/kernel/suspend.c +++ b/arch/arm/kernel/suspend.c @@ -1,6 +1,7 @@ #include #include +#include #include #include #include @@ -34,6 +35,7 @@ int cpu_suspend(unsigned long arg, int (*fn)(unsigned long)) cpu_switch_mm(mm->pgd, mm); local_flush_bp_all(); local_flush_tlb_all(); + check_other_bugs(); } return ret;