View previous topic :: View next topic |
Author |
Message |
Tender Apprentice
Joined: 05 Nov 2005 Posts: 166
|
Posted: Wed Apr 25, 2012 8:08 am Post subject: qemu-kvm -no-kvm (risolto) |
|
|
Ciao a tutti,
sto tentando di far funzionare con prestazioni umane la virtualizzazione in oggetto su un sistema con ATOM D425, senza riuscirvi.
Sullo stesso sistema ho provato virtualbox che funziona a meraviglia.
Il problema con qemu è la lentezza, tra uno e due ordini di grandezza più lento di virtualbox, praticamente inutilizzabile.
Penso che le possibilità siano due : qemu-kvm senza supporto HW alla virtualizzazione è molto molto lento oppure, più probabile, sto commettendo un errore madornale (qualche parametro mancante fondamentale) .
L'host non ha supporto per interfaccia grafica, la console del guest la gestisco da rete con vnc (con virtualbox con RDP).
Riassumendo:
Code: |
lowpower2 admin # emerge --info
Portage 2.1.10.49 (default/linux/amd64/10.0/server, gcc-4.5.3, glibc-2.14.1-r3, 3.2.12-gentoo x86_64)
=================================================================
System uname: Linux-3.2.12-gentoo-x86_64-Intel-R-_Atom-TM-_CPU_D425_@_1.80GHz-with-gentoo-2.0.3
Timestamp of tree: Tue, 24 Apr 2012 00:00:01 +0000
app-shells/bash: 4.2_p20
dev-lang/python: 2.7.2-r3, 3.1.4-r3, 3.2.2
dev-util/pkgconfig: 0.26
sys-apps/baselayout: 2.0.3
sys-apps/openrc: 0.9.8.4
sys-apps/sandbox: 2.5
sys-devel/autoconf: 2.68
sys-devel/automake: 1.9.6-r3, 1.11.1
sys-devel/binutils: 2.21.1-r1
sys-devel/gcc: 4.5.3-r2
sys-devel/gcc-config: 1.5-r2
sys-devel/libtool: 2.4-r1
sys-devel/make: 3.82-r1
sys-kernel/linux-headers: 3.1 (virtual/os-headers)
sys-libs/glibc: 2.14.1-r3
Repositories: gentoo
ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="*"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=atom -O2 -pipe -fomit-frame-pointer"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-march=atom -O2 -pipe -fomit-frame-pointer"
DISTDIR="/mnt/samba/portage/distfiles"
EMERGE_DEFAULT_OPTS="--autounmask=n"
FEATURES="assume-digests binpkg-logs distlocks ebuild-locks fixlafiles metadata-transfer news parallel-fetch protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch"
FFLAGS=""
GENTOO_MIRRORS="http://gentoo.tiscali.nl/ http://ftp.snt.utwente.nl/pub/os/linux/gentoo/ ftp://ftp.snt.utwente.nl/pub/os/linux/gentoo/"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
LINGUAS="en"
MAKEOPTS="-j4"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY=""
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="3dnow acpi amd64 apm bzip2 cracklib cript crypt cxx fontconfig gdbm gmp gpm iconv iproute2 ipv6 maildir mdev mmx multilib ncurses nls nptl openmp pcre posix session snmp sqlite sqlite3 sse sse2 sse3 ssl ssse3 threads truetype unicode xml zlib" APACHE2_MODULES="actions alias authz_host dir log_config mime rewrite unique_id vhost_alias" ELIBC="glibc" KERNEL="linux" LINGUAS="en" QEMU_SOFTMMU_TARGETS="i386 x86_64" QEMU_USER_TARGETS="i386 x86_64" USERLAND="GNU"
Unset: CPPFLAGS, CTARGET, INSTALL_MASK, LANG, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, USE_PYTHON
|
Code: |
lowpower2 admin # equery u virtualbox
[ Legend : U - final flag setting for installation]
[ : I - package is installed with flag ]
[ Colors : set, unset ]
* Found these USE flags for app-emulation/virtualbox-4.1.8:
U I
+ + additions : Install Guest System Tools ISO
- - alsa : Adds support for media-libs/alsa-lib (Advanced Linux Sound Architecture)
- - doc : Adds extra documentation (API, Javadoc, etc). It is recommended to enable per package instead of globally
+ + extensions : Install extension module packages
+ + headless : Build without any graphic frontend
- - java : Adds support for Java
- - opengl : Adds support for OpenGL (3D graphics)
- - pam : Adds support for PAM (Pluggable Authentication Modules) - DANGEROUS to arbitrarily flip
- - pulseaudio : Adds support for PulseAudio sound server
- - python : Adds optional support/bindings for the Python language
- - qt4 : Adds support for the Qt GUI/Application Toolkit version 4.x
- - sdk : Enable building of SDK
- - vboxwebsrv : Build and install the VirtualBox webservice
- - vnc : Enable VNC (remote desktop viewer) support
|
Code: |
lowpower2 admin # equery u qemu-kvm
[ Legend : U - final flag setting for installation]
[ : I - package is installed with flag ]
[ Colors : set, unset ]
* Found these USE flags for app-emulation/qemu-kvm-1.0-r3:
U I
+ + aio : Enables support for Linux's Async IO
- - alsa : Enable alsa output for sound emulation
- - bluetooth : Enables Bluetooth Support
- - brltty : Adds support for braille displays using brltty
- - curl : Support ISOs / -cdrom directives vis HTTP or HTTPS.
- - debug : Enable extra debug codepaths, like asserts and extra output. If you want to get meaningful backtraces see
http://www.gentoo.org/proj/en/qa/backtraces.xml
- - fdt : Enables firmware device tree support
+ + ncurses : Enable the ncurses-based console
- - opengl : Adds support for OpenGL (3D graphics)
- - pulseaudio : Enable pulseaudio output for sound emulation
- - qemu-ifup : Provides the qemu-ifup script for use with QEMU's built in bridging
- - qemu_softmmu_targets_arm : system emulation target
- - qemu_softmmu_targets_cris : system emulation target
+ + qemu_softmmu_targets_i386 : system emulation target
- - qemu_softmmu_targets_m68k : system emulation target
- - qemu_softmmu_targets_microblaze : system emulation target
- - qemu_softmmu_targets_mips : system emulation target
- - qemu_softmmu_targets_mips64 : system emulation target
- - qemu_softmmu_targets_mips64el : system emulation target
- - qemu_softmmu_targets_mipsel : system emulation target
- - qemu_softmmu_targets_ppc : system emulation target
- - qemu_softmmu_targets_ppc64 : system emulation target
- - qemu_softmmu_targets_ppcemb : system emulation target
- - qemu_softmmu_targets_sh4 : system emulation target
- - qemu_softmmu_targets_sh4eb : system emulation target
- - qemu_softmmu_targets_sparc : system emulation target
- - qemu_softmmu_targets_sparc64 : system emulation target
+ + qemu_softmmu_targets_x86_64 : system emulation target
- - qemu_user_targets_alpha : userspace emulation target
- - qemu_user_targets_arm : userspace emulation target
- - qemu_user_targets_armeb : userspace emulation target
- - qemu_user_targets_cris : userspace emulation target
+ + qemu_user_targets_i386 : userspace emulation target
- - qemu_user_targets_m68k : userspace emulation target
- - qemu_user_targets_microblaze : userspace emulation target
- - qemu_user_targets_mips : userspace emulation target
- - qemu_user_targets_mipsel : userspace emulation target
- - qemu_user_targets_ppc : userspace emulation target
- - qemu_user_targets_ppc64 : userspace emulation target
- - qemu_user_targets_ppc64abi32 : userspace emulation target
- - qemu_user_targets_sh4 : userspace emulation target
- - qemu_user_targets_sh4eb : userspace emulation target
- - qemu_user_targets_sparc : userspace emulation target
- - qemu_user_targets_sparc32plus : userspace emulation target
- - qemu_user_targets_sparc64 : userspace emulation target
+ + qemu_user_targets_x86_64 : userspace emulation target
- - sasl : Adds support for the Simple Authentication and Security Layer
- - sdl : Enable the SDL-based console
- - smartcard : Enables smartcard support
- - spice : Enable Spice protocol support via app-emulation/spice
- - static : !!do not set this during bootstrap!! Causes binaries to be statically linked instead of dynamically
- - test : Workaround to pull in packages needed to run with FEATURES=test. Portage-2.1.2 handles this internally, so don't set it in
make.conf/package.use anymore
+ + threads : Adds threads support for various packages. Usually pthreads
- - tls : Enable TLS support for the VNC console server
- - usbredir : Use sys-apps/usbredir to redirect USB devices to another machine over TCP
- - vde : Enable VDE-based networking
- - vhost-net : Enable accelerated networking using vhost-net, see http://www.linux-kvm.org/page/VhostNet
- - xattr : Add support for getting and setting POSIX extended attributes, through sys-apps/attr. Requisite for the virtfs backend.
- - xen : Enables support for Xen backends
|
Esempio di lancio dell'installazione di Windows XP ridotta all'osso, tanto la lentezza è evidente già in questa fase:
Code: |
qemu-kvm -no-kvm -vnc :0 -cdrom XP.iso -boot d -m 512
|
Nessun errore su \var\log\messages, non so come risolvere.
Help
RISOLTO:
Ho ancora fatto una prova con quello che segue, si puo' usare in alternativa a qemu-kvm, ha prestazioni decenti, ma mai come virtualbox:
Code: |
lowpower2 admin # equery u qemu
[ Legend : U - final flag setting for installation]
[ : I - package is installed with flag ]
[ Colors : set, unset ]
* Found these USE flags for app-emulation/qemu-0.11.1:
U I
- - alsa : Adds support for media-libs/alsa-lib (Advanced Linux Sound Architecture)
- - bluetooth : Enables Bluetooth Support
- - gnutls : Enable TLS support for the VNC console server
+ + kqemu : Enables the kernel acceleration module on a x86/x86-64 cpu
- - kvm : Use the KVM (Kernel Virtual Machine) infrastructure on compatible hardware
+ + ncurses : Enable the ncurses-based console
- - pulseaudio : Enable pulseaudio output for sound emulation
- - qemu_softmmu_targets_arm : system emulation target
- - qemu_softmmu_targets_cris : system emulation target
+ + qemu_softmmu_targets_i386 : system emulation target
- - qemu_softmmu_targets_m68k : system emulation target
- - qemu_softmmu_targets_mips : system emulation target
- - qemu_softmmu_targets_mips64 : system emulation target
- - qemu_softmmu_targets_mips64el : system emulation target
- - qemu_softmmu_targets_mipsel : system emulation target
- - qemu_softmmu_targets_ppc : system emulation target
- - qemu_softmmu_targets_ppc64 : system emulation target
- - qemu_softmmu_targets_ppcemb : system emulation target
- - qemu_softmmu_targets_sh4 : system emulation target
- - qemu_softmmu_targets_sh4eb : system emulation target
- - qemu_softmmu_targets_sparc : system emulation target
+ + qemu_softmmu_targets_x86_64 : system emulation target
- - qemu_user_targets_alpha : userspace emulation target
- - qemu_user_targets_arm : userspace emulation target
- - qemu_user_targets_armeb : userspace emulation target
- - qemu_user_targets_cris : userspace emulation target
+ + qemu_user_targets_i386 : userspace emulation target
- - qemu_user_targets_m68k : userspace emulation target
- - qemu_user_targets_mips : userspace emulation target
- - qemu_user_targets_mips64 : userspace emulation target
- - qemu_user_targets_mips64el : userspace emulation target
- - qemu_user_targets_mipsel : userspace emulation target
- - qemu_user_targets_ppc : userspace emulation target
- - qemu_user_targets_ppc64 : userspace emulation target
- - qemu_user_targets_ppc64abi32 : userspace emulation target
- - qemu_user_targets_sh4 : userspace emulation target
- - qemu_user_targets_sh4eb : userspace emulation target
- - qemu_user_targets_sparc : userspace emulation target
- - qemu_user_targets_sparc32plus : userspace emulation target
- - qemu_user_targets_sparc64 : userspace emulation target
+ + qemu_user_targets_x86_64 : userspace emulation target
- - sasl : Adds support for the Simple Authentication and Security Layer
- - sdl : Enable the SDL-based console
- - vde : Enable Virtual Distributed Ethernet (VDE) based networking
|
Visto che ci ho preso gusto, ho installato per davvero XP con questo comando:
Code: |
qemu -vnc :0 -hda so.img -cdrom XP.iso -boot d -m 512
|
CPUZ eseguito dentro XP indica come CPU un Pentium II.
Ho capito che la use flag kqemu (vedi sopra) si riferisce al modulo del kernel generato dal pacchetto app-emulation/kqemu.
Ho quindi installato anche app-emulation/kqemu, caricato il modulo con modprobe kqemu ed eseguito XP con il comando:
Code: |
qemu -vnc :0 -hda so.img -cdrom XP.iso -boot d -m 512 -enable-kqemu
|
Ora CPUZ eseguito dentro XP indica come CPU un ATOM, ma le prestazioni sono sempre le stesse, al limite della sufficienza.
Non ho voglia di approfondire, non possono fare confluire qemu con opzione kqemu in qemu-kvm aggiungendo l'opzione kqemu?
E' un peccato che non sia tutto insieme; se è vero che qemu-kvm è il fork più importante, è un peccato che non funzioni decentemente su sistemi senza supporto HW alla virtualizzazione.
Se qualcuno mi spiega la situazione mi fa un favore.
Ciao
Last edited by Tender on Wed Apr 25, 2012 7:47 pm; edited 2 times in total |
|
Back to top |
|
|
Dun Apprentice
Joined: 17 Apr 2004 Posts: 172 Location: Amsterdam (NL) / Venice (IT)
|
Posted: Wed Apr 25, 2012 10:51 am Post subject: |
|
|
AFAIK, qemu senza kvm e' un emulatore, mentre virtual box virtualizza... son due cose diverse. |
|
Back to top |
|
|
ago Developer
Joined: 01 Mar 2008 Posts: 1527 Location: Milan, Italy
|
Posted: Wed Apr 25, 2012 7:22 pm Post subject: |
|
|
Inoltre aggiungerei che -march=atom funziona con gcc-4.6 (potrei anche ricordare male) |
|
Back to top |
|
|
Tender Apprentice
Joined: 05 Nov 2005 Posts: 166
|
Posted: Wed Apr 25, 2012 7:56 pm Post subject: |
|
|
ago wrote: | Inoltre aggiungerei che -march=atom funziona con gcc-4.6 (potrei anche ricordare male) |
http://gcc.gnu.org/gcc-4.5/changes.html
IA-32/x86-64
GCC now will set the default for -march= based on the configure target.
GCC now supports handling floating-point excess precision arising from use of the x87 floating-point unit in a way that conforms to ISO C99. This is enabled with -fexcess-precision=standard and with standards conformance options such as -std=c99, and may be disabled using -fexcess-precision=fast.
Support for the Intel Atom processor is now available through the -march=atom and -mtune=atom options.
A new -mcrc32 option is now available to enable crc32 intrinsics.
A new -mmovbe option is now available to enable GCC to use the movbe instruction to implement __builtin_bswap32 and __builtin_bswap64.
SSE math now can be enabled by default at configure time with the new --with-fpmath=sse option.
There is a new intrinsic header file, <x86intrin.h>. It should be included before using any IA-32/x86-64 intrinsics.
Support for the XOP, FMA4, and LWP instruction sets for the AMD Orochi processors are now available with the -mxop, -mfma4, and -mlwp options.
The -mabm option enables GCC to use the popcnt and lzcnt instructions on AMD processors.
The -mpopcnt option enables GCC to use the popcnt instructions on both AMD and Intel processors. |
|
Back to top |
|
|
xdarma l33t
Joined: 08 Dec 2003 Posts: 719 Location: tra veneto e friuli (italy)
|
Posted: Thu Apr 26, 2012 7:28 am Post subject: |
|
|
Puoi trovare informazioni nel wiki non-ufficiale: KVM
Controlla la configurazione del kernel e che i moduli per il tuo processore-host siano caricati prima di avviare la macchina virtuale:
Ciao. _________________ proud user of faKeDE-4.7.3 -> back to windowmaker -> moved to LXQt |
|
Back to top |
|
|
ago Developer
Joined: 01 Mar 2008 Posts: 1527 Location: Milan, Italy
|
Posted: Thu Apr 26, 2012 8:08 am Post subject: |
|
|
Tender wrote: | ago wrote: | Inoltre aggiungerei che -march=atom funziona con gcc-4.6 (potrei anche ricordare male) |
http://gcc.gnu.org/gcc-4.5/changes.html
IA-32/x86-64
GCC now will set the default for -march= based on the configure target.
GCC now supports handling floating-point excess precision arising from use of the x87 floating-point unit in a way that conforms to ISO C99. This is enabled with -fexcess-precision=standard and with standards conformance options such as -std=c99, and may be disabled using -fexcess-precision=fast.
Support for the Intel Atom processor is now available through the -march=atom and -mtune=atom options.
A new -mcrc32 option is now available to enable crc32 intrinsics.
A new -mmovbe option is now available to enable GCC to use the movbe instruction to implement __builtin_bswap32 and __builtin_bswap64.
SSE math now can be enabled by default at configure time with the new --with-fpmath=sse option.
There is a new intrinsic header file, <x86intrin.h>. It should be included before using any IA-32/x86-64 intrinsics.
Support for the XOP, FMA4, and LWP instruction sets for the AMD Orochi processors are now available with the -mxop, -mfma4, and -mlwp options.
The -mabm option enables GCC to use the popcnt and lzcnt instructions on AMD processors.
The -mpopcnt option enables GCC to use the popcnt instructions on both AMD and Intel processors. |
Ti ricordo che io ho scritto funziona. Essere supportato è un discorso diverso. |
|
Back to top |
|
|
Tender Apprentice
Joined: 05 Nov 2005 Posts: 166
|
Posted: Thu Apr 26, 2012 5:12 pm Post subject: |
|
|
ago wrote: | Tender wrote: | ago wrote: | Inoltre aggiungerei che -march=atom funziona con gcc-4.6 (potrei anche ricordare male) |
http://gcc.gnu.org/gcc-4.5/changes.html
IA-32/x86-64
GCC now will set the default for -march= based on the configure target.
GCC now supports handling floating-point excess precision arising from use of the x87 floating-point unit in a way that conforms to ISO C99. This is enabled with -fexcess-precision=standard and with standards conformance options such as -std=c99, and may be disabled using -fexcess-precision=fast.
Support for the Intel Atom processor is now available through the -march=atom and -mtune=atom options.
A new -mcrc32 option is now available to enable crc32 intrinsics.
A new -mmovbe option is now available to enable GCC to use the movbe instruction to implement __builtin_bswap32 and __builtin_bswap64.
SSE math now can be enabled by default at configure time with the new --with-fpmath=sse option.
There is a new intrinsic header file, <x86intrin.h>. It should be included before using any IA-32/x86-64 intrinsics.
Support for the XOP, FMA4, and LWP instruction sets for the AMD Orochi processors are now available with the -mxop, -mfma4, and -mlwp options.
The -mabm option enables GCC to use the popcnt and lzcnt instructions on AMD processors.
The -mpopcnt option enables GCC to use the popcnt instructions on both AMD and Intel processors. |
Ti ricordo che io ho scritto funziona. Essere supportato è un discorso diverso. |
Per cortesia se mi dai un consiglio cerca di essere esaustivo, altrimenti mi confondi ancora di più le idee.
Se uso gcc 4.6 funziona che cosa? -march=atom? qemu-kvm? kqemu? funziona in che senso?
Grazie |
|
Back to top |
|
|
ago Developer
Joined: 01 Mar 2008 Posts: 1527 Location: Milan, Italy
|
Posted: Thu Apr 26, 2012 6:02 pm Post subject: |
|
|
Tender wrote: | Per cortesia se mi dai un consiglio cerca di essere esaustivo, altrimenti mi confondi ancora di più le idee.
Se uso gcc 4.6 funziona che cosa? -march=atom? qemu-kvm? kqemu? funziona in che senso?
Grazie |
Prova innanzitutto a lanciare: Code: | gcc -march=native -E -v - </dev/null 2>&1 | sed -n 's/.* -v - //p' | Posta l'output.
Io intendevo semplicemente, che -march=atom può essere stato introdotto in gcc-4.5 ma funziona decentemente in gcc-4.6. Di conseguenza se funziona male potresti avere effetti negativi con tutti i pacchetti che hai compilato con quella flag(world suppongo).
Soluzione: ricompilare world con -march più 'stabile'
C'è qualcos'altro di non chiaro? |
|
Back to top |
|
|
Tender Apprentice
Joined: 05 Nov 2005 Posts: 166
|
Posted: Thu Apr 26, 2012 6:11 pm Post subject: |
|
|
Ecco la postata:
Code: |
lowpower2 qemu-kvm # gcc -march=native -E -v - </dev/null 2>&1 | sed -n 's/.* -v - //p'
-D_FORTIFY_SOURCE=2 -march=atom -mcx16 -msahf -mmovbe --param l1-cache-size=24 --param l1-cache-line-size=64 --param l2-cache-size=512 -mtune=atom
|
Mi stupisce l'affermazione che il supporto funziona male.
Scusa il paragone, è come se la documentazione di una una motherboard dicesse che supporta una certa cpu e poi quando la monti funziona male
Esiste un termine da cercare nei changelog di gcc dal quale si evinca con certezza che una certa cosa funziona? |
|
Back to top |
|
|
djinnZ Advocate
Joined: 02 Nov 2006 Posts: 4831 Location: somewhere in L.O.S.
|
Posted: Fri Apr 27, 2012 6:32 pm Post subject: |
|
|
Nel mondo "commerciale" (escludo volutamente il mondo "proprietario" e le ciofeche in stile M$) quando una cosa non è supportata in genere funziona male (per via del modo di lavorare non sto stigmatizzando) vuoi perché è stata affidata ad un nuovo team che non ha scritto il codice di partenza e sta ancora cercando di capire dove volevano arrivare gli sviluppatori iniziali (o ne stanno maledicendo la stirpe pensando di dover ripartire ex novo, anzichenò), vuoi perché è una semplice prova per vedere se c'è qualcuno che gradisce l'innovazione etc.
Nel mondo open source vuol dire "al momento il codice è questo, dovrebbe funzionare ma non abbiamo controllato e, soprattutto, se ci gira domani mattina lo stravolgiamo".
Nel tuo caso vuol dire che i binari prodotti dalle successive opzioni del compilatore potrebbero essere notevolmente differenti e quasi sicuramente le opzioni implicite (ogni -march implica un -qualcosa) cambieranno di sana pianta.
Per provare a spingere un poco mencoder potrebbe andar bene ma non per il gcc e per le librerie principali, potresti trovarti a dover fare un emerge -e @world al prossimo aggiornamento.
Più o meno credo che ago volesse dir questo. _________________ scita et risus abundant in ore stultorum sed etiam semper severi insani sunt
mala tempora currunt...mater stultorum semper pregna est
Murpy'sLaw:If anything can go wrong, it will - O'Toole's Corollary:Murphy was an optimist |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|