Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755069AbeAHSIy (ORCPT + 1 other); Mon, 8 Jan 2018 13:08:54 -0500 Received: from mail-wm0-f65.google.com ([74.125.82.65]:36026 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754913AbeAHSIv (ORCPT ); Mon, 8 Jan 2018 13:08:51 -0500 X-Google-Smtp-Source: ACJfBouAVrQb8dVZP8ljGlkO4KIxBNyh9vpmo9SWgxRbFQnrBgXYWds7w505c02IWL5gwhAc6BJyHw== From: Paolo Bonzini To: linux-kernel@vger.kernel.org, kvm@vger.kernel.org Cc: jmattson@google.com, aliguori@amazon.com, thomas.lendacky@amd.com, dwmw@amazon.co.uk, bp@alien8.de Subject: [PATCH 0/7] KVM: x86: expose CVE-2017-5715 ("Spectre variant 2") mitigations to guest Date: Mon, 8 Jan 2018 19:08:38 +0100 Message-Id: <1515434925-10250-1-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: This series allows guests to use the MSR_IA32_SPEC_CTRL and MSR_IA32_PRED_CMD model specific registers that were added as mitigations for CVE-2017-5715. These are only the KVM specific parts of the fix. It does *not* yet include any protection for reading host memory from the guest, because that would be done in the same way as the rest of Linux. So there is no IBRS *usage* here, no retpolines, no stuffing of the return stack buffer. (KVM already includes a fix to clear all registers on vmexit, which is enough to block Google Project Zero's PoC exploit). However, I am including the changes to use IBPB (indirect branch predictor barrier) if available. That occurs only when there is a VCPU switch on a physical CPU, thus it has a small impact on performance. The patches are a bit hackish because the relevant cpufeatures have not been included yet, and because I wanted to make the patches easier to backport to distro kernels if desired, but I would still like to have them in 4.16. Please review. Thanks, Paolo Paolo Bonzini (5): KVM: x86: add SPEC_CTRL and IBPB_SUPPORT accessors x86/msr: add definitions for indirect branch predictor MSRs kvm: vmx: pass MSR_IA32_SPEC_CTRL and MSR_IA32_PRED_CMD down to the guest kvm: svm: pass MSR_IA32_SPEC_CTRL and MSR_IA32_PRED_CMD down to guest KVM: x86: add SPEC_CTRL and IBPB_SUPPORT to MSR and CPUID lists Tim Chen (1): kvm: vmx: Set IBPB when running a different VCPU Tom Lendacky (1): x86/svm: Set IBPB when running a different VCPU arch/x86/include/asm/msr-index.h | 5 ++++ arch/x86/kvm/cpuid.c | 27 +++++++++++++---- arch/x86/kvm/cpuid.h | 22 ++++++++++++++ arch/x86/kvm/svm.c | 65 +++++++++++++++++++++++++++++++++++++++- arch/x86/kvm/vmx.c | 41 +++++++++++++++++++++++++ arch/x86/kvm/x86.c | 1 + 6 files changed, 154 insertions(+), 7 deletions(-) -- 1.8.3.1