asterinas / hyperenclave

HyperEnclave is an open and cross-platform trusted execution environment.
Apache License 2.0
25 stars 4 forks source link

An 'I/O error: VmFailInvalid' occurred when trying to enable Intel MKTME, which was just a very simple attempt. #13

Open bronzeMe opened 2 weeks ago

bronzeMe commented 2 weeks ago

An 'I/O error: VmFailInvalid' occurred when trying to enable Intel MKTME, which was just a very simple attempt and is still under debugging.

You can find the simple patch codes at mktme test

Step1: Programming (initializing) an MKTME KeyID (keyid == 1) using the PCONFIG instruction via a kernel module. The implementation of the kernel module is referenced at Program new PCONFIG targets with MKTME keys

Step2: Start the patched hyperenclave.

The following are the serial port logs from ipmitool tool.

We are still debugging this issue, and any suggestions or tips you could provide would be greatly appreciated, as they could help speed up the process.

Thanks.

Secondary CPU 22 entered.
Secondary CPU 134 entered.
Secondary CPU 15 entered.
Secondary CPU 4 entered.
Secondary CPU 30 entered.
Secondary CPU 26 entered.
Secondary CPU 165 entered.
Secondary CPU 147 entered.
Secondary CPU 112 entered.
Secondary CPU 142 entered.
Secondary CPU 0 entered.
Secondary CPU 138 entered.
Secondary CPU 166 entered.
Secondary CPU 121 entered.
Secondary CPU 212 entered.
Secondary CPU 62 entered.
Secondary CPU 35 entered.
Secondary CPU 51 entered.
Secondary CPU 8 entered.
Secondary CPU 150 entered.
Secondary CPU 161 entered.
Secondary CPU 139 entered.
Secondary CPU 156 entered.
Secondary CPU 126 entered.
Secondary CPU 163 entered.
Secondary CPU 53 entered.
Secondary CPU 118 entered.
Secondary CPU 9 entered.
Secondary CPU 46 entered.
Secondary CPU 162 entered.
Secondary CPU 55 entered.
Secondary CPU 174 entered.
Secondary CPU 167 entered.
Secondary CPU 74 entered.
Secondary CPU 50 entered.
Secondary CPU 109 entered.
Secondary CPU 172 entered.
Secondary CPU 164 entered.
Secondary CPU 117 entered.
Secondary CPU 116 entered.
Secondary CPU 186 entered.
Secondary CPU 44 entered.
Secondary CPU 38 entered.
Secondary CPU 49 entered.
Secondary CPU 137 entered.
Secondary CPU 34 entered.
Secondary CPU 149 entered.
Secondary CPU 32 entered.
Secondary CPU 14 entered.
Secondary CPU 41 entered.
Secondary CPU 140 entered.
Secondary CPU 24 entered.
Secondary CPU 144 entered.
Secondary CPU 135 entered.
Secondary CPU 6 entered.
Secondary CPU 18 entered.
Secondary CPU 13 entered.
Secondary CPU 120 entered.
Secondary CPU 158 entered.
Secondary CPU 5 entered.
Secondary CPU 2 entered.
Secondary CPU 23 entered.
Secondary CPU 25 entered.
Secondary CPU 154 entered.
Secondary CPU 36 entered.
Secondary CPU 10 entered.
Secondary CPU 136 entered.
Secondary CPU 54 entered.
Secondary CPU 12 entered.
Secondary CPU 143 entered.
Secondary CPU 125 entered.
Secondary CPU 127 entered.
Secondary CPU 119 entered.
Secondary CPU 114 entered.
Secondary CPU 11 entered.
Secondary CPU 123 entered.
Secondary CPU 20 entered.
Secondary CPU 155 entered.
Secondary CPU 42 entered.
Secondary CPU 146 entered.
Secondary CPU 27 entered.
Secondary CPU 40 entered.
Secondary CPU 152 entered.
Secondary CPU 37 entered.
Secondary CPU 17 entered.
Secondary CPU 28 entered.
Secondary CPU 48 entered.
Secondary CPU 159 entered.
Secondary CPU 129 entered.
Secondary CPU 132 entered.
Secondary CPU 160 entered.
Secondary CPU 151 entered.
Secondary CPU 16 entered.
Secondary CPU 128 entered.
Secondary CPU 113 entered.
Secondary CPU 131 entered.
Secondary CPU 1 entered.
Secondary CPU 187 entered.
Secondary CPU 194 entered.
Secondary CPU 78 entered.
Secondary CPU 45 entered.
Secondary CPU 19 entered.
Secondary CPU 148 entered.
Secondary CPU 153 entered.
Secondary CPU 122 entered.
Secondary CPU 130 entered.
Secondary CPU 47 entered.
Secondary CPU 115 entered.
Secondary CPU 3 entered.
Secondary CPU 157 entered.
Secondary CPU 52 entered.
Secondary CPU 7 entered.
Secondary CPU 31 entered.
Secondary CPU 39 entered.
Secondary CPU 21 entered.
Secondary CPU 133 entered.
Secondary CPU 43 entered.
Secondary CPU 29 entered.
Secondary CPU 193 entered.
Primary CPU 221 entered.
Secondary CPU 56 entered.
Secondary CPU 168 entered.
Secondary CPU 141 entered.
Secondary CPU 124 entered.
Secondary CPU 145 entered.
Secondary CPU 33 entered.
Secondary CPU 178 entered.
Secondary CPU 66 entered.
Secondary CPU 81 entered.
Secondary CPU 60 entered.
Secondary CPU 106 entered.
Secondary CPU 210 entered.
Secondary CPU 97 entered.
Secondary CPU 103 entered.
Secondary CPU 82 entered.
Secondary CPU 215 entered.
Secondary CPU 206 entered.
Secondary CPU 67 entered.

