FT2000+ openEuler 20.03 LTS SP3 aarch64 源码编译qemu 打开--enabe-kvm编译开关 字符界面安装系统 bc计算圆周率基准测试对比

本文详细记录了在aarch64架构下编译QEMU的过程,包括官方源码下载、编译选项设置、依赖库检查等。之后,文章介绍了如何使用QEMU安装CentOS-7-aarch64-Minimal-2009,并进行基准性能测试。还探讨了KVM加速对性能的影响以及遇到的问题。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

编译

官方源码路径

Download QEMU - QEMU

官方编译方法参考

git clone https://gitlab.com/qemu-project/qemu.git
cd qemu
git submodule init
git submodule update --recursive
./configure
make

打包好的完整源码包

链接:https://pan.baidu.com/s/1P7CuyyOPfmIJ688ejggs5Q?pwd=fu3u 
提取码:fu3u

编译安装

无需编译aarch64以外的target,节约时间

export CC=/home/yeqiang/bisheng-compiler-1.3.3-aarch64-linux/bin/clang
./configure --enable-vnc --enable-kvm --target-list="aarch64-softmmu,aarch64_be-linux-user,aarch64-linux-user"
make -j64
make install

查看版本

附:configure输出

Using './build' as the directory for build output
The Meson build system
Version: 0.61.5
Source dir: /home/yeqiang/qemu
Build dir: /home/yeqiang/qemu/build
Build type: native build
Project name: qemu
Project version: 7.2.91
C compiler for the host machine: /home/yeqiang/bisheng-compiler-1.3.3-aarch64-linux/bin/clang (clang 1.3.3 "Bisheng Compiler 1.3.3.b023 clang version 10.0.1 (clang-e31092d4f8cd flang-3c92ea4b404f)")
C linker for the host machine: /home/yeqiang/bisheng-compiler-1.3.3-aarch64-linux/bin/clang ld.bfd 2.34
Host machine cpu family: aarch64
Host machine cpu: aarch64
Program scripts/symlink-install-tree.py found: YES (/usr/bin/python3 /home/yeqiang/qemu/scripts/symlink-install-tree.py)
Program sh found: YES (/usr/bin/sh)
C++ compiler for the host machine: c++ (gcc 7.3.0 "c++ (GCC) 7.3.0")
C++ linker for the host machine: c++ ld.bfd 2.34
Program python3 found: YES (/usr/bin/python3)
Program bzip2 found: YES (/usr/bin/bzip2)
Program iasl found: NO
Compiler for C supports link arguments -Wl,-z,relro: YES 
Compiler for C supports link arguments -Wl,-z,now: YES 
Message: C++ compiler does not work with C compiler
Message: Disabling C++-specific optional code
Compiler for C supports link arguments -Wl,--warn-common: YES 
Program cgcc found: NO
Library m found: YES
Run-time dependency threads found: YES
Library util found: YES
Run-time dependency appleframeworks found: NO (tried framework)
Found pkg-config: /usr/bin/pkg-config (1.7.3)
Run-time dependency gio-2.0 found: YES 2.66.8
Program /usr/bin/gdbus-codegen found: YES (/usr/bin/gdbus-codegen)
Run-time dependency gio-unix-2.0 found: YES 2.66.8
Run-time dependency pixman-1 found: YES 0.40.0
Run-time dependency zlib found: YES 1.2.11
Has header "libaio.h" : NO 
Run-time dependency liburing found: NO (tried pkgconfig)
Run-time dependency libnfs found: NO (tried pkgconfig)
Run-time dependency appleframeworks found: NO (tried framework)
Run-time dependency appleframeworks found: NO (tried framework)
Run-time dependency libseccomp found: NO (tried pkgconfig)
Has header "cap-ng.h" : NO 
Run-time dependency xkbcommon found: NO (tried pkgconfig)
Run-time dependency slirp found: NO (tried pkgconfig)
Has header "libvdeplug.h" : NO 
Run-time dependency libpulse found: NO (tried pkgconfig)
Run-time dependency alsa found: NO (tried pkgconfig)
Run-time dependency jack found: NO (tried pkgconfig)
Run-time dependency sndio found: NO (tried pkgconfig)
Run-time dependency spice-protocol found: NO (tried pkgconfig)
Run-time dependency spice-server found: NO (tried pkgconfig)
Library rt found: YES
Run-time dependency libiscsi found: NO (tried pkgconfig)
Run-time dependency libzstd found: NO (tried pkgconfig)
Run-time dependency virglrenderer found: NO (tried pkgconfig)
Run-time dependency blkio found: NO (tried pkgconfig)
Run-time dependency libcurl found: NO (tried pkgconfig)
Run-time dependency libudev found: NO (tried pkgconfig)
Library mpathpersist found: NO
Run-time dependency ncursesw found: YES 6.2.20200411
Has header "brlapi.h" : NO 
sdl2-config found: NO
Run-time dependency sdl2 found: NO (tried pkgconfig and config-tool)
Library rados found: NO
Has header "rbd/librbd.h" : NO 
Run-time dependency glusterfs-api found: NO (tried pkgconfig)
Run-time dependency libssh found: NO (tried pkgconfig)
Has header "bzlib.h" : YES 
Library bz2 found: YES
Has header "lzfse.h" : NO 
Has header "sys/soundcard.h" : YES 
Run-time dependency epoxy found: NO (tried pkgconfig)
Has header "epoxy/egl.h" with dependency epoxy: NO 
Run-time dependency gnutls found: NO (tried pkgconfig)
Run-time dependency gnutls found: NO (tried pkgconfig)
libgcrypt-config found: NO need ['>=1.8']
Run-time dependency libgcrypt found: NO (tried config-tool)
Run-time dependency nettle found: NO (tried pkgconfig)
Run-time dependency gmp found: YES 6.2.0
Run-time dependency gtk+-3.0 found: NO (tried pkgconfig)
Run-time dependency libpng found: YES 1.6.37
Run-time dependency libjpeg found: YES 2.0.5
Has header "sasl/sasl.h" : NO 
Has header "security/pam_appl.h" : NO 
Has header "snappy-c.h" : NO 
Has header "lzo/lzo1x.h" : NO 
Has header "numa.h" : NO 
Library ibumad found: NO
Has header "rdma/rdma_cma.h" : NO 
Library ibverbs found: NO
Run-time dependency xencontrol found: NO (tried pkgconfig)
Library xenstore found: NO
Library xenctrl found: NO
Library xendevicemodel found: NO
Library xenforeignmemory found: NO
Library xengnttab found: NO
Library xenevtchn found: NO
Library xentoolcore found: NO
Run-time dependency libcacard found: NO (tried pkgconfig)
Run-time dependency u2f-emu found: NO (tried pkgconfig)
Run-time dependency canokey-qemu found: NO (tried pkgconfig)
Run-time dependency libusbredirparser-0.5 found: NO (tried pkgconfig)
Run-time dependency libusb-1.0 found: NO (tried pkgconfig)
Run-time dependency libpmem found: NO (tried pkgconfig)
Run-time dependency libdaxctl found: NO (tried pkgconfig)
Run-time dependency libkeyutils found: YES 1.6.3
Checking for function "gettid" : NO 
Run-time dependency libselinux found: YES 3.1
Run-time dependency fuse3 found: NO (tried pkgconfig)
Run-time dependency libbpf found: NO (tried pkgconfig)
Run-time dependency libdw found: NO (tried pkgconfig)
Has header "sys/epoll.h" : YES 
Has header "linux/magic.h" : YES 
Has header "valgrind/valgrind.h" : NO 
Has header "linux/btrfs.h" : YES 
Has header "libdrm/drm.h" : NO 
Has header "pty.h" : YES 
Has header "sys/disk.h" : NO 
Has header "sys/ioccom.h" : NO 
Has header "sys/kcov.h" : NO 
Checking for function "close_range" : NO 
Checking for function "accept4" : YES 
Checking for function "clock_adjtime" : YES 
Checking for function "dup3" : YES 
Checking for function "fallocate" : YES 
Checking for function "posix_fallocate" : YES 
Checking for function "posix_memalign" : YES 
Checking for function "_aligned_malloc" : NO 
Checking for function "valloc" : YES 
Checking for function "memalign" : YES 
Checking for function "ppoll" : YES 
Checking for function "preadv" : YES 
Checking for function "pthread_fchdir_np" : NO 
Checking for function "sendfile" : YES 
Checking for function "setns" : YES 
Checking for function "unshare" : YES 
Checking for function "syncfs" : YES 
Checking for function "sync_file_range" : YES 
Checking for function "timerfd_create" : YES 
Checking for function "copy_file_range" : YES 
Checking for function "getifaddrs" : YES 
Checking for function "openpty" with dependency -lutil: YES 
Checking for function "strchrnul" : YES 
Checking for function "system" : YES 
Header <sys/epoll.h> has symbol "epoll_create1" : YES 
Header <linux/falloc.h> has symbol "FALLOC_FL_PUNCH_HOLE" : YES 
Header <linux/falloc.h> has symbol "FALLOC_FL_KEEP_SIZE" : YES 
Header <linux/falloc.h> has symbol "FALLOC_FL_ZERO_RANGE" : YES 
Has header "linux/fiemap.h" : YES 
Header <linux/fs.h> has symbol "FS_IOC_FIEMAP" : YES 
Checking for function "getrandom" : YES 
Header <sys/random.h> has symbol "GRND_NONBLOCK" : YES 
Header <sys/inotify.h> has symbol "inotify_init" : YES 
Header <sys/inotify.h> has symbol "inotify_init1" : YES 
Header <sys/prctl.h> has symbol "PR_SET_TIMERSLACK" : YES 
Header <linux/rtnetlink.h> has symbol "IFLA_PROTO_DOWN" : YES 
Header <sys/sysmacros.h> has symbol "makedev" : YES 
Header <getopt.h> has symbol "optreset" : NO 
Header <netinet/in.h> has symbol "IPPROTO_MPTCP" : NO 
Checking whether type "struct sigevent" has member "sigev_notify_thread_id" : NO 
Checking whether type "struct stat" has member "st_atim" : YES 
Checking for type "struct iovec" : YES 
Checking for type "struct utmpx" : YES 
Checking for type "struct mmsghdr" : YES 
Header <linux/vm_sockets.h> has symbol "AF_VSOCK" : YES 
Program scripts/minikconf.py found: YES (/usr/bin/python3 /home/yeqiang/qemu/scripts/minikconf.py)
Configuring aarch64-softmmu-config-target.h using configuration
Configuring aarch64-softmmu-config-devices.mak with command
Reading depfile: /home/yeqiang/qemu/build/meson-private/aarch64-softmmu-config-devices.mak.d
Configuring aarch64-softmmu-config-devices.h using configuration
Configuring aarch64_be-linux-user-config-target.h using configuration
Configuring aarch64-linux-user-config-target.h using configuration
Program scripts/make-config-poison.sh found: YES (/home/yeqiang/qemu/scripts/make-config-poison.sh)
Run-time dependency capstone found: NO (tried pkgconfig)
Library fdt found: YES
Configuring config-host.h using configuration
Program scripts/hxtool found: YES (/home/yeqiang/qemu/scripts/hxtool)
Program scripts/shaderinclude.py found: YES (/usr/bin/python3 /home/yeqiang/qemu/scripts/shaderinclude.py)
Program scripts/qapi-gen.py found: YES (/usr/bin/python3 /home/yeqiang/qemu/scripts/qapi-gen.py)
Program scripts/qemu-version.sh found: YES (/home/yeqiang/qemu/scripts/qemu-version.sh)

