public inbox for util-linux@vger.kernel.org
 help / color / mirror / Atom feed
* Hypervisor & Virtualization lscpu test fail
@ 2013-02-10 16:25 Luis Aranguren
  2013-02-10 21:04 ` Sami Kerola
  0 siblings, 1 reply; 6+ messages in thread
From: Luis Aranguren @ 2013-02-10 16:25 UTC (permalink / raw)
  To: util-linux

Hi, I'm trying to package util-linux for exherbo, a source based distro.

util-linux's lscpu tests fail when compiled on a VM running under a VMware Vsphere esxi hypervisor. 

#cat ./C/64/tests/diff/lscpu/lscpu-x86_64-64cpu
--- /var/tmp/paludis/build/sys-apps-util-linux-2.22.2/work/util-linux-2.22.2/tests/expected/lscpu/lscpu-x86_64-64cpu    2012-10-15 10:09:42.000000000 +0000
+++ /var/tmp/paludis/build/sys-apps-util-linux-2.22.2/work/C/64/tests/output/lscpu/lscpu-x86_64-64cpu   2013-02-09 03:35:37.000000000 +0000
@@ -12,6 +12,8 @@
 CPU MHz:               1064.000
 BogoMIPS:              3989.44
 Virtualization:        VT-x
+Hypervisor vendor:     VMware
+Virtualization type:   full
 L1d cache:             32K
 L1i cache:             32K
 L2 cache:              256K


# lscpu
Architecture:          x86_64
CPU op-mode(s):        32-bit, 64-bit
Byte Order:            Little Endian
CPU(s):                2
On-line CPU(s) list:   0,1
Thread(s) per core:    1
Core(s) per socket:    2
Socket(s):             1
NUMA node(s):          1
Vendor ID:             AuthenticAMD
CPU family:            16
Model:                 6
Stepping:              3
CPU MHz:               1497.506
BogoMIPS:              2995.01
Hypervisor vendor:     VMware
Virtualization type:   full
L1d cache:             64K
L1i cache:             64K
L2 cache:              1024K
NUMA node0 CPU(s):     0,1

How can I solve this?
Luis Aranguren


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

* Re: Hypervisor & Virtualization lscpu test fail
  2013-02-10 16:25 Hypervisor & Virtualization lscpu test fail Luis Aranguren
@ 2013-02-10 21:04 ` Sami Kerola
  2013-02-11  1:44   ` Luis Aranguren
  0 siblings, 1 reply; 6+ messages in thread
From: Sami Kerola @ 2013-02-10 21:04 UTC (permalink / raw)
  To: Luis Aranguren; +Cc: util-linux

On Sun, Feb 10, 2013 at 4:25 PM, Luis Aranguren <pizzaman@hotmail.com> wrote:
> Hi, I'm trying to package util-linux for exherbo, a source based distro.
>
> util-linux's lscpu tests fail when compiled on a VM running under a VMware Vsphere esxi hypervisor.
>
> #cat ./C/64/tests/diff/lscpu/lscpu-x86_64-64cpu
> --- /var/tmp/paludis/build/sys-apps-util-linux-2.22.2/work/util-linux-2.22.2/tests/expected/lscpu/lscpu-x86_64-64cpu    2012-10-15 10:09:42.000000000 +0000
> +++ /var/tmp/paludis/build/sys-apps-util-linux-2.22.2/work/C/64/tests/output/lscpu/lscpu-x86_64-64cpu   2013-02-09 03:35:37.000000000 +0000
> @@ -12,6 +12,8 @@
>  CPU MHz:               1064.000
>  BogoMIPS:              3989.44
>  Virtualization:        VT-x
> +Hypervisor vendor:     VMware
> +Virtualization type:   full
>  L1d cache:             32K
>  L1i cache:             32K
>  L2 cache:              256K
>
>
> # lscpu
> Architecture:          x86_64
> CPU op-mode(s):        32-bit, 64-bit
> Byte Order:            Little Endian
> CPU(s):                2
> On-line CPU(s) list:   0,1
> Thread(s) per core:    1
> Core(s) per socket:    2
> Socket(s):             1
> NUMA node(s):          1
> Vendor ID:             AuthenticAMD
> CPU family:            16
> Model:                 6
> Stepping:              3
> CPU MHz:               1497.506
> BogoMIPS:              2995.01
> Hypervisor vendor:     VMware
> Virtualization type:   full
> L1d cache:             64K
> L1i cache:             64K
> L2 cache:              1024K
> NUMA node0 CPU(s):     0,1
>
> How can I solve this?
> Luis Aranguren

Hi Luis,

I have a hunch best way to proceed is to get cpu data from your /proc.
This can be achieved easiest by running a lscpu test data collector
script.

cd src/util-linux
sh tests/ts/lscpu/mk-input.sh vmware-esxi

After running the script you can find file vmware-esxi.tar.gz in
current directory. Please send the file to mail list, and inform if it
can be added to be part of regression test suite (which would of
course is much preferred).

-- 
   Sami Kerola
   http://www.iki.fi/kerolasa/

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

* Re: Hypervisor & Virtualization lscpu test fail
  2013-02-10 21:04 ` Sami Kerola
