From patchwork Wed Oct 31 14:04:21 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Long X-Patchwork-Id: 149822 Delivered-To: patches@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp6835942ljp; Wed, 31 Oct 2018 07:04:44 -0700 (PDT) X-Received: by 2002:a9f:364a:: with SMTP id s10mr1341904uad.78.1540994683954; Wed, 31 Oct 2018 07:04:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540994683; cv=none; d=google.com; s=arc-20160816; b=U8QV3JQxZexkG8V57pxJShd0WyVsJS2MSW5kH92YD15mx7XsmnOWkI8hKyRYVPmQiZ cJICIQrA6ZAHStIbcRR7tsCvpibXnqrRjrbdR9N/Lt+ubw02v7vfUceofJyZ/4MjeCLG PISOUt6cGQZnKtWWwe4GLfeo8XQBi1HxzrmVCl+RXLp6tUuD4F7c3EH0A5fitQOl1xqa 1hNVYyZtjDGx71+iqwMrLOM5bnxpzc+ZHRvcmLzqyaCorYpiamQ1VpkteMbEqzVzhhph IoulJBxTuR4UzQSQroKRqaHHPAsDF9OD3rEy1/xtBS7lpoWZQjz+KZZQq4BPSs9fU880 zKEQ== 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=XEVPM1Mo+ku5rrRHAc518WvkerVTKSxDAXP6BlmW8w8=; b=SSUCace4lWBSsDeUfsunrwlkQIOtwiooP3WkyuSEGrm+taEdbC+IY45LXk5/Jpb6ZC 0gcl1sm2srdfPT7wf4OW4qpHh3yJP6w15z6g996q931Bt66l1gPuzZezgyN5ORBeYWD7 98RbyY/BKNK19TgFVzyf5cWe4CHHWvSZiaWF/y1OK1F6hKQCHjus/8JH2AD+gUSf2emP mJkwinm86Ex3WHOP+X9v4k/N1d4coKi1RbG+5oKJoAe24czlJE/SWLmrVHVopO6cWf/5 smxncugWwvaztuXvtiR7WN5BrbapeqOqeNpN2TW/27637oGQSyBlAxnD/GVc014Ack5f bDig== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=bKK36Lco; 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 c10sor16246799uak.27.2018.10.31.07.04.43 for (Google Transport Security); Wed, 31 Oct 2018 07:04:43 -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=bKK36Lco; 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=XEVPM1Mo+ku5rrRHAc518WvkerVTKSxDAXP6BlmW8w8=; b=bKK36Lco5Q19SzXvf1gDx04qFNWpUu1kbJOt3VOmE4rV5sW9mBr+LIFAY7wme4pRlw Hc9FAW+bGq54ERZXEMcu7Cu2HdewCGv0u65EsztqywB6yN5FM8G/GLxfB4WKeq+R92im ej98np2bX/486/PjpIK9djiM09XhRGEFBrWjs= 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=XEVPM1Mo+ku5rrRHAc518WvkerVTKSxDAXP6BlmW8w8=; b=Cm/s4k+esxA89edPyJAy35gMKzWYRsXSwsvvj8A80S+2eRa2jjjgPfl51LDtzauBl+ +E8dLlbL7XnRJ6ZcQ8gkyktklo48trHIB5b5L7v5Luh9pIrEcthnrbHrrQy60lycI3qt HXQaZ8dTix799RB7mSIj8tHLXmn8+xISyAZoRWtTz/ItRoWeFbs9AV1SHruQfJUgIxv9 UljumIZHcY8NXzaCh24wubyTHr1t5B1DrOP7i5kYH49EirFj3TPflRluoPrhYMSd8llp qyWCMW0ToChecr93t1pvWlsh33L6VplC2puM9apbTP8qqQxl5Ft4vTTXyDnC0SrCVpTj Ak6g== X-Gm-Message-State: AGRZ1gIVcndGsycmB9dlphJE5AkCma6NT8hww3bMoBUX0xGZOwWXDokJ kLjMg5V+5hoF92J4QKTQT4suJyPo X-Google-Smtp-Source: AJdET5e1MVU+Funpa0lxM6CwE66GfLhmlH3K+wqFyOm+3/gjLqT1kKGIySuL26WvVw6w/OYz3v6sxg== X-Received: by 2002:ab0:162e:: with SMTP id k43mr1322245uae.77.1540994683105; Wed, 31 Oct 2018 07:04:43 -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 6sm6795632vsy.25.2018.10.31.07.04.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 31 Oct 2018 07:04:42 -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.4 03/18] ARM: bugs: hook processor bug checking into SMP and suspend paths Date: Wed, 31 Oct 2018 10:04:21 -0400 Message-Id: <20181031140436.2964-4-dave.long@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181031140436.2964-1-dave.long@linaro.org> References: <20181031140436.2964-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 b26361355dae..334c319f5766 100644 --- a/arch/arm/kernel/smp.c +++ b/arch/arm/kernel/smp.c @@ -29,6 +29,7 @@ #include #include +#include #include #include #include @@ -396,6 +397,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;