kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* monitor flag on native kvm tool guest
       [not found] <CAMEokbTT2hDRr_o5VNpBS4hQPKaLR1gRLZF9b_6wOEHU3-J_oA@mail.gmail.com>
@ 2011-12-01 13:37 ` Daniele Carollo
  2011-12-01 13:48   ` Avi Kivity
  0 siblings, 1 reply; 6+ messages in thread
From: Daniele Carollo @ 2011-12-01 13:37 UTC (permalink / raw)
  To: kvm

Hi,
my name's Daniele and I'm using the native linux kvm tool.
If I try to execute it in this way ./kvm run -d ~/linux-0.2.img I get
a kernel panic like this: http://paste.org/41673
Only using the addictional option -p "idle=halt" I can run a virtual machine.
Printing cat /proc/cpuinfo on the host i get http://paste.org/41663
and on the guest http://paste.org/41664
Sashal from the native linux kvm tool team noticed that there is the
monitor cpu flag even on the guest.
Thanks for the attention,
Daniele Carollo

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: monitor flag on native kvm tool guest
  2011-12-01 13:37 ` monitor flag on native kvm tool guest Daniele Carollo
@ 2011-12-01 13:48   ` Avi Kivity
  2011-12-01 13:50     ` Sasha Levin
  2011-12-01 13:54     ` Daniele Carollo
  0 siblings, 2 replies; 6+ messages in thread
From: Avi Kivity @ 2011-12-01 13:48 UTC (permalink / raw)
  To: Daniele Carollo; +Cc: kvm, Sasha Levin

[-- Attachment #1: Type: text/plain, Size: 930 bytes --]

On 12/01/2011 03:37 PM, Daniele Carollo wrote:
> Hi,
> my name's Daniele and I'm using the native linux kvm tool.
> If I try to execute it in this way ./kvm run -d ~/linux-0.2.img I get
> a kernel panic like this: http://paste.org/41673
> Only using the addictional option -p "idle=halt" I can run a virtual machine.
> Printing cat /proc/cpuinfo on the host i get http://paste.org/41663
> and on the guest http://paste.org/41664
> Sashal from the native linux kvm tool team noticed that there is the
> monitor cpu flag even on the guest.
>

from cpuid.c:

    /* cpuid 1.ecx */
    const u32 kvm_supported_word4_x86_features =
        F(XMM3) | F(PCLMULQDQ) | 0 /* DTES64, MONITOR */ |

so either the masking later on is subtly wrong, or kvm tool doesn't pass
it on correctly, or Linux ignores it.

Please run the attached program on the host and post its output.

-- 
error compiling committee.c: too many arguments to function


[-- Attachment #2: show-supported-cpuid.c --]
[-- Type: text/x-csrc, Size: 763 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;

    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);
	return 1;
    }

    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);
    }
    free(cpuid);
    close(kvm);

    return 0;
}

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: monitor flag on native kvm tool guest
  2011-12-01 13:48   ` Avi Kivity
@ 2011-12-01 13:50     ` Sasha Levin
  2011-12-01 13:53       ` Avi Kivity
  2011-12-01 13:54     ` Daniele Carollo
  1 sibling, 1 reply; 6+ messages in thread
From: Sasha Levin @ 2011-12-01 13:50 UTC (permalink / raw)
  To: Avi Kivity; +Cc: Daniele Carollo, kvm

On Thu, 2011-12-01 at 15:48 +0200, Avi Kivity wrote:
> On 12/01/2011 03:37 PM, Daniele Carollo wrote:
> > Hi,
> > my name's Daniele and I'm using the native linux kvm tool.
> > If I try to execute it in this way ./kvm run -d ~/linux-0.2.img I get
> > a kernel panic like this: http://paste.org/41673
> > Only using the addictional option -p "idle=halt" I can run a virtual machine.
> > Printing cat /proc/cpuinfo on the host i get http://paste.org/41663
> > and on the guest http://paste.org/41664
> > Sashal from the native linux kvm tool team noticed that there is the
> > monitor cpu flag even on the guest.
> >
> 
> from cpuid.c:
> 
>     /* cpuid 1.ecx */
>     const u32 kvm_supported_word4_x86_features =
>         F(XMM3) | F(PCLMULQDQ) | 0 /* DTES64, MONITOR */ |
> 
> so either the masking later on is subtly wrong, or kvm tool doesn't pass
> it on correctly, or Linux ignores it.
> 
> Please run the attached program on the host and post its output.
> 

