This service will be undergoing maintenance at 00:00 UTC, 2016-08-01. It is expected to last about 1 hours

Bug 247835

Summary: libvirt miscalculates socket count on certain dual-socket motherboards
Product: [Fedora] Fedora Reporter: Chris Snook <csnook>
Component: libvirtAssignee: Daniel Veillard <veillard>
Status: CLOSED CURRENTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: low Docs Contact:
Priority: low    
Version: 7   
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: x Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2008-04-04 12:06:34 EDT Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:

Description Chris Snook 2007-07-11 12:22:41 EDT
Description of problem:
When running under the baremetal kernel (for kvm) virt-manager incorrectly
reports 8 logical CPUs on a dual-socket X dual-core = 4-core Woodcrest Xeon box
without hyperthreading.  Under the Xen kernel, 4 logical processors are reported.

Like many dual-socket motherboards, the motherboard on this Dell Precision 490n
numbers the sockets 0 and 3, omitting 1 and 2.  I suspect that libvirt is
incorrectly inferring the existence of 4 distinct physical IDs by the presence
of a physical ID 3 in /proc/cpuinfo.

[root@bernoulli ~]# virsh --connect qemu:///system   nodeinfo
CPU model:           x86_64
CPU(s):              4
CPU frequency:       1595 MHz
CPU socket(s):       4
Core(s) per socket:  2
Thread(s) per core:  1
NUMA cell(s):        1
Memory size:         2057684 kB

[root@bernoulli ~]# cat /proc/cpuinfo
processor       : 0
vendor_id       : GenuineIntel
cpu family      : 6
model           : 15
model name      : Intel(R) Xeon(R) CPU            5110  @ 1.60GHz
stepping        : 6
cpu MHz         : 1595.925
cache size      : 4096 KB
physical id     : 0
siblings        : 2
core id         : 0
cpu cores       : 2
fpu             : yes
fpu_exception   : yes
cpuid level     : 10
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov
pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm syscall lm constant_tsc
pni monitor ds_cpl vmx tm2 ssse3 cx16 xtpr dca lahf_lm
bogomips        : 3193.88
clflush size    : 64
cache_alignment : 64
address sizes   : 36 bits physical, 48 bits virtual
power management:

processor       : 1
vendor_id       : GenuineIntel
cpu family      : 6
model           : 15
model name      : Intel(R) Xeon(R) CPU            5110  @ 1.60GHz
stepping        : 6
cpu MHz         : 1595.925
cache size      : 4096 KB
physical id     : 3
siblings        : 2
core id         : 0
cpu cores       : 2
fpu             : yes
fpu_exception   : yes
cpuid level     : 10
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov
pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm syscall lm constant_tsc
pni monitor ds_cpl vmx tm2 ssse3 cx16 xtpr dca lahf_lm
bogomips        : 3191.89
clflush size    : 64
cache_alignment : 64
address sizes   : 36 bits physical, 48 bits virtual
power management:

processor       : 2
vendor_id       : GenuineIntel
cpu family      : 6
model           : 15
model name      : Intel(R) Xeon(R) CPU            5110  @ 1.60GHz
stepping        : 6
cpu MHz         : 1595.925
cache size      : 4096 KB
physical id     : 0
siblings        : 2
core id         : 1
cpu cores       : 2
fpu             : yes
fpu_exception   : yes
cpuid level     : 10
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov
pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm syscall lm constant_tsc
pni monitor ds_cpl vmx tm2 ssse3 cx16 xtpr dca lahf_lm
bogomips        : 3191.88
clflush size    : 64
cache_alignment : 64
address sizes   : 36 bits physical, 48 bits virtual
power management:

processor       : 3
vendor_id       : GenuineIntel
cpu family      : 6
model           : 15
model name      : Intel(R) Xeon(R) CPU            5110  @ 1.60GHz
stepping        : 6
cpu MHz         : 1595.925
cache size      : 4096 KB
physical id     : 3
siblings        : 2
core id         : 1
cpu cores       : 2
fpu             : yes
fpu_exception   : yes
cpuid level     : 10
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov
pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm syscall lm constant_tsc
pni monitor ds_cpl vmx tm2 ssse3 cx16 xtpr dca lahf_lm
bogomips        : 3191.87
clflush size    : 64
cache_alignment : 64
address sizes   : 36 bits physical, 48 bits virtual
power management:

Version-Release number of selected component (if applicable):
libvirt-0.2.2-4.fc7

How reproducible:
always, on this box

Steps to Reproduce:
1. Install F7 x86_64 on a Dell Precision 490n with 2 dual-core Woodcrest Xeon
processors
2. Boot into the baremetal (non-xen) kernel
3. run virt-manager
4. create a guest with the wizard, note the number of reported logical processors
  
Actual results:
8 logical processors

Expected results:
4 logical processors
Comment 1 Daniel Berrange 2007-07-13 14:15:11 EDT
Argh. Yes, we assume that "num sockets == max(socket id) + 1":

            if ((id+1) > *sockets)
                *sockets = (id + 1);

So since Dell is omitting sockets 1 & 2, we count too many sockets. I'll have to
re-work the parsing code to actually count real sockets in a bitmap somehow. Hate.
Comment 2 Daniel Berrange 2008-04-04 12:06:34 EDT
This is addressed in current libvirt release