not so precise "How To" documentation prevents use of project images

196 views
Skip to first unread message

Румен Петров

unread,
Dec 21, 2018, 8:26:27 AM12/21/18
to Android-x86
In brief all my attempts to run "Android-x86" images on AMD Phenom(tm) II X6 1090T processor fail until recently.
This processor supports "sse" and "sse2" instruction sets but does not support "sse3" and etc. required to run vendor images under emulator.

I'm able run many VM under QEMU (linux-es) or VirtualBox (Solaris).
Let me quote from VirtualBox how to: "[System] Optional: Processor(s) may be set above 1 if you have more than one virtual processor.."
As processor (AMD 1090T) is with six cores I run VM with two or more processors.
So nothing suspicious but only "Android-x86" images fail to start either under my QEMU or VirtualBox.

After successful build of AOSP (9.0r10) for x86 architecture, patched do not require "sse3" and run in emulator I wonder more and more why "Android-x86" images cannot start im my VM environment.
I decided to try again and to find culprit.

One day I decided to test VM without flag "-smp 2" just becuse vendor images for android emulator does not support multi-CPU.

And surprise - voilà 32-bit "Android-x86" image android-x86-8.1-rc2 finally run!


So "How to" suggestion to use more then one processor does not look correct.
Please remove it.


Next my comment is about QEMU "How to". It looks outdated.

According to my notes command is qemu-system-x86_64 (for qemu version >= 1.0) with argument "-enable-kvm" (as of version >= 1.3+) and etc...
Dunno what is "qemu-kvm".
Debian package "kvm" just install a shell script with following content on 64-bit OS-es:
exec qemu-system-x86_64 -enable-kvm "$@"

So please replace "qemu-kvm" with " qemu-system-x86_64 -enable-kvm".


Regards,
Roumen Petrov

Chih-Wei Huang

