Re: [PATCH v2 5/5] sgx: Reset the vEPC regions during VM reboot

2021-10-26 Thread Yang Zhong
On Fri, Oct 22, 2021 at 11:46:30PM +0200, Paolo Bonzini wrote: > On 22/10/21 21:27, Yang Zhong wrote: > >+ > >+for (j = 0; j < num; j++) { > >+epc = pcms->sgx_epc.sections[j]; > >+hostmem = MEMORY_BACKEND(epc->hostmem); > >+fd = memory_region_get_fd(host_memory_backend_g

Re: [PATCH v2 5/5] sgx: Reset the vEPC regions during VM reboot

2021-10-22 Thread Paolo Bonzini
On 22/10/21 21:27, Yang Zhong wrote: + +for (j = 0; j < num; j++) { +epc = pcms->sgx_epc.sections[j]; +hostmem = MEMORY_BACKEND(epc->hostmem); +fd = memory_region_get_fd(host_memory_backend_get_memory(hostmem)); + +failures = ioctl(fd, SGX_IOC_VEPC_REMOVE_ALL);

[PATCH v2 5/5] sgx: Reset the vEPC regions during VM reboot

2021-10-22 Thread Yang Zhong
For bare-metal SGX on real hardware, the hardware provides guarantees SGX state at reboot. For instance, all pages start out uninitialized. The vepc driver provides a similar guarantee today for freshly-opened vepc instances, but guests such as Windows expect all pages to be in uninitialized state