Phala-Network / phala-blockchain

The Phala Network Blockchain, pRuntime and the bridge.
https://phala.network
Apache License 2.0
332 stars 149 forks source link

ERROR:SGX_ERROR_UNRECOGNIZED_PLATFORM #245

Closed wcw84 closed 3 years ago

wcw84 commented 3 years ago

Hi guys,

I found the error below from pRuntime logs, when i started pHost via Phala-Network/solo-mining-scripts:

[2021-07-01T06:57:16Z INFO rocket::rocket] POST /get_info application/json: [2021-07-01T06:57:16Z INFO rocket::rocket] Matched: POST /get_info application/json (get_info) [2021-07-01T06:57:16Z INFO rocket::rocket] Outcome: Success [2021-07-01T06:57:16Z INFO rocket::rocket] Response succeeded. [2021-07-01T06:57:16Z INFO rocket::rocket] POST /init_runtime application/json: [2021-07-01T06:57:16Z INFO rocket::rocket] Matched: POST /init_runtime application/json (init_runtime) [2021-07-01T06:57:16Z INFO enclaveapp] Identity pubkey: "02a422498940155d4e67db253f89ed660c100d013b9c670a2b75be762c9fa87b73" [2021-07-01T06:57:16Z INFO enclaveapp] ECDH pubkey: "04589b893b7f4e5da619336f4593904e030f1e35f71e579ea3693db1d13d887c81159412a381c54c9a4cf1830c1d6ad20dc16dc6dad4d7db3faa4a894a35931fe5" [2021-07-01T06:57:16Z INFO enclaveapp] CPU cores: 2 [2021-07-01T06:57:16Z INFO enclaveapp] CPU Support AVX2 [2021-07-01T06:57:16Z INFO enclaveapp] CPU Support AVX512 [2021-07-01T06:57:16Z INFO enclaveapp] Encoded runtime info [2021-07-01T06:57:16Z INFO enclaveapp] "01000000bbacc4283cedbe2094ef28cd289433eb02a422498940155d4e67db253f89ed660c100d013b9c670a2b75be762c9fa87b73080200000003000000" [2021-07-01T06:57:16Z INFO app] Entering ocall_sgx_init_quote aesm_service[16]: [ADMIN]EPID Provisioning initiated aesm_service[16]: The Request ID is a4db8c8dd3fd407bb89a910ec98c4a81 aesm_service[16]: The Request ID is 4e2d3424395042d18c7f849df5534199 aesm_service[16]: [ADMIN]EPID Provisioning protocol error reported by Backend (6) aesmservice[16]: [ADMIN]EPID Provisioning failed [2021-07-01T06:57:19Z INFO enclaveapp] eg = [0, 0, 0, 0] **[2021-07-01T06:57:19Z ERROR enclaveapp] Error in create_attestation_report: SGX_ERROR_UNRECOGNIZEDPLATFORM** [2021-07-01T06:57:19Z INFO enclaveapp] {"payload":"{\"message\":\"Error while connecting to IAS\"}","signature":"8d79835a41c53bac920941f298f0fa16184fd3d219086a3d21608f9f922192ac1eaaf5660788564d0b722596bcb3c221887da6ad4f0de9d8b41ebcad47874b71","status":"error"} [2021-07-01T06:57:19Z INFO rocket::rocket] Outcome: Success [2021-07-01T06:57:19Z INFO rocket::rocket] Response succeeded.

And i found the details of SGX_ERROR_UNRECOGNIZED_PLATFORM from the sgx_error.h:

SGX_ERROR_UNRECOGNIZED_PLATFORM = SGX_MK_ERROR(0x4012), / EPID Provisioning failed due to platform not recognized by backend server/

And this is the output of phala sgx-test:

Docker version 20.10.7, build f0df350 Sleep 6s aesm_service[15]: The server sock is 0x5588aaf9d130 Detecting SGX, this may take a minute... aesm_service[15]: Malformed request received (May be forged for attack) aesm_service[15]: InKernel LE loaded aesm_service[15]: InKernel LE loaded aesm_service[15]: InKernel LE loaded aesm_service[15]: InKernel LE loaded aesm_service[15]: InKernel LE loaded aesm_service[15]: InKernel LE loaded aesm_service[15]: InKernel LE loaded aesm_service[15]: InKernel LE loaded ? SGX instruction set ✔ CPU support ✔ CPU configuration ✔ Enclave attributes ? Enclave Page Cache SGX features ✔ SGX2 ✔ EXINFO ✘ ENCLV ✘ OVERSUB ✔ KSS
Total EPC size: 0.0MiB ✔ Flexible launch control ✔ CPU support ? CPU configuration ✔ Able to launch production mode enclave ✔ SGX system software ✔ SGX kernel device (/dev/sgx/enclave) ✔ libsgx_enclave_common ✔ AESM service ✔ Able to launch enclaves ✔ Debug mode ✔ Production mode ✔ Production mode (Intel whitelisted)

