From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [PATCH] KVM: Add CPUID support for VIA CPU Date: Wed, 13 Apr 2011 11:59:04 +0300 Message-ID: <4DA565D8.8050504@redhat.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: mtosatti@redhat.com, kvm@vger.kernel.org To: BrillyWu@viatech.com.cn Return-path: Received: from mx1.redhat.com ([209.132.183.28]:60863 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757863Ab1DMI7J (ORCPT ); Wed, 13 Apr 2011 04:59:09 -0400 In-Reply-To: Sender: kvm-owner@vger.kernel.org List-ID: On 04/13/2011 06:26 AM, BrillyWu@viatech.com.cn wrote: > The CPUIDs for Centaur are added, and then the features of PadLock > hardware > engine on VIA CPU, such as "ace", "ace_en" and so on, can be passed into > the > kvm guest. > Nice to see this. Please post a link to the documentation describing these features. > > + /* cpuid 0xC0000001.edx */ > + const u32 kvm_supported_word5_x86_features = > + F(XSTORE) | F(XSTORE_EN) | F(XCRYPT) | F(XCRYPT_EN) | > + F(ACE2) | F(ACE2_EN) | F(PHE) | F(PHE_EN) | > + F(PMM) | F(PMM_EN); > + Are all of these features save wrt save/restore? (do they all act on state in standard registers?) Do they need any control register bits to be active or MSRs to configure? > @@ -2484,6 +2504,17 @@ static int kvm_dev_ioctl_get_supported_c > > r = -E2BIG; > if (nent>= cpuid->nent) > + goto out_free; > + > + /* Add support for Centaur's CPUID instruction. */ > + do_cpuid_ent(&cpuid_entries[nent], 0xC0000000, 0,&nent, > cpuid->nent); nent overflow check missing here. Also, should probably skip if not a Via. > + limit = cpuid_entries[nent - 1].eax; > + for (func = 0xC0000001; func<= limit&& nent< cpuid->nent; > ++func) > + do_cpuid_ent(&cpuid_entries[nent], func, 0, > + &nent, cpuid->nent); > + > + r = -E2BIG; > + if (nent>= cpuid->nent) > goto out_free; > > do_cpuid_ent(&cpuid_entries[nent], KVM_CPUID_SIGNATURE, 0, > &nent, -- error compiling committee.c: too many arguments to function