@ 2013-02-11  1:44   ` Luis Aranguren
  2013-02-11 22:56     ` Sami Kerola
  0 siblings, 1 reply; 6+ messages in thread
From: Luis Aranguren @ 2013-02-11  1:44 UTC (permalink / raw)
  To: kerolasa; +Cc: util-linux

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

On 11/02/2013 7:04 AM, Sami Kerola wrote:
> On Sun, Feb 10, 2013 at 4:25 PM, Luis Aranguren <pizzaman@hotmail.com> wrote:
>> Hi, I'm trying to package util-linux for exherbo, a source based distro.
>>
>> util-linux's lscpu tests fail when compiled on a VM running under a VMware Vsphere esxi hypervisor.
>>
>> #cat ./C/64/tests/diff/lscpu/lscpu-x86_64-64cpu
>> --- /var/tmp/paludis/build/sys-apps-util-linux-2.22.2/work/util-linux-2.22.2/tests/expected/lscpu/lscpu-x86_64-64cpu    2012-10-15 10:09:42.000000000 +0000
>> +++ /var/tmp/paludis/build/sys-apps-util-linux-2.22.2/work/C/64/tests/output/lscpu/lscpu-x86_64-64cpu   2013-02-09 03:35:37.000000000 +0000
>> @@ -12,6 +12,8 @@
>>  CPU MHz:               1064.000
>>  BogoMIPS:              3989.44
>>  Virtualization:        VT-x
>> +Hypervisor vendor:     VMware
>> +Virtualization type:   full
>>  L1d cache:             32K
>>  L1i cache:             32K
>>  L2 cache:              256K
>>
>>
>> # lscpu
>> Architecture:          x86_64
>> CPU op-mode(s):        32-bit, 64-bit
>> Byte Order:            Little Endian
>> CPU(s):                2
>> On-line CPU(s) list:   0,1
>> Thread(s) per core:    1
>> Core(s) per socket:    2
>> Socket(s):             1
>> NUMA node(s):          1
>> Vendor ID:             AuthenticAMD
>> CPU family:            16
>> Model:                 6
>> Stepping:              3
>> CPU MHz:               1497.506
>> BogoMIPS:              2995.01
>> Hypervisor vendor:     VMware
>> Virtualization type:   full
>> L1d cache:             64K
>> L1i cache:             64K
>> L2 cache:              1024K
>> NUMA node0 CPU(s):     0,1
>>
>> How can I solve this?
>> Luis Aranguren
> Hi Luis,
>
> I have a hunch best way to proceed is to get cpu data from your /proc.
> This can be achieved easiest by running a lscpu test data collector
> script.
>
> cd src/util-linux
> sh tests/ts/lscpu/mk-input.sh vmware-esxi
>
> After running the script you can find file vmware-esxi.tar.gz in
> current directory. Please send the file to mail list, and inform if it
> can be added to be part of regression test suite (which would of
> course is much preferred).
>
Hi Sami,

Thanks for the reply. I include the output file from mk-input.sh, I have
to note that there were a three permission denied instances.

# sh tests/ts/lscpu/mk-input.sh vmware-esxi
cp: cannot open ‘/sys/devices/system/cpu/microcode/reload’ for reading:
Permission denied
cp: cannot open ‘/sys/devices/system/cpu/probe’ for reading: Permission
denied
cp: cannot open ‘/sys/devices/system/cpu/release’ for reading:
Permission denied

Feel free to use it as part of the regression test suite.

Luis Aranguren
<http://paste.luisaranguren.com/index.php?8px@raw>

[-- Attachment #2: vmware-esxi.tar.gz --]
[-- Type: application/gzip, Size: 4268 bytes --]

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

* Re: Hypervisor & Virtualization lscpu test fail
  2013-02-11  1:44   ` Luis Aranguren
@ 2013-02-11 22:56     ` Sami Kerola
  2013-02-13 16:35       ` Luis Aranguren
  2013-02-14 14:40       ` Karel Zak
  0 siblings, 2 replies; 6+ messages in thread
From: Sami Kerola @ 2013-02-11 22:56 UTC (permalink / raw)
  To: Luis Aranguren; +Cc: util-linux

On Mon, Feb 11, 2013 at 1:44 AM, Luis Aranguren <pizzaman@hotmail.com> wrote:
> Thanks for the reply. I include the output file from mk-input.sh, I have
> to note that there were a three permission denied instances.

Oh, I did not look the code before asking the stuff from /proc/. It
seems the lscpu detects virtualization by looking characteristics of
cpu. See cpuid() from

https://github.com/karelzak/util-linux/blob/master/sys-utils/lscpu.c#L453

Perhaps turning off call to that function is the most sensible thing
to do. Any thoughts?

diff --git a/sys-utils/lscpu.c b/sys-utils/lscpu.c
index 824c8b7..27f2567 100644
--- a/sys-utils/lscpu.c
+++ b/sys-utils/lscpu.c
@@ -1217,9 +1217,9 @@ print_summary(struct lscpu_desc *desc, struct
lscpu_modifier *mod)
 		else if (!strcmp(desc->virtflag, "vmx"))
 			print_s(_("Virtualization:"), "VT-x");
 	}
