From patchwork Mon Oct 15 15:31:57 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Long X-Patchwork-Id: 148853 Delivered-To: patches@linaro.org Received: by 2002:a2e:8595:0:0:0:0:0 with SMTP id b21-v6csp3933727lji; Mon, 15 Oct 2018 08:32:25 -0700 (PDT) X-Received: by 2002:ac8:76d6:: with SMTP id q22-v6mr17039212qtr.351.1539617544923; Mon, 15 Oct 2018 08:32:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539617544; cv=none; d=google.com; s=arc-20160816; b=EUq/gqnvSKRwULfyhtNmTQcCOahN0HCI4hwScz7/Qv6HyBMTjyZWHAMb3CLKtyQ39g Powd7OUJ1tcEhhDCRRWzEQftswgCwxiJJj76RoWpu7h9Mxo1d+56IJChK68HVmbb0eWo Lg6ln7U8e+kjeOGYxpMj2mrLN4sxlQJwOeNNgIXHSeVmGxD0fc+LhV4dblK9OoY71Ybj dt16S2sRuXbnzN4ilUpDovmhzArtzCN/bk6AXweMQe0tKomxdnDaKezPYDyvJx3h5qMn 6Br2XA6ODRecfUMusgiF8SRW3JQ3K/k3x7vd1XDjfhsNjoblNF9BLaNz+5oOGsmMF6XN SfWQ== 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=VXjSAahQybg56aFMST5v/2dlSctjHTG6nZ4CM4xKejw=; b=S7Oe/Qq7qyLs4rgqICzVwb8rhfB5biuXpLiIgxa89ifpI93GzhNhhBr+JeHbMnCN0E t4vJwAKVHCSwVY966tqi49ESqSpIDB1z8qY1rbLp4X03xOQt38OyyVsZ1tuJy0mD/nVW pOwdAMWu/mlujpyRlUaktJryxjD+Ij/4F1A3NXmnMRGRvUdiG0lhFc2pZ+kyhklfy6hm eiu6Wgd6PSNCkvC+BJgH9tGdTOcpuJTeN26wkwRVukYvnAQ785099nI12EjX7zwg2L/t MVFfJSV39H6yuUT2DdTRs3MEkMkt05n5dHaVmFbsNUZBMAzfR493z2Gc5Aba7IlRWmaj qnIg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=HkOpPPsi; 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 w7-v6sor12077118qvf.25.2018.10.15.08.32.24 for (Google Transport Security); Mon, 15 Oct 2018 08:32:24 -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=HkOpPPsi; 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=VXjSAahQybg56aFMST5v/2dlSctjHTG6nZ4CM4xKejw=; b=HkOpPPsi8YNe0fv9BBZwSM9VQa6iKTRoV+yTJs7oG+p2Brer46PcbUd9PqojbhS58A Apxp1fu0AnPkF3QEQ8vHKPgp+0ATUd0SEArXNSf4pC13qqtXKk1DVK2hg136XgB0+AHb HD2Pp2fqIN/JukxNmbAdh9T9Ych2jPti6for8= 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=VXjSAahQybg56aFMST5v/2dlSctjHTG6nZ4CM4xKejw=; b=LoARVeaw+oPmclLnJ9TMi4El2kxBlXa98A700tq6qQZp5EkSEUD5LJoEAv4FrQ8CZj bbha/vpP79mB002fhOQOHaM7I2AALCqWTwocZU67xHKfJpw2MRewCjOo/WYJgd6mzDje 9VRTMzqVNUP+nOterPiS74fS4zt2Wpoq4K8MxsLqD+wv30PDN3XLFrFm15CUQpTlNllB PusCblT2g7iVMqX7v/rVvTpRa5TUR46t9Y05DilOdYuT/T+sPxJ8uVGa7wWU390nZjqA QnOvGPrIT5G9jknZFjjGXWPwhfMGCEnl2XWCbVc8jX5vaN8Z24tGteojzNPQ8s7MuIDW iWRQ== X-Gm-Message-State: ABuFfoi4muw4SuNRCfZn0wDFTPq6JL951INpVvr06WIdOCMh3nq/qVNv RWbq4Q3NsTyoeJHo/5cb6sP0yE0S X-Google-Smtp-Source: ACcGV636GOz6XdoHfPL3pRQplqhZgqxV4H6i8Pm84zUHEZel0PmVIfo4/5RXYXCb8tkROdUXpR6IHg== X-Received: by 2002:a0c:d78e:: with SMTP id z14-v6mr17066966qvi.92.1539617544525; Mon, 15 Oct 2018 08:32:24 -0700 (PDT) Return-Path: Received: from localhost.localdomain ([72.71.243.63]) by smtp.googlemail.com with ESMTPSA id g82-v6sm10087768qkh.24.2018.10.15.08.32.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 15 Oct 2018 08:32:24 -0700 (PDT) From: David Long To: , Russell King - ARM Linux , Florian Fainelli , Tony Lindgren , Marc Zyngier , Mark Rutland Cc: Greg KH , Mark Brown Subject: [PATCH 4.14 03/24] ARM: bugs: hook processor bug checking into SMP and suspend paths Date: Mon, 15 Oct 2018 11:31:57 -0400 Message-Id: <1539617538-22328-4-git-send-email-dave.long@linaro.org> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1539617538-22328-1-git-send-email-dave.long@linaro.org> References: <1539617538-22328-1-git-send-email-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.5.0 diff --git a/arch/arm/include/asm/bugs.h b/arch/arm/include/asm/bugs.h index ed122d2..73a99c7 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 8802402..16e7ba2 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 c9a0a52..e61af06 100644 --- a/arch/arm/kernel/smp.c +++ b/arch/arm/kernel/smp.c @@ -31,6 +31,7 @@ #include #include +#include #include #include #include @@ -402,6 +403,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 a40ebb7..d080992 100644 --- a/arch/arm/kernel/suspend.c +++ b/arch/arm/kernel/suspend.c @@ -3,6 +3,7 @@ #include #include +#include #include #include #include @@ -36,6 +37,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;