Received: by 10.223.176.46 with SMTP id f43csp929332wra; Fri, 19 Jan 2018 04:23:54 -0800 (PST) X-Google-Smtp-Source: ACJfBot+ks78Qo8Hh4HU4cWZiIJr1kHgEVlgwdPV+mh7wwbWAGKB89GQ4ijNXaG/2YDHsXfHx3X7 X-Received: by 10.99.123.8 with SMTP id w8mr29740697pgc.201.1516364633980; Fri, 19 Jan 2018 04:23:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516364633; cv=none; d=google.com; s=arc-20160816; b=zIVYO9C0XVXXyGluPvrs6SxZX+o8OtRSJfJhhqNtUbWhXco/CpNzBcUnU4Pssqxt+n XyaUFfyNxcOR6fhezaoe0L3vgI/genXkNEJwHefaVWEfv40WJmiREbk7pJaFxcBmGfOi K3WI60RbFUVD8hfE75gsKWZa5i2P6Z9dmu7Jz/wV7AIPNNvoGoiMQRre9hB9wDV4dxCZ D9wZqZziV0tZMCaQNCJ5YGO6O8/RL1UY/K4kM1phGU50UCPrDvCOSHg7mwz3ELebCHeM kVyDClPCqMi3N8Hbn0j1EjItxiY2vFaBgQlvPIKWJMPzo3o4JYDHGCXxJf7pR078rN8A 4IMw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:spamdiagnosticmetadata :spamdiagnosticoutput:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature:arc-authentication-results; bh=o6TWIwSV2hiNx2UtSPrgOSdJRBalH6dCE68cuVbztT8=; b=cMmhK/TlcjawZEBNb80wLJ1TUZ+YdvTf26Fd2M2nxJQaxeA2eBh1yZqNL2n+EI39QL WTph/M1KGTz+veKXg1Tw2w14f7/IRPbx93O4o+EOa8wDsZKlXKPzOag8LveqQ8bmxEWB 33d85ttzLLHSI5gyeTZSHRx5wN8g7k5oN/2WaKo7rBtQTRcOVDScjmpz8szMgDFywrzS ROM1aFn3qkit9q7m3dMG1BRPdrFBtQWL0zHgj8TEb3IN73QbF1BBtoIUHVaHbSD6u5Ug FnipHTmMF64DCcgP49XHK4ySAIrne3+82aNMtDU6ZpoWR/cEmOZZQbDbdS0yl7AVWN2S cYbA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@CAVIUMNETWORKS.onmicrosoft.com header.s=selector1-cavium-com header.b=W0rRVTdh; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x16si8208289pgc.817.2018.01.19.04.23.39; Fri, 19 Jan 2018 04:23:53 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-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=@CAVIUMNETWORKS.onmicrosoft.com header.s=selector1-cavium-com header.b=W0rRVTdh; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755088AbeASMXK (ORCPT + 99 others); Fri, 19 Jan 2018 07:23:10 -0500 Received: from mail-dm3nam03on0077.outbound.protection.outlook.com ([104.47.41.77]:17632 "EHLO NAM03-DM3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751200AbeASMXE (ORCPT ); Fri, 19 Jan 2018 07:23:04 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=o6TWIwSV2hiNx2UtSPrgOSdJRBalH6dCE68cuVbztT8=; b=W0rRVTdhdBHHofzL7/tYWo34hfoyGH7xn/QT10d0ctxVGhNWLu+AXxbT69hQ3KEMPCS18qOuD8kdKwU4cPi4zdLxIbX7YoMnP5paiOBbRNs+ON93H7yvwPoLBZCBJ5N7z2Oee2MdG18f6ham8/I5vRv06jn9ID8646zzbBu/FwE= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Jayachandran.Nair@cavium.com; Received: from jc-sabre.caveonetworks.com (50.233.148.156) by DM2PR0701MB1068.namprd07.prod.outlook.com (2a01:111:e400:2472::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.407.7; Fri, 19 Jan 2018 12:23:01 +0000 From: Jayachandran C To: Will Deacon , Jon Masters Cc: marc.zyngier@arm.com, linux-arm-kernel@lists.infradead.org, lorenzo.pieralisi@arm.com, ard.biesheuvel@linaro.org, catalin.marinas@arm.com, linux-kernel@vger.kernel.org, labbott@redhat.com, christoffer.dall@linaro.org, Jayachandran C Subject: [PATCH v3 1/2] arm64: Branch predictor hardening for Cavium ThunderX2 Date: Fri, 19 Jan 2018 04:22:47 -0800 Message-Id: <1516364568-95577-1-git-send-email-jnair@caviumnetworks.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <20180118135354.GB20783@arm.com> References: <20180118135354.GB20783@arm.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [50.233.148.156] X-ClientProxiedBy: DM5PR2001CA0021.namprd20.prod.outlook.com (2603:10b6:4:16::31) To DM2PR0701MB1068.namprd07.prod.outlook.com (2a01:111:e400:2472::21) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 01e945d6-52e2-4387-3678-08d55f37626b X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(4534125)(4602075)(4627221)(201703031133081)(201702281549075)(5600026)(4604075)(2017052603307)(7153060)(7193020);SRVR:DM2PR0701MB1068; X-Microsoft-Exchange-Diagnostics: 1;DM2PR0701MB1068;3:NQwQCXVpFLTH+Xe6mdAYfdLYhzQtQYC5IOEESI2byAE0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6Zxp/OfR48o4IIdjQvmo03KLGTaXazkyguTLNb1cBDevXJhZH4OVN7CLDar+16wTO4ljKD1cIB/hHQ1/7IQsuRzNk18nmLT+86rPMesNelETMPqvbahQsCymIZFgT8ApgMpE0MKxzXeqQ/ZgUlAID5XxDIs2Pf4syAPRm+0lSbB3BDYtaVPRWw35IRtMpAq/uN2dCsHy6WHtH4peVkiRfB+j8aRWwLMoFvsVKqW6gyz58JSOuyuXc6UjU6+pBY6UvMp9QogJFbPhEc183p30i3RhZSmRLcteez16Af9V+UYhD63M3Xbc6VUBQuuaWCVCzptNBK4llS5vbnz8VcZtRHU0FcbtdDGgF/DJI/crUXPldKYJlIdwrP0C4whsuhYt8vY/b/Qs1HsJ0At9bitUXL8PiTA=;4:6kSq0CLRe7wZmlKlfaaZKB/4SOeABH+7dDf/E/30BnqEhtM5LAi7ylVCsHkilrJ2huTAtOTCd/QiMxBuc+aZZ/o9Aj1rEnyoGOBErygbKeXhjXNuSZT/GzEtFA2kFzfMiD9ssZcG+1mGqrJPDkE2pCeO5YEmRXUNv9dAmWpM5FcWwjrci2zZ8dOh0CPEc/xnY3y2kiOkPusjtfc6h/fomPHcqK1XQHYgpqvZRQ7s5RUjWrPFpbgOXqE9J4C0zJ1YLtkQZ2M96PlBIfeIQuT4aw== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6040495)(2401047)(8121501046)(5005006)(10201501046)(3231023)(2400077)(944501161)(93006095)(3002001)(6041282)(20161123558120)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123562045)(6072148)(201708071742011);SRVR:DM2PR0701MB1068;BCL:0;PCL:0;RULEID:(100000803101)(100110400095);SRVR:DM2PR0701MB1068; X-Forefront-PRVS: 0557CBAD84 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(376002)(346002)(39380400002)(366004)(39860400002)(396003)(199004)(189003)(7736002)(53936002)(110136005)(5660300001)(8676002)(50466002)(81166006)(48376002)(81156014)(6512007)(305945005)(386003)(6506007)(16586007)(42882006)(2950100002)(68736007)(69596002)(51416003)(72206003)(76176011)(316002)(52116002)(6486002)(8936002)(6666003)(105586002)(26005)(107886003)(25786009)(47776003)(53416004)(66066001)(478600001)(36756003)(16526018)(2906002)(97736004)(7416002)(6116002)(3846002)(4326008)(106356001)(50226002);DIR:OUT;SFP:1101;SCL:1;SRVR:DM2PR0701MB1068;H:jc-sabre.caveonetworks.com;FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX:1;LANG:en; Received-SPF: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;DM2PR0701MB1068;23:9quJM0LGbMoCk8vBxZ+Km30D7c53baBDDq1m5fz?= =?us-ascii?Q?wBH/JdDbg101M8AWp5w9PFx1Gzz/1BP1rrgrUJj+p0jqnexEMc9Db2LnLzxt?= =?us-ascii?Q?xuuHuQH3rlnoUMyS2hlnKG5HCOZQRGtr2OypvQwaL304zDlKfOSIgTEX4MKU?= =?us-ascii?Q?90zI+8vZoHpX9HGtxm8iFU4ZcN6KC8hkaRh0F67RS62j2bH4uCJHT2ubV/Y+?= =?us-ascii?Q?AhQvDac6lNbeP/j9tn3iPobWzzoUT2S2fHuoiy5VxfWYRL2fyLHaUEjMSmYU?= =?us-ascii?Q?scXSd55iWAAfYkkN2aZAfaAmAbB13/bp+ml9P2bzKqjbgXH3kxwvwe6zQewO?= =?us-ascii?Q?BLjGKSL/RSLuSEdixFRZLPqTBZOt+VSq7FVPBF/X+fNKL6rSfhV9WY34rmQT?= =?us-ascii?Q?s+uoPomv3C6IXGZRIRxViQq/XWOd6x/aIMSKhtbsGPHPZQFpgIZQCv4wO8aY?= =?us-ascii?Q?J5Lspnod5G430Ip/y8tInfE4xSyDelUm+OsKxKlV6DO8jyUKDai1aar7iAfQ?= =?us-ascii?Q?m0idgVPWz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REqzj05ddgdbQQyX3BSFo/usAOIVSnotXCt6R6cg/Zuoemo+0ACshafdPEtkcC5TD5Scz6Gj4Sa4VDg4/c3yNo2Sjq5t1rG+q7sJGkdxChVvt9phbwgf4qtykEv0zDS9oXqkK32RS6qYKm2b5ikY=;5:mNXQA5su3HhzhDfa/06+nojQSAAFUEChhlL1SfzE18XuMVRZpOYR4Nu1N5Z1aasQoLPQgknKkqLQjRepGbx7wQdvH8pucNpPhCjqD5JZBz0+EXL0iXnGdCQSlSMlbmbqA+5qN6nFfPsGMMYR/jFsKjqJQ1iaOVnKr/0zKUDLKdg=;24:rcWziKjfdYpRjxwB+I+YJNBknwqKYpXWwhP2t8A1fPEHp5yDJnndleNsFiGsAP8oz1USHly5BpgzjLW1JDtwLnBrJTt7H1aTZFIWNjbHYE8=;7:BV7misQ5k9zITHWhziV7hBNaEgrr8DSlWE39OnAlcwW6BpXYgLSnA7QPC26AY+zoIXjaD2J2heGhmBRvMS4nSOkFbNOYOMguXXLPBylxpiwLUfK/fX/mcdwvTlM6zksMWni+Yb7WxwxMYGNJ2nlDciFCka4axjxdPxbrPgb1qzcfLLMXlfYNqwxXdrCjPqol0crhNVonmErWDNTDcKerWZvCOf27Fddqb9cUJSzJZmYSVbtINTjWhzkyLfrTgNVv SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Jan 2018 12:23:01.5420 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 01e945d6-52e2-4387-3678-08d55f37626b X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM2PR0701MB1068 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Use PSCI based mitigation for speculative execution attacks targeting the branch predictor. We use the same mechanism as the one used for Cortex-A CPUs, we expect the PSCI version call to have a side effect of clearing the BTBs. Signed-off-by: Jayachandran C --- arch/arm64/kernel/cpu_errata.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/arch/arm64/kernel/cpu_errata.c b/arch/arm64/kernel/cpu_errata.c index 70e5f18..45ff9a2 100644 --- a/arch/arm64/kernel/cpu_errata.c +++ b/arch/arm64/kernel/cpu_errata.c @@ -338,6 +338,16 @@ const struct arm64_cpu_capabilities arm64_errata[] = { .capability = ARM64_HARDEN_BP_POST_GUEST_EXIT, MIDR_ALL_VERSIONS(MIDR_QCOM_FALKOR_V1), }, + { + .capability = ARM64_HARDEN_BRANCH_PREDICTOR, + MIDR_ALL_VERSIONS(MIDR_BRCM_VULCAN), + .enable = enable_psci_bp_hardening, + }, + { + .capability = ARM64_HARDEN_BRANCH_PREDICTOR, + MIDR_ALL_VERSIONS(MIDR_CAVIUM_THUNDERX2), + .enable = enable_psci_bp_hardening, + }, #endif { } -- 2.7.4