From patchwork Tue Jun 19 01:43:12 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Michael Roth X-Patchwork-Id: 931254 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=linux.vnet.ibm.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="ZWqXG6RD"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 418rk92Hkhz9s2t for ; Tue, 19 Jun 2018 11:59:29 +1000 (AEST) Received: from localhost ([::1]:38438 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fV5va-0003Df-VA for incoming@patchwork.ozlabs.org; Mon, 18 Jun 2018 21:59:26 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44540) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fV5gj-0000Bv-Ud for qemu-devel@nongnu.org; Mon, 18 Jun 2018 21:44:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fV5gj-0007g9-2n for qemu-devel@nongnu.org; Mon, 18 Jun 2018 21:44:06 -0400 Received: from mail-oi0-x22d.google.com ([2607:f8b0:4003:c06::22d]:34771) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fV5gi-0007g0-Ts; Mon, 18 Jun 2018 21:44:05 -0400 Received: by mail-oi0-x22d.google.com with SMTP id i205-v6so16709457oib.1; Mon, 18 Jun 2018 18:44:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=N4K6Oa+HZwIOiIK41/u0S6M1fyg2xFZtjjeSyVsz8Tc=; b=ZWqXG6RD7TiGX3l48znSsuIC1Y1MjbOmuALwW5LoahOIRIlF2GPuvvMNjlhMWN9G/n eunxeoJQaC+PH0ouRl5K2ZnBeHhLVd8iL49AzBDnVeSXH2EXwx0DkrxOECohg6RHRy+k KESmrp9SS9lcB9L5jB156A1pZ0O816p3bRJC/8yVqJH6+08eXf6pRQAZYtW1y12zLnmN 0HfKUMvZAPn8IaYrPh9M0d4Kk63TEhg9K23gCglBdqGjnk2G4RC4xRT/XRbX1CGXy1b4 kQb2qH9BVig6JjFrMfuEsqN/9Pkh9aTwe4UloCJb0LLTBZQwoxN2ujWCLmWbifudU/Ch Jujg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=N4K6Oa+HZwIOiIK41/u0S6M1fyg2xFZtjjeSyVsz8Tc=; b=kRnN+p7FuZ1ncwOA+DLDmoRWtYJhbYcpihpKKWahQTZSPiOn7J1zY8iiHLpcGUExtX Iv3j6x3m6EUYdKktt6L3fFGyVp5Sxv9OpDPjQ2c2id2Lj/claCJAK6atFvHy+yqDKbjj p5TCGXfVDqiA9BbkASRMQfTkhXBQaYokHPNDOLWcgm8dqyj94e4zTKnI2pPqCfEHUwGx Jsk4jQzDREdcitO74NJpTDMeW/S0LYPPfchnWUIHCtKbe/z2v5NfhO+7X16z0ZdgBCb+ 9rq+Ux8BBHzgbV2S9KPRfeoHHrWu4zCQJOe6Jrd8tzjrXsqh0kgZKg5b1Ciqcce4Fnyp WqTw== X-Gm-Message-State: APt69E0VYqyrYM6zft/+BVUizftxfAaJR39mqQ5utmj4V9Rr3H+9yAlh fVlWaW0AOzMrne+xk9bPirfvNimF X-Google-Smtp-Source: ADUXVKLAGwULLoTKhUe6WCOUDc7qJeGmPbx+eRm3ysZj4FW5ykotivnipORflD1jQONpkcDuFftaOA== X-Received: by 2002:aca:e34a:: with SMTP id a71-v6mr7816460oih.283.1529372643719; Mon, 18 Jun 2018 18:44:03 -0700 (PDT) Received: from localhost ([2600:1700:70:e488:b0ee:9bda:ee6f:91be]) by smtp.gmail.com with ESMTPSA id s43-v6sm9291190ots.18.2018.06.18.18.44.02 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 18 Jun 2018 18:44:02 -0700 (PDT) From: Michael Roth To: qemu-devel@nongnu.org Date: Mon, 18 Jun 2018 20:43:12 -0500 Message-Id: <20180619014319.28272-107-mdroth@linux.vnet.ibm.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180619014319.28272-1-mdroth@linux.vnet.ibm.com> References: <20180619014319.28272-1-mdroth@linux.vnet.ibm.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4003:c06::22d Subject: [Qemu-devel] [PATCH 106/113] i386: define the 'ssbd' CPUID feature bit (CVE-2018-3639) X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-stable@nongnu.org, Eduardo Habkost , Konrad Rzeszutek Wilk Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Daniel P. Berrangé New microcode introduces the "Speculative Store Bypass Disable" CPUID feature bit. This needs to be exposed to guest OS to allow them to protect against CVE-2018-3639. Signed-off-by: Daniel P. Berrangé Reviewed-by: Konrad Rzeszutek Wilk Signed-off-by: Konrad Rzeszutek Wilk Message-Id: <20180521215424.13520-2-berrange@redhat.com> Signed-off-by: Eduardo Habkost (cherry picked from commit d19d1f965904a533998739698020ff4ee8a103da) Signed-off-by: Michael Roth --- target/i386/cpu.c | 2 +- target/i386/cpu.h | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/target/i386/cpu.c b/target/i386/cpu.c index 70c8ae82d5..bc087e95c3 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -459,7 +459,7 @@ static FeatureWordInfo feature_word_info[FEATURE_WORDS] = { NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, "spec-ctrl", NULL, - NULL, NULL, NULL, NULL, + NULL, NULL, NULL, "ssbd", }, .cpuid_eax = 7, .cpuid_needs_ecx = true, .cpuid_ecx = 0, diff --git a/target/i386/cpu.h b/target/i386/cpu.h index f3d0ebb673..422d99d80c 100644 --- a/target/i386/cpu.h +++ b/target/i386/cpu.h @@ -644,6 +644,7 @@ typedef uint32_t FeatureWordArray[FEATURE_WORDS]; #define CPUID_7_0_EDX_AVX512_4VNNIW (1U << 2) /* AVX512 Neural Network Instructions */ #define CPUID_7_0_EDX_AVX512_4FMAPS (1U << 3) /* AVX512 Multiply Accumulation Single Precision */ #define CPUID_7_0_EDX_SPEC_CTRL (1U << 26) /* Speculation Control */ +#define CPUID_7_0_EDX_SPEC_CTRL_SSBD (1U << 31) /* Speculative Store Bypass Disable */ #define CPUID_8000_0008_EBX_IBPB (1U << 12) /* Indirect Branch Prediction Barrier */