Executing subproject libvhost-user 

libvhost-user| Project name: libvhost-user
libvhost-user| Project version: undefined
libvhost-user| C compiler for the host machine: /home/yeqiang/bisheng-compiler-1.3.3-aarch64-linux/bin/clang (clang 1.3.3 "Bisheng Compiler 1.3.3.b023 clang version 10.0.1 (clang-e31092d4f8cd flang-3c92ea4b404f)")
libvhost-user| C linker for the host machine: /home/yeqiang/bisheng-compiler-1.3.3-aarch64-linux/bin/clang ld.bfd 2.34
libvhost-user| Compiler for C supports arguments -Wsign-compare: YES
libvhost-user| Compiler for C supports arguments -Wdeclaration-after-statement: YES
libvhost-user| Compiler for C supports arguments -Wstrict-aliasing: YES
libvhost-user| Dependency threads found: YES unknown (cached)
libvhost-user| Dependency glib-2.0 found: YES 2.66.8 (overridden)
libvhost-user| Build targets in project: 9
libvhost-user| Subproject libvhost-user finished.


Executing subproject libvduse 

libvduse| Project name: libvduse
libvduse| Project version: undefined
libvduse| C compiler for the host machine: /home/yeqiang/bisheng-compiler-1.3.3-aarch64-linux/bin/clang (clang 1.3.3 "Bisheng Compiler 1.3.3.b023 clang version 10.0.1 (clang-e31092d4f8cd flang-3c92ea4b404f)")
libvduse| C linker for the host machine: /home/yeqiang/bisheng-compiler-1.3.3-aarch64-linux/bin/clang ld.bfd 2.34
libvduse| Compiler for C supports arguments -Wsign-compare: YES (cached)
libvduse| Compiler for C supports arguments -Wdeclaration-after-statement: YES (cached)
libvduse| Compiler for C supports arguments -Wstrict-aliasing: YES (cached)
libvduse| Build targets in project: 10
libvduse| Subproject libvduse finished.