Avi,

We tested it with qemu where Daniele has reported that monitor is also
visible in the cpuid there.

-- 

Sasha.


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: monitor flag on native kvm tool guest
  2011-12-01 13:50     ` Sasha Levin
@ 2011-12-01 13:53       ` Avi Kivity
  0 siblings, 0 replies; 6+ messages in thread
From: Avi Kivity @ 2011-12-01 13:53 UTC (permalink / raw)
  To: Sasha Levin; +Cc: Daniele Carollo, kvm

On 12/01/2011 03:50 PM, Sasha Levin wrote:
> On Thu, 2011-12-01 at 15:48 +0200, Avi Kivity wrote:
> > On 12/01/2011 03:37 PM, Daniele Carollo wrote:
> > > Hi,
> > > my name's Daniele and I'm using the native linux kvm tool.
> > > If I try to execute it in this way ./kvm run -d ~/linux-0.2.img I get
> > > a kernel panic like this: http://paste.org/41673
> > > Only using the addictional option -p "idle=halt" I can run a virtual machine.
> > > Printing cat /proc/cpuinfo on the host i get http://paste.org/41663
> > > and on the guest http://paste.org/41664
> > > Sashal from the native linux kvm tool team noticed that there is the
> > > monitor cpu flag even on the guest.
> > >
> > 
> > from cpuid.c:
> > 
> >     /* cpuid 1.ecx */
> >     const u32 kvm_supported_word4_x86_features =
> >         F(XMM3) | F(PCLMULQDQ) | 0 /* DTES64, MONITOR */ |
> > 
> > so either the masking later on is subtly wrong, or kvm tool doesn't pass
> > it on correctly, or Linux ignores it.
> > 
> > Please run the attached program on the host and post its output.
> > 
>
> Avi,
>
> We tested it with qemu where Daniele has reported that monitor is also
> visible in the cpuid there.
>

Not here (3.2).  Maybe it's another manifestation of the -E2BIG cpuid bug.

-- 
error compiling committee.c: too many arguments to function


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: monitor flag on native kvm tool guest
  2011-12-01 13:48   ` Avi Kivity
  2011-12-01 13:50     ` Sasha Levin
@ 2011-12-01 13:54     ` Daniele Carollo
  2011-12-01 13:58       ` Avi Kivity
  1 sibling, 1 reply; 6+ messages in thread
From: Daniele Carollo @ 2011-12-01 13:54 UTC (permalink / raw)
  To: Avi Kivity; +Cc: kvm, Sasha Levin

Il 01 dicembre 2011 14:48, Avi Kivity <avi@redhat.com> ha scritto:
> On 12/01/2011 03:37 PM, Daniele Carollo wrote:
>> Hi,
>> my name's Daniele and I'm using the native linux kvm tool.
>> If I try to execute it in this way ./kvm run -d ~/linux-0.2.img I get
>> a kernel panic like this: http://paste.org/41673
>> Only using the addictional option -p "idle=halt" I can run a virtual machine.
>> Printing cat /proc/cpuinfo on the host i get http://paste.org/41663
>> and on the guest http://paste.org/41664
>> Sashal from the native linux kvm tool team noticed that there is the
>> monitor cpu flag even on the guest.
>>
>
> from cpuid.c:
>
>    /* cpuid 1.ecx */
>    const u32 kvm_supported_word4_x86_features =
>        F(XMM3) | F(PCLMULQDQ) | 0 /* DTES64, MONITOR */ |
>
> so either the masking later on is subtly wrong, or kvm tool doesn't pass
> it on correctly, or Linux ignores it.
>
> Please run the attached program on the host and post its output.
>
> --
> error compiling committee.c: too many arguments to function
>