Initializing hypervisor...
build_mode = release
log_level = warn
arch = x86_64
vendor = intel
stats = off
sme = off
epc = epc48

Secondary CPU 179 entered.
Secondary CPU 190 entered.
Secondary CPU 222 entered.
Secondary CPU 209 entered.
Secondary CPU 198 entered.
Secondary CPU 86 entered.
Secondary CPU 100 entered.
Secondary CPU 176 entered.
Secondary CPU 64 entered.
Secondary CPU 196 entered.
Secondary CPU 61 entered.
Secondary CPU 90 entered.
Secondary CPU 111 entered.
Secondary CPU 72 entered.
Secondary CPU 184 entered.
Secondary CPU 59 entered.
Secondary CPU 98 entered.
Secondary CPU 201 entered.
Secondary CPU 101 entered.
Secondary CPU 205 entered.
Secondary CPU 94 entered.
reclaim crypto algorithm: EncSWHmacSW
Secondary CPU 57 entered.
Secondary CPU 58 entered.
Secondary CPU 110 entered.
Secondary CPU 65 entered.
Secondary CPU 91 entered.
Secondary CPU 203 entered.
Secondary CPU 93 entered.
Secondary CPU 177 entered.
Secondary CPU 208 entered.
Secondary CPU 175 entered.
Secondary CPU 181 entered.
Secondary CPU 217 entered.
Secondary CPU 84 entered.
Secondary CPU 211 entered.
Secondary CPU 213 entered.
Secondary CPU 63 entered.
Secondary CPU 202 entered.
Secondary CPU 219 entered.
Secondary CPU 69 entered.
Secondary CPU 170 entered.
Secondary CPU 95 entered.
Secondary CPU 99 entered.
Secondary CPU 223 entered.
Secondary CPU 88 entered.
Secondary CPU 92 entered.
Secondary CPU 76 entered.
Secondary CPU 188 entered.
tpm mmio is mapped va=0xffffffff
Secondary CPU 214 entered.
[ERROR][108] [src/arch/x86_64/intel/mod.rs:51:18] I/O error: VmFailInvalid
[ERROR][42] [src/arch/x86_64/intel/mod.rs:51:18] I/O error: VmFailInvalid
[ERROR][0] [src/arch/x86_64/intel/mod.rs:51:18] I/O error: VmFailInvalid
[ERROR][71] [src/arch/x86_64/intel/mod.rs:51:18] I/O error: VmFailInvalid
[ERROR][61] [src/arch/x86_64/intel/mod.rs:51:18] I/O error: VmFailInvalid
[ERROR][33] [src/arch/x86_64/intel/mod.rs:51:18] I/O error: VmFailInvalid
Secondary CPU 195 entered.
[ERROR][168] [src/arch/x86_64/intel/mod.rs:51:18] I/O error: VmFailInvalid
Secondary CPU 71 entered.
CPU 142 return back to driver with code -5.
Bonjourz commented 1 week ago

Hi @bronzeMe

Could you provide the modified HyperEnclave-Driver mode?

To better understand what happens on your platform, could you show which line of code causes these error:

[ERROR][108] [src/arch/x86_64/intel/mod.rs:51:18] I/O error: VmFailInvalid
[ERROR][42] [src/arch/x86_64/intel/mod.rs:51:18] I/O error: VmFailInvalid
[ERROR][0] [src/arch/x86_64/intel/mod.rs:51:18] I/O error: VmFailInvalid
[ERROR][71] [src/arch/x86_64/intel/mod.rs:51:18] I/O error: VmFailInvalid
[ERROR][61] [src/arch/x86_64/intel/mod.rs:51:18] I/O error: VmFailInvalid
[ERROR][33] [src/arch/x86_64/intel/mod.rs:51:18] I/O error: VmFailInvalid