intel / qemu-sgx

Other
71 stars 29 forks source link

Error while running 'make' command #6

Closed gokhalesushant65 closed 4 years ago

gokhalesushant65 commented 5 years ago

This is my OS info:

dell@dell-OptiPlex-7050:~/mtech/qemu-sgx/build$ lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 16.04.6 LTS Release: 16.04 Codename: xenial

I am trying to apply the patch to qemu for virtualizing sgx from the tag sgx-v3.0.0-r2 . Getting the following error after firing 'make' command: qemuSGX_make_error.txt

The same error occurs with the latest tag (i.e. sgx-v3.1.0-r1).

Note: In ubuntu 18.04, this is running completely fine.

sean-jc commented 5 years ago

Does adding #include "qemu/typedefs.h" to include/sysemu/hostmem.h resolve the build error?

gokhalesushant65 commented 5 years ago

No, it didn't resolve the error.

gokhalesushant65 commented 5 years ago

Have started getting the same error for ubuntu 18.04 for the tag sgx-v3.0.0-r2

sean-jc commented 5 years ago

That sounds like an issue in your build environment and/or config. sgx-v3.0.0-r2 doesn't implement EPC as a memory backend, i.e. shouldn't touch hostmem.h whatsoever. Can you reproduce the error from a clean build directory?

gokhalesushant65 commented 5 years ago

Tried to build with a fresh build environment. But Getting the same error on ubuntu 18.04 and ubuntu 16.04 as well.

gokhalesushant65 commented 5 years ago

I reinstalled ubuntu 18.04 and downloaded the repos kvm sgx-v4.19.1-r1 and qemu sgx-v3.0.0-r2 and tried again but the error persists.

Note that on the host I don't have sgx driver, SDK and PSW. But I had succeeded once patching QEMU even without sgx driver, SDK and PSW on the host machine (and had run enclave programs in hardware mode on the guest).

Now, I am not able to find what's going wrong. Please let me know.

sean-jc commented 5 years ago

Please attach your config.status, I'll try to reproduce.

gokhalesushant65 commented 5 years ago

Attaching as 'config.txt' as uploading of file with '.status' is unsupported: config.txt

Also, adding 'config.log' if you want(I dont know the reason behind lot of errors in the log): config.log

gokhalesushant65 commented 5 years ago

I could compile successfully with following command. Thanks for help.

../configure --target-list=x86_64-softmmu

Now, having applied the QEMU patch, when I try to start with the virtual machine with 'epc' option, it gives me the following error:

dell@dell-OptiPlex-7050:~$ sudo qemu-system-x86_64 -enable-kvm -machine epc=40M -machine epc-below-4g=auto -m 8G -cpu host ~/qemu_images/ubuntu_18_04.qcow2 -vga qxl [sudo] password for dell: qemu-system-x86_64: Property '.epc' not found

What should be done?

sean-jc commented 5 years ago

The most recent Qemu build implements EPC as a memory backend. See the README for details on how to enable EPC with the new command line options.