Program scripts/decodetree.py found: YES (/usr/bin/python3 /home/yeqiang/qemu/scripts/decodetree.py)
Program ../scripts/modules/module_block.py found: YES (/usr/bin/python3 /home/yeqiang/qemu/block/../scripts/modules/module_block.py)
Program ../scripts/block-coroutine-wrapper.py found: YES (/usr/bin/python3 /home/yeqiang/qemu/block/../scripts/block-coroutine-wrapper.py)
Program scripts/modinfo-collect.py found: YES (/home/yeqiang/qemu/scripts/modinfo-collect.py)
Program scripts/modinfo-generate.py found: YES (/home/yeqiang/qemu/scripts/modinfo-generate.py)
Program nm found: YES
Program scripts/undefsym.py found: YES (/usr/bin/python3 /home/yeqiang/qemu/scripts/undefsym.py)
Program scripts/feature_to_c.sh found: YES (/bin/sh /home/yeqiang/qemu/scripts/feature_to_c.sh)
Configuring 50-edk2-i386-secure.json using configuration
Configuring 50-edk2-x86_64-secure.json using configuration
Configuring 60-edk2-aarch64.json using configuration
Configuring 60-edk2-arm.json using configuration
Configuring 60-edk2-i386.json using configuration
Configuring 60-edk2-x86_64.json using configuration
Program qemu-keymap found: NO
Program sphinx-build found: NO
Program bash found: YES 5.0.18 (/usr/bin/bash)
Program diff found: YES (/usr/bin/diff)
Program dbus-daemon found: YES (/usr/bin/dbus-daemon)
Found CMake: /usr/bin/cmake (3.16.5)
Run-time dependency gvnc-1.0 found: NO (tried pkgconfig and cmake)
Run-time dependency sysprof-capture-4 found: NO (tried pkgconfig and cmake)
Program initrd-stress.sh found: YES (/home/yeqiang/qemu/tests/migration/initrd-stress.sh)
Build targets in project: 498

