Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp1208882pxb; Wed, 6 Apr 2022 11:21:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwcxwhk9nKytsk/lpNDsjqdNjRakarzxINnVNG76k7fNPM2fAtr/v1lofnO0dlzKWQSf4fZ X-Received: by 2002:a17:90b:1d8f:b0:1c7:a0ac:dc99 with SMTP id pf15-20020a17090b1d8f00b001c7a0acdc99mr11694044pjb.130.1649269318940; Wed, 06 Apr 2022 11:21:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649269318; cv=none; d=google.com; s=arc-20160816; b=SKYqN7DKfb5jMHzc/cPUf4Ov7NDxoy35nUXz+afsk9fXzQeRgSNX+tFIFvXkqsCZ0X 4AER3BsTS6VTyFvIERB/BBkU9tJGLCR9OTMlcU+a9RwGUx3YLsrEE2h7uHtunFiv3SEt ifrsZjkExh10oZ7RPSBD18czg4sI8joIFyTxUV45dpuInvLkxphT/uVpSpMKjJg2IAz7 RZj3y7f0AfAc9aIIK+Bdx1kMj+MtiIS/n1WTG1a589yyCnMt51Ig0ocd5BAvzTc/RED6 xM74y0zNmuwYP2nAdI17y/rTTHhktXR+uM5S0zvWqdUq1AMGnuS3jpNOi9+4eIbQ9TfK 2e5Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=FVtF/ry8l8QydUz6DFe1p3b8XVL8PwCyPUMT6CBOdYc=; b=qynYPH4Vy6SThe4WSBj1DsqA7+YC2mhoAO7zPgH5Ha74RT9ayhFBojbAisnHgTq1Ed a3zJJiNesByYKw6rjyDwRdP8RQkOfDD4ssBqdIbmzUYfYB31AwMSEkXvalhqKdwnmpvg CNHiDJez40vU9HdCZu2ZuwXXCuqsvn/vbT3aUuK3X3+WCsMbKxex+HSbnjHsF8LGf+mU PjD0uh1BBpT4BVN/xDmetEDoCQP6kgKeowG9/0uJEYd0SmMKZivIp+E7xQLY7RGNgUkZ VRbecqE7EKbM5X4opg5/Z9CVcTYGylsTxQYoTwD5i9VKDUaPtkonoiML9FTxm1yrUvi/ gpEA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id h128-20020a625386000000b004fa8a73c6ecsi15182421pfb.180.2022.04.06.11.21.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Apr 2022 11:21:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 45B7F2CCB2; Wed, 6 Apr 2022 11:04:56 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239737AbiDFSGv (ORCPT + 99 others); Wed, 6 Apr 2022 14:06:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40646 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240057AbiDFSGl (ORCPT ); Wed, 6 Apr 2022 14:06:41 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id CCB83184622; Wed, 6 Apr 2022 09:42:35 -0700 (PDT) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id A1D0D23A; Wed, 6 Apr 2022 09:42:35 -0700 (PDT) Received: from eglon.cambridge.arm.com (eglon.cambridge.arm.com [10.1.196.218]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id F39B43F73B; Wed, 6 Apr 2022 09:42:34 -0700 (PDT) From: James Morse To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: James Morse , Catalin Marinas Subject: [stable:PATCH v4.9.309 00/43] arm64: Mitigate spectre style branch history side channels Date: Wed, 6 Apr 2022 17:41:34 +0100 Message-Id: <20220406164217.1888053-1-james.morse@arm.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello! Compared to the v4.14 backport, this backport for v4.9 includes extra infrastructure for the arch timer driver, which is needed for the A76 timer workaround, which is needed to cleanly pick up the A76 MIDR definition. I didn't backport the Hisilicon 161010101 workaround as I'm unable to test it. I also backported the capabilities midr-range support, which the bhb mitigation makes use of. Ard had already backported this to v4.14. I ended up backporting Ard's version from v4.14 as it conflicted less, and he had added A35 to the spectre-safe list. .. and then the Spectre-BHB bits, where as before the KVM stuff is different to mainline as the infrastructure for doing this stuff is very different. Thanks, James Anshuman Khandual (1): arm64: Add Cortex-X2 CPU part definition Arnd Bergmann (1): arm64: arch_timer: avoid unused function warning Dave Martin (1): arm64: capabilities: Update prototype for enable call back Ding Tianhong (2): clocksource/drivers/arm_arch_timer: Remove fsl-a008585 parameter clocksource/drivers/arm_arch_timer: Introduce generic errata handling infrastructure James Morse (20): arm64: Remove useless UAO IPI and describe how this gets enabled arm64: entry.S: Add ventry overflow sanity checks arm64: entry: Make the trampoline cleanup optional arm64: entry: Free up another register on kpti's tramp_exit path arm64: entry: Move the trampoline data page before the text page arm64: entry: Allow tramp_alias to access symbols after the 4K boundary arm64: entry: Don't assume tramp_vectors is the start of the vectors arm64: entry: Move trampoline macros out of ifdef'd section arm64: entry: Make the kpti trampoline's kpti sequence optional arm64: entry: Allow the trampoline text to occupy multiple pages arm64: entry: Add non-kpti __bp_harden_el1_vectors for mitigations arm64: Move arm64_update_smccc_conduit() out of SSBD ifdef arm64: entry: Add vectors that have the bhb mitigation sequences arm64: entry: Add macro for reading symbol addresses from the trampoline arm64: Add percpu vectors for EL1 KVM: arm64: Add templates for BHB mitigation sequences arm64: Mitigate spectre style branch history side channels KVM: arm64: Allow SMCCC_ARCH_WORKAROUND_3 to be discovered and migrated arm64: add ID_AA64ISAR2_EL1 sys register arm64: Use the clearbhb instruction in mitigations Marc Zyngier (6): arm64: arch_timer: Add infrastructure for multiple erratum detection methods arm64: arch_timer: Add erratum handler for CPU-specific capability arm64: arch_timer: Add workaround for ARM erratum 1188873 arm64: Add silicon-errata.txt entry for ARM erratum 1188873 arm64: Make ARM64_ERRATUM_1188873 depend on COMPAT arm64: Add part number for Neoverse N1 Rob Herring (1): arm64: Add part number for Arm Cortex-A77 Robert Richter (1): arm64: errata: Provide macro for major and minor cpu revisions Suzuki K Poulose (10): arm64: Add MIDR encoding for Arm Cortex-A55 and Cortex-A35 arm64: capabilities: Move errata work around check on boot CPU arm64: capabilities: Move errata processing code arm64: capabilities: Prepare for fine grained capabilities arm64: capabilities: Add flags to handle the conflicts on late CPU arm64: capabilities: Clean up midr range helpers arm64: Add helpers for checking CPU MIDR against a range arm64: capabilities: Add support for checks based on a list of MIDRs arm64: Add Neoverse-N2, Cortex-A710 CPU part definition arm64: Add helper to decode register from instruction Documentation/arm64/silicon-errata.txt | 1 + Documentation/kernel-parameters.txt | 9 - arch/arm/include/asm/kvm_host.h | 5 + arch/arm/kvm/psci.c | 4 + arch/arm64/Kconfig | 24 + arch/arm64/include/asm/arch_timer.h | 44 +- arch/arm64/include/asm/assembler.h | 34 ++ arch/arm64/include/asm/cpu.h | 1 + arch/arm64/include/asm/cpucaps.h | 4 +- arch/arm64/include/asm/cpufeature.h | 232 +++++++++- arch/arm64/include/asm/cputype.h | 63 +++ arch/arm64/include/asm/fixmap.h | 6 +- arch/arm64/include/asm/insn.h | 2 + arch/arm64/include/asm/kvm_host.h | 4 + arch/arm64/include/asm/kvm_mmu.h | 2 +- arch/arm64/include/asm/mmu.h | 8 +- arch/arm64/include/asm/processor.h | 6 +- arch/arm64/include/asm/sections.h | 6 + arch/arm64/include/asm/sysreg.h | 5 + arch/arm64/include/asm/vectors.h | 74 +++ arch/arm64/kernel/bpi.S | 55 +++ arch/arm64/kernel/cpu_errata.c | 595 ++++++++++++++++++++----- arch/arm64/kernel/cpufeature.c | 167 +++++-- arch/arm64/kernel/cpuinfo.c | 1 + arch/arm64/kernel/entry.S | 197 ++++++-- arch/arm64/kernel/fpsimd.c | 1 + arch/arm64/kernel/insn.c | 29 ++ arch/arm64/kernel/smp.c | 6 - arch/arm64/kernel/traps.c | 4 +- arch/arm64/kernel/vmlinux.lds.S | 2 +- arch/arm64/kvm/hyp/hyp-entry.S | 4 + arch/arm64/kvm/hyp/switch.c | 9 +- arch/arm64/mm/fault.c | 17 +- arch/arm64/mm/mmu.c | 11 +- drivers/clocksource/Kconfig | 4 + drivers/clocksource/arm_arch_timer.c | 202 +++++++-- include/linux/arm-smccc.h | 7 + 37 files changed, 1509 insertions(+), 336 deletions(-) create mode 100644 arch/arm64/include/asm/vectors.h -- 2.30.2