From patchwork Fri Jan 19 12:22:47 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jayachandran C X-Patchwork-Id: 10175167 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id D29AB60392 for ; Fri, 19 Jan 2018 12:23:20 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C17C62868B for ; Fri, 19 Jan 2018 12:23:20 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B5D4D28696; Fri, 19 Jan 2018 12:23:20 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED, DKIM_VALID, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 4BF432868B for ; Fri, 19 Jan 2018 12:23:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=4vcYWUxbLnxkfBUV92er18mDdthvGLbt88iV+ufKi7U=; b=kI3NFjteHxlqok 5DKzw3prK8msgRdzKqq3TadK0CB8PtQZWC+fapMiktT7u1NQgj1nph9EFccGRragDO8ZV/On/Qfge wKMMg2I1EU1wwF3pgTb43EiUpKJOJEtPAgOyzJ58eqHXT3WyeutBoQbeqipx9MLI2Uz314xd9NuuZ Owjc8k0NmA0GHak4cnREA4R0bf19sYQJWX8vdMjYfcQfa5a3hwwNCpfqWU20tVRikerYjGeVUojcJ cJ+J9kHyKH3HHkycHGClKtWqAfx8xbub3Moh0YEIt+GZwEKQ+a8GjXt0hmdnAjQSn10mu0V39nK6i vyJX1nFLYkhbon5HJMPQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.89 #1 (Red Hat Linux)) id 1ecVhW-0004Q8-9T; Fri, 19 Jan 2018 12:23:18 +0000 Received: from mail-dm3nam03on0609.outbound.protection.outlook.com ([2a01:111:f400:fe49::609] helo=NAM03-DM3-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.89 #1 (Red Hat Linux)) id 1ecVhS-0004PI-JX for linux-arm-kernel@lists.infradead.org; Fri, 19 Jan 2018 12:23:16 +0000 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 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 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+Xe6mdAYfdLYhzQtQYC5IOEESI2byAE0n51d2xbAhMcga7ZHgqgS78xvEGERefEO/cPzN+KzjYxDNlS65Eu+rvJL3EgmUOFl995KJaHwWDDPsqUJyfXF5HWfE+lQHFp+wi56J7ScNmjJeTqOsP+jK4pfrYWKQRNXZOTUWgboaxytVHmhKVUDewjwAoYqD1RpsPE9Jw2kqbIPUWsPSsKKS2ftnO3nIURqet4CuKewCb9TpECO7SC5; 25:s/Oq5hH/uUZBlbz+sPiI3iK+UzlqIfpKKIc/j0T3FkNGqLdStRlWw5ZJ87/qix/m9nPqSNXo1lxFPCtgYyzOgX0ba4MCnnqhfvl9X4Ww+3tMIkLRdgwjUg5j5Q5eSWEmY77x/lIS+wrrESo1OmH5W3RgYgrgNtK5Si4545xbU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1HsJ0At9bitUXL8PiTA=; 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-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ndleNsFiGsAP8oz1USHly5BpgzjLW1JDtwLnBrJTt7H1aTZFIWNjbHYE8=; 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 X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: lorenzo.pieralisi@arm.com, ard.biesheuvel@linaro.org, marc.zyngier@arm.com, catalin.marinas@arm.com, linux-kernel@vger.kernel.org, christoffer.dall@linaro.org, labbott@redhat.com, linux-arm-kernel@lists.infradead.org, Jayachandran C Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP 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 Acked-by: Will Deacon --- 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 { }