-	if (desc->hypervisor)
+	if (desc->hypervisor && mod->system == SYSTEM_LIVE)
 		print_s(_("Hypervisor:"), desc->hypervisor);
-	if (desc->hyper) {
+	if (desc->hyper && mod->system == SYSTEM_LIVE) {
 		print_s(_("Hypervisor vendor:"), hv_vendors[desc->hyper]);
 		print_s(_("Virtualization type:"), _(virt_types[desc->virtype]));
 	}

> Feel free to use it as part of the regression test suite.

Thank you.

-- 
   Sami Kerola
   http://www.iki.fi/kerolasa/

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

* Re: Hypervisor & Virtualization lscpu test fail
  2013-02-11 22:56     ` Sami Kerola
@ 2013-02-13 16:35       ` Luis Aranguren
  2013-02-14 14:40       ` Karel Zak
  1 sibling, 0 replies; 6+ messages in thread
From: Luis Aranguren @ 2013-02-13 16:35 UTC (permalink / raw)
  To: kerolasa; +Cc: util-linux

On 2/12/2013 8:56 AM, Sami Kerola wrote:
>  
> -	if (desc->hypervisor)
> +	if (desc->hypervisor && mod->system == SYSTEM_LIVE)
>  		print_s(_("Hypervisor:"), desc->hypervisor);
> -	if (desc->hyper) {
> +	if (desc->hyper && mod->system == SYSTEM_LIVE) {
>

Thanks for the fix. After applying it I got these results:

        lscpu:                                ... 
                : ppc64-POWER7                ... OK 
                : s390-kvm                    ... FAILED
(lscpu/lscpu-s390-kvm) 
                : s390-lpar                   ... FAILED
(lscpu/lscpu-s390-lpar) 
                : s390-zvm                    ... FAILED
(lscpu/lscpu-s390-zvm) 
                : x86_64-64cpu                ... OK 
                : x86_64-dell_e4310           ... OK 
           ... FAILED (3 from 6 sub-tests) 

---
/var/tmp/paludis/build/sys-apps-util-linux-2.22.2/work/util-linux-2.22.2/tests/expected/lscpu/lscpu-s390-kvm   
2012-10-15 10:09:42.000000000 +0000
+++
/var/tmp/paludis/build/sys-apps-util-linux-2.22.2/work/C/64/tests/output/lscpu/lscpu-s390-kvm   
2013-02-13 15:37:56.000000000 +0000
@@ -7,9 +7,6 @@
 Book(s):               3
 Vendor ID:             IBM/S390
 BogoMIPS:              14367.00
-Hypervisor:            KVM/Linux
-Hypervisor vendor:     KVM
-Virtualization type:   full
 Dispatching mode:      horizontal
 

Same for the other two s390's. Hope this helps.
Thanks!

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

* Re: Hypervisor & Virtualization lscpu test fail
  2013-02-11 22:56     ` Sami Kerola
  2013-02-13 16:35       ` Luis Aranguren
@ 2013-02-14 14:40       ` Karel Zak
  1 sibling, 0 replies; 6+ messages in thread
From: Karel Zak @ 2013-02-14 14:40 UTC (permalink / raw)
  To: kerolasa; +Cc: Luis Aranguren, util-linux

On Mon, Feb 11, 2013 at 10:56:22PM +0000, Sami Kerola wrote:
> On Mon, Feb 11, 2013 at 1:44 AM, Luis Aranguren <pizzaman@hotmail.com> wrote:
> > Thanks for the reply. I include the output file from mk-input.sh, I have
> > to note that there were a three permission denied instances.
> 
> Oh, I did not look the code before asking the stuff from /proc/. It
> seems the lscpu detects virtualization by looking characteristics of
> cpu. See cpuid() from
> 
> https://github.com/karelzak/util-linux/blob/master/sys-utils/lscpu.c#L453
> 
> Perhaps turning off call to that function is the most sensible thing
> to do. Any thoughts?

 Yes, good idea. Implemented, pushed.

    Karel

-- 
 Karel Zak  <kzak@redhat.com>
 http://karelzak.blogspot.com

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

end of thread, other threads:[~2013-02-14 14:40 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-02-10 16:25 Hypervisor & Virtualization lscpu test fail Luis Aranguren
2013-02-10 21:04 ` Sami Kerola
2013-02-11  1:44   ` Luis Aranguren
2013-02-11 22:56     ` Sami Kerola
2013-02-13 16:35       ` Luis Aranguren
2013-02-14 14:40       ` Karel Zak

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox