From patchwork Mon Oct 15 15:31:58 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Long X-Patchwork-Id: 148854 Delivered-To: patches@linaro.org Received: by 2002:a2e:8595:0:0:0:0:0 with SMTP id b21-v6csp3933748lji; Mon, 15 Oct 2018 08:32:25 -0700 (PDT) X-Received: by 2002:ac8:4297:: with SMTP id o23-v6mr16311471qtl.389.1539617545855; Mon, 15 Oct 2018 08:32:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539617545; cv=none; d=google.com; s=arc-20160816; b=PLVX5Y4EKUoPMwoVs2vObCXnwNR5Dm21wYUI2hyuZ8aj7dRm+e57b3eR+qXH0IdZb1 P6jS53B2Z9sebpaJ1vhMa+5IUJHPoz2RncMp5ZYSCC2YRug5jCgwwBeRh7BukzvLmXaX Wz3/1RL9g7oJB2d2yRiVm7oz10YiSoIGiawYXrJ1/toemqIcE2GffODt74hEjXrt11e7 UdAYqff/5mJIf7LxDYqi+31o5fz5B7HK37lJiWnm2TiyWrGUbYwhim8S67JUL4dDFW3U z7K+Cfn0RcwaQQJs818tPezoX545U9AyG/jQUyFL4hfPhawME5hMXIidOQdkkUWZQDeO L8fg== 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=0YPZkRY98qJSZM112i0kzySKIaSL6QV++zUV918JKOY=; b=APGLGN9pDNlhC/LcuYb0OxKFQCBSm39c2AXX540itfT1aYZngc6p+v1i7UU++hU2P/ VYOAviKvDG/5WgtbYY8z53wpkqgDq3r3GNg5E4rpkvGakwALrC/uw3TMs1kL7paHa3xn KUfLUpmvOh83XcKsbC0wSMPb/86BCFKuLs80IdL1dDk1aPGHVGLyRaQs9m6DJDvAXYjZ hhwQH1JeVXwxpgue+zEr99oaBlfRuKfv85p/P0spmlZspoMQOyFTOrlxLku3e9EdpMG6 zpb324LAyV1Mp/6ANHk6wroelf1c/Od+RgGWdJR4IvWBemb3mQ1ImA6ztPT0zj7ajdCn 8IoQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=bTpJSm7Q; 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 u14-v6sor12117833qvg.23.2018.10.15.08.32.25 for (Google Transport Security); Mon, 15 Oct 2018 08:32:25 -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=bTpJSm7Q; 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=0YPZkRY98qJSZM112i0kzySKIaSL6QV++zUV918JKOY=; b=bTpJSm7QyCEzl7B6hLPbHlCsymc3X6wN3jqTqK/aUEcbNnVxU8AVkdiHOaHSX+v4O+ +vo87wS1UDHlo7oViFN6jOg//oZQYoCF5Fc4Mxgz/cgNoBmVEtZyvChaXZg3Ve50O3FF mopGZtdGiBSErt06zl7Khgugpapb9pX1WtwmU= 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=0YPZkRY98qJSZM112i0kzySKIaSL6QV++zUV918JKOY=; b=p8OLoYlw7Tcmjb0U3UAJI7HezxSu6bosunXTgPlG6VBN3xtgT1SLW6PAox7pAUUMsZ wqcPUGQEI0EuYzwGmJJl2ekJaWBNZrp7jibcM7DBVZiJGKoIrKJNeKz3f6/PXLSNYV2j d++Xv8a2L3cYRkMYKyJ9TIxwXHVNSNFdDif+j2+MNzA3lZxkpm8oEhAaeFsFSxvLi6MW Wkzj6mKsc7fjKTsSDhFe+xc17Ipxx3AHxVfsPgrXKLYpInZxBdRGNh7V/5/NxgbCVVhI 5XMMhN13Qc1VgG4dN8xDIP+cYKsvE8f9PPinwmZZjWzgLikNso6VSBljU2M736rzX0pV TMSw== X-Gm-Message-State: ABuFfoh25KTnl0RgrMAIgUwfVJTrYICOr3/igN1atoNykXndV4VtaCx9 o9PQrp5n6Tfm8+TBPktTcwcFCYTf X-Google-Smtp-Source: ACcGV63W2aYm3w2we/ooCSxgqYsAW+OXS9pDypj7g6U5zPkrCrgSAJkoqt/kl8GYgP4UqQg3C8IK2A== X-Received: by 2002:a0c:de02:: with SMTP id t2mr17600861qvk.117.1539617545436; Mon, 15 Oct 2018 08:32:25 -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.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 15 Oct 2018 08:32:25 -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 04/24] ARM: bugs: add support for per-processor bug checking Date: Mon, 15 Oct 2018 11:31:58 -0400 Message-Id: <1539617538-22328-5-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 9d3a04925deeabb97c8e26d940b501a2873e8af3 upstream. Add support for per-processor bug checking - each processor function descriptor gains a function pointer for this check, which must not be an __init function. If non-NULL, this will be called whenever a CPU enters the kernel via which ever path (boot CPU, secondary CPU startup, CPU resuming, etc.) This allows processor specific bug checks to validate that workaround bits are properly enabled by firmware via all entry paths to 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/proc-fns.h | 4 ++++ arch/arm/kernel/bugs.c | 4 ++++ arch/arm/mm/proc-macros.S | 3 ++- 3 files changed, 10 insertions(+), 1 deletion(-) -- 2.5.0 diff --git a/arch/arm/include/asm/proc-fns.h b/arch/arm/include/asm/proc-fns.h index f2e1af4..e25f439 100644 --- a/arch/arm/include/asm/proc-fns.h +++ b/arch/arm/include/asm/proc-fns.h @@ -37,6 +37,10 @@ extern struct processor { */ void (*_proc_init)(void); /* + * Check for processor bugs + */ + void (*check_bugs)(void); + /* * Disable any processor specifics */ void (*_proc_fin)(void); diff --git a/arch/arm/kernel/bugs.c b/arch/arm/kernel/bugs.c index 16e7ba2..7be5113 100644 --- a/arch/arm/kernel/bugs.c +++ b/arch/arm/kernel/bugs.c @@ -5,6 +5,10 @@ void check_other_bugs(void) { +#ifdef MULTI_CPU + if (processor.check_bugs) + processor.check_bugs(); +#endif } void __init check_bugs(void) diff --git a/arch/arm/mm/proc-macros.S b/arch/arm/mm/proc-macros.S index f10e31d..81d0efb 100644 --- a/arch/arm/mm/proc-macros.S +++ b/arch/arm/mm/proc-macros.S @@ -273,13 +273,14 @@ mcr p15, 0, ip, c7, c10, 4 @ data write barrier .endm -.macro define_processor_functions name:req, dabort:req, pabort:req, nommu=0, suspend=0 +.macro define_processor_functions name:req, dabort:req, pabort:req, nommu=0, suspend=0, bugs=0 .type \name\()_processor_functions, #object .align 2 ENTRY(\name\()_processor_functions) .word \dabort .word \pabort .word cpu_\name\()_proc_init + .word \bugs .word cpu_\name\()_proc_fin .word cpu_\name\()_reset .word cpu_\name\()_do_idle