Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Qemu support for gunyah hypervisor #25

Open
luxontw opened this issue May 19, 2024 · 7 comments
Open

Qemu support for gunyah hypervisor #25

luxontw opened this issue May 19, 2024 · 7 comments

Comments

@luxontw
Copy link

luxontw commented May 19, 2024

As far as I know, Gunyah is currently working on Qemu support. I wanted to ask if you could provide compiled Qemu with Gunyah support. I have tried several times to compile the static version of Qemu using the instructions provided in the document, but without success because the compilation environment lacks some of the static version libraries.

./configure --target-list=aarch64-softmmu --enable-debug --enable-gunyah --static

https://patchew.org/QEMU/[email protected]/

@luxontw luxontw closed this as completed May 19, 2024
@luxontw luxontw reopened this May 19, 2024
@quic-cvanscha
Copy link
Contributor

quic-cvanscha commented May 20, 2024 via email

@luxontw
Copy link
Author

luxontw commented May 20, 2024

I use the docker image of ubuntu:20.04 to compile.
During the compilation process, the error /usr/bin/ld: cannot find -lp11-kit appears, but libp11-kit-dev has been installed. Perhaps libp11-kit-dev does not provide static links library file?

[984/3052] Linking target fsdev/virtfs-proxy-helper
FAILED: fsdev/virtfs-proxy-helper 
cc -m64 -mcx16  -o fsdev/virtfs-proxy-helper fsdev/virtfs-proxy-helper.p/virtfs-proxy-helper.c.o fsdev/virtfs-proxy-helper.p/9p-marshal.c.o fsdev/virtfs-proxy-helper.p/9p-iov-marshal.c.o -Wl,--as-needed -Wl,--no-undefined -pie -Wl,--whole-archive libevent-loop-base.fa libqom.fa -Wl,--no-whole-archive -static-pie -fstack-protector-strong -Wl,-z,relro -Wl,-z,now -Wl,--start-group libqemuutil.a subprojects/libvhost-user/libvhost-user-glib.a subprojects/libvhost-user/libvhost-user.a libevent-loop-base.fa libqom.fa /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/libcap-ng.a /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/libnuma.a /usr/lib/x86_64-linux-gnu/libgio-2.0.a -ldl /usr/lib/x86_64-linux-gnu/libresolv.a /usr/lib/x86_64-linux-gnu/libgmodule-2.0.a -pthread /usr/lib/x86_64-linux-gnu/libz.a /usr/lib/x86_64-linux-gnu/libmount.a /usr/lib/x86_64-linux-gnu/libblkid.a /usr/lib/x86_64-linux-gnu/libselinux.a /usr/lib/x86_64-linux-gnu/libsepol.a /usr/lib/x86_64-linux-gnu/libpcre2-8.a /usr/lib/x86_64-linux-gnu/libgobject-2.0.a /usr/lib/x86_64-linux-gnu/libffi.a /usr/lib/x86_64-linux-gnu/libglib-2.0.a /usr/lib/x86_64-linux-gnu/libpcre.a /usr/lib/x86_64-linux-gnu/libgnutls.a /usr/lib/x86_64-linux-gnu/libgmp.a /usr/lib/x86_64-linux-gnu/libunistring.a /usr/lib/x86_64-linux-gnu/libidn2.a /usr/lib/gcc/x86_64-linux-gnu/9/libatomic.a /usr/lib/x86_64-linux-gnu/libhogweed.a /usr/lib/x86_64-linux-gnu/libnettle.a /usr/lib/x86_64-linux-gnu/libtasn1.a -lp11-kit -L/usr/lib/x86_64-linux-gnu -lgcrypt /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/libgpg-error.a -lm -Wl,--end-group
/usr/bin/ld: cannot find -lp11-kit
collect2: error: ld returned 1 exit status
[985/3052] Compiling C object tests/qtest/libqos/libqos.fa.p/.._libqmp.c.o
[986/3052] Compiling C object tests/qtest/libqos/libqos.fa.p/qgraph.c.o
[987/3052] Compiling C object tests/qtest/libqos/libqos.fa.p/virtio-balloon.c.o
[988/3052] Compiling C object tests/qtest/libqos/libqos.fa.p/.._libqtest.c.o
[989/3052] Compiling C object tests/qtest/libqos/libqos.fa.p/qos_external.c.o
[990/3052] Compiling C object tcg/libtcg_system.fa.p/optimize.c.o
[991/3052] Compiling C object tcg/libtcg_system.fa.p/tcg-op-vec.c.o
[992/3052] Compiling C object tcg/libtcg_system.fa.p/tcg-op.c.o
[993/3052] Compiling C object tcg/libtcg_system.fa.p/tcg-op-ldst.c.o
[994/3052] Compiling C object tcg/libtcg_system.fa.p/tcg-op-gvec.c.o
[995/3052] Compiling C object tcg/libtcg_system.fa.p/tcg.c.o
ninja: build stopped: subcommand failed.
make[1]: *** [Makefile:167: run-ninja] Error 1
make[1]: Leaving directory '/root/qemu/build'
make: *** [GNUmakefile:6: build] Error 2
root@hp-envy-laptop:~/qemu# dpkg -l | grep libp11-kit-dev
ii  libp11-kit-dev:amd64                 0.23.20-1ubuntu0.1                amd64        library for loading and coordinating access to PKCS#11 modules - development