qemu 7.2.91

  Directories
    Install prefix               : /usr/local
    BIOS directory               : share/qemu
    firmware path                : share/qemu-firmware
    binary directory             : /usr/local/bin
    library directory            : /usr/local/lib64
    module directory             : lib64/qemu
    libexec directory            : /usr/local/libexec
    include directory            : /usr/local/include
    config directory             : /usr/local/etc
    local state directory        : /var/local
    Manual directory             : /usr/local/share/man
    Doc directory                : /usr/local/share/doc
    Build directory              : /home/yeqiang/qemu/build
    Source path                  : /home/yeqiang/qemu
    GIT submodules               : ui/keycodemapdb meson tests/fp/berkeley-testfloat-3 tests/fp/berkeley-softfloat-3 dtc

  Host binaries
    git                          : git
    make                         : make
    python                       : /usr/bin/python3 (version: 3.7)
    sphinx-build                 : NO
    gdb                          : /usr/bin/gdb
    iasl                         : NO
    genisoimage                  : 

  Configurable features
    Documentation                : NO
    system-mode emulation        : YES
    user-mode emulation          : YES
    block layer                  : YES
    Install blobs                : YES
    module support               : NO
    fuzzing support              : NO
    Audio drivers                : oss
    Trace backends               : log
    D-Bus display                : YES
    QOM debugging                : NO
    vhost-kernel support         : YES
    vhost-net support            : YES
    vhost-user support           : YES
    vhost-user-crypto support    : YES
    vhost-user-blk server support: YES
    vhost-vdpa support           : YES
    build guest agent            : YES

  Compilation
    host CPU                     : aarch64
    host endianness              : little
    C compiler                   : /home/yeqiang/bisheng-compiler-1.3.3-aarch64-linux/bin/clang
    Host C compiler              : /home/yeqiang/bisheng-compiler-1.3.3-aarch64-linux/bin/clang
    C++ compiler                 : NO
    CFLAGS                       : -g -O2
    QEMU_CFLAGS                  : -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -fno-strict-aliasing -fno-common -fwrapv -Wundef -Wwrite-strings -Wmissing-prototypes -Wstrict-prototypes -Wredundant-decls -Wold-style-definition -Wtype-limits -Wformat-security -Wformat-y2k -Winit-self -Wignored-qualifiers -Wempty-body -Wnested-externs -Wendif-labels -Wexpansion-to-defined -Wmissing-format-attribute -Wthread-safety -Wno-initializer-overrides -Wno-missing-include-dirs -Wno-shift-negative-value -Wno-string-plus-int -Wno-typedef-redefinition -Wno-tautological-type-limit-compare -Wno-gnu-variable-sized-type-not-at-end -fstack-protector-strong
    QEMU_CXXFLAGS                : -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -fno-strict-aliasing -fno-common -fwrapv -Wundef -Wwrite-strings -Wtype-limits -Wformat-security -Wformat-y2k -Winit-self -Wignored-qualifiers -Wempty-body -Wendif-labels -Wexpansion-to-defined -Wmissing-format-attribute -Wthread-safety -Wno-initializer-overrides -Wno-missing-include-dirs -Wno-shift-negative-value -Wno-string-plus-int -Wno-typedef-redefinition -Wno-tautological-type-limit-compare -Wno-gnu-variable-sized-type-not-at-end -fstack-protector-strong
    QEMU_LDFLAGS                 : -fstack-protector-strong -Wl,-z,relro -Wl,-z,now -Wl,--warn-common
    profiler                     : NO
    link-time optimization (LTO) : NO
    PIE                          : YES
    static build                 : NO
    malloc trim support          : YES
    membarrier                   : NO
    debug stack usage            : NO
    mutex debugging              : NO
    memory allocator             : system
    avx2 optimization            : NO
    avx512bw optimization        : NO
    avx512f optimization         : NO
    gprof                        : NO
    gcov                         : NO
    thread sanitizer             : NO
    CFI support                  : NO
    strip binaries               : NO
    sparse                       : NO
    mingw32 support              : NO

  Cross compilers
    aarch64                      : /home/yeqiang/bisheng-compiler-1.3.3-aarch64-linux/bin/clang

  Targets and accelerators
    KVM support                  : YES
    HAX support                  : NO
    HVF support                  : NO
    WHPX support                 : NO
    NVMM support                 : NO
    Xen support                  : NO
    Xen emulation                : NO
    TCG support                  : YES
    TCG backend                  : native (aarch64)
    TCG plugins                  : YES
    TCG debug enabled            : NO
    target list                  : aarch64-softmmu aarch64_be-linux-user aarch64-linux-user
    default devices              : YES
    out of process emulation     : YES
    vfio-user server             : NO

  Block layer support
    coroutine backend            : ucontext
    coroutine pool               : YES
    Block whitelist (rw)         : 
    Block whitelist (ro)         : 
    Use block whitelist in tools : NO
    VirtFS support               : NO
    Live block migration         : YES
    replication support          : YES
    bochs support                : YES
    cloop support                : YES
    dmg support                  : YES
    qcow v1 support              : YES
    vdi support                  : YES
    vvfat support                : YES
    qed support                  : YES
    parallels support            : YES
    FUSE exports                 : NO
    VDUSE block exports          : YES

  Crypto
    TLS priority                 : NORMAL
    GNUTLS support               : NO
    libgcrypt                    : NO
    nettle                       : NO
    AF_ALG support               : NO
    rng-none                     : NO
    Linux keyring                : YES

  Dependencies
    SDL support                  : NO
    SDL image support            : NO
    GTK support                  : NO
    pixman                       : YES 0.40.0
    VTE support                  : NO
    slirp support                : NO
    libtasn1                     : NO
    PAM                          : NO
    iconv support                : YES
    curses support               : YES
    virgl support                : NO
    blkio support                : NO
    curl support                 : NO
    Multipath support            : NO
    PNG support                  : YES 1.6.37
    VNC support                  : YES
    VNC SASL support             : NO
    VNC JPEG support             : YES 2.0.5
    OSS support                  : YES
    sndio support                : NO
    ALSA support                 : NO
    PulseAudio support           : NO
    JACK support                 : NO
    brlapi support               : NO
    vde support                  : NO
    netmap support               : NO
    l2tpv3 support               : YES
    Linux AIO support            : NO
    Linux io_uring support       : NO
    ATTR/XATTR support           : YES
    RDMA support                 : NO
    PVRDMA support               : NO
    fdt support                  : system
    libcap-ng support            : NO
    bpf support                  : NO
    spice protocol support       : NO
    rbd support                  : NO
    smartcard support            : NO
    U2F support                  : NO
    libusb                       : NO
    usb net redir                : NO
    OpenGL support (epoxy)       : NO
    GBM                          : NO
    libiscsi support             : NO
    libnfs support               : NO
    seccomp support              : NO
    GlusterFS support            : NO
    TPM support                  : YES
    libssh support               : NO
    lzo support                  : NO
    snappy support               : NO
    bzip2 support                : YES
    lzfse support                : NO
    zstd support                 : NO
    NUMA host support            : NO
    capstone                     : NO
    libpmem support              : NO
    libdaxctl support            : NO
    libudev                      : NO
    FUSE lseek                   : NO
    selinux                      : YES 3.1
    libdw                        : NO

  Subprojects
    libvduse                     : YES
    libvhost-user                : YES

  User defined options
    Native files                 : config-meson.cross
    prefix                       : /usr/local
    werror                       : true
    kvm                          : enabled
    vfio_user_server             : disabled
    vnc                          : enabled