unread,
Dec 24, 2018, 7:06:23 PM12/24/18
to Android-x86
Thank you for the report but I didn't get the point.
I admit the doc is outdated (nobody maintains it).
However, saying Android-x86 8.1-rc2 doesn't support multi-CPU
is absolutely wrong!
Multi-CPU support has been added to Android for a very long time.
(probably since 3.0? I can't remember exactly)
I don't see anybody else complains about issues of
multi-CPU support either for a real device or VM.

I run 8.1 on Qemu with "-smp 2" every day (to play game :p)
No problem at all.
I suggest you get dmesg and logcat to check
what real issue is with "-smp 2" for you.

Here is my info from running qemu 2.9.1:

x86_64:/ # getprop ro.build.fingerprint
Android-x86/android_x86_64/x86_64:8.1.0/OPM8.181005.003/lh1212:userdebug/test-keys
x86_64:/ # cat /sys/class/dmi/id/uevent
MODALIAS=dmi:bvnSeaBIOS:bvr1.10.2-1.fc26:bd04/01/2014:svnQEMU:pnStandardPC(i440FX+PIIX,1996):pvrpc-i440fx-2.9:cvnQEMU:ct1:cvrpc-i440fx-2.9:
x86_64:/ # cat /proc/cpuinfo
processor : 0
vendor_id : GenuineIntel
cpu family : 6
model : 60
model name : Intel(R) Core(TM) i7-4790 CPU @ 3.60GHz
stepping : 3
microcode : 0x1
cpu MHz : 3591.682
cache size : 16384 KB
physical id : 0
siblings : 1
core id : 0
cpu cores : 1
apicid : 0
initial apicid : 0
fpu : yes
fpu_exception : yes
cpuid level : 13
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge
mca cmov pat pse36 clflush mmx fxsr sse sse2 ss syscall nx pdpe1gb
rdtscp lm constant_tsc arch_perfmon rep_good nopl xtopology cpuid
tsc_known_freq pni pclmulqdq ssse3 fma cx16 pcid sse4_1 sse4_2 x2apic
movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand hypervisor
lahf_lm abm cpuid_fault invpcid_single fsgsbase tsc_adjust bmi1 avx2
smep bmi2 erms invpcid xsaveopt arat umip
bugs : cpu_meltdown spectre_v1 spectre_v2 spec_store_bypass l1tf
bogomips : 7183.36
clflush size : 64
cache_alignment : 64
address sizes : 40 bits physical, 48 bits virtual
power management:

processor : 1
vendor_id : GenuineIntel
cpu family : 6
model : 60
model name : Intel(R) Core(TM) i7-4790 CPU @ 3.60GHz
stepping : 3
microcode : 0x1
cpu MHz : 3591.682
cache size : 16384 KB
physical id : 1
siblings : 1
core id : 0
cpu cores : 1
apicid : 1
initial apicid : 1
fpu : yes
fpu_exception : yes
cpuid level : 13
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge
mca cmov pat pse36 clflush mmx fxsr sse sse2 ss syscall nx pdpe1gb
rdtscp lm constant_tsc arch_perfmon rep_good nopl xtopology cpuid
tsc_known_freq pni pclmulqdq ssse3 fma cx16 pcid sse4_1 sse4_2 x2apic
movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand hypervisor
lahf_lm abm cpuid_fault invpcid_single fsgsbase tsc_adjust bmi1 avx2
smep bmi2 erms invpcid xsaveopt arat umip
bugs : cpu_meltdown spectre_v1 spectre_v2 spec_store_bypass l1tf
bogomips : 7183.36
clflush size : 64
cache_alignment : 64
address sizes : 40 bits physical, 48 bits virtual
power management:


Румен Петров <rpetr...@gmail.com> 於 2018年12月21日 週五 下午9:26寫道:
> --
> You received this message because you are subscribed to the Google Groups "Android-x86" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to android-x86...@googlegroups.com.
> To post to this group, send email to andro...@googlegroups.com.
> Visit this group at https://groups.google.com/group/android-x86.
> For more options, visit https://groups.google.com/d/optout.



--
Chih-Wei
Android-x86 project
http://www.android-x86.org

DDS Central

unread,
Dec 24, 2018, 8:03:09 PM12/24/18
to Android-x86
I think multi-CPU support depends on kernel, not userspace.
Linux has supported multi-CPU for ages.

Mauro Rossi

unread,
Dec 25, 2018, 12:47:07 AM12/25/18
to Android-x86
Hi Petrov,


On Friday, December 21, 2018 at 2:26:27 PM UTC+1, Румен Петров wrote:
In brief all my attempts to run "Android-x86" images on AMD Phenom(tm) II X6 1090T processor fail until recently.
This processor supports "sse" and "sse2" instruction sets but does not support "sse3" and etc. required to run vendor images under emulator.

I'm able run many VM under QEMU (linux-es) or VirtualBox (Solaris).
Let me quote from VirtualBox how to: "[System] Optional: Processor(s) may be set above 1 if you have more than one virtual processor.."
As processor (AMD 1090T) is with six cores I run VM with two or more processors.
So nothing suspicious but only "Android-x86" images fail to start either under my QEMU or VirtualBox.

After successful build of AOSP (9.0r10) for x86 architecture, patched do not require "sse3" and run in emulator I wonder more and more why "Android-x86" images cannot start im my VM environment.
I decided to try again and to find culprit.

AMD Phenom) II X6  supports SSE3, lowering the requirement to sse2 to get an amd64 build hides a lot of tricky issues,
for example apps will still be using the ABI optimizations and compilers in the prebuits have embedded options to enable SSSE3 (clang binary with +mssse3)

 

One day I decided to test VM without flag "-smp 2" just becuse vendor images for android emulator does not support multi-CPU.

And surprise - voilà 32-bit "Android-x86" image android-x86-8.1-rc2 finally run!

This could also depend on the HW serving the virtualization layer, e.g. a problem with additional thread using the second vCPU
 


So "How to" suggestion to use more then one processor does not look correct.
Please remove it.


Next my comment is about QEMU "How to". It looks outdated.

According to my notes command is qemu-system-x86_64 (for qemu version >= 1.0) with argument "-enable-kvm" (as of version >= 1.3+) and etc...
Dunno what is "qemu-kvm".
Debian package "kvm" just install a shell script with following content on 64-bit OS-es:
exec qemu-system-x86_64 -enable-kvm "$@"

