Flavio Stanchina wrote:
Quello che mi domando è se questa impostazione cambia la "visione" dell'hardware virtuale (i.e. la macchina virtuale vede due CPU separate o una CPU con due core), se configura l'affinità del processo nei confronti di CPU / core sulla macchina fisica, o se fa entrambe le cose.[...]...credo che lancerò una Knoppix per cercare di capire che cosa vede la macchina virtuale, ma non saprei come fare per verificare quello che succede sull'hardware fisico.
Ecco /proc/cpuinfo e dmesg delle due opzioni, prodotti da un kernel 2.4.24.4:
*.2cpu: due CPU con un core/socket *.2core: una cpu con due core/socketEffettivamente la macchina virtuale vede due CPU separate nel primo caso, una CPU con due core nel secondo.
Hmmm... KVM, o meglio, QEMU sarà così furbo da attaccarsi a due core sulla stessa CPU nel secondo caso? O forse lo fa comunque?
-- Ciao, Flavio
processor : 0 vendor_id : AuthenticAMD cpu family : 6 model : 2 model name : QEMU Virtual CPU version 0.11.1 stepping : 3 cpu MHz : 2493.918 cache size : 512 KB fdiv_bug : no hlt_bug : no f00f_bug : no coma_bug : no fpu : yes fpu_exception : yes cpuid level : 4 wp : yes flags : fpu de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 syscall nx lm pni bogomips : 4994.45 clflush size : 64 processor : 1 vendor_id : AuthenticAMD cpu family : 6 model : 2 model name : QEMU Virtual CPU version 0.11.1 stepping : 3 cpu MHz : 2493.918 cache size : 512 KB fdiv_bug : no hlt_bug : no f00f_bug : no coma_bug : no fpu : yes fpu_exception : yes cpuid level : 4 wp : yes flags : fpu de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 syscall nx lm pni bogomips : 4989.05 clflush size : 64
processor : 0 vendor_id : AuthenticAMD cpu family : 6 model : 2 model name : QEMU Virtual CPU version 0.11.1 stepping : 3 cpu MHz : 2493.909 cache size : 512 KB physical id : 0 siblings : 2 core id : 0 cpu cores : 2 fdiv_bug : no hlt_bug : no f00f_bug : no coma_bug : no fpu : yes fpu_exception : yes cpuid level : 4 wp : yes flags : fpu de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx lm pni cmp_legacy bogomips : 4994.27 clflush size : 64 processor : 1 vendor_id : AuthenticAMD cpu family : 6 model : 2 model name : QEMU Virtual CPU version 0.11.1 stepping : 3 cpu MHz : 2493.909 cache size : 512 KB physical id : 0 siblings : 2 core id : 1 cpu cores : 2 fdiv_bug : no hlt_bug : no f00f_bug : no coma_bug : no fpu : yes fpu_exception : yes cpuid level : 4 wp : yes flags : fpu de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx lm pni cmp_legacy bogomips : 4989.97 clflush size : 64
Linux version 2.6.24.4 (root@Knoppix) (gcc version 4.2.3 (Debian 4.2.3-2)) #2 SMP PREEMPT Tue Mar 25 21:35:28 CET 2008 BIOS-provided physical RAM map: BIOS-e820: 0000000000000000 - 000000000009f000 (usable) BIOS-e820: 000000000009f000 - 00000000000a0000 (reserved) BIOS-e820: 00000000000e8000 - 0000000000100000 (reserved) BIOS-e820: 0000000000100000 - 000000001fff0000 (usable) BIOS-e820: 000000001fff0000 - 0000000020000000 (ACPI data) BIOS-e820: 00000000fffbc000 - 0000000100000000 (reserved) 0MB HIGHMEM available. 511MB LOWMEM available. found SMP MP-table at 000fbc90 Entering add_active_range(0, 0, 131056) 0 entries of 256 used Zone PFN ranges: DMA 0 -> 4096 Normal 4096 -> 131056 HighMem 131056 -> 131056 Movable zone start PFN for each node early_node_map[1] active PFN ranges 0: 0 -> 131056 On node 0 totalpages: 131056 DMA zone: 32 pages used for memmap DMA zone: 0 pages reserved DMA zone: 4064 pages, LIFO batch:0 Normal zone: 991 pages used for memmap Normal zone: 125969 pages, LIFO batch:31 HighMem zone: 0 pages used for memmap Movable zone: 0 pages used for memmap DMI 2.4 present. ACPI: RSDP 000FBDE0, 0014 (r0 QEMU ) ACPI: RSDT 1FFF0000, 0034 (r1 QEMU QEMURSDT 1 QEMU 1) ACPI: FACP 1FFF01B4, 0074 (r1 QEMU QEMUFACP 1 QEMU 1) ACPI: DSDT 1FFF0280, 1DD4 (r1 BXPC BXDSDT 1 INTL 20061109) ACPI: FACS 1FFF0240, 0040 ACPI: SSDT 1FFF2054, 09E3 (r1 BXPC BXSSDT 1 INTL 20061109) ACPI: APIC 1FFF2A38, 00EA (r1 QEMU QEMUAPIC 1 QEMU 1) ACPI: HPET 1FFF2B90, 0038 (r1 QEMU QEMUHPET 1 QEMU 1) ACPI: PM-Timer IO Port: 0xb008 ACPI: Local APIC address 0xfee00000 ACPI: LAPIC (acpi_id[0x00] lapic_id[0x00] enabled) Processor #0 6:2 APIC version 20 ACPI: LAPIC (acpi_id[0x01] lapic_id[0x01] enabled) Processor #1 6:2 APIC version 20 ACPI: LAPIC (acpi_id[0x02] lapic_id[0x02] disabled) ACPI: LAPIC (acpi_id[0x03] lapic_id[0x03] disabled) ACPI: LAPIC (acpi_id[0x04] lapic_id[0x04] disabled) ACPI: LAPIC (acpi_id[0x05] lapic_id[0x05] disabled) ACPI: LAPIC (acpi_id[0x06] lapic_id[0x06] disabled) ACPI: LAPIC (acpi_id[0x07] lapic_id[0x07] disabled) ACPI: LAPIC (acpi_id[0x08] lapic_id[0x08] disabled) ACPI: LAPIC (acpi_id[0x09] lapic_id[0x09] disabled) ACPI: LAPIC (acpi_id[0x0a] lapic_id[0x0a] disabled) ACPI: LAPIC (acpi_id[0x0b] lapic_id[0x0b] disabled) ACPI: LAPIC (acpi_id[0x0c] lapic_id[0x0c] disabled) ACPI: LAPIC (acpi_id[0x0d] lapic_id[0x0d] disabled) ACPI: LAPIC (acpi_id[0x0e] lapic_id[0x0e] disabled) ACPI: LAPIC (acpi_id[0x0f] lapic_id[0x0f] disabled) ACPI: IOAPIC (id[0x02] address[0xfec00000] gsi_base[0]) IOAPIC[0]: apic_id 2, version 17, address 0xfec00000, GSI 0-23 ACPI: INT_SRC_OVR (bus 0 bus_irq 0 global_irq 2 dfl dfl) ACPI: INT_SRC_OVR (bus 0 bus_irq 5 global_irq 5 high level) ACPI: INT_SRC_OVR (bus 0 bus_irq 9 global_irq 9 high level) ACPI: INT_SRC_OVR (bus 0 bus_irq 10 global_irq 10 high level) ACPI: INT_SRC_OVR (bus 0 bus_irq 11 global_irq 11 high level) ACPI: IRQ0 used by override. ACPI: IRQ2 used by override. ACPI: IRQ5 used by override. ACPI: IRQ9 used by override. ACPI: IRQ10 used by override. ACPI: IRQ11 used by override. Enabling APIC mode: Flat. Using 1 I/O APICs ACPI: HPET id: 0x8086a201 base: 0xfed00000 Using ACPI (MADT) for SMP configuration information Allocating PCI resources starting at 30000000 (gap: 20000000:dffbc000) swsusp: Registered nosave memory region: 000000000009f000 - 00000000000a0000 swsusp: Registered nosave memory region: 00000000000a0000 - 00000000000e8000 swsusp: Registered nosave memory region: 00000000000e8000 - 0000000000100000 Built 1 zonelists in Zone order, mobility grouping on. Total pages: 130033 Kernel command line: ramdisk_size=100000 init=/etc/init lang=us apm=power-off vga=791 initrd=minirt.gz nomce highres=off loglevel=0 libata.atapi_enabled=1 quiet SELINUX_INIT=NO nmi_watchdog=0 BOOT_IMAGE=knoppix BOOT_IMAGE=linux 2 mapped APIC to ffffb000 (fee00000) mapped IOAPIC to ffffa000 (fec00000) Enabling fast FPU save and restore... done. Enabling unmasked SIMD FPU exception support... done. Initializing CPU#0 PID hash table entries: 2048 (order: 11, 8192 bytes) Detected 2493.918 MHz processor. Console: colour dummy device 80x25 console [tty0] enabled Dentry cache hash table entries: 65536 (order: 6, 262144 bytes) Inode-cache hash table entries: 32768 (order: 5, 131072 bytes) Memory: 511872k/524224k available (3742k kernel code, 11776k reserved, 1262k data, 420k init, 0k highmem) virtual kernel memory layout: fixmap : 0xffe13000 - 0xfffff000 (1968 kB) pkmap : 0xff800000 - 0xffc00000 (4096 kB) vmalloc : 0xe0800000 - 0xff7fe000 ( 495 MB) lowmem : 0xc0000000 - 0xdfff0000 ( 511 MB) .init : 0xc05ea000 - 0xc0653000 ( 420 kB) .data : 0xc04a78c8 - 0xc05e327c (1262 kB) .text : 0xc0100000 - 0xc04a78c8 (3742 kB) Checking if this processor honours the WP bit even in supervisor mode... Ok. Calibrating delay using timer specific routine.. 4994.45 BogoMIPS (lpj=8320724) Security Framework initialized SELinux: Initializing. SELinux: Starting in permissive mode selinux_register_security: Registering secondary module capability Capability LSM initialized as secondary Mount-cache hash table entries: 512 CPU: After generic identify, caps: 078bfbfd 2191abfd 00000000 00000000 80000001 00000000 00000000 00000000 CPU: L1 I Cache: 64K (64 bytes/line), D cache 64K (64 bytes/line) CPU: L2 Cache: 512K (64 bytes/line) CPU: After all inits, caps: 078bfbfd 2191abfd 00000000 00000420 80000001 00000000 00000000 00000000 Compat vDSO mapped to ffffe000. Checking 'hlt' instruction... OK. Checking for popad bug... OK. SMP alternatives: switching to UP code ACPI: Core revision 20070126 CPU0: AMD QEMU Virtual CPU version 0.11.1 stepping 03 SMP alternatives: switching to SMP code Booting processor 1/1 eip 3000 Initializing CPU#1 Calibrating delay using timer specific routine.. 4989.05 BogoMIPS (lpj=8312086) CPU: After generic identify, caps: 078bfbfd 2191abfd 00000000 00000000 80000001 00000000 00000000 00000000 CPU: L1 I Cache: 64K (64 bytes/line), D cache 64K (64 bytes/line) CPU: L2 Cache: 512K (64 bytes/line) CPU: After all inits, caps: 078bfbfd 2191abfd 00000000 00000420 80000001 00000000 00000000 00000000 CPU1: AMD QEMU Virtual CPU version 0.11.1 stepping 03 Total of 2 processors activated (9983.50 BogoMIPS). WARNING: This combination of AMD processors is not suitable for SMP. ENABLING IO-APIC IRQs ..TIMER: vector=0x31 apic1=0 pin1=2 apic2=-1 pin2=-1 Brought up 2 CPUs net_namespace: 64 bytes Booting paravirtualized kernel on bare hardware ...
Linux version 2.6.24.4 (root@Knoppix) (gcc version 4.2.3 (Debian 4.2.3-2)) #2 SMP PREEMPT Tue Mar 25 21:35:28 CET 2008 BIOS-provided physical RAM map: BIOS-e820: 0000000000000000 - 000000000009f000 (usable) BIOS-e820: 000000000009f000 - 00000000000a0000 (reserved) BIOS-e820: 00000000000e8000 - 0000000000100000 (reserved) BIOS-e820: 0000000000100000 - 000000001fff0000 (usable) BIOS-e820: 000000001fff0000 - 0000000020000000 (ACPI data) BIOS-e820: 00000000fffbc000 - 0000000100000000 (reserved) 0MB HIGHMEM available. 511MB LOWMEM available. found SMP MP-table at 000fbc90 Entering add_active_range(0, 0, 131056) 0 entries of 256 used Zone PFN ranges: DMA 0 -> 4096 Normal 4096 -> 131056 HighMem 131056 -> 131056 Movable zone start PFN for each node early_node_map[1] active PFN ranges 0: 0 -> 131056 On node 0 totalpages: 131056 DMA zone: 32 pages used for memmap DMA zone: 0 pages reserved DMA zone: 4064 pages, LIFO batch:0 Normal zone: 991 pages used for memmap Normal zone: 125969 pages, LIFO batch:31 HighMem zone: 0 pages used for memmap Movable zone: 0 pages used for memmap DMI 2.4 present. ACPI: RSDP 000FBDE0, 0014 (r0 QEMU ) ACPI: RSDT 1FFF0000, 0034 (r1 QEMU QEMURSDT 1 QEMU 1) ACPI: FACP 1FFF01B4, 0074 (r1 QEMU QEMUFACP 1 QEMU 1) ACPI: DSDT 1FFF0280, 1DD4 (r1 BXPC BXDSDT 1 INTL 20061109) ACPI: FACS 1FFF0240, 0040 ACPI: SSDT 1FFF2054, 09E3 (r1 BXPC BXSSDT 1 INTL 20061109) ACPI: APIC 1FFF2A38, 00EA (r1 QEMU QEMUAPIC 1 QEMU 1) ACPI: HPET 1FFF2B90, 0038 (r1 QEMU QEMUHPET 1 QEMU 1) ACPI: PM-Timer IO Port: 0xb008 ACPI: Local APIC address 0xfee00000 ACPI: LAPIC (acpi_id[0x00] lapic_id[0x00] enabled) Processor #0 6:2 APIC version 20 ACPI: LAPIC (acpi_id[0x01] lapic_id[0x01] enabled) Processor #1 6:2 APIC version 20 ACPI: LAPIC (acpi_id[0x02] lapic_id[0x02] disabled) ACPI: LAPIC (acpi_id[0x03] lapic_id[0x03] disabled) ACPI: LAPIC (acpi_id[0x04] lapic_id[0x04] disabled) ACPI: LAPIC (acpi_id[0x05] lapic_id[0x05] disabled) ACPI: LAPIC (acpi_id[0x06] lapic_id[0x06] disabled) ACPI: LAPIC (acpi_id[0x07] lapic_id[0x07] disabled) ACPI: LAPIC (acpi_id[0x08] lapic_id[0x08] disabled) ACPI: LAPIC (acpi_id[0x09] lapic_id[0x09] disabled) ACPI: LAPIC (acpi_id[0x0a] lapic_id[0x0a] disabled) ACPI: LAPIC (acpi_id[0x0b] lapic_id[0x0b] disabled) ACPI: LAPIC (acpi_id[0x0c] lapic_id[0x0c] disabled) ACPI: LAPIC (acpi_id[0x0d] lapic_id[0x0d] disabled) ACPI: LAPIC (acpi_id[0x0e] lapic_id[0x0e] disabled) ACPI: LAPIC (acpi_id[0x0f] lapic_id[0x0f] disabled) ACPI: IOAPIC (id[0x02] address[0xfec00000] gsi_base[0]) IOAPIC[0]: apic_id 2, version 17, address 0xfec00000, GSI 0-23 ACPI: INT_SRC_OVR (bus 0 bus_irq 0 global_irq 2 dfl dfl) ACPI: INT_SRC_OVR (bus 0 bus_irq 5 global_irq 5 high level) ACPI: INT_SRC_OVR (bus 0 bus_irq 9 global_irq 9 high level) ACPI: INT_SRC_OVR (bus 0 bus_irq 10 global_irq 10 high level) ACPI: INT_SRC_OVR (bus 0 bus_irq 11 global_irq 11 high level) ACPI: IRQ0 used by override. ACPI: IRQ2 used by override. ACPI: IRQ5 used by override. ACPI: IRQ9 used by override. ACPI: IRQ10 used by override. ACPI: IRQ11 used by override. Enabling APIC mode: Flat. Using 1 I/O APICs ACPI: HPET id: 0x8086a201 base: 0xfed00000 Using ACPI (MADT) for SMP configuration information Allocating PCI resources starting at 30000000 (gap: 20000000:dffbc000) swsusp: Registered nosave memory region: 000000000009f000 - 00000000000a0000 swsusp: Registered nosave memory region: 00000000000a0000 - 00000000000e8000 swsusp: Registered nosave memory region: 00000000000e8000 - 0000000000100000 Built 1 zonelists in Zone order, mobility grouping on. Total pages: 130033 Kernel command line: ramdisk_size=100000 init=/etc/init lang=us apm=power-off vga=791 initrd=minirt.gz nomce highres=off loglevel=0 libata.atapi_enabled=1 quiet SELINUX_INIT=NO nmi_watchdog=0 BOOT_IMAGE=knoppix BOOT_IMAGE=linux 2 mapped APIC to ffffb000 (fee00000) mapped IOAPIC to ffffa000 (fec00000) Enabling fast FPU save and restore... done. Enabling unmasked SIMD FPU exception support... done. Initializing CPU#0 PID hash table entries: 2048 (order: 11, 8192 bytes) Detected 2493.909 MHz processor. Console: colour dummy device 80x25 console [tty0] enabled Dentry cache hash table entries: 65536 (order: 6, 262144 bytes) Inode-cache hash table entries: 32768 (order: 5, 131072 bytes) Memory: 511872k/524224k available (3742k kernel code, 11776k reserved, 1262k data, 420k init, 0k highmem) virtual kernel memory layout: fixmap : 0xffe13000 - 0xfffff000 (1968 kB) pkmap : 0xff800000 - 0xffc00000 (4096 kB) vmalloc : 0xe0800000 - 0xff7fe000 ( 495 MB) lowmem : 0xc0000000 - 0xdfff0000 ( 511 MB) .init : 0xc05ea000 - 0xc0653000 ( 420 kB) .data : 0xc04a78c8 - 0xc05e327c (1262 kB) .text : 0xc0100000 - 0xc04a78c8 (3742 kB) Checking if this processor honours the WP bit even in supervisor mode... Ok. Calibrating delay using timer specific routine.. 4994.27 BogoMIPS (lpj=8320440) Security Framework initialized SELinux: Initializing. SELinux: Starting in permissive mode selinux_register_security: Registering secondary module capability Capability LSM initialized as secondary Mount-cache hash table entries: 512 CPU: After generic identify, caps: 178bfbfd 2191abfd 00000000 00000000 80000001 00000000 00000002 00000000 CPU: L1 I Cache: 64K (64 bytes/line), D cache 64K (64 bytes/line) CPU: L2 Cache: 512K (64 bytes/line) CPU 0(2) -> Core 0 CPU: After all inits, caps: 178bfbfd 2191abfd 00000000 00000420 80000001 00000000 00000002 00000000 Compat vDSO mapped to ffffe000. Checking 'hlt' instruction... OK. Checking for popad bug... OK. SMP alternatives: switching to UP code ACPI: Core revision 20070126 CPU0: AMD QEMU Virtual CPU version 0.11.1 stepping 03 SMP alternatives: switching to SMP code Booting processor 1/1 eip 3000 Initializing CPU#1 Calibrating delay using timer specific routine.. 4989.97 BogoMIPS (lpj=8311957) CPU: After generic identify, caps: 178bfbfd 2191abfd 00000000 00000000 80000001 00000000 00000002 00000000 CPU: L1 I Cache: 64K (64 bytes/line), D cache 64K (64 bytes/line) CPU: L2 Cache: 512K (64 bytes/line) CPU 1(2) -> Core 1 CPU: After all inits, caps: 178bfbfd 2191abfd 00000000 00000420 80000001 00000000 00000002 00000000 CPU1: AMD QEMU Virtual CPU version 0.11.1 stepping 03 Total of 2 processors activated (9983.24 BogoMIPS). WARNING: This combination of AMD processors is not suitable for SMP. ENABLING IO-APIC IRQs ..TIMER: vector=0x31 apic1=0 pin1=2 apic2=-1 pin2=-1 Brought up 2 CPUs net_namespace: 64 bytes Booting paravirtualized kernel on bare hardware ...