Found ninja-1.11.1 at /usr/local/bin/ninja
Running postconf script '/usr/bin/python3 /home/yeqiang/qemu/scripts/symlink-install-tree.py'

安装CentOS-7-aarch64-Minimal-2009

qemu-img创建qcow2格式虚拟硬盘

qemu-img create -f qcow2 vm.qcow2 20G

字符界面安装CentOS

启动

qemu-system-aarch64  -machine virt,accel=kvm -cpu host -m 32G -smp 16,sockets=1,cores=16,threads=1 -bios /usr/local/share/qemu/edk2-aarch64-code.fd  -boot d -hda /home/yeqiang/qemu-virtual-machine/vm.qcow2 -cdrom /root/CentOS-7-aarch64-Minimal-2009.iso  -vnc :0  -nographic

直接选择安装

 由于-nographic参数,自动进入图形交互界面

 配置Time settings

 

 回车翻页

输入65回车

 开始设置安装位置

输入c 继续

 默认使用所有空间,继续 

 默认lvm 继续

设置root密码

输入b 开始安装

 安装完成,回车 自动卸载光驱 重启

注意:后续启动qemu-system-aarch64进程就无需再添加参数:-cdrom /root/CentOS-7-aarch64-Minimal-2009.iso

 

登录系统,查看基本信息

 

