From patchwork Wed Oct 31 13:56:52 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Long X-Patchwork-Id: 149797 Delivered-To: patches@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp6826349ljp; Wed, 31 Oct 2018 06:57:21 -0700 (PDT) X-Received: by 2002:a67:6507:: with SMTP id z7mr1173677vsb.135.1540994241150; Wed, 31 Oct 2018 06:57:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540994241; cv=none; d=google.com; s=arc-20160816; b=ZhEsBn31k8qWtnrIs+17YaARVbOyudgxT6rkXEHtBlcqfq4Y8hXCn2IzPN6vrw591D Mzat7q135q27MHBJncvTuxxXkOY9bUI+MrzJkiZCYKFDf5jeMlgSeACfA6+3IDMMKiPH t9ZHClR3c8Tz+gaJT/hQu3dMjZQtWe5Y733E4PCa0qhJlguRdqEnEVP3vu4hwWwwiS98 eUwM0iepPwIoIMfC0iNRh+7ykrSEvKmCVqRfUFkzxyLgBoomP+j4/YP2zXym5/KKa76+ kuBUvzwfbCzO39Bwg4Tp7+dZGNhOzthH//PQpklqSkzdK+004d71wBr2wi6fzTySYoL0 S8UQ== 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=sBccI9A/n0lBKR8TMyeFz6xWoe0cLonIbPRD/Kwb2yCRJHXEbfSMvbsxht6ZgQxQCG CQLHytaY+LnKM8jsuBapPzl2tQIW6aAd5l298/E1Qxh2TlvnIzX6V2VH635bkyG+jVW1 8siNmDDCjEXIuKNxPBcHRu8asrlRvzl4MwdvuD9+0qNwkbAPBsJWwB6QeL8URXwn0chB Rpvxkq35p6lZevaseQZwdN7ef1zy/HZKT4Ueb86AInFu1/gdCZKG3S5P9SKsBOZY31yq 3tfbkGrcGDafxU4PvJowSPjU+MrrKhEU3EufWcLlY70VcZYR5OOqeiHz494K/YVU8zIR WI0w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=dzeUehjc; 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 f134sor16039451vsd.67.2018.10.31.06.57.20 for (Google Transport Security); Wed, 31 Oct 2018 06:57:21 -0700 (PDT) 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=dzeUehjc; 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=dzeUehjcG+yj4mj2r8360vnADdkp+ttIEOAqFUqU0j8uOFjk/a0oV01OXw7mT5ywCn hF//qVRpBoeVT0x+M7NaBE/McNCgGowGNsjk9zkqZo/RBbeeirLTBKKtbc2OHTWeirmM LRhgxAnaaJ+BeFWYe8dR4SDVZvhhApxitRpf0= 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=PoGQ17G3DQE6pvB3VOCml9NgmV2kRetNfi16cB8YaPi0hgxS5vPYqfhCuOiVt38AkX 7kblu2QN17C/on3a8P+PYSGuW56GsXPL0QTVrgRhZf6jiqTmTxHP/QoW8xbwjgTJGsVj KFmtbBDQIGAfu2SkMyCiiyRa+V2TbSicrv+d4c/BxR7tWZta12yeUP7NJ54smtU+/gtI A96z0JbQ3k0/e2VPVucNfHhQi/9MOc52bEF/zCAbf7bN0v2RxfFMTJY7ZRHokNh5p8aX W1hkVAKCCdvnICWuwall3yj/zC2bXf5v5Epx5DqdcamtRyXRPy8aPTl8b9Iu0ULMYZMO eFiw== X-Gm-Message-State: AGRZ1gLuk74K3BvoYXd6adk+nSDl/VohQjubbyclE+ox4Y2LN5cbpxCB 5+A4RNzP95JZkkuaeKNwOBODUdYo X-Google-Smtp-Source: AJdET5drnJ6JCbv2D7hTGXI99Lh04ASVsf+O9z4o6RmNACwJ0CvhuJo25LqIEaQlXIoHb4w0b1TmbA== X-Received: by 2002:a67:1c45:: with SMTP id c66mr1318819vsc.195.1540994240466; Wed, 31 Oct 2018 06:57:20 -0700 (PDT) Return-Path: Received: from dave-Dell-System-XPS-L502X.hsd1.nh.comcast.net ([2603:3005:3403:7100:2c71:8680:34e1:a6aa]) by smtp.googlemail.com with ESMTPSA id s85-v6sm2275624vse.29.2018.10.31.06.57.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 31 Oct 2018 06:57:19 -0700 (PDT) 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 03/24] ARM: bugs: hook processor bug checking into SMP and suspend paths Date: Wed, 31 Oct 2018 09:56:52 -0400 Message-Id: <20181031135713.2873-4-dave.long@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181031135713.2873-1-dave.long@linaro.org> References: <20181031135713.2873-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;