@pahmann
Copy link

pahmann commented May 22, 2024

Also you can get some information about qemu support from the Linaro Connect. https://resources.linaro.org/de/resource/3HVmrEyRwRqb7L5EC3QZkT

Maybe this is useful for you @luxontw

@quic-yvasi
Copy link

Hi luxontw, can you please confirm if you are building the image according to instructions from
https://github.com/quic/gunyah-support-scripts/blob/develop/quickstart.md
or is this from somewhere else with any additional patches?
Also are you building Qemu on your native machine or within the docker environment?

@luxontw
Copy link
Author

luxontw commented May 24, 2024

Hi luxontw, can you please confirm if you are building the image according to instructions from quic/gunyah-support-scripts@develop/quickstart.md or is this from somewhere else with any additional patches? Also are you building Qemu on your native machine or within the docker environment?

I am currently compiling qemu using the image provided by quic, but the error is still displayed.

[994/2944] Linking target tests/bench/bufferiszero-bench
FAILED: tests/bench/bufferiszero-bench 
cc -m64 -mcx16  -o tests/bench/bufferiszero-bench tests/bench/bufferiszero-bench.p/bufferiszero-bench.c.o -Wl,--as-needed -Wl,--no-undefined -pie -Wl,--whole-archive libevent-loop-base.fa libqom.fa -Wl,--no-whole-archive -static-pie -fstack-protector-strong -Wl,-z,relro -Wl,-z,now -Wl,--start-group libqemuutil.a subprojects/libvhost-user/libvhost-user-glib.a subprojects/libvhost-user/libvhost-user.a libevent-loop-base.fa libqom.fa /usr/lib/x86_64-linux-gnu/libgio-2.0.a /usr/lib/x86_64-linux-gnu/libgmodule-2.0.a -pthread /usr/lib/x86_64-linux-gnu/libz.a -ldl /usr/lib/x86_64-linux-gnu/libblkid.a /usr/lib/x86_64-linux-gnu/libselinux.a /usr/lib/x86_64-linux-gnu/libsepol.a /usr/lib/x86_64-linux-gnu/libpcre2-8.a /usr/lib/x86_64-linux-gnu/libgobject-2.0.a /usr/lib/x86_64-linux-gnu/libffi.a /usr/lib/x86_64-linux-gnu/libglib-2.0.a -lm /usr/lib/x86_64-linux-gnu/libpcre.a -lmount -lmount -Wl,--end-group
/usr/bin/ld: cannot find -lmount: No such file or directory
/usr/bin/ld: cannot find -lmount: No such file or directory
collect2: error: ld returned 1 exit status
[995/2944] Compiling C object tests/qtest/libqos/libqos.fa.p/rtas.c.o
[996/2944] Compiling C object tests/qtest/libqos/libqos.fa.p/qgraph.c.o
[997/2944] Compiling C object tests/qtest/libqos/libqos.fa.p/libqos-spapr.c.o
[998/2944] Compiling C object tests/qtest/libqos/libqos.fa.p/libqos-malloc.c.o
[999/2944] Compiling C object tests/qtest/libqos/libqos.fa.p/fw_cfg.c.o
[1000/2944] Compiling C object tcg/libtcg_system.fa.p/tcg-op-vec.c.o
[1001/2944] Compiling C object tcg/libtcg_system.fa.p/optimize.c.o
[1002/2944] Compiling C object tcg/libtcg_system.fa.p/tcg-op.c.o
[1003/2944] Compiling C object tcg/libtcg_system.fa.p/tcg-op-ldst.c.o
[1004/2944] Compiling C object tcg/libtcg_system.fa.p/tcg-op-gvec.c.o
[1005/2944] Compiling C object tcg/libtcg_system.fa.p/tcg.c.o
ninja: build stopped: subcommand failed.
make[1]: *** [Makefile:167: run-ninja] Error 1
make[1]: Leaving directory '/home/luxon/qemu/build'
make: *** [GNUmakefile:6: build] Error 2
(gunyah-venv) luxon@hyp-dev-env:~/qemu$ 

