From patchwork Fri Apr 12 19:39:02 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Manoj Iyer X-Patchwork-Id: 1084903 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=canonical.com Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 44gp9x1sWJz9s55; Sat, 13 Apr 2019 05:39:16 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1hF20w-0002Im-Vd; Fri, 12 Apr 2019 19:39:06 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by huckleberry.canonical.com with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.86_2) (envelope-from ) id 1hF20v-0002If-HU for kernel-team@lists.ubuntu.com; Fri, 12 Apr 2019 19:39:05 +0000 Received: from 1.general.manjo.us.vpn ([10.172.65.2] helo=lazy) by youngberry.canonical.com with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.76) (envelope-from ) id 1hF20u-0004ZY-VZ; Fri, 12 Apr 2019 19:39:05 +0000 Date: Fri, 12 Apr 2019 14:39:02 -0500 (CDT) From: Manoj Iyer X-X-Sender: manjo@lazy To: kernel-team@lists.ubuntu.com Subject: [PULL][Bionic] Address Spectre V2 on Power9 DD2.3 Message-ID: User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Michael Ranweiler Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" BugLink: https://bugs.launchpad.net/bugs/1822870 Please consider the following patches to address Spectre V2 Meltdown vulnerability in Power9 DD2.3. The patches were identified as IBM as being critical for addressing this issue on Bionic 4.15 kernel. Majority of the patches were clean cherry-picks and a few patches requiring minor backports. A test kernel was made available in PPA: ppa:ubuntu-power-triage/lp1822870 (built for Power and AMD64 archs) and test results based on this kernel on Power9 DD2.3 is available in the bug report. We do not have Power9 DD2.3 hardware in-house, so all testing was done by IBM. The patches are isolated to the ppc64el architecture, and IBM has not reported any regressions, and they have verified that the test kernel works as expected. I have cced Michael Ranweiler@IBM on this pull request so that we can get help to address any concerns you might have after SRU review. The following changes since commit c50532b9d7b623ff98aeaf0b848e58adae54ca75: UBUNTU: Ubuntu-4.15.0-48.51 (2019-04-02 18:31:55 +0200) are available in the Git repository at: git+ssh://git.launchpad.net/~manjo/+git/bionic-lp1822870 spectre-1822870 for you to fetch changes up to a527672055a2477c4d93bb0cce7a2bdc9e8558b8: powerpc: Avoid code patching freed init sections (2019-04-12 13:36:07 -0500) ---------------------------------------------------------------- Christophe Leroy (2): powerpc/lib/code-patching: refactor patch_instruction() powerpc/lib/feature-fixups: use raw_patch_instruction() Diana Craciun (5): powerpc/64: Disable the speculation barrier from the command line powerpc/64: Make stf barrier PPC_BOOK3S_64 specific. powerpc/64: Make meltdown reporting Book3S 64 specific powerpc/fsl: Fix spectre_v2 mitigations reporting powerpc/fsl: Add nospectre_v2 command line argument Michael Ellerman (11): powerpc: Use barrier_nospec in copy_from_user() powerpc/64: Use barrier_nospec in syscall entry powerpc64s: Show ori31 availability in spectre_v1 sysfs file not v2 powerpc/64: Add CONFIG_PPC_BARRIER_NOSPEC powerpc/64: Call setup_barrier_nospec() from setup_arch() powerpc/asm: Add a patch_site macro & helpers for patching instructions powerpc/64s: Add new security feature flags for count cache flush powerpc/64s: Add support for software count cache flush powerpc/pseries: Query hypervisor for count cache flush settings powerpc/powernv: Query firmware for count cache flush settings powerpc/security: Fix spectre_v2 reporting Michael Neuling (1): powerpc: Avoid code patching freed init sections Michal Suchanek (4): powerpc/64s: Add support for ori barrier_nospec patching powerpc/64s: Patch barrier_nospec in modules powerpc/64s: Enable barrier_nospec based on firmware settings powerpc/64s: Enhance the information in cpu_show_spectre_v1() Suraj Jitindar Singh (1): KVM: PPC: Book3S: Add count cache flush parameters to kvmppc_get_cpu_char() arch/powerpc/Kconfig | 7 +- arch/powerpc/include/asm/asm-prototypes.h | 15 ++ arch/powerpc/include/asm/barrier.h | 8 +- arch/powerpc/include/asm/code-patching-asm.h | 18 +++ arch/powerpc/include/asm/code-patching.h | 3 + arch/powerpc/include/asm/feature-fixups.h | 9 ++ arch/powerpc/include/asm/hvcall.h | 2 + arch/powerpc/include/asm/security_features.h | 7 + arch/powerpc/include/asm/setup.h | 21 +++ arch/powerpc/include/asm/uaccess.h | 11 +- arch/powerpc/include/uapi/asm/kvm.h | 2 + arch/powerpc/kernel/Makefile | 3 +- arch/powerpc/kernel/entry_64.S | 64 ++++++++ arch/powerpc/kernel/module.c | 10 +- arch/powerpc/kernel/security.c | 215 +++++++++++++++++++++++++-- arch/powerpc/kernel/setup-common.c | 2 + arch/powerpc/kernel/vmlinux.lds.S | 11 +- arch/powerpc/kvm/powerpc.c | 18 ++- arch/powerpc/lib/code-patching.c | 55 +++++-- arch/powerpc/lib/feature-fixups.c | 47 +++++- arch/powerpc/mm/mem.c | 2 + arch/powerpc/platforms/powernv/setup.c | 7 + arch/powerpc/platforms/pseries/setup.c | 7 + 23 files changed, 502 insertions(+), 42 deletions(-) create mode 100644 arch/powerpc/include/asm/code-patching-asm.h Acked-by: Stefan Bader Acked-by: Kleber Sacilotto de Souza --- ============================ Manoj Iyer Ubuntu/Canonical ============================