From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: kvm-tools: can't seem to set guest_mac and KVM_GET_SUPPORTED_CPUID failed. Date: Thu, 17 Nov 2011 18:49:16 +0200 Message-ID: <4EC53B0C.4090300@redhat.com> References: <1321510055.4221.5.camel@lappy> <1321512998.4221.7.camel@lappy> <20111117153833.GA5915@dancer.ca.sandia.gov> <1321544629.8010.9.camel@lappy> <20111117155000.GB5915@dancer.ca.sandia.gov> <1321545120.8010.10.camel@lappy> <4EC52E0E.1000502@redhat.com> <20111117161200.GB25489@dancer.ca.sandia.gov> <4EC53451.5070209@redhat.com> <20111117162959.GC25489@dancer.ca.sandia.gov> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------080205030708080008080105" Cc: Sasha Levin , Pekka Enberg , kvm@vger.kernel.org To: David Evensky Return-path: Received: from mx1.redhat.com ([209.132.183.28]:25996 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757857Ab1KQQuF (ORCPT ); Thu, 17 Nov 2011 11:50:05 -0500 In-Reply-To: <20111117162959.GC25489@dancer.ca.sandia.gov> Sender: kvm-owner@vger.kernel.org List-ID: This is a multi-part message in MIME format. --------------080205030708080008080105 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit On 11/17/2011 06:29 PM, David Evensky wrote: > Avi, > > evensky@waltz:~/megatux/vmatic$ perl -e 'for $cnt (1..10000){ $o=`taskset 0x01 ./4sasha`; chomp($o); $histogram{$o}++}; for $o (sort keys %histogram){print "$o: $histogram{$o}\n"}' > KVM_GET_SUPPORTED_CPUID returned -1 with errno 7: 3 > Returned entries: 31: 9995 > Returned entries: 32: 1 > Returned entries: 64: 1 > evensky@waltz:~/megatux/vmatic$ perl -e 'for $cnt (1..10000){ $o=`taskset 0x02 ./4sasha`; chomp($o); $histogram{$o}++}; for $o (sort keys %histogram){print "$o: $histogram{$o}\n"}' > KVM_GET_SUPPORTED_CPUID returned -1 with errno 7: 1 > Returned entries: 31: 9999 > evensky@waltz:~/megatux/vmatic$ perl -e 'for $cnt (1..10000){ $o=`taskset 0x03 ./4sasha`; chomp($o); $histogram{$o}++}; for $o (sort keys %histogram){print "$o: $histogram{$o}\n"}' > KVM_GET_SUPPORTED_CPUID returned -1 with errno 7: 3 > Returned entries: 31: 9995 > Returned entries: 57: 1 > Returned entries: 58: 1 > evensky@waltz:~/megatux/vmatic$ perl -e 'for $cnt (1..10000){ $o=`taskset 0x04 ./4sasha`; chomp($o); $histogram{$o}++}; for $o (sort keys %histogram){print "$o: $histogram{$o}\n"}' > Returned entries: 31: 10000 > evensky@waltz:~/megatux/vmatic$ perl -e 'for $cnt (1..10000){ $o=`taskset 0x08 ./4sasha`; chomp($o); $histogram{$o}++}; for $o (sort keys %histogram){print "$o: $histogram{$o}\n"}' > KVM_GET_SUPPORTED_CPUID returned -1 with errno 7: 1 > Returned entries: 31: 9998 > Returned entries: 54: 1 > Please run the attached program (which works for me, btw). -- error compiling committee.c: too many arguments to function --------------080205030708080008080105 Content-Type: text/x-csrc; name="supported-cpuid.c" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="supported-cpuid.c" #include #include #include #include #include int main(void) { struct kvm_cpuid2 *cpuid; int kvm, r = 0, i, j; for (i = 0; i < 1000000; ++i) { kvm = open("/dev/kvm", O_RDWR); cpuid = malloc(sizeof(*cpuid) + sizeof(struct kvm_cpuid_entry2) * 100); cpuid->nent = 100; r = ioctl(kvm, KVM_GET_SUPPORTED_CPUID, cpuid); if (r) printf("KVM_GET_SUPPORTED_CPUID returned %d with errno %d\n", r, errno); else if (cpuid->nent > 31) { printf("Returned entries: %d\n", cpuid->nent); for (j = 0; j < cpuid->nent; ++j) { struct kvm_cpuid_entry2 *e = &cpuid->entries[j]; printf("func %08x ind %08x flags %08x -> %08x %08x %08x %08x\n", e->function, e->index, e->flags, e->eax, e->ebx, e->ecx, e->edx); } return 1; } free(cpuid); close(kvm); } return 0; } --------------080205030708080008080105--