基准性能测试

qemu-system-aarch64 -cpu cortex-a53

启动

qemu-system-aarch64  -machine virt -cpu cortex-a53 -m 32G -smp 16,sockets=1,cores=16,threads=1 -bios /usr/local/share/qemu/edk2-aarch64-code.fd  -boot d -hda /home/yeqiang/qemu-virtual-machine/vm.qcow2 -vnc :0  -nographic

启动过程明显慢

单核基准测试(4m14.096s)

[root@localhost ~]# time echo "scale=5000; 4*a(1)" | bc -l -q
3.141592653589793238462643383279502884197169399375105820974944592307\
81640628620899862803482534211706798214808651328230664709384460955058\
22317253594081284811174502841027019385211055596446229489549303819644\
28810975665933446128475648233786783165271201909145648566923460348610\
45432664821339360726024914127372458700660631558817488152092096282925\
40917153643678925903600113305305488204665213841469519415116094330572\
70365759591953092186117381932611793105118548074462379962749567351885\
75272489122793818301194912983367336244065664308602139494639522473719\
07021798609437027705392171762931767523846748184676694051320005681271\
45263560827785771342757789609173637178721468440901224953430146549585\
37105079227968925892354201995611212902196086403441815981362977477130\
99605187072113499999983729780499510597317328160963185950244594553469\
08302642522308253344685035261931188171010003137838752886587533208381\
42061717766914730359825349042875546873115956286388235378759375195778\
18577805321712268066130019278766111959092164201989380952572010654858\
63278865936153381827968230301952035301852968995773622599413891249721\
77528347913151557485724245415069595082953311686172785588907509838175\
46374649393192550604009277016711390098488240128583616035637076601047\
10181942955596198946767837449448255379774726847104047534646208046684\
25906949129331367702898915210475216205696602405803815019351125338243\
00355876402474964732639141992726042699227967823547816360093417216412\
19924586315030286182974555706749838505494588586926995690927210797509\
30295532116534498720275596023648066549911988183479775356636980742654\
25278625518184175746728909777727938000816470600161452491921732172147\
72350141441973568548161361157352552133475741849468438523323907394143\
33454776241686251898356948556209921922218427255025425688767179049460\
16534668049886272327917860857843838279679766814541009538837863609506\
80064225125205117392984896084128488626945604241965285022210661186306\
74427862203919494504712371378696095636437191728746776465757396241389\
08658326459958133904780275900994657640789512694683983525957098258226\
20522489407726719478268482601476990902640136394437455305068203496252\
45174939965143142980919065925093722169646151570985838741059788595977\
29754989301617539284681382686838689427741559918559252459539594310499\
72524680845987273644695848653836736222626099124608051243884390451244\
13654976278079771569143599770012961608944169486855584840635342207222\
58284886481584560285060168427394522674676788952521385225499546667278\
23986456596116354886230577456498035593634568174324112515076069479451\
09659609402522887971089314566913686722874894056010150330861792868092\
08747609178249385890097149096759852613655497818931297848216829989487\
22658804857564014270477555132379641451523746234364542858444795265867\
82105114135473573952311342716610213596953623144295248493718711014576\
54035902799344037420073105785390621983874478084784896833214457138687\
51943506430218453191048481005370614680674919278191197939952061419663\
42875444064374512371819217999839101591956181467514269123974894090718\
64942319615679452080951465502252316038819301420937621378559566389377\
87083039069792077346722182562599661501421503068038447734549202605414\
66592520149744285073251866600213243408819071048633173464965145390579\
62685610055081066587969981635747363840525714591028970641401109712062\
80439039759515677157700420337869936007230558763176359421873125147120\
53292819182618612586732157919841484882916447060957527069572209175671\
16722910981690915280173506712748583222871835209353965725121083579151\
36988209144421006751033467110314126711136990865851639831501970165151\
16851714376576183515565088490998985998238734552833163550764791853589\
32261854896321329330898570642046752590709154814165498594616371802709\
81994309924488957571282890592323326097299712084433573265489382391193\
25974636673058360414281388303203824903758985243744170291327656180937\
73444030707469211201913020330380197621101100449293215160842444859637\
66983895228684783123552658213144957685726243344189303968642624341077\
32269780280731891544110104468232527162010526522721116603966655730925\
47110557853763466820653109896526918620564769312570586356620185581007\
29360659876486117910453348850346113657686753249441668039626579787718\
55608455296541266540853061434443185867697514566140680070023787765913\
44017127494704205622305389945613140711270004078547332699390814546646\
45880797270826683063432858785698305235808933065757406795457163775254\
20211495576158140025012622859413021647155097925923099079654737612551\
76567513575178296664547791745011299614890304639947132962107340437518\
95735961458901938971311179042978285647503203198691514028708085990480\
10941214722131794764777262241425485454033215718530614228813758504306\
33217518297986622371721591607716692547487389866549494501146540628433\
66393790039769265672146385306736096571209180763832716641627488880078\
69256029022847210403172118608204190004229661711963779213375751149595\
01566049631862947265473642523081770367515906735023507283540567040386\
74351362222477158915049530984448933309634087807693259939780541934144\
73774418426312986080998886874132604720

real    4m14.096s
user    4m14.015s
sys     0m0.085s

qemu-system-aarch64 -cpu contex-a53 -enable-kvm(accel=kvm)

启动报错

qemu-system-aarch64: kvm_init_vcpu: kvm_arch_init_vcpu failed (0): Invalid argument

qemu-system-aarch64 --cpu host -enable-kvm(accel=kvm)

启动

qemu-system-aarch64  -machine virt,accel=kvm -cpu host -m 32G -smp 16,sockets=1,cores=16,threads=1 -bios /usr/local/share/qemu/edk2-aarch64-code.fd  -boot d -hda /home/yeqiang/qemu-virtual-machine/vm.qcow2 -vnc :0  -nographic

单核基准测试(0m36.355s)

[root@localhost ~]# time echo "scale=5000; 4*a(1)" | bc -l -q
3.141592653589793238462643383279502884197169399375105820974944592307\
81640628620899862803482534211706798214808651328230664709384460955058\
22317253594081284811174502841027019385211055596446229489549303819644\
28810975665933446128475648233786783165271201909145648566923460348610\
45432664821339360726024914127372458700660631558817488152092096282925\
40917153643678925903600113305305488204665213841469519415116094330572\
70365759591953092186117381932611793105118548074462379962749567351885\
75272489122793818301194912983367336244065664308602139494639522473719\
07021798609437027705392171762931767523846748184676694051320005681271\
45263560827785771342757789609173637178721468440901224953430146549585\
37105079227968925892354201995611212902196086403441815981362977477130\
99605187072113499999983729780499510597317328160963185950244594553469\
08302642522308253344685035261931188171010003137838752886587533208381\
42061717766914730359825349042875546873115956286388235378759375195778\
18577805321712268066130019278766111959092164201989380952572010654858\
63278865936153381827968230301952035301852968995773622599413891249721\
77528347913151557485724245415069595082953311686172785588907509838175\
46374649393192550604009277016711390098488240128583616035637076601047\
10181942955596198946767837449448255379774726847104047534646208046684\
25906949129331367702898915210475216205696602405803815019351125338243\
00355876402474964732639141992726042699227967823547816360093417216412\
19924586315030286182974555706749838505494588586926995690927210797509\
30295532116534498720275596023648066549911988183479775356636980742654\
25278625518184175746728909777727938000816470600161452491921732172147\
72350141441973568548161361157352552133475741849468438523323907394143\
33454776241686251898356948556209921922218427255025425688767179049460\
16534668049886272327917860857843838279679766814541009538837863609506\
80064225125205117392984896084128488626945604241965285022210661186306\
74427862203919494504712371378696095636437191728746776465757396241389\
08658326459958133904780275900994657640789512694683983525957098258226\
20522489407726719478268482601476990902640136394437455305068203496252\
45174939965143142980919065925093722169646151570985838741059788595977\
29754989301617539284681382686838689427741559918559252459539594310499\
72524680845987273644695848653836736222626099124608051243884390451244\
13654976278079771569143599770012961608944169486855584840635342207222\
58284886481584560285060168427394522674676788952521385225499546667278\
23986456596116354886230577456498035593634568174324112515076069479451\
09659609402522887971089314566913686722874894056010150330861792868092\
08747609178249385890097149096759852613655497818931297848216829989487\
22658804857564014270477555132379641451523746234364542858444795265867\
82105114135473573952311342716610213596953623144295248493718711014576\
54035902799344037420073105785390621983874478084784896833214457138687\
51943506430218453191048481005370614680674919278191197939952061419663\
42875444064374512371819217999839101591956181467514269123974894090718\
64942319615679452080951465502252316038819301420937621378559566389377\
87083039069792077346722182562599661501421503068038447734549202605414\
66592520149744285073251866600213243408819071048633173464965145390579\
62685610055081066587969981635747363840525714591028970641401109712062\
80439039759515677157700420337869936007230558763176359421873125147120\
53292819182618612586732157919841484882916447060957527069572209175671\
16722910981690915280173506712748583222871835209353965725121083579151\
36988209144421006751033467110314126711136990865851639831501970165151\
16851714376576183515565088490998985998238734552833163550764791853589\
32261854896321329330898570642046752590709154814165498594616371802709\
81994309924488957571282890592323326097299712084433573265489382391193\
25974636673058360414281388303203824903758985243744170291327656180937\
73444030707469211201913020330380197621101100449293215160842444859637\
66983895228684783123552658213144957685726243344189303968642624341077\
32269780280731891544110104468232527162010526522721116603966655730925\
47110557853763466820653109896526918620564769312570586356620185581007\
29360659876486117910453348850346113657686753249441668039626579787718\
55608455296541266540853061434443185867697514566140680070023787765913\
44017127494704205622305389945613140711270004078547332699390814546646\
45880797270826683063432858785698305235808933065757406795457163775254\
20211495576158140025012622859413021647155097925923099079654737612551\
76567513575178296664547791745011299614890304639947132962107340437518\
95735961458901938971311179042978285647503203198691514028708085990480\
10941214722131794764777262241425485454033215718530614228813758504306\
33217518297986622371721591607716692547487389866549494501146540628433\
66393790039769265672146385306736096571209180763832716641627488880078\
69256029022847210403172118608204190004229661711963779213375751149595\
01566049631862947265473642523081770367515906735023507283540567040386\
74351362222477158915049530984448933309634087807693259939780541934144\
73774418426312986080998886874132604720

real    0m36.355s
user    0m36.254s
sys     0m0.102s

故障

远程挂vpc崩溃

[  OK  ] Started Hardware RNG Entropy Gatherer Daemon.
段错误 (核心已转储)

 可能是个bug,后续再研究。

未开启kvm且未指定-cpu假死

虚拟机已无法操作,在宿主服务器上kill掉14199这个进程。参考前面的正确参数启动。

ERROR: You need at least GCC v7.4 or Clang v10.0 (or XCode Clang v12.0)

采用华为的毕昇编译器

参考:

Bisheng

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值