From patchwork Tue Jul 12 09:15:44 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 9224839 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id D3EB060868 for ; Tue, 12 Jul 2016 09:16:08 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B9A8A26419 for ; Tue, 12 Jul 2016 09:16:08 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id ADAD127F7F; Tue, 12 Jul 2016 09:16:08 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 43C4E26419 for ; Tue, 12 Jul 2016 09:16:08 +0000 (UTC) Received: from localhost ([::1]:38584 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bMtnS-0006W5-Nv for patchwork-qemu-devel@patchwork.kernel.org; Tue, 12 Jul 2016 05:16:06 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52086) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bMtnD-0006Tg-Cj for qemu-devel@nongnu.org; Tue, 12 Jul 2016 05:15:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bMtnA-0005Wo-4V for qemu-devel@nongnu.org; Tue, 12 Jul 2016 05:15:51 -0400 Received: from mail-wm0-x242.google.com ([2a00:1450:400c:c09::242]:34341) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bMtn9-0005Wi-Tr for qemu-devel@nongnu.org; Tue, 12 Jul 2016 05:15:48 -0400 Received: by mail-wm0-x242.google.com with SMTP id w75so1464905wmd.1 for ; Tue, 12 Jul 2016 02:15:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id; bh=bJwpCSCnj9HEIGnoI8a/MrW0AI3nsEJiolo7MVNYXms=; b=0cVHMJUqRFjPe/hegwlhy11YFKZbt/fq+1pmKhnPGhaXVI8S9WOMccGCEJNTlZwJSp i3TdutlGpN0sIhrfQaTnM/kzcyWbjEeO9YGT7VjffqjCOYmsEbGCBPxMJWC0wQIl8XPo pI56Mvxq0ruo3PXecZH+Q9919QqO/lmZlFntch1aKkbyVN3Zr7Cdzrja7UvJxwguI1TR eeUEKfNQI6/ym3ICtoq/7+Fr6Pf2Yllsklp2wDIXQJVPbp7k+PE7Dp+uLJA6RoKn2RKF zzubIdh7GNtEtxx4GAnUrO7qKf5V92rS7lBisSAyw4TIPQdGslKL3xdROzsKg0knV/KB JMfw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id; bh=bJwpCSCnj9HEIGnoI8a/MrW0AI3nsEJiolo7MVNYXms=; b=fKEIo6qHZAsPXXVHaoTZ2MKQsKGzYToP9mp3Q2fA2eOThFd8wB/6vKmeCjCROtrhhW nW8Uyl7ZBYs7hUukDe/7TrZEi4ppwlsw4rx/iRe6cSZ/dqGQBBPia6M+7quMGZRzbyBt s2pxg608T0BSGIbGfWWjJ4tKk15Tg6pmhWjVhuwg8jBlgVrHSinBCSJHj+jG2moyfVoR KgFkZ14bTKPH5lgzC0qp01uOyNyepjt49u1nExxMisLbIFvLUK2W0FSVdjrEqr00QXCD n/UVMWP0GFHSTV6dvvxqFhOBWj4TK314i/m7BDcOj/RhtTAa3gwSpOXwpCe7AYkX/+Xr 2ZVA== X-Gm-Message-State: ALyK8tI81AbDGh2adIifvZN501BXcIFxF+mZqG5p/E9LTzby2NcmH+/HVvOwtcwcBLKTNQ== X-Received: by 10.28.13.1 with SMTP id 1mr18270755wmn.60.1468314947115; Tue, 12 Jul 2016 02:15:47 -0700 (PDT) Received: from donizetti.lan (94-39-188-118.adsl-ull.clienti.tiscali.it. [94.39.188.118]) by smtp.gmail.com with ESMTPSA id e69sm4886822wma.2.2016.07.12.02.15.46 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 12 Jul 2016 02:15:46 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Tue, 12 Jul 2016 11:15:44 +0200 Message-Id: <1468314944-22273-1-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 2.7.4 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a00:1450:400c:c09::242 Subject: [Qemu-devel] [PATCH for 2.7] target-i386: add support for UMIP and RDPID CPUID bits 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: ehabkost@redhat.com Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP These are both stored in CPUID[EAX=7,EBX=0].ECX. KVM is going to be able to emulate both (albeit with a performance loss in the case of RDPID, which therefore will be in KVM_GET_EMULATED_CPUID rather than KVM_GET_SUPPORTED_CPUID). It's also possible to implement both in TCG, but this is for 2.8. Signed-off-by: Paolo Bonzini --- target-i386/cpu.c | 4 ++-- target-i386/cpu.h | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/target-i386/cpu.c b/target-i386/cpu.c index 3bd3cfc..7fc86c3 100644 --- a/target-i386/cpu.c +++ b/target-i386/cpu.c @@ -264,12 +264,12 @@ static const char *cpuid_7_0_ebx_feature_name[] = { }; static const char *cpuid_7_0_ecx_feature_name[] = { - NULL, NULL, NULL, "pku", + NULL, NULL, "umip", "pku", "ospke", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, - NULL, NULL, NULL, NULL, + NULL, NULL, "rdpid", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, }; diff --git a/target-i386/cpu.h b/target-i386/cpu.h index 474b0b9..0ed3b56 100644 --- a/target-i386/cpu.h +++ b/target-i386/cpu.h @@ -606,8 +606,10 @@ typedef uint32_t FeatureWordArray[FEATURE_WORDS]; #define CPUID_7_0_EBX_AVX512ER (1U << 27) /* AVX-512 Exponential and Reciprocal */ #define CPUID_7_0_EBX_AVX512CD (1U << 28) /* AVX-512 Conflict Detection */ +#define CPUID_7_0_ECX_UMIP (1U << 2) #define CPUID_7_0_ECX_PKU (1U << 3) #define CPUID_7_0_ECX_OSPKE (1U << 4) +#define CPUID_7_0_ECX_RDPID (1U << 22) #define CPUID_XSAVE_XSAVEOPT (1U << 0) #define CPUID_XSAVE_XSAVEC (1U << 1)