So please replace "qemu-kvm" with " qemu-system-x86_64 -enable-kvm".


Regards,
Roumen Petrov

There were also other changes since the last update of documentation,
for example in Ubuntu 18.04/18.10 it is possible to install snap package qemu-virgil which will provide a version already supporting virglrender


I'm using latest edge version:

snap refresh --edge qemu-virgil
sudo snap connect qemu-virgil:kvm

Unfortunately libvirt does not support enabling virtio 3D acceleration option in virt-manager (it returns an error when enabing it),
so I'm using this command line:

#Test stock x86 android-x86-8.1-rc2.iso
qemu
-virgil -enable-kvm -boot menu=on \
-m 2048 -device virtio-vga,virgl=on -display sdl,gl=on -soundhw ac97 \
-cdrom ~/Downloads/android-x86-8.1-rc2.iso \
-hda ~/Downloads/oreo-x86.img

This command works and, to the surprise of Chih-Wei and Povilas, 
who may have not tested in the same conditions (I have a  AMD Phenom(tm) II X3 720)
I also confirm that -smp 2 does cause an immediate reset/reboot
and not using -smp 2 allows to boot like a charm the android-x86-8.1-rc2.iso

$ cat /proc/cpuinfo 
processor : 0
vendor_id : AuthenticAMD
cpu family : 16
model : 4
model name : AMD Phenom(tm) II X3 720 Processor
stepping : 2
microcode : 0x10000db


I've collected the console log with -smp 2, in the attachment and there is a warning related to specific AMD processors 
and then the kernel panic.

