From patchwork Thu Aug 1 08:15:55 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 170325 Delivered-To: patch@linaro.org Received: by 2002:a92:512:0:0:0:0:0 with SMTP id q18csp5085581ile; Thu, 1 Aug 2019 01:20:05 -0700 (PDT) X-Google-Smtp-Source: APXvYqwfOZp4KNVqCRi2X/GK3Xl+LxyDouzmH+11NLIBYoZNRXW/E1ZNMjkZb4OS2Ej6T11zDimQ X-Received: by 2002:a17:902:b285:: with SMTP id u5mr35762398plr.329.1564647605479; Thu, 01 Aug 2019 01:20:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564647605; cv=none; d=google.com; s=arc-20160816; b=p0vO4X6o9TshQnWD6nKqiAkdJ1m8rMXkUKPYnMBUCPzglEz5v8sXa6veYwYWKVzTsG n3WkEISS81RgpgbkZOi5QejqSO0HHcVTR7hT7RYVDyy5Xiphcyw3cYzYh5K8krrB8gXX FOstMB55ydTJxm1q+aQkQAsS3FJfajyBEKZZg28XkvUAHEPzFORuYKqlZrM9ArBtwOAS cwDNvyeD7K5uLeDMs8jxbESz0FmKVdRYsGgWGO4fnc8hJLhBUWXGIGU5cKe14XABtws3 dXMNMIwnaMXqNjNuMl+yzUajrYKmJROOZYHg0O3KTjgw2hQET6WtwXD2cMNw1MkdLujm 3rZw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=X5q/embD7eXIzs5RT/nIptjidKOY81lXVOsi7bVlsas=; b=rZI90/PbTTqq4hYAZdoz4zxkSav7LIOowZ8FUsD7IKEQAHvWVE4k92IhG2pXPdmkFY w5weKjjs2PAjhP8NvFMYSZ1Qrq8avamJjSU0wuGerVdNxomm/E97qTrlEhQUqWJCHZ+q sxKt3Um3/pRTvKP/+ahNdOHwblQjGXtIpT/BmQKEpasKk5LUJewhPLhod0BaIyqHLDgl YgqV6VXAi29CaPLfEgJ4WX14SSTan/dLvR101m58wst8XsNgLFubtgcZyydBA4iv8vHC mEmpL0h+p1mqK8SiA0YUFSviKlxcaA+g1tDw1rOv7oT2q1gFRh4pDhUtcIOBEaJkhbph R5fw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=h+PuW0lE; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ch18si32232418plb.76.2019.08.01.01.20.05; Thu, 01 Aug 2019 01:20:05 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=h+PuW0lE; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731032AbfHAIUE (ORCPT + 14 others); Thu, 1 Aug 2019 04:20:04 -0400 Received: from mail-pg1-f194.google.com ([209.85.215.194]:39680 "EHLO mail-pg1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728146AbfHAIUE (ORCPT ); Thu, 1 Aug 2019 04:20:04 -0400 Received: by mail-pg1-f194.google.com with SMTP id u17so33735424pgi.6 for ; Thu, 01 Aug 2019 01:20:04 -0700 (PDT) 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 :mime-version:content-transfer-encoding; bh=X5q/embD7eXIzs5RT/nIptjidKOY81lXVOsi7bVlsas=; b=h+PuW0lEZY8T/ZZSwYcmqS9Be9NSD84V+yeP0216GYwk6bRO15/K6tS+k7m+kmYupA 0JtVTHhkqr4MqThyhhe15Tr/RvX0NBStrad4AO09QPjN1W0Fpnb3vcGKhTbnFWmwhkVf PDXheBxfY+SrGqDbQn69QmYa0oDZMcsCwhpPLa2+3aAp1x0fFWwErRzhlY7xYLIAbovm oNrcN0Dx7h8cx112E5tWi4qqCX8rXkANYfSrxrZOcrqENPoXmPGPkdutnFSJrTg2uE6F qt1AuXCict0LQkqKiIc/thfAcWghJFlIq836lYmT9Twij6OOzf0xZnJxVWARLqbXJ8Xu rhKw== 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:mime-version:content-transfer-encoding; bh=X5q/embD7eXIzs5RT/nIptjidKOY81lXVOsi7bVlsas=; b=Iq3jD4vJc4WfEJ6Z0Q0L4f8k1Ty+WWLI/G9IaJsQg5VRbRqTvVg0t3oFkJqFuTqbeJ 4gX7NniM17mzooKzRhXI4sKymGEuulxwuiFFjVKyZkPTT4O2R1ydNIiE8M4HJ9KWPWyB 5LbiTJDELK/sEEpdRpclalsX5bAbkywcYOKOdCf5A1/CUJvP6sWjr79aFF+9UZsDLtnl deKAfuL6/g1HCsn1CEThhUL1SvTqcDITn8WdMiEFUf3WtO8bVhFT3mIC7RkkjYGV0fmM vmpj5BSiak6bWaKq/4ecnYExISAGw/eREMveODfL8t6RYa3x2L0Pzk+uH+L2lyrSWvRH reGQ== X-Gm-Message-State: APjAAAXr7o5VQ6FVe3umdbotteFPZVzs9yTUSp13No45D5NFLLfz4lb6 dr++Cdgbmb0lMkUh0LmB43Qgszakw7k= X-Received: by 2002:a17:90a:d343:: with SMTP id i3mr7511467pjx.15.1564647603787; Thu, 01 Aug 2019 01:20:03 -0700 (PDT) Received: from localhost ([122.172.28.117]) by smtp.gmail.com with ESMTPSA id s22sm78451239pfh.107.2019.08.01.01.20.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 01 Aug 2019 01:20:03 -0700 (PDT) From: Viresh Kumar To: stable@vger.kernel.org Cc: Viresh Kumar , Julien Thierry , linux-arm-kernel@lists.infradead.org, Catalin Marinas , Marc Zyngier , Mark Rutland , Will Deacon , Russell King , Vincent Guittot , mark.brown@arm.com, guohanjun@huawei.com Subject: [PATCH ARM32 v4.4 V2 11/47] ARM: bugs: hook processor bug checking into SMP and suspend paths Date: Thu, 1 Aug 2019 13:45:55 +0530 Message-Id: <98b601c1241fbdfff7d7f1e30de696055441d24b.1564646727.git.viresh.kumar@linaro.org> X-Mailer: git-send-email 2.21.0.rc0.269.g1a574e7a288b In-Reply-To: References: MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.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 Signed-off-by: Viresh Kumar --- 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.21.0.rc0.269.g1a574e7a288b 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 0f1c11861147..bafbd29c6e64 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;