From patchwork Tue Apr 3 11:08:56 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Rutland X-Patchwork-Id: 132711 Delivered-To: patch@linaro.org Received: by 10.46.84.29 with SMTP id i29csp3665233ljb; Tue, 3 Apr 2018 04:09:33 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+I3y5vj0NLkToS0YrcWaqJPJ+40QHJ3Eo0KTSNlywSlHOUQ0yFNfZku4jxKwqw+3EnwtYz X-Received: by 10.99.140.77 with SMTP id q13mr8841969pgn.44.1522753773155; Tue, 03 Apr 2018 04:09:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522753773; cv=none; d=google.com; s=arc-20160816; b=ZB2cIRzRqJQvdh0855VDZJianrF8MtPUm9HMojfMcYKqncnDdUVZ4QacslfJgJ2WOS IbqNW6O1C+K9a0RI0vxFLhXvMWuIoASM8S6XpImtcJyXBSEDoDP1sHdOepM0XAHELGJz GYR0hOsxVGvqfII7RMh2EpcwSGNW0UexHR4U8mWK3rktmCOkH1+0D/FRCBqJil/xRQo/ KCMJshAS6ecu2ztMHPoO1nQtsUk4eYTCo7QLd6i5+u3szOPVXlkq7d4xaVycYfCKX11I rRe2fC8oNYKqpSm0LCMVgBYYSOD7omxG9O6W4APs41k5CbZEbl4bLaqT30P1A/44D2Q9 6pGg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=zb2PeIzQ70cGU7uuoQmqM8XPO3PaZlpAUw3FHse6IUE=; b=emYNEvjqxB1vJWBVC2GhVdfd9hfQHor3wUHCrqkKCdOjFhznAMr6S5jNwJyD5hz7UE JtehV4PSz6fwy69tjzQ7um0iFum7JJnJKR8a8Yc2HaDI5/HE+EVU3UFb73OkRFuWWWEK p7oUdYASDXypChkNkxs19BMH2RS9gDQhloO6rfBWZqpD1uu56j3q4bO1wcedsh9xal+L BlOzxUIxIwplhMT+ZQrNjPlrRkP5UhCo81yO+fWsxnDZFFZL5p5YEkTAKSfpOjZqS81p MkOYyWo26cHSlG6hK1OSciRcRO6QS9BEhxJpxeEfv9ng16Vf4mHKbRcHGAUkl7/HjAXk /nKg== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d14-v6si302866plj.191.2018.04.03.04.09.32; Tue, 03 Apr 2018 04:09:33 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755233AbeDCLJc (ORCPT + 11 others); Tue, 3 Apr 2018 07:09:32 -0400 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:59272 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754994AbeDCLJb (ORCPT ); Tue, 3 Apr 2018 07:09:31 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 996EF1435; Tue, 3 Apr 2018 04:09:31 -0700 (PDT) Received: from lakrids.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.72.51.249]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 67CB93F587; Tue, 3 Apr 2018 04:09:30 -0700 (PDT) From: Mark Rutland To: stable@vger.kernel.org Cc: mark.brown@linaro.org, ard.biesheuvel@linaro.org, marc.zyngier@arm.com, will.deacon@arm.com Subject: [PATCH v4.9.y 00/27] arm64 meltdown patches Date: Tue, 3 Apr 2018 12:08:56 +0100 Message-Id: <20180403110923.43575-1-mark.rutland@arm.com> X-Mailer: git-send-email 2.11.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org Hi Greg, These patches backport KPTI to v4.9.y (based on v4.9.92), providing protection against meltdown on arm64 platforms. I picked up Alex Shi's backport for review and testing, and as I found a couple of issues to fix up, I'm sending this with my Signed-off-by in the chain, with those fixups applied and noted. To the best of my understanding the code is correct, in the context of the v4.9.y kernel, and I've tested the seires on arm64 hardware available to me. i.e. if this didn't have my Signed-off-by it would have my Reviewed-by and Tested-by tags. Are you happy to pick these up for v4.9.93? Thanks, Mark. AKASHI Takahiro (1): module: extend 'rodata=off' boot cmdline parameter to module mappings Jayachandran C (2): arm64: cputype: Add MIDR values for Cavium ThunderX2 CPUs arm64: Turn on KPTI only on CPUs that need it Marc Zyngier (2): arm64: Allow checking of a CPU-local erratum arm64: Force KPTI to be disabled on Cavium ThunderX Mark Rutland (1): arm64: factor out entry stack manipulation Suzuki K Poulose (1): arm64: capabilities: Handle duplicate entries for a capability Will Deacon (20): arm64: mm: Use non-global mappings for kernel space arm64: mm: Move ASID from TTBR0 to TTBR1 arm64: mm: Allocate ASIDs in pairs arm64: mm: Add arm64_kernel_unmapped_at_el0 helper arm64: mm: Invalidate both kernel and user ASIDs when performing TLBI arm64: entry: Add exception trampoline page for exceptions from EL0 arm64: mm: Map entry trampoline into trampoline and kernel page tables arm64: entry: Explicitly pass exception level to kernel_ventry macro arm64: entry: Hook up entry trampoline to exception vectors arm64: tls: Avoid unconditional zeroing of tpidrro_el0 for native tasks arm64: entry: Add fake CPU feature for unmapping the kernel at EL0 arm64: kaslr: Put kernel vectors address in separate data page arm64: use RET instruction for exiting the trampoline arm64: Kconfig: Add CONFIG_UNMAP_KERNEL_AT_EL0 arm64: Kconfig: Reword UNMAP_KERNEL_AT_EL0 kconfig entry arm64: Take into account ID_AA64PFR0_EL1.CSV3 arm64: kpti: Make use of nG dependent on arm64_kernel_unmapped_at_el0() arm64: kpti: Add ->enable callback to remap swapper using nG mappings arm64: entry: Reword comment about post_ttbr_update_workaround arm64: idmap: Use "awx" flags for .idmap.text .pushsection directives arch/arm64/Kconfig | 12 ++ arch/arm64/include/asm/assembler.h | 3 + arch/arm64/include/asm/cpucaps.h | 3 +- arch/arm64/include/asm/cputype.h | 3 + arch/arm64/include/asm/fixmap.h | 6 + arch/arm64/include/asm/mmu.h | 11 ++ arch/arm64/include/asm/mmu_context.h | 7 ++ arch/arm64/include/asm/pgtable-hwdef.h | 1 + arch/arm64/include/asm/pgtable-prot.h | 35 +++--- arch/arm64/include/asm/pgtable.h | 1 + arch/arm64/include/asm/proc-fns.h | 6 - arch/arm64/include/asm/sysreg.h | 1 + arch/arm64/include/asm/tlbflush.h | 16 ++- arch/arm64/kernel/asm-offsets.c | 6 +- arch/arm64/kernel/cpu-reset.S | 2 +- arch/arm64/kernel/cpufeature.c | 135 ++++++++++++++++++--- arch/arm64/kernel/entry.S | 188 ++++++++++++++++++++++++---- arch/arm64/kernel/head.S | 2 +- arch/arm64/kernel/process.c | 12 +- arch/arm64/kernel/sleep.S | 2 +- arch/arm64/kernel/vmlinux.lds.S | 22 +++- arch/arm64/mm/context.c | 25 ++-- arch/arm64/mm/mmu.c | 31 +++++ arch/arm64/mm/proc.S | 216 +++++++++++++++++++++++++++++++-- include/linux/init.h | 3 + init/main.c | 7 +- kernel/module.c | 20 ++- 27 files changed, 675 insertions(+), 101 deletions(-) -- 2.11.0 Tested-by: Will Deacon Tested-by: Greg Hackmann