[    0.000000] Initializing CPU#1
[    0.001000] kvm-clock: cpu 1, msr 0:32ab0041, secondary cpu clock
[    0.001000] ------------[ cut here ]------------
[    0.001000] WARNING: This combination of AMD processors is not suitable for SMP.
[    0.001000] invalid opcode: 0000 [#1] PREEMPT SMP
[    0.001000] CPU: 1 PID: 0 Comm: swapper/1 Not tainted 4.18.14-android-x86-gfa66992329ec #1
[    0.001000] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.12.0-0-ga698c8995f-prebuilt.qemu.org 04/01/2014
[    0.001000] EIP: init_amd+0x30c/0x5c5
[    0.001000] Code: 76 0e 8b 43 14 a9 00 00 08 00 0f 85 d0 00 00 00 80 3d c8 9a a5 c1 00 75 14 c6 05 c8 9a a5 c1 01 68 d6 19 8b c1 e8 71 70 02 00 <0f> 0b 58 ba 01 00 00 00 b8 02 00 00 00 e8 16 70 02 00 e9 9f 00 00
[    0.001000] EAX: 00000044 EBX: f1895040 ECX: c1b7e1c8 EDX: 00000001
[    0.001000] ESI: f18950cd EDI: 0000002b EBP: f111ff30 ESP: f111ff00
[    0.001000] DS: 007b ES: 007b FS: 00d8 GS: 00e0 SS: 0068 EFLAGS: 00210092
[    0.001000] CR0: 80050033 CR2: 00000000 CR3: 01b6d000 CR4: 00000690
[    0.001000] Call Trace:
[    0.001000]  identify_cpu+0x221/0x45e
[    0.001000]  identify_secondary_cpu+0x15/0x73
[    0.001000]  smp_store_cpu_info+0x3c/0x48
[    0.001000]  start_secondary+0xb5/0x1c4
[    0.001000]  startup_32_smp+0x164/0x168
[    0.001000]  ? startup_32_smp+0x164/0x168
[    0.001000] Modules linked in:
[    0.001000] ---[ end trace aaf38d8859660b2b ]---
[    0.001000] EIP: init_amd+0x30c/0x5c5
[    0.001000] Code: 76 0e 8b 43 14 a9 00 00 08 00 0f 85 d0 00 00 00 80 3d c8 9a a5 c1 00 75 14 c6 05 c8 9a a5 c1 01 68 d6 19 8b c1 e8 71 70 02 00 <0f> 0b 58 ba 01 00 00 00 b8 02 00 00 00 e8 16 70 02 00 e9 9f 00 00
[    0.001000] EAX: 00000044 EBX: f1895040 ECX: c1b7e1c8 EDX: 00000001
[    0.001000] ESI: f18950cd EDI: 0000002b EBP: f111ff30 ESP: c1b7043c
[    0.001000] DS: 007b ES: 007b FS: 00d8 GS: 00e0 SS: 0068 EFLAGS: 00210092
[    0.001000] CR0: 80050033 CR2: 00000000 CR3: 01b6d000 CR4: 00000690
[    0.001000] Kernel panic - not syncing: Attempted to kill the idle task!
[    0.001000] Rebooting in 5 seconds..



Mauro
console_log.txt

Chih-Wei Huang

unread,
Dec 25, 2018, 1:16:09 AM12/25/18
to Android-x86
Mauro Rossi <issor...@gmail.com> 於 2018年12月25日 週二 下午1:47寫道:
>
> I've collected the console log with -smp 2, in the attachment and there is a warning related to specific AMD processors
> and then the kernel panic.
>
> [ 0.000000] Initializing CPU#1
> [ 0.001000] kvm-clock: cpu 1, msr 0:32ab0041, secondary cpu clock
> [ 0.001000] ------------[ cut here ]------------
> [ 0.001000] WARNING: This combination of AMD processors is not suitable for SMP.

Good finding!
Could you try to add "-cpu host" options?

Refer to
https://kvm.vger.kernel.narkive.com/asIYB7TO/this-combination-of-amdprocessors-is-not-suitable-for-smp

Mauro Rossi

unread,
Dec 25, 2018, 3:02:14 AM12/25/18
to Android-x86
Thanks Chih-Wei,

On Tuesday, December 25, 2018 at 7:16:09 AM UTC+1, Chih-Wei Huang wrote:
Mauro Rossi <issor...@gmail.com> 於 2018年12月25日 週二 下午1:47寫道:
>
> I've collected the console log with -smp 2, in the attachment and there is a warning related to specific AMD processors
> and then the kernel panic.
>
> [    0.000000] Initializing CPU#1
> [    0.001000] kvm-clock: cpu 1, msr 0:32ab0041, secondary cpu clock
> [    0.001000] ------------[ cut here ]------------
> [    0.001000] WARNING: This combination of AMD processors is not suitable for SMP.

Good finding!
Could you try to add "-cpu host" options?

Refer to
https://kvm.vger.kernel.narkive.com/asIYB7TO/this-combination-of-amdprocessors-is-not-suitable-for-smp

Using -smp 2 and -cpu host worked perfectly
New console log in the attachment
Case closed

Mauro
console_log_cpu_host.txt

Румен Петров

unread,
Dec 30, 2018, 11:21:24 AM12/30/18
to Android-x86
Hello,

Thanks for all of you feedback.

Invalid operation on x86 image is exactly as is posted by Mauro Rossi and this look like qemu defect - failure in init_amd() following a warning that shows initialization of K7 processor.
I repeat test with 32-bit image on VirtualBox and it works fine. I guess that before I choose by mistake 64-bit image (Let do not discuss in this thread 64-bit image).


Unfortunately this thread is for documentation. Let me summarize.
----- [start] -----
On AMD processors x86(32-bit) image mail fail to run in multiprocessing mode.

If VM is QEMU tuning with option -cpu could help.
It is confirmed that on "Phenom" processors QEMU multiprocessing work with extra option "-cpu host". Option "-cpu phenom" should work as well.

On those processors and VirtualBox as VM, 32-bit image is expected to work in multiprocessing mode.
----- [end] -----

Regard,
Roumen Petrov



Mauro Rossi

unread,
Dec 30, 2018, 11:43:07 AM12/30/18
to Android-x86
Hi,


On Sunday, December 30, 2018 at 5:21:24 PM UTC+1, Румен Петров wrote:
Hello,

Thanks for all of you feedback.

You're welcome
I think is very much important to have mentioned that the new qemu-virgil snap package 
may avoid a lot of complexity in building virglrendered and qemu binary supporting virglrender

Users can just install it

Was that documented anywhere?

Mauro

Reply all
Reply to author
Forward
0 new messages