🕮 SGX instruction set > Enclave Page Cache Your hardware supports SGX, but the Enclave Page Cache (EPC) is misconfigured. This could indicate a CPU or hypervisor bug.

debug: CPUID.(EAX=12H,ECX=2H):ECX[3:0] = Unknown

More information: https://edp.fortanix.com/docs/installation/help/#invalid-cpuid Generated machine id: [187, 172, 196, 40, 60, 237, 190, 32, 148, 239, 40, 205, 40, 148, 51, 235]

CPU Cores: 2

Encoded runtime info: [1, 0, 0, 0, 187, 172, 196, 40, 60, 237, 190, 32, 148, 239, 40, 205, 40, 148, 51, 235, 3, 184, 68, 6, 185, 224, 56, 175, 40, 191, 114, 176, 165, 187, 44, 222, 2, 169, 209, 76, 141, 167, 59, 27, 234, 61, 38, 88, 90, 108, 4, 121, 199, 8, 2, 0, 0, 0, 1, 0, 0, 0] Testing RA... aesm_service[15]: [ADMIN]EPID Provisioning initiated aesm_service[15]: The Request ID is 565d229e05fa4a63a2e2fbc77aa48f98 aesm_service[15]: The Request ID is f8b3179c130745d982ccdbed44c30c0c aesm_service[15]: [ADMIN]EPID Provisioning protocol error reported by Backend (6) aesm_service[15]: [ADMIN]EPID Provisioning failed thread '' panicked at 'error while doing remote attestation: SGX_ERROR_UNRECOGNIZED_PLATFORM', src/lib.rs:448:132 note: Call backtrace::enable_backtrace with 'PrintFormat::Short/Full' for a backtrace. fatal runtime error: failed to initiate panic, error 5 ./start_sgx_detect.sh: line 20: 41 Illegal instruction (core dumped) ./app

It seems that my machine support sgx except EPID, is there any way to fix that?

h4x3rotab commented 3 years ago

Have you tried to switch the driver (SGX or DCAP driver)? What's your CPU and mobo?

wcw84 commented 3 years ago

Have you tried to switch the driver (SGX or DCAP driver)? What's your CPU and mobo?

How to switch? I just followed solo-mining-scripts, I can't find anything about it.

And the cpu model name is: 8369

h4x3rotab commented 3 years ago

No wonder. Xeon 8369 is the latest generation CPU. It only supports SGX 2.0 (while Phala is currently on SGX 1.0). We are working hard to add the support, but there's no concrete timeline yet.

wcw84 commented 3 years ago

No wonder. Xeon 8369 is the latest generation CPU. It only supports SGX 2.0 (while Phala is currently on SGX 1.0). We are working hard to add the support, but there's no concrete timeline yet.

Oops... So you mean if i want to run phala, I need to buy some older hardwares?

h4x3rotab commented 3 years ago

Yes, SGX is required if you run on mainnet. Testing can be done with SGX_MODE=SW make

maybeTomorrow commented 3 years ago

is the latest generation CPU. It only supports SGX 2.0 (while Phala is currently on SGX 1.0). We are working hard to add the support, but there's no concrete timeline yet

does Gold 6330 suport SGX1.0?

maybeTomorrow commented 3 years ago

SGX instruction set ✔ CPU support ✔ CPU configuration ✔ Enclave attributes ? Enclave Page Cache SGX features ✔ SGX2 ✔ EXINFO ✘ ENCLV ✘ OVERSUB ✔ KSS
Total EPC size: 0.0MiB ✔ Flexible launch control ✔ CPU support ? CPU configuration ✔ Able to launch production mode enclave ✔ SGX system software ✔ SGX kernel device (/dev/sgx/enclave) ✔ libsgx_enclave_common ✔ AESM service ✔ Able to launch enclaves ✔ Debug mode ✔ Production mode ✔ Production mode (Intel whitelisted)

🕮 SGX instruction set > Enclave Page Cache Your hardware supports SGX, but the Enclave Page Cache (EPC) is misconfigured. This could indicate a CPU or hypervisor bug.

debug: CPUID.(EAX=12H,ECX=2H):ECX[3:0] = Unknown debug: CPUID.(EAX=12H,ECX=3H):ECX[3:0] = Unknown