It gave me:
func 00000000 ind 00000000 flags 00000000 -> 0000000d 756e6547 6c65746e 49656e69
func 00000001 ind 00000000 flags 00000000 -> 000206a7 03100800 14b8220b 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 02c0003f 00000fff 00000006
func 00000004 ind 00000004 flags 00000001 -> 00000000 00000000 00000000 00000000
func 00000005 ind 00000000 flags 00000000 -> 00000000 00000000 00000000 00000000
func 00000006 ind 00000000 flags 00000000 -> 00000000 00000000 00000000 00000000
func 00000007 ind 00000000 flags 00000001 -> 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 -> 00000000 00000000 00000000 00000000
func 0000000b ind 00000000 flags 00000001 -> 00000001 00000002 00000100 00000003
func 0000000b ind 00000001 flags 00000001 -> 00000004 00000004 00000201 00000003
func 0000000b ind 00000002 flags 00000001 -> 00000000 00000000 00000002 00000003
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 0000000d ind 00000002 flags 00000001 -> 00000100 00000240 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 -> 00000000 00000000 00000000 00000000
func 80000003 ind 00000000 flags 00000000 -> 00000000 00000000 00000000 00000000
func 80000004 ind 00000000 flags 00000000 -> 00000000 00000000 00000000 00000000
func 80000005 ind 00000000 flags 00000000 -> 00000000 00000000 00000000 00000000
func 80000006 ind 00000000 flags 00000000 -> 00000000 00000000 00000000 00000000
func 80000007 ind 00000000 flags 00000000 -> 00000000 00000000 00000000 00000000
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 -> 0100003b 00000000 00000000 00000000

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: monitor flag on native kvm tool guest
  2011-12-01 13:54     ` Daniele Carollo
@ 2011-12-01 13:58       ` Avi Kivity
  0 siblings, 0 replies; 6+ messages in thread
From: Avi Kivity @ 2011-12-01 13:58 UTC (permalink / raw)
  To: Daniele Carollo; +Cc: kvm, Sasha Levin

On 12/01/2011 03:54 PM, Daniele Carollo wrote:
> Il 01 dicembre 2011 14:48, Avi Kivity <avi@redhat.com> ha scritto:
> > On 12/01/2011 03:37 PM, Daniele Carollo wrote:
> >> Hi,
> >> my name's Daniele and I'm using the native linux kvm tool.
> >> If I try to execute it in this way ./kvm run -d ~/linux-0.2.img I get
> >> a kernel panic like this: http://paste.org/41673
> >> Only using the addictional option -p "idle=halt" I can run a virtual machine.
> >> Printing cat /proc/cpuinfo on the host i get http://paste.org/41663
> >> and on the guest http://paste.org/41664
> >> Sashal from the native linux kvm tool team noticed that there is the
> >> monitor cpu flag even on the guest.
> >>
> >
> > from cpuid.c:
> >
> >    /* cpuid 1.ecx */
> >    const u32 kvm_supported_word4_x86_features =
> >        F(XMM3) | F(PCLMULQDQ) | 0 /* DTES64, MONITOR */ |
> >
> > so either the masking later on is subtly wrong, or kvm tool doesn't pass
> > it on correctly, or Linux ignores it.
> >
> > Please run the attached program on the host and post its output.
> >
> > --
> > error compiling committee.c: too many arguments to function
> >
>
> It gave me:
> func 00000000 ind 00000000 flags 00000000 -> 0000000d 756e6547 6c65746e 49656e69
> func 00000001 ind 00000000 flags 00000000 -> 000206a7 03100800 14b8220b 0f8bfbff
>

cpuid 1.ecx[3] = 1, so it's a host kernel issue.

Please try git://git.kernel.org/pub/scm/virt/kvm/kvm.git
kvm-updates/3.1, see it if fixes it for you.

-- 
error compiling committee.c: too many arguments to function


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2011-12-01 13:59 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <CAMEokbTT2hDRr_o5VNpBS4hQPKaLR1gRLZF9b_6wOEHU3-J_oA@mail.gmail.com>
2011-12-01 13:37 ` monitor flag on native kvm tool guest Daniele Carollo
2011-12-01 13:48   ` Avi Kivity
2011-12-01 13:50     ` Sasha Levin
2011-12-01 13:53       ` Avi Kivity
2011-12-01 13:54     ` Daniele Carollo
2011-12-01 13:58       ` Avi Kivity

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).