* kvm-tools: can't seem to set guest_mac and KVM_GET_SUPPORTED_CPUID failed.
@ 2011-11-17 0:42 David Evensky
2011-11-17 6:07 ` Sasha Levin
0 siblings, 1 reply; 19+ messages in thread
From: David Evensky @ 2011-11-17 0:42 UTC (permalink / raw)
To: kvm
There was a patch (quoted below) that changed networking at the end of September. When I
try to set the guest_mac from the usage in the patch and an admittaly too
brief a look at the code, the guest's mac address isn't being set. I'm using:
sudo /path/to/linux-kvm/tools/kvm/kvm run -c 1 -m 256 -k /path/to/bzImage-3.0.8 \
-i /path/to/initramfs-host.img --console serial -p ' console=ttyS0 ' -n tap,guest_mac=00:11:11:11:11:11
In the guest I get:
# ifconfig eth0
eth0 Link encap:Ethernet HWaddr 02:15:15:15:15:15
inet addr:192.168.122.237 Bcast:192.168.122.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:24 errors:0 dropped:2 overruns:0 frame:0
TX packets:2 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:1874 (1.8 KiB) TX bytes:656 (656.0 B)
which is the default.
Also, when I start the guest I sometimes get the following error message:
# kvm run -k /path/to/bzImage-3.0.8 -m 256 -c 1 --name guest-15757
KVM_GET_SUPPORTED_CPUID failed: Argument list too long
I haven't seen that before.
Thanks,
\dae
On Sat, Sep 24, 2011 at 12:17:51PM +0300, Sasha Levin wrote:
> This patch adds support for multiple network devices. The command line syntax
> changes to the following:
>
> --network/-n [mode=[tap/user/none]] [guest_ip=[guest ip]] [host_ip=
> [host_ip]] [guest_mac=[guest_mac]] [script=[script]]
>
> Each of the parameters is optional, and the config defaults to a TAP based
> networking with a random MAC.
> ...
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: kvm-tools: can't seem to set guest_mac and KVM_GET_SUPPORTED_CPUID failed.
2011-11-17 0:42 kvm-tools: can't seem to set guest_mac and KVM_GET_SUPPORTED_CPUID failed David Evensky
@ 2011-11-17 6:07 ` Sasha Levin
2011-11-17 6:53 ` Pekka Enberg
2011-11-17 15:55 ` David Evensky
0 siblings, 2 replies; 19+ messages in thread
From: Sasha Levin @ 2011-11-17 6:07 UTC (permalink / raw)
To: David Evensky; +Cc: kvm
On Wed, 2011-11-16 at 16:42 -0800, David Evensky wrote:
>
> There was a patch (quoted below) that changed networking at the end of September. When I
> try to set the guest_mac from the usage in the patch and an admittaly too
> brief a look at the code, the guest's mac address isn't being set. I'm using:
>
> sudo /path/to/linux-kvm/tools/kvm/kvm run -c 1 -m 256 -k /path/to/bzImage-3.0.8 \
> -i /path/to/initramfs-host.img --console serial -p ' console=ttyS0 ' -n tap,guest_mac=00:11:11:11:11:11
>
> In the guest I get:
>
> # ifconfig eth0
> eth0 Link encap:Ethernet HWaddr 02:15:15:15:15:15
> inet addr:192.168.122.237 Bcast:192.168.122.255 Mask:255.255.255.0
> UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
> RX packets:24 errors:0 dropped:2 overruns:0 frame:0
> TX packets:2 errors:0 dropped:0 overruns:0 carrier:0
> collisions:0 txqueuelen:1000
> RX bytes:1874 (1.8 KiB) TX bytes:656 (656.0 B)
>
> which is the default.
This should be '-n mode=tap,guest_mac=00:11:11:11:11:11'
It will set the right mac:
sh-2.05b# ifconfig
eth0 Link encap:Ethernet HWaddr 00:11:11:11:11:11
[...]
>
> Also, when I start the guest I sometimes get the following error message:
>
> # kvm run -k /path/to/bzImage-3.0.8 -m 256 -c 1 --name guest-15757
> KVM_GET_SUPPORTED_CPUID failed: Argument list too long
Heh, we were talking about it couple of weeks ago, but since I couldn't
reproduce it here (it was happening to me before, but now it's gone) the
discussing died.
Could you please provide some statistics on how often it happens to you?
Also, can you try wrapping the ioctl with a 'while (1)' (theres only 1
ioctl call to KVM_GET_SUPPORTED_CPUID) and see if it would happen at
some point?
Thanks!
> I haven't seen that before.
>
> Thanks,
> \dae
>
> On Sat, Sep 24, 2011 at 12:17:51PM +0300, Sasha Levin wrote:
> > This patch adds support for multiple network devices. The command line syntax
> > changes to the following:
> >
> > --network/-n [mode=[tap/user/none]] [guest_ip=[guest ip]] [host_ip=
> > [host_ip]] [guest_mac=[guest_mac]] [script=[script]]
> >
> > Each of the parameters is optional, and the config defaults to a TAP based
> > networking with a random MAC.
> > ...
>
> --
> To unsubscribe from this list: send the line "unsubscribe kvm" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
--
Sasha.
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: kvm-tools: can't seem to set guest_mac and KVM_GET_SUPPORTED_CPUID failed.
2011-11-17 6:07 ` Sasha Levin
@ 2011-11-17 6:53 ` Pekka Enberg
2011-11-17 6:56 ` Sasha Levin
2011-11-17 15:55 ` David Evensky
1 sibling, 1 reply; 19+ messages in thread
From: Pekka Enberg @ 2011-11-17 6:53 UTC (permalink / raw)
To: Sasha Levin; +Cc: David Evensky, kvm, Avi Kivity
On Thu, Nov 17, 2011 at 8:07 AM, Sasha Levin <levinsasha928@gmail.com> wrote:
>> Also, when I start the guest I sometimes get the following error message:
>>
>> # kvm run -k /path/to/bzImage-3.0.8 -m 256 -c 1 --name guest-15757
>> KVM_GET_SUPPORTED_CPUID failed: Argument list too long
>
> Heh, we were talking about it couple of weeks ago, but since I couldn't
> reproduce it here (it was happening to me before, but now it's gone) the
> discussing died.
>
> Could you please provide some statistics on how often it happens to you?
> Also, can you try wrapping the ioctl with a 'while (1)' (theres only 1
> ioctl call to KVM_GET_SUPPORTED_CPUID) and see if it would happen at
> some point?
I'm no longer able to reproduce it here with 3.2-rc1. We could just
try the easy way out and do what Qemu does and retry for E2BIG...
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: kvm-tools: can't seem to set guest_mac and KVM_GET_SUPPORTED_CPUID failed.
2011-11-17 6:53 ` Pekka Enberg
@ 2011-11-17 6:56 ` Sasha Levin
2011-11-17 9:04 ` Avi Kivity
2011-11-17 15:38 ` David Evensky
0 siblings, 2 replies; 19+ messages in thread
From: Sasha Levin @ 2011-11-17 6:56 UTC (permalink / raw)
To: Pekka Enberg; +Cc: David Evensky, kvm, Avi Kivity
On Thu, 2011-11-17 at 08:53 +0200, Pekka Enberg wrote:
> On Thu, Nov 17, 2011 at 8:07 AM, Sasha Levin <levinsasha928@gmail.com> wrote:
> >> Also, when I start the guest I sometimes get the following error message:
> >>
> >> # kvm run -k /path/to/bzImage-3.0.8 -m 256 -c 1 --name guest-15757
> >> KVM_GET_SUPPORTED_CPUID failed: Argument list too long
> >
> > Heh, we were talking about it couple of weeks ago, but since I couldn't
> > reproduce it here (it was happening to me before, but now it's gone) the
> > discussing died.
> >
> > Could you please provide some statistics on how often it happens to you?
> > Also, can you try wrapping the ioctl with a 'while (1)' (theres only 1
> > ioctl call to KVM_GET_SUPPORTED_CPUID) and see if it would happen at
> > some point?
>
> I'm no longer able to reproduce it here with 3.2-rc1. We could just
> try the easy way out and do what Qemu does and retry for E2BIG...
Let's not do that :)
It'll just get uncovered again when someone decides to use
KVM_GET_SUPPORTED_CPUID somewhere else (like in Avi's cpuid patch).
I'll try going back to <3.0 later today and see if it comes back.
David, which host kernel do you use?
--
Sasha.
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: kvm-tools: can't seem to set guest_mac and KVM_GET_SUPPORTED_CPUID failed.
2011-11-17 6:56 ` Sasha Levin
@ 2011-11-17 9:04 ` Avi Kivity
2011-11-17 10:08 ` Sasha Levin
2011-11-17 15:38 ` David Evensky
1 sibling, 1 reply; 19+ messages in thread
From: Avi Kivity @ 2011-11-17 9:04 UTC (permalink / raw)
To: Sasha Levin; +Cc: Pekka Enberg, David Evensky, kvm
On 11/17/2011 08:56 AM, Sasha Levin wrote:
> On Thu, 2011-11-17 at 08:53 +0200, Pekka Enberg wrote:
> > On Thu, Nov 17, 2011 at 8:07 AM, Sasha Levin <levinsasha928@gmail.com> wrote:
> > >> Also, when I start the guest I sometimes get the following error message:
> > >>
> > >> # kvm run -k /path/to/bzImage-3.0.8 -m 256 -c 1 --name guest-15757
> > >> KVM_GET_SUPPORTED_CPUID failed: Argument list too long
> > >
> > > Heh, we were talking about it couple of weeks ago, but since I couldn't
> > > reproduce it here (it was happening to me before, but now it's gone) the
> > > discussing died.
> > >
> > > Could you please provide some statistics on how often it happens to you?
> > > Also, can you try wrapping the ioctl with a 'while (1)' (theres only 1
> > > ioctl call to KVM_GET_SUPPORTED_CPUID) and see if it would happen at
> > > some point?
> >
> > I'm no longer able to reproduce it here with 3.2-rc1. We could just
> > try the easy way out and do what Qemu does and retry for E2BIG...
>
> Let's not do that :)
Right :)
> It'll just get uncovered again when someone decides to use
> KVM_GET_SUPPORTED_CPUID somewhere else (like in Avi's cpuid patch).
>
> I'll try going back to <3.0 later today and see if it comes back.
It might be worthwhile to write a small program that only does
KVM_GET_SUPPORTED_CPUID, to rule out issues in userspace (though there
isn't much of a window for such issues).
--
error compiling committee.c: too many arguments to function
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: kvm-tools: can't seem to set guest_mac and KVM_GET_SUPPORTED_CPUID failed.
2011-11-17 9:04 ` Avi Kivity
@ 2011-11-17 10:08 ` Sasha Levin
0 siblings, 0 replies; 19+ messages in thread
From: Sasha Levin @ 2011-11-17 10:08 UTC (permalink / raw)
To: Avi Kivity; +Cc: Pekka Enberg, David Evensky, kvm
On Thu, 2011-11-17 at 11:04 +0200, Avi Kivity wrote:
> On 11/17/2011 08:56 AM, Sasha Levin wrote:
> > On Thu, 2011-11-17 at 08:53 +0200, Pekka Enberg wrote:
> > > On Thu, Nov 17, 2011 at 8:07 AM, Sasha Levin <levinsasha928@gmail.com> wrote:
> > > >> Also, when I start the guest I sometimes get the following error message:
> > > >>
> > > >> # kvm run -k /path/to/bzImage-3.0.8 -m 256 -c 1 --name guest-15757
> > > >> KVM_GET_SUPPORTED_CPUID failed: Argument list too long
> > > >
> > > > Heh, we were talking about it couple of weeks ago, but since I couldn't
> > > > reproduce it here (it was happening to me before, but now it's gone) the
> > > > discussing died.
> > > >
> > > > Could you please provide some statistics on how often it happens to you?
> > > > Also, can you try wrapping the ioctl with a 'while (1)' (theres only 1
> > > > ioctl call to KVM_GET_SUPPORTED_CPUID) and see if it would happen at
> > > > some point?
> > >
> > > I'm no longer able to reproduce it here with 3.2-rc1. We could just
> > > try the easy way out and do what Qemu does and retry for E2BIG...
> >
> > Let's not do that :)
>
> Right :)
>
> > It'll just get uncovered again when someone decides to use
> > KVM_GET_SUPPORTED_CPUID somewhere else (like in Avi's cpuid patch).
> >
> > I'll try going back to <3.0 later today and see if it comes back.
>
> It might be worthwhile to write a small program that only does
> KVM_GET_SUPPORTED_CPUID, to rule out issues in userspace (though there
> isn't much of a window for such issues).
Heh... It actually discovered a different (minor) issue there, and a
documentation error as well.
I'll send patches in a bit.
--
Sasha.
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: kvm-tools: can't seem to set guest_mac and KVM_GET_SUPPORTED_CPUID failed.
2011-11-17 6:56 ` Sasha Levin
2011-11-17 9:04 ` Avi Kivity
@ 2011-11-17 15:38 ` David Evensky
2011-11-17 15:43 ` Sasha Levin
1 sibling, 1 reply; 19+ messages in thread
From: David Evensky @ 2011-11-17 15:38 UTC (permalink / raw)
To: Sasha Levin; +Cc: Pekka Enberg, kvm, Avi Kivity
On Thu, Nov 17, 2011 at 08:56:38AM +0200, Sasha Levin wrote:
> On Thu, 2011-11-17 at 08:53 +0200, Pekka Enberg wrote:
> > On Thu, Nov 17, 2011 at 8:07 AM, Sasha Levin <levinsasha928@gmail.com> wrote:
> > >> Also, when I start the guest I sometimes get the following error message:
> ....
>
> David, which host kernel do you use?
I'm using the kernel that ships with Debian Sid, which I last booted as 3.0.0-2-amd64.
My guest kernel is a 32bit kernel built from kernel.org's linux-3.0.8.
>
> --
>
> Sasha.
>
> --
> To unsubscribe from this list: send the line "unsubscribe kvm" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: kvm-tools: can't seem to set guest_mac and KVM_GET_SUPPORTED_CPUID failed.
2011-11-17 15:38 ` David Evensky
@ 2011-11-17 15:43 ` Sasha Levin
2011-11-17 15:50 ` David Evensky
0 siblings, 1 reply; 19+ messages in thread
From: Sasha Levin @ 2011-11-17 15:43 UTC (permalink / raw)
To: David Evensky; +Cc: Pekka Enberg, kvm, Avi Kivity
On Thu, 2011-11-17 at 07:38 -0800, David Evensky wrote:
> On Thu, Nov 17, 2011 at 08:56:38AM +0200, Sasha Levin wrote:
> > On Thu, 2011-11-17 at 08:53 +0200, Pekka Enberg wrote:
> > > On Thu, Nov 17, 2011 at 8:07 AM, Sasha Levin <levinsasha928@gmail.com> wrote:
> > > >> Also, when I start the guest I sometimes get the following error message:
> > ....
> >
> > David, which host kernel do you use?
>
> I'm using the kernel that ships with Debian Sid, which I last booted as 3.0.0-2-amd64.
> My guest kernel is a 32bit kernel built from kernel.org's linux-3.0.8.
Hm... This should be new enough...
Could you please try compiling and running the code below several times
and see if you get an error message? This should help us understand if
it's a usermode or a kernel issue.
Thanks!
------------ cut here---------------
#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>
#include <errno.h>
#include <linux/kvm.h>
int main(void)
{
struct kvm_cpuid2 *cpuid;
int kvm, r = 0;
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
printf("Returned entries: %d\n", cpuid->nent);
free(cpuid);
close(kvm);
return 0;
}
--
Sasha.
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: kvm-tools: can't seem to set guest_mac and KVM_GET_SUPPORTED_CPUID failed.
2011-11-17 15:43 ` Sasha Levin
@ 2011-11-17 15:50 ` David Evensky
2011-11-17 15:52 ` Sasha Levin
0 siblings, 1 reply; 19+ messages in thread
From: David Evensky @ 2011-11-17 15:50 UTC (permalink / raw)
To: Sasha Levin; +Cc: Pekka Enberg, kvm, Avi Kivity
It prints 'Returned entries: 31'
\dae
On Thu, Nov 17, 2011 at 05:43:49PM +0200, Sasha Levin wrote:
> On Thu, 2011-11-17 at 07:38 -0800, David Evensky wrote:
> > On Thu, Nov 17, 2011 at 08:56:38AM +0200, Sasha Levin wrote:
> > > On Thu, 2011-11-17 at 08:53 +0200, Pekka Enberg wrote:
> > > > On Thu, Nov 17, 2011 at 8:07 AM, Sasha Levin <levinsasha928@gmail.com> wrote:
> > > > >> Also, when I start the guest I sometimes get the following error message:
> > > ....
> > >
> > > David, which host kernel do you use?
> >
> > I'm using the kernel that ships with Debian Sid, which I last booted as 3.0.0-2-amd64.
> > My guest kernel is a 32bit kernel built from kernel.org's linux-3.0.8.
>
> Hm... This should be new enough...
>
> Could you please try compiling and running the code below several times
> and see if you get an error message? This should help us understand if
> it's a usermode or a kernel issue.
>
> Thanks!
>
> ------------ cut here---------------
>
> #include <stdio.h>
> #include <stdlib.h>
> #include <fcntl.h>
> #include <errno.h>
> #include <linux/kvm.h>
>
> int main(void)
> {
> struct kvm_cpuid2 *cpuid;
> int kvm, r = 0;
>
> 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
> printf("Returned entries: %d\n", cpuid->nent);
>
> free(cpuid);
> close(kvm);
>
> return 0;
> }
>
> --
>
> Sasha.
>
> --
> To unsubscribe from this list: send the line "unsubscribe kvm" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: kvm-tools: can't seem to set guest_mac and KVM_GET_SUPPORTED_CPUID failed.
2011-11-17 15:50 ` David Evensky
@ 2011-11-17 15:52 ` Sasha Levin
2011-11-17 15:53 ` Avi Kivity
0 siblings, 1 reply; 19+ messages in thread
From: Sasha Levin @ 2011-11-17 15:52 UTC (permalink / raw)
To: David Evensky; +Cc: Pekka Enberg, kvm, Avi Kivity
On Thu, 2011-11-17 at 07:50 -0800, David Evensky wrote:
> It prints 'Returned entries: 31'
> \dae
Thats the OK scenario, could you run it several times to see if you can
trigger it to print something else?
--
Sasha.
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: kvm-tools: can't seem to set guest_mac and KVM_GET_SUPPORTED_CPUID failed.
2011-11-17 15:52 ` Sasha Levin
@ 2011-11-17 15:53 ` Avi Kivity
2011-11-17 16:12 ` David Evensky
0 siblings, 1 reply; 19+ messages in thread
From: Avi Kivity @ 2011-11-17 15:53 UTC (permalink / raw)
To: Sasha Levin; +Cc: David Evensky, Pekka Enberg, kvm
On 11/17/2011 05:52 PM, Sasha Levin wrote:
> On Thu, 2011-11-17 at 07:50 -0800, David Evensky wrote:
> > It prints 'Returned entries: 31'
> > \dae
>
> Thats the OK scenario, could you run it several times to see if you can
> trigger it to print something else?
Maybe with 'taskset' to get it to run on different cpus?
In a loop please.
--
error compiling committee.c: too many arguments to function
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: kvm-tools: can't seem to set guest_mac and KVM_GET_SUPPORTED_CPUID failed.
2011-11-17 6:07 ` Sasha Levin
2011-11-17 6:53 ` Pekka Enberg
@ 2011-11-17 15:55 ` David Evensky
1 sibling, 0 replies; 19+ messages in thread
From: David Evensky @ 2011-11-17 15:55 UTC (permalink / raw)
To: Sasha Levin; +Cc: kvm
On Thu, Nov 17, 2011 at 08:07:35AM +0200, Sasha Levin wrote:
> On Wed, 2011-11-16 at 16:42 -0800, David Evensky wrote:
> >
> > ...
> This should be '-n mode=tap,guest_mac=00:11:11:11:11:11'
> ...
Thanks!
> >
> > Also, when I start the guest I sometimes get the following error message:
> >
> > # kvm run -k /path/to/bzImage-3.0.8 -m 256 -c 1 --name guest-15757
> > KVM_GET_SUPPORTED_CPUID failed: Argument list too long
>
> Heh, we were talking about it couple of weeks ago, but since I couldn't
> reproduce it here (it was happening to me before, but now it's gone) the
> discussing died.
>
> Could you please provide some statistics on how often it happens to you?
> Also, can you try wrapping the ioctl with a 'while (1)' (theres only 1
> ioctl call to KVM_GET_SUPPORTED_CPUID) and see if it would happen at
> some point?
Last night I was getting it > 10%; but now that the sun has risen, of
course I can't produce it with 10 tries with 3 sets of args that I was
using. I did upgrade a few packages last night, but nothing that
should affect this.
> Thanks!
>
> > I haven't seen that before.
> >
> > Thanks,
> > \dae
> > ...
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: kvm-tools: can't seem to set guest_mac and KVM_GET_SUPPORTED_CPUID failed.
2011-11-17 15:53 ` Avi Kivity
@ 2011-11-17 16:12 ` David Evensky
2011-11-17 16:20 ` Sasha Levin
2011-11-17 16:20 ` Avi Kivity
0 siblings, 2 replies; 19+ messages in thread
From: David Evensky @ 2011-11-17 16:12 UTC (permalink / raw)
To: Avi Kivity; +Cc: Sasha Levin, Pekka Enberg, kvm
evensky@waltz:~/megatux/vmatic$ perl -e 'for $cnt (1..100000){ $o=`./4sasha`; chomp($o); $histogram{$o}++}; for $o (keys %histogram){print "$o: $histogram{$o}\n"}'
Returned entries: 31: 99987
Returned entries: 56: 1
KVM_GET_SUPPORTED_CPUID returned -1 with errno 7: 8
Returned entries: 37: 4
\dae
On Thu, Nov 17, 2011 at 05:53:50PM +0200, Avi Kivity wrote:
> On 11/17/2011 05:52 PM, Sasha Levin wrote:
> > On Thu, 2011-11-17 at 07:50 -0800, David Evensky wrote:
> > > It prints 'Returned entries: 31'
> > > \dae
> >
> > Thats the OK scenario, could you run it several times to see if you can
> > trigger it to print something else?
>
> Maybe with 'taskset' to get it to run on different cpus?
>
> In a loop please.
>
> --
> error compiling committee.c: too many arguments to function
>
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: kvm-tools: can't seem to set guest_mac and KVM_GET_SUPPORTED_CPUID failed.
2011-11-17 16:12 ` David Evensky
@ 2011-11-17 16:20 ` Sasha Levin
2011-11-17 16:20 ` Avi Kivity
1 sibling, 0 replies; 19+ messages in thread
From: Sasha Levin @ 2011-11-17 16:20 UTC (permalink / raw)
To: David Evensky; +Cc: Avi Kivity, Pekka Enberg, kvm
On Thu, 2011-11-17 at 08:12 -0800, David Evensky wrote:
>
> evensky@waltz:~/megatux/vmatic$ perl -e 'for $cnt (1..100000){ $o=`./4sasha`; chomp($o); $histogram{$o}++}; for $o (keys %histogram){print "$o: $histogram{$o}\n"}'
> Returned entries: 31: 99987
> Returned entries: 56: 1
> KVM_GET_SUPPORTED_CPUID returned -1 with errno 7: 8
> Returned entries: 37: 4
Awesome, thanks!
So it's a kernel thing.
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: kvm-tools: can't seem to set guest_mac and KVM_GET_SUPPORTED_CPUID failed.
2011-11-17 16:12 ` David Evensky
2011-11-17 16:20 ` Sasha Levin
@ 2011-11-17 16:20 ` Avi Kivity
2011-11-17 16:29 ` David Evensky
1 sibling, 1 reply; 19+ messages in thread
From: Avi Kivity @ 2011-11-17 16:20 UTC (permalink / raw)
To: David Evensky; +Cc: Sasha Levin, Pekka Enberg, kvm
On 11/17/2011 06:12 PM, David Evensky wrote:
>
> evensky@waltz:~/megatux/vmatic$ perl -e 'for $cnt (1..100000){ $o=`./4sasha`; chomp($o); $histogram{$o}++}; for $o (keys %histogram){print "$o: $histogram{$o}\n"}'
> Returned entries: 31: 99987
> Returned entries: 56: 1
> KVM_GET_SUPPORTED_CPUID returned -1 with errno 7: 8
> Returned entries: 37: 4
>
>
So it seems to be cpu migration related. But there's a get_cpu() in
do_cpuid_ent().
What happens if you change `./4sasha` to `taskset 1 ./4sasha`? or 2 4 8
10 20 etc?
--
error compiling committee.c: too many arguments to function
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: kvm-tools: can't seem to set guest_mac and KVM_GET_SUPPORTED_CPUID failed.
2011-11-17 16:20 ` Avi Kivity
@ 2011-11-17 16:29 ` David Evensky
2011-11-17 16:49 ` Avi Kivity
0 siblings, 1 reply; 19+ messages in thread
From: David Evensky @ 2011-11-17 16:29 UTC (permalink / raw)
To: Avi Kivity; +Cc: Sasha Levin, Pekka Enberg, kvm
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
\dae
On Thu, Nov 17, 2011 at 06:20:33PM +0200, Avi Kivity wrote:
> On 11/17/2011 06:12 PM, David Evensky wrote:
> >
> > evensky@waltz:~/megatux/vmatic$ perl -e 'for $cnt (1..100000){ $o=`./4sasha`; chomp($o); $histogram{$o}++}; for $o (keys %histogram){print "$o: $histogram{$o}\n"}'
> > Returned entries: 31: 99987
> > Returned entries: 56: 1
> > KVM_GET_SUPPORTED_CPUID returned -1 with errno 7: 8
> > Returned entries: 37: 4
> >
> >
>
> So it seems to be cpu migration related. But there's a get_cpu() in
> do_cpuid_ent().
>
> What happens if you change `./4sasha` to `taskset 1 ./4sasha`? or 2 4 8
> 10 20 etc?
>
> --
> error compiling committee.c: too many arguments to function
>
> --
> To unsubscribe from this list: send the line "unsubscribe kvm" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: kvm-tools: can't seem to set guest_mac and KVM_GET_SUPPORTED_CPUID failed.
2011-11-17 16:29 ` David Evensky
@ 2011-11-17 16:49 ` Avi Kivity
2011-11-17 17:13 ` David Evensky
0 siblings, 1 reply; 19+ messages in thread
From: Avi Kivity @ 2011-11-17 16:49 UTC (permalink / raw)
To: David Evensky; +Cc: Sasha Levin, Pekka Enberg, kvm
[-- Attachment #1: Type: text/plain, Size: 1590 bytes --]
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
[-- Attachment #2: supported-cpuid.c --]
[-- Type: text/x-csrc, Size: 1008 bytes --]
#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>
#include <errno.h>
#include <linux/kvm.h>
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;
}
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: kvm-tools: can't seem to set guest_mac and KVM_GET_SUPPORTED_CPUID failed.
2011-11-17 16:49 ` Avi Kivity
@ 2011-11-17 17:13 ` David Evensky
2011-11-17 17:30 ` Avi Kivity
0 siblings, 1 reply; 19+ messages in thread
From: David Evensky @ 2011-11-17 17:13 UTC (permalink / raw)
To: Avi Kivity; +Cc: Sasha Levin, Pekka Enberg, kvm
Avi, sure:
evensky@waltz:~$ gcc supported-cpuid.c -o supported-cpuid
evensky@waltz:~$ ./supported-cpuid
Returned entries: 37
func 00000000 ind 00000000 flags 00000000 -> 0000000d 756e6547 6c65746e 49656e69
func 00000001 ind 00000000 flags 00000000 -> 000206a7 01100800 16b82203 0f8bfbff
func 00000002 ind 00000000 flags 00000006 -> 76035a01 00f0b2ff 00000000 00ca0000
func 00000003 ind 00000000 flags 00000000 -> 00000000 00000000 00000000 00000000
func 00000004 ind 00000000 flags 00000001 -> 1c004121 01c0003f 0000003f 00000000
func 00000004 ind 00000001 flags 00000001 -> 1c004122 01c0003f 0000003f 00000000
func 00000004 ind 00000002 flags 00000001 -> 1c004143 01c0003f 000001ff 00000000
func 00000004 ind 00000003 flags 00000001 -> 1c03c163 03c0003f 00000fff 00000006
func 00000004 ind 00000004 flags 00000001 -> 00000000 00000000 00000000 00000000
func 00000005 ind 00000000 flags 00000000 -> 00000040 00000040 00000003 00021120
func 00000006 ind 00000000 flags 00000000 -> 00000077 00000002 00000009 00000000
func 00000007 ind 00000000 flags 00000000 -> 00000000 00000000 00000000 00000000
func 00000008 ind 00000000 flags 00000000 -> 00000000 00000000 00000000 00000000
func 00000009 ind 00000000 flags 00000000 -> 00000000 00000000 00000000 00000000
func 0000000a ind 00000000 flags 00000000 -> 07300403 00000000 00000000 00000603
func 0000000b ind 00000000 flags 00000001 -> 00000001 00000002 00000100 00000001
func 0000000b ind 00000001 flags 00000001 -> 00000004 00000004 00000201 00000001
func 0000000b ind 00000002 flags 00000001 -> 00000000 00000000 00000002 00000001
func 0000000c ind 00000000 flags 00000000 -> 00000000 00000000 00000000 00000000
func 0000000d ind 00000000 flags 00000001 -> 00000007 00000340 00000340 00000000
func 0000000d ind 00000001 flags 00000001 -> 00000001 00000000 00000000 00000000
func 80000001 ind 00000000 flags 00000000 -> 00000000 00000000 00000001 28100800
func 0000000d ind 00000003 flags 00000001 -> 00000000 00000000 00000000 00000000
func 0000000d ind 00000004 flags 00000001 -> 00000000 00000000 00000000 00000000
func 0000000d ind 00000005 flags 00000001 -> 00000000 00000000 00000000 00000000
func 80000005 ind 00000000 flags 00000000 -> 00000000 00000000 00000000 00000000
func 80000000 ind 00000000 flags 00000000 -> 80000008 00000000 00000000 00000000
func 80000001 ind 00000000 flags 00000000 -> 00000000 00000000 00000001 28100800
func 80000002 ind 00000000 flags 00000000 -> 20202020 49202020 6c65746e 20295228
func 80000003 ind 00000000 flags 00000000 -> 65726f43 294d5428 2d376920 30323632
func 80000004 ind 00000000 flags 00000000 -> 5043204d 20402055 30372e32 007a4847
func 80000005 ind 00000000 flags 00000000 -> 00000000 00000000 00000000 00000000
func 80000006 ind 00000000 flags 00000000 -> 00000000 00000000 01006040 00000000
func 80000007 ind 00000000 flags 00000000 -> 00000000 00000000 00000000 00000100
func 80000008 ind 00000000 flags 00000000 -> 00003024 00000000 00000000 00000000
func 40000000 ind 00000000 flags 00000000 -> 00000000 4b4d564b 564b4d56 0000004d
func 40000001 ind 00000000 flags 00000000 -> 0100001b 00000000 00000000 00000000
\dae
On Thu, Nov 17, 2011 at 06:49:16PM +0200, Avi Kivity wrote:
> 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
>
> #include <stdio.h>
> #include <stdlib.h>
> #include <fcntl.h>
> #include <errno.h>
> #include <linux/kvm.h>
>
> 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;
> }
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: kvm-tools: can't seem to set guest_mac and KVM_GET_SUPPORTED_CPUID failed.
2011-11-17 17:13 ` David Evensky
@ 2011-11-17 17:30 ` Avi Kivity
0 siblings, 0 replies; 19+ messages in thread
From: Avi Kivity @ 2011-11-17 17:30 UTC (permalink / raw)
To: David Evensky; +Cc: Sasha Levin, Pekka Enberg, kvm
On 11/17/2011 07:13 PM, David Evensky wrote:
> func 0000000d ind 00000001 flags 00000001 -> 00000001 00000000 00000000 00000000
> func 80000001 ind 00000000 flags 00000000 -> 00000000 00000000 00000001 28100800
> func 0000000d ind 00000003 flags 00000001 -> 00000000 00000000 00000000 00000000
> func 0000000d ind 00000004 flags 00000001 -> 00000000 00000000 00000000 00000000
> func 0000000d ind 00000005 flags 00000001 -> 00000000 00000000 00000000 00000000
Leaf 0xd handling is broken in 3.0:
case 0xd: {
int i;
entry->flags |= KVM_CPUID_FLAG_SIGNIFCANT_INDEX;
for (i = 1; *nent < maxnent && i < 64; ++i) {
if (entry[i].eax == 0)
continue;
do_cpuid_1_ent(&entry[i], function, i);
entry[i].flags |=
KVM_CPUID_FLAG_SIGNIFCANT_INDEX;
++*nent;
}
break;
}
We check entry[i].eax before we compute it. 3.2 is fine, so it's only a
matter of backports.
--
error compiling committee.c: too many arguments to function
^ permalink raw reply [flat|nested] 19+ messages in thread
end of thread, other threads:[~2011-11-17 17:31 UTC | newest]
Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-17 0:42 kvm-tools: can't seem to set guest_mac and KVM_GET_SUPPORTED_CPUID failed David Evensky
2011-11-17 6:07 ` Sasha Levin
2011-11-17 6:53 ` Pekka Enberg
2011-11-17 6:56 ` Sasha Levin
2011-11-17 9:04 ` Avi Kivity
2011-11-17 10:08 ` Sasha Levin
2011-11-17 15:38 ` David Evensky
2011-11-17 15:43 ` Sasha Levin
2011-11-17 15:50 ` David Evensky
2011-11-17 15:52 ` Sasha Levin
2011-11-17 15:53 ` Avi Kivity
2011-11-17 16:12 ` David Evensky
2011-11-17 16:20 ` Sasha Levin
2011-11-17 16:20 ` Avi Kivity
2011-11-17 16:29 ` David Evensky
2011-11-17 16:49 ` Avi Kivity
2011-11-17 17:13 ` David Evensky
2011-11-17 17:30 ` Avi Kivity
2011-11-17 15:55 ` David Evensky
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox