From patchwork Fri Feb 21 17:36:12 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Liu, Jinsong" X-Patchwork-Id: 3699031 Return-Path: X-Original-To: patchwork-kvm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id E41A6BF13A for ; Fri, 21 Feb 2014 17:37:50 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 29E812012F for ; Fri, 21 Feb 2014 17:37:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 47339201BB for ; Fri, 21 Feb 2014 17:37:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933459AbaBURgn (ORCPT ); Fri, 21 Feb 2014 12:36:43 -0500 Received: from mga02.intel.com ([134.134.136.20]:3794 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933198AbaBURgm convert rfc822-to-8bit (ORCPT ); Fri, 21 Feb 2014 12:36:42 -0500 Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga101.jf.intel.com with ESMTP; 21 Feb 2014 09:36:40 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.97,520,1389772800"; d="scan'208,223";a="487301496" Received: from fmsmsx105.amr.corp.intel.com ([10.19.9.36]) by orsmga002.jf.intel.com with ESMTP; 21 Feb 2014 09:36:15 -0800 Received: from fmsmsx116.amr.corp.intel.com (10.18.116.20) by FMSMSX105.amr.corp.intel.com (10.19.9.36) with Microsoft SMTP Server (TLS) id 14.3.123.3; Fri, 21 Feb 2014 09:36:15 -0800 Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by fmsmsx116.amr.corp.intel.com (10.18.116.20) with Microsoft SMTP Server (TLS) id 14.3.123.3; Fri, 21 Feb 2014 09:36:15 -0800 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.26]) by SHSMSX151.ccr.corp.intel.com ([169.254.3.127]) with mapi id 14.03.0123.003; Sat, 22 Feb 2014 01:36:12 +0800 From: "Liu, Jinsong" To: Paolo Bonzini CC: "gleb@redhat.com" , "kvm@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "qemu-devel@nongnu.org" Subject: [PATCH] KVM: x86: expose ADX feature to guest Thread-Topic: [PATCH] KVM: x86: expose ADX feature to guest Thread-Index: Ac8vK2my5KNlzGauQ0KFfJzcg9es4w== Date: Fri, 21 Feb 2014 17:36:12 +0000 Message-ID: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Spam-Status: No, score=-7.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From 0750e335eb5860b0b483e217e8a08bd743cbba16 Mon Sep 17 00:00:00 2001 From: Liu Jinsong Date: Thu, 20 Feb 2014 17:39:32 +0800 Subject: [PATCH] KVM: x86: expose ADX feature to guest ADCX and ADOX instructions perform an unsigned addition with Carry flag and Overflow flag respectively. Signed-off-by: Xudong Hao Signed-off-by: Liu Jinsong --- arch/x86/kvm/cpuid.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/arch/x86/kvm/cpuid.c b/arch/x86/kvm/cpuid.c index abe18b4..a951ae4 100644 --- a/arch/x86/kvm/cpuid.c +++ b/arch/x86/kvm/cpuid.c @@ -303,7 +303,8 @@ static inline int __do_cpuid_ent(struct kvm_cpuid_entry2 *entry, u32 function, /* cpuid 7.0.ebx */ const u32 kvm_supported_word9_x86_features = F(FSGSBASE) | F(BMI1) | F(HLE) | F(AVX2) | F(SMEP) | - F(BMI2) | F(ERMS) | f_invpcid | F(RTM) | F(RDSEED); + F(BMI2) | F(ERMS) | f_invpcid | F(RTM) | F(RDSEED) | + F(ADX); /* all calls to cpuid_count() should be made on the same cpu */ get_cpu();