My compilation process is as follows:

git clone https://github.com/patchew-project/qemu.git
git checkout patchew/[email protected]
git submodule init
git submodule update --recursive
./configure --target-list=aarch64-softmmu --enable-debug --enable-gunyah --static
make -j12

I mainly want to run qemu with gunyah support on a Snapdragon 8gen3 Android device with root privileges.

@quic-yvasi
Copy link

I use the docker image of ubuntu:20.04 to compile. During the compilation process, the error /usr/bin/ld: cannot find -lp11-kit appears, but libp11-kit-dev has been installed. Perhaps libp11-kit-dev does not provide static links library file?

[984/3052] Linking target fsdev/virtfs-proxy-helper
FAILED: fsdev/virtfs-proxy-helper 
cc -m64 -mcx16  -o fsdev/virtfs-proxy-helper fsdev/virtfs-proxy-helper.p/virtfs-proxy-helper.c.o fsdev/virtfs-proxy-helper.p/9p-marshal.c.o fsdev/virtfs-proxy-helper.p/9p-iov-marshal.c.o -Wl,--as-needed -Wl,--no-undefined -pie -Wl,--whole-archive libevent-loop-base.fa libqom.fa -Wl,--no-whole-archive -static-pie -fstack-protector-strong -Wl,-z,relro -Wl,-z,now -Wl,--start-group libqemuutil.a subprojects/libvhost-user/libvhost-user-glib.a subprojects/libvhost-user/libvhost-user.a libevent-loop-base.fa libqom.fa /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/libcap-ng.a /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/libnuma.a /usr/lib/x86_64-linux-gnu/libgio-2.0.a -ldl /usr/lib/x86_64-linux-gnu/libresolv.a /usr/lib/x86_64-linux-gnu/libgmodule-2.0.a -pthread /usr/lib/x86_64-linux-gnu/libz.a /usr/lib/x86_64-linux-gnu/libmount.a /usr/lib/x86_64-linux-gnu/libblkid.a /usr/lib/x86_64-linux-gnu/libselinux.a /usr/lib/x86_64-linux-gnu/libsepol.a /usr/lib/x86_64-linux-gnu/libpcre2-8.a /usr/lib/x86_64-linux-gnu/libgobject-2.0.a /usr/lib/x86_64-linux-gnu/libffi.a /usr/lib/x86_64-linux-gnu/libglib-2.0.a /usr/lib/x86_64-linux-gnu/libpcre.a /usr/lib/x86_64-linux-gnu/libgnutls.a /usr/lib/x86_64-linux-gnu/libgmp.a /usr/lib/x86_64-linux-gnu/libunistring.a /usr/lib/x86_64-linux-gnu/libidn2.a /usr/lib/gcc/x86_64-linux-gnu/9/libatomic.a /usr/lib/x86_64-linux-gnu/libhogweed.a /usr/lib/x86_64-linux-gnu/libnettle.a /usr/lib/x86_64-linux-gnu/libtasn1.a -lp11-kit -L/usr/lib/x86_64-linux-gnu -lgcrypt /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/libgpg-error.a -lm -Wl,--end-group
/usr/bin/ld: cannot find -lp11-kit
collect2: error: ld returned 1 exit status
[985/3052] Compiling C object tests/qtest/libqos/libqos.fa.p/.._libqmp.c.o
[986/3052] Compiling C object tests/qtest/libqos/libqos.fa.p/qgraph.c.o
[987/3052] Compiling C object tests/qtest/libqos/libqos.fa.p/virtio-balloon.c.o
[988/3052] Compiling C object tests/qtest/libqos/libqos.fa.p/.._libqtest.c.o
[989/3052] Compiling C object tests/qtest/libqos/libqos.fa.p/qos_external.c.o
[990/3052] Compiling C object tcg/libtcg_system.fa.p/optimize.c.o
[991/3052] Compiling C object tcg/libtcg_system.fa.p/tcg-op-vec.c.o
[992/3052] Compiling C object tcg/libtcg_system.fa.p/tcg-op.c.o
[993/3052] Compiling C object tcg/libtcg_system.fa.p/tcg-op-ldst.c.o
[994/3052] Compiling C object tcg/libtcg_system.fa.p/tcg-op-gvec.c.o
[995/3052] Compiling C object tcg/libtcg_system.fa.p/tcg.c.o
ninja: build stopped: subcommand failed.
make[1]: *** [Makefile:167: run-ninja] Error 1
make[1]: Leaving directory '/root/qemu/build'
make: *** [GNUmakefile:6: build] Error 2
root@hp-envy-laptop:~/qemu# dpkg -l | grep libp11-kit-dev
ii  libp11-kit-dev:amd64                 0.23.20-1ubuntu0.1                amd64        library for loading and coordinating access to PKCS#11 modules - development

