From patchwork Wed Oct 31 13:56:49 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Long X-Patchwork-Id: 149794 Delivered-To: patches@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp6826283ljp; Wed, 31 Oct 2018 06:57:17 -0700 (PDT) X-Received: by 2002:ab0:5ac8:: with SMTP id x8mr1451679uae.113.1540994237476; Wed, 31 Oct 2018 06:57:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540994237; cv=none; d=google.com; s=arc-20160816; b=kCD8yRbV0dBZywwIp1wiDVxl3O7ZVIMqpiV6r7t7wNAFtLSJ1IHmnVkHTnwxf53B+W qVgBW35GZqWoispzEl92t30sQFDL7pCNOrcudMj/HVohaic1i6iwnEszmk8I0YZkfXeo rlqtrOC9sB4HHwt39JoYHlO4YeIgD85Eph7dcyyEe3mzp4xCLzLld0UPBKBrqIPKVFwt rkr0Uk5sh1JCwYZm5W+O4N/5CfeqGcl8TiLi7rgy5Gz4o2z8g5WcE8Nv58oUezjIXlBu OT3Af6hYVQP3w8BUbQBFBKbEky4rl2K+XQBuli2D+cFtkMMS95vZ02vBzw6YG9XINjbS as/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=message-id:date:subject:cc:to:from:dkim-signature; bh=m7yLGXhL+Q/QXdQF0MoX9wvLvS1TwmNJrC1ozJwF57Y=; b=mW3E9HeOFPwIY8VGOO0QmotCN86euGBJZi7npqbsJy7KoFz0F2TbBC3/ZtTLyf8WGP NKKWS2VBSagDejO7B3mnCAHrVudYz4xD4rNYcAmRpqSx1uo/R1e2sSAzlm1b4Oji3Kiz Fv12sibJopChcUk2/lsrkEyS+TAU3yb8R/hKxUuJvTE7tlC1q2821KSDYdsJ2uXstXuc o1C5MaNuPrtyXuCscmOASlf/Vdsmul7Tcl9ryvw1n+IqVAzXSAtwhdk8llHbYD+IyqcY +7hZvEU2vvzpAo0/ShCO3iDgfocw0AjTCd+wOVD2U/+5y2CJEJqDCpreFV86RPA7INrK nPHg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=M9RQMDuW; 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 p9sor16157840uak.10.2018.10.31.06.57.17 for (Google Transport Security); Wed, 31 Oct 2018 06:57:17 -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=M9RQMDuW; 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; bh=m7yLGXhL+Q/QXdQF0MoX9wvLvS1TwmNJrC1ozJwF57Y=; b=M9RQMDuWugMjBuY69CX4Sr2y1czcxhtVBEfdcTM0xRxfRx0Q+WgkWGi4qVO/k0gFyS qTg/rS5iHgEFWuTpj3Eyoh3o/D/GZRjkP+ToUTueLETHVHLfZJlANHkq0uXxlOakdvTf /Gi046bb1BM12psJb82/Qf4OeP2nHeub8n8lA= 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; bh=m7yLGXhL+Q/QXdQF0MoX9wvLvS1TwmNJrC1ozJwF57Y=; b=JmYj1lWIr6Aa8iCIuktQ3TYF4lSesYqQKC7ROHOd/vEiDQZpL/6vkqyECjk6SkPwz/ zkyywWFc63/AT/0jL6nPC3tdi93ezsO5Bx+6jYc6sCUyr3RzuueagmvIO/0tGCq63LYn /se8qj28lmzzv99IaR+Lv7AcBR/BI5chBsgUliFkQZcqJ4yndBzsvOv4JU9HwYHnoHJI XjI4XzPt4ednJLyYeuLFuyY/nPg60yw2qoMeRucARgvNVM5VoWpbtyxJC5Gxet+yjz7v hVIPCmROSweg4PG4oxFmb0oo5btYCNRmtx4d9myLg2P6kevH+5yi72p+mHE+na8lElxT 6YrA== X-Gm-Message-State: AGRZ1gIh0MsXknQeaTW1EQr3b/vtUNd9crjdq3XT2r+KjwKyQ8AcojyW vYUYnjXw2v/QIDoCJEwg9UHiTTzz X-Google-Smtp-Source: AJdET5c+9B4CMmUaKaL43v0hqKWQ87nTogyWlxnFjPG+r58rYk6Ypur2D0OElpYVDecs/a5gHt4fKg== X-Received: by 2002:ab0:55c1:: with SMTP id w1mr1364405uaa.54.1540994236890; Wed, 31 Oct 2018 06:57:16 -0700 (PDT) Return-Path: Received: from dave-Dell-System-XPS-L502X.hsd1.nh.comcast.net ([2603:3005:3403:7100:2c71:8680:34e1:a6aa]) by smtp.googlemail.com with ESMTPSA id s85-v6sm2275624vse.29.2018.10.31.06.57.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 31 Oct 2018 06:57:16 -0700 (PDT) From: David Long To: stable@vger.kernel.org, Russell King - ARM Linux , Florian Fainelli , Tony Lindgren , Marc Zyngier , Mark Rutland Cc: Greg KH , Mark Brown Subject: [PATCH 4.9 00/24] V4.9 backport of 32-bit arm spectre patches Date: Wed, 31 Oct 2018 09:56:49 -0400 Message-Id: <20181031135713.2873-1-dave.long@linaro.org> X-Mailer: git-send-email 2.17.1 From: "David A. Long" V4.9 backport of spectre patches from Russell M. King's spectre branch. Patches not yet in upstream are excluded. Marc Zyngier (2): ARM: KVM: invalidate BTB on guest exit for Cortex-A12/A17 ARM: KVM: invalidate icache on guest exit for Cortex-A15 Russell King (22): ARM: add more CPU part numbers for Cortex and Brahma B15 CPUs ARM: bugs: prepare processor bug infrastructure ARM: bugs: hook processor bug checking into SMP and suspend paths ARM: bugs: add support for per-processor bug checking ARM: spectre: add Kconfig symbol for CPUs vulnerable to Spectre ARM: spectre-v2: harden branch predictor on context switches ARM: spectre-v2: add Cortex A8 and A15 validation of the IBE bit ARM: spectre-v2: harden user aborts in kernel space ARM: spectre-v2: add firmware based hardening ARM: spectre-v2: warn about incorrect context switching functions ARM: spectre-v2: KVM: invalidate icache on guest exit for Brahma B15 ARM: KVM: Add SMCCC_ARCH_WORKAROUND_1 fast handling ARM: KVM: report support for SMCCC_ARCH_WORKAROUND_1 ARM: spectre-v1: add speculation barrier (csdb) macros ARM: spectre-v1: add array_index_mask_nospec() implementation ARM: spectre-v1: fix syscall entry ARM: signal: copy registers using __copy_from_user() ARM: vfp: use __copy_from_user() when restoring VFP state ARM: oabi-compat: copy semops using __copy_from_user() ARM: use __inttype() in get_user() ARM: spectre-v1: use get_user() for __get_user() ARM: spectre-v1: mitigate user accesses arch/arm/include/asm/assembler.h | 12 ++ arch/arm/include/asm/barrier.h | 32 ++++++ arch/arm/include/asm/bugs.h | 6 +- arch/arm/include/asm/cp15.h | 3 + arch/arm/include/asm/cputype.h | 8 ++ arch/arm/include/asm/kvm_asm.h | 2 - arch/arm/include/asm/kvm_host.h | 14 ++- arch/arm/include/asm/kvm_mmu.h | 23 +++- arch/arm/include/asm/proc-fns.h | 4 + arch/arm/include/asm/system_misc.h | 15 +++ arch/arm/include/asm/thread_info.h | 4 +- arch/arm/include/asm/uaccess.h | 26 +++-- arch/arm/kernel/Makefile | 1 + arch/arm/kernel/bugs.c | 18 +++ arch/arm/kernel/entry-common.S | 18 ++- arch/arm/kernel/entry-header.S | 25 +++++ arch/arm/kernel/signal.c | 55 ++++----- arch/arm/kernel/smp.c | 4 + arch/arm/kernel/suspend.c | 2 + arch/arm/kernel/sys_oabi-compat.c | 8 +- arch/arm/kvm/hyp/hyp-entry.S | 110 +++++++++++++++++- arch/arm/lib/copy_from_user.S | 9 ++ arch/arm/mm/Kconfig | 23 ++++ arch/arm/mm/Makefile | 2 +- arch/arm/mm/fault.c | 3 + arch/arm/mm/proc-macros.S | 3 +- arch/arm/mm/proc-v7-2level.S | 6 - arch/arm/mm/proc-v7-bugs.c | 174 +++++++++++++++++++++++++++++ arch/arm/mm/proc-v7.S | 154 +++++++++++++++++++------ arch/arm/vfp/vfpmodule.c | 17 ++- 30 files changed, 674 insertions(+), 107 deletions(-) create mode 100644 arch/arm/kernel/bugs.c create mode 100644 arch/arm/mm/proc-v7-bugs.c -- 2.17.1 Reviewed-by: Florian Fainelli