More information: https://edp.fortanix.com/docs/installation/help/#invalid-cpuid Generated machine id: [169, 85, 218, 206, 115, 126, 2, 40, 89, 161, 16, 245, 160, 60, 21, 96]

CPU Cores: 112

Encoded runtime info: [1, 0, 0, 0, 169, 85, 218, 206, 115, 126, 2, 40, 89, 161, 16, 245, 160, 60, 21, 96, 3, 87, 134, 148, 165, 150, 23, 166, 116, 10, 133, 220, 162, 61, 196, 218, 158, 25, 59, 147, 41, 105, 83, 93, 108, 138, 85, 202, 236, 167, 223, 121, 224, 8, 112, 0, 0, 0, 1, 0, 0, 0] Testing RA... aesm_service[16]: [ADMIN]EPID Provisioning initiated aesm_service[16]: The Request ID is f81c63195f434c78a4c1df2f177bb8d3 aesm_service[16]: The Request ID is a265de9dbd104df58b3982d4566d028d aesm_service[16]: [ADMIN]EPID Provisioning protocol error reported by Backend (6) aesm_service[16]: [ADMIN]EPID Provisioning failed thread '' panicked at 'error while doing remote attestation: SGX_ERROR_UNRECOGNIZED_PLATFORM', src/lib.rs:448:132 note: Call backtrace::enable_backtrace with 'PrintFormat::Short/Full' for a backtrace. fatal runtime error: failed to initiate panic, error 5 ./start_sgx_detect.sh: line 20: 42 Illegal instruction (core dumped) ./app

h4x3rotab commented 3 years ago

is the latest generation CPU. It only supports SGX 2.0 (while Phala is currently on SGX 1.0). We are working hard to add the support, but there's no concrete timeline yet

does Gold 6330 suport SGX1.0?

No. To our best knowledge, Xeon except E3 don't support SGX1.0

tanter commented 3 years ago

I have the same problem

? SGX instruction set ✔ CPU support ✔ CPU configuration ✔ Enclave attributes ? Enclave Page Cache SGX features ✔ SGX2 ✔ EXINFO ✘ ENCLV ✘ OVERSUB ✔ KSS
Total EPC size: 0.0MiB ✔ Flexible launch control ✔ CPU support ? CPU configuration ✔ Able to launch production mode enclave ✔ SGX system software ✔ SGX kernel device (/dev/sgx/enclave) ✔ libsgx_enclave_common ✔ AESM service ✔ Able to launch enclaves ✔ Debug mode ✔ Production mode ✔ Production mode (Intel whitelisted)

🕮 SGX instruction set > Enclave Page Cache Your hardware supports SGX, but the Enclave Page Cache (EPC) is misconfigured. This could indicate a CPU or hypervisor bug.

debug: CPUID.(EAX=12H,ECX=2H):ECX[3:0] = Unknown

More information: https://edp.fortanix.com/docs/installation/help/#invalid-cpuid Generated machine id: [160, 10, 33, 83, 90, 137, 251, 130, 69, 198, 62, 99, 5, 106, 226, 107]

CPU Cores: 48

Encoded runtime info: [1, 0, 0, 0, 160, 10, 33, 83, 90, 137, 251, 130, 69, 198, 62, 99, 5, 106, 226, 107, 3, 108, 162, 232, 239, 217, 48, 217, 164, 173, 210, 195, 84, 185, 221, 136, 181, 7, 12, 42, 104, 147, 104, 223, 242, 160, 177, 14, 206, 85, 223, 213, 33, 8, 48, 0, 0, 0, 1, 0, 0, 0] Testing RA... aesm_service[15]: [ADMIN]EPID Provisioning initiated aesm_service[15]: The Request ID is 7384b2bdea5c470ab393b7197d28b186 aesm_service[15]: The Request ID is bec5fcf66293418981ae9d908d38d57e aesm_service[15]: [ADMIN]EPID Provisioning protocol error reported by Backend (6) aesm_service[15]: [ADMIN]EPID Provisioning failed thread '' panicked at 'error while doing remote attestation: SGX_ERROR_UNRECOGNIZED_PLATFORM', src/lib.rs:448:132 note: Call backtrace::enable_backtrace with 'PrintFormat::Short/Full' for a backtrace. fatal runtime error: failed to initiate panic, error 5 ./start_sgx_detect.sh: line 20: 41 Illegal instruction (core dumped) ./app

h4x3rotab commented 3 years ago

This is an hardware issue, not relevant to the development. Closing now