Note that the libp11-kit-dev that its showing is amd64, which will not work to link to AARCH64 objects/binaries.

@vsrivatsa1
Copy link

Hi luxontw, can you please confirm if you are building the image according to instructions from quic/gunyah-support-scripts@develop/quickstart.md or is this from somewhere else with any additional patches? Also are you building Qemu on your native machine or within the docker environment?

I am currently compiling qemu using the image provided by quic, but the error is still displayed.

[994/2944] Linking target tests/bench/bufferiszero-bench
FAILED: tests/bench/bufferiszero-bench 
cc -m64 -mcx16  -o tests/bench/bufferiszero-bench tests/bench/bufferiszero-bench.p/bufferiszero-bench.c.o -Wl,--as-needed -Wl,--no-undefined -pie -Wl,--whole-archive libevent-loop-base.fa libqom.fa -Wl,--no-whole-archive -static-pie -fstack-protector-strong -Wl,-z,relro -Wl,-z,now -Wl,--start-group libqemuutil.a subprojects/libvhost-user/libvhost-user-glib.a subprojects/libvhost-user/libvhost-user.a libevent-loop-base.fa libqom.fa /usr/lib/x86_64-linux-gnu/libgio-2.0.a /usr/lib/x86_64-linux-gnu/libgmodule-2.0.a -pthread /usr/lib/x86_64-linux-gnu/libz.a -ldl /usr/lib/x86_64-linux-gnu/libblkid.a /usr/lib/x86_64-linux-gnu/libselinux.a /usr/lib/x86_64-linux-gnu/libsepol.a /usr/lib/x86_64-linux-gnu/libpcre2-8.a /usr/lib/x86_64-linux-gnu/libgobject-2.0.a /usr/lib/x86_64-linux-gnu/libffi.a /usr/lib/x86_64-linux-gnu/libglib-2.0.a -lm /usr/lib/x86_64-linux-gnu/libpcre.a -lmount -lmount -Wl,--end-group
/usr/bin/ld: cannot find -lmount: No such file or directory
/usr/bin/ld: cannot find -lmount: No such file or directory
collect2: error: ld returned 1 exit status
[995/2944] Compiling C object tests/qtest/libqos/libqos.fa.p/rtas.c.o
[996/2944] Compiling C object tests/qtest/libqos/libqos.fa.p/qgraph.c.o
[997/2944] Compiling C object tests/qtest/libqos/libqos.fa.p/libqos-spapr.c.o
[998/2944] Compiling C object tests/qtest/libqos/libqos.fa.p/libqos-malloc.c.o
[999/2944] Compiling C object tests/qtest/libqos/libqos.fa.p/fw_cfg.c.o
[1000/2944] Compiling C object tcg/libtcg_system.fa.p/tcg-op-vec.c.o
[1001/2944] Compiling C object tcg/libtcg_system.fa.p/optimize.c.o
[1002/2944] Compiling C object tcg/libtcg_system.fa.p/tcg-op.c.o
[1003/2944] Compiling C object tcg/libtcg_system.fa.p/tcg-op-ldst.c.o
[1004/2944] Compiling C object tcg/libtcg_system.fa.p/tcg-op-gvec.c.o
[1005/2944] Compiling C object tcg/libtcg_system.fa.p/tcg.c.o
ninja: build stopped: subcommand failed.
make[1]: *** [Makefile:167: run-ninja] Error 1
make[1]: Leaving directory '/home/luxon/qemu/build'
make: *** [GNUmakefile:6: build] Error 2
(gunyah-venv) luxon@hyp-dev-env:~/qemu$ 

My compilation process is as follows:

git clone https://github.com/patchew-project/qemu.git
git checkout patchew/[email protected]
git submodule init
git submodule update --recursive
./configure --target-list=aarch64-softmmu --enable-debug --enable-gunyah --static
make -j12

I mainly want to run qemu with gunyah support on a Snapdragon 8gen3 Android device with root privileges.

Can you try this configure cmd?

./configure --target-list=aarch64-softmmu --static --disable-gio

I think disable-gio should help get you past the libmount issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants