From patchwork Mon Oct 15 15:31:54 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Long X-Patchwork-Id: 148850 Delivered-To: patches@linaro.org Received: by 2002:a2e:8595:0:0:0:0:0 with SMTP id b21-v6csp3933673lji; Mon, 15 Oct 2018 08:32:22 -0700 (PDT) X-Received: by 2002:a37:2e05:: with SMTP id u5-v6mr16494157qkh.38.1539617541940; Mon, 15 Oct 2018 08:32:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539617541; cv=none; d=google.com; s=arc-20160816; b=zr0+NSh2wxqHDkSJWjzkRoH/95zpOUSzVNGpiarP/imwbQYdUjvGNY195cfhRkDpi+ pR1ZJu0nDkYW87wj08UjWiaw0KHpTktmelbqOnWCkOmTzIJRsL17LCPRov2sRguqc2Sc BhRJJbeNT3Az6f3Fk0aqkjz48yYyXc5IFZ41rHn21QcwDp9R13f8P3GWEHlus12UPxi9 MHrKtoX719I44l9fkUr7DHTFcfGCAowZu09h3Bx4ymSDJOoCIb6ePwisx+iv716Vtqkd h0InTUK9H2m/nbKvOuzPYkeRryDyivzrKoLixw92dcV4C6ORh+cLi8OafjbOiS2el5gT yeTw== 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=jH8V/OO/SSGBeQuP/Sal8qTayCqoCEQhb5P5m8kbQfc=; b=GCZJA4fF+hcMo+klcjIEAQ9njtnOyX0zAXPjw3t1VcFWPfXN05OU71ucVp1Jl8aad4 c2vmB7qgzFJ1KMNAwNdVMWT9idGrewromCvgYMUfAdYNlPmWtqR7yuQIYKq6ec1phsiD eEqVuceYQusWYauXzW+40qLqKUXdLna2ybbCSO8hqNZn4Ng/HHZuv9OaVc71Z1H2CwIh Y5Ugw8bphDSk+humxmNwfnsB+gRzB6Bo23z7nmiRwDhUY0QOaU+DIK6b2QGBQDAhmdiU OZYXAcD1MpEx3uoRRnBptTJtc7efYOUopy0gKXzwUIaBA8lpKKF9Li9Q7ZCoP0bctUtn QY0g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Ayi7vUeR; 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 a21-v6sor13129389qtn.41.2018.10.15.08.32.21 for (Google Transport Security); Mon, 15 Oct 2018 08:32:21 -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=Ayi7vUeR; 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=jH8V/OO/SSGBeQuP/Sal8qTayCqoCEQhb5P5m8kbQfc=; b=Ayi7vUeRwZT+idQ2WiibDtpCH35BVaftA+TrrwOQvy38XpfDpoblUvFlII8OqfruUN vt1/J68CQf4N0nuiernZXTDisDK6BjPPSZBDtSRcsJb760dTY8JP3DkSLV23rYU60f1T rmmGn/cOLjOMfudj007ONZoxm42iUeDpGSkVY= 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=jH8V/OO/SSGBeQuP/Sal8qTayCqoCEQhb5P5m8kbQfc=; b=gMFE3xHkNURRyp4uihZtmgYYee0Wm6V5QzX5vurYjSevbpL90UrDTVnWxFWYT+kF3B 6emrUX/A+CB7vOoeqxPoGESk6TSNCiralmlrRp9ccg05rJcdzyUKDyXGlHgPnezRix/o 5DSny73BRAaaYaVgtQHnQbq6wFRFITQ44RNGCrmHjidAMX5OPSr3/mXDev0Ob3/QAmTq BC+VV5ee678vfXjMHZes7H/R+TSDxK2/uKwCOqDxqQy+ZJ2UhNPizpxQ2b6gQF/bm05g a+tlyZb/pqY28F+r09xOq2DxFTwyNpBD/JnDy3QJq7LAtGOyiAHF32RfYD/uO+Je/l1N de6A== X-Gm-Message-State: ABuFfoi0YoLlOItGcOGc/QAYo6JdygUD88OF76uPja9ZF6hp5254+XxU jg3adUb6KGA+Uuna9+M8WyC7MjJv X-Google-Smtp-Source: ACcGV62x0p8/pE1EKJu/piz5HejgCae7ZBg0uupQu8jAAU/OPHndTe8I1Q1FnJqHeNduCgLavfYpGg== X-Received: by 2002:ac8:544f:: with SMTP id d15-v6mr16698099qtq.353.1539617541430; Mon, 15 Oct 2018 08:32:21 -0700 (PDT) Return-Path: Received: from localhost.localdomain ([72.71.243.63]) by smtp.googlemail.com with ESMTPSA id g82-v6sm10087768qkh.24.2018.10.15.08.32.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 15 Oct 2018 08:32:20 -0700 (PDT) From: David Long To: , Russell King - ARM Linux , Florian Fainelli , Tony Lindgren , Marc Zyngier , Mark Rutland Cc: Greg KH , Mark Brown Subject: [PATCH 4.14 00/24] V4.14 backport of 32-bit arm spectre patches Date: Mon, 15 Oct 2018 11:31:54 -0400 Message-Id: <1539617538-22328-1-git-send-email-dave.long@linaro.org> X-Mailer: git-send-email 2.5.0 From: "David A. Long" V4.14 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 | 58 ++++++------- 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 | 112 +++++++++++++++++++++++- 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(+), 112 deletions(-) create mode 100644 arch/arm/kernel/bugs.c create mode 100644 arch/arm/mm/proc-v7-bugs.c -- 2.5.0