Closed inochisa closed 1 year ago
As-per error message, the first thing running in Guest is accessing a non-existent memory region.
I recompiled this with the upstream toolchain and everything worked fine.
I think this is a gcc bug related to the arch linux riscv64 toolchain. It is OK to closed it.
I recompiled this with the upstream toolchain and everything worked fine.
I think this is a gcc bug related to the arch linux riscv64 toolchain. It is OK to closed it.
Similar situation here, if I use the riscv64-linux-gnu
toolchain in Ubuntu 22.04, the guest kick fails with the exact error complaining about accessing guest_phys=0x000127170AA04000.
$ riscv64-linux-gnu-gcc -v
Using built-in specs.
COLLECT_GCC=riscv64-linux-gnu-gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc-cross/riscv64-linux-gnu/11/lto-wrapper
Target: riscv64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 11.4.0-1ubuntu1~22.04' --with-bugurl=file:///usr/share/doc/gcc-11/README.Bugs --enable-languages=c,ada,c++,go,d,fortran,objc,obj-c++,m2 --prefix=/usr --with-gcc-major-version-only --program-suffix=-11 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-libitm --disable-libquadmath --disable-libquadmath-support --enable-plugin --enable-default-pie --with-system-zlib --enable-libphobos-checking=release --without-target-system-zlib --enable-multiarch --disable-werror --disable-multilib --with-arch=rv64gc --with-abi=lp64d --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=riscv64-linux-gnu --program-prefix=riscv64-linux-gnu- --includedir=/usr/riscv64-linux-gnu/include --with-build-config=bootstrap-lto-lean --enable-link-serialization=2
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 11.4.0 (Ubuntu 11.4.0-1ubuntu1~22.04)
After switching to another toolchain, and recompiled Xvisor, the guest kick succeded.
$ riscv64-unknown-linux-gnu-gcc -v
Using built-in specs.
COLLECT_GCC=riscv64-unknown-linux-gnu-gcc
COLLECT_LTO_WRAPPER=/home/user/toolchain_build/riscv-toolchain/install/riscv64-unknown-linux-gnu/bin/../libexec/gcc/riscv64-unknown-linux-gnu/12.2.1/lto-wrapper
Target: riscv64-unknown-linux-gnu
Configured with: /home/user/toolchain_build/riscv-toolchain/crosstool-ng/.build/riscv64-unknown-linux-gnu/src/gcc/configure --build=x86_64-build_pc-linux-gnu --host=x86_64-build_pc-linux-gnu --target=riscv64-unknown-linux-gnu --prefix=/home/user/toolchain_build/riscv-toolchain/install/riscv64-unknown-linux-gnu --enable-shared --exec_prefix=/home/user/toolchain_build/riscv-toolchain/install/riscv64-unknown-linux-gnu --with-sysroot=/home/user/toolchain_build/riscv-toolchain/install/riscv64-unknown-linux-gnu/riscv64-unknown-linux-gnu/sysroot --enable-languages=c,c++,fortran --with-arch=rv64gcb --with-abi=lp64d --with-pkgversion='Custom GCC-Linux-2023-06-30' --disable-libmudflap --disable-libssp --disable-libquadmath --disable-libquadmath-support --disable-libsanitizer --with-gmp=/home/user/toolchain_build/riscv-toolchain/crosstool-ng/.build/riscv64-unknown-linux-gnu/buildtools --with-mpfr=/home/user/toolchain_build/riscv-toolchain/crosstool-ng/.build/riscv64-unknown-linux-gnu/buildtools --with-mpc=/home/user/toolchain_build/riscv-toolchain/crosstool-ng/.build/riscv64-unknown-linux-gnu/buildtools --with-isl=/home/user/toolchain_build/riscv-toolchain/crosstool-ng/.build/riscv64-unknown-linux-gnu/buildtools --enable-threads=posix --disable-nls --with-system-zlib --enable-tls --disable-multilib --with-local-prefix=/home/user/toolchain_build/riscv-toolchain/install/riscv64-unknown-linux-gnu/riscv64-unknown-linux-gnu/sysroot --enable-long-long 'CFLAGS_FOR_TARGET=-O2 -mcmodel=medany -march=rv64gcb' 'CXXFLAGS_FOR_TARGET=-O2 -mcmodel=medany -march=rv64gcb'
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 12.2.1 20230307 (Custom GCC-Linux-2023-06-30)
I got a mmap fault when kicking a basic VM created by following the tutorial in tests/riscv/virt64/basic/README, but got the following fault:
It seems to like the VM halted at the very early stage, but I have no idea about what caused this.
Qemu command:
Software: qemu 8.1.2-1 (OpenSBI is provided by the qemu) kernel 6.5.9-arch2-1 riscv64-linux-gnu-gcc 12.2.0 (Arch LInux)