RE: [PATCH] whpx: Added support for saving/restoring VM state

2022-05-18 Thread Ivan Shcherbakov
evel On Behalf Of Paolo Bonzini Sent: Tuesday, May 17, 2022 7:12 AM To: Ivan Shcherbakov ; qemu-devel@nongnu.org Subject: Re: [PATCH] whpx: Added support for saving/restoring VM state On 5/16/22 20:44, Ivan Shcherbakov wrote: > Passing it to x86_cpu_xrstor_all_areas()/x86_cpu_xsave_all_area

Re: [PATCH] whpx: Added support for saving/restoring VM state

2022-05-17 Thread Paolo Bonzini
On 5/16/22 20:44, Ivan Shcherbakov wrote: Passing it to x86_cpu_xrstor_all_areas()/x86_cpu_xsave_all_areas() changed the following values: 0x001C: ff ff -> 00 00 0x0208: 07 -> 00 0x020F: 80 -> 00 0x1C-0x1F is MXCSR_MASK. There's already a field in the x86 CPUState, but it was fo

RE: [PATCH] whpx: Added support for saving/restoring VM state

2022-05-16 Thread Ivan Shcherbakov
Hi Paolo, >What are the differences? Is it using the XSAVEC/XSAVES ("compacted") format? I am not very familiar with the format internals, so I briefly checked whether I could reuse the general logic from the HVF port. Here's what I got on a booted Linux VM: WHvGetVirtualProcessorXsaveState()

Re: [PATCH] whpx: Added support for saving/restoring VM state

2022-05-14 Thread Paolo Bonzini
On 5/14/22 03:29, Ivan Shcherbakov wrote: +/* + * As of Windows 10 21H1, the layout of the XSAVE data returned by the WHPX API + * does not match the layout used by QEMU. + * + * Specifically, trying to pass the state returned by x86_cpu_xsave_all_areas() + * to WHvSetVirtualProcessorXsaveState()

[PATCH] whpx: Added support for saving/restoring VM state

2022-05-13 Thread Ivan Shcherbakov
This patch adds support for the savevm/loadvm commands when using WHPX. It saves the XSAVE state and the relevant internal registers that were not otherwise captured into a separate "whpx/cpustate" object in the snapshot, and restores them when the snapshot is loaded. Note that due to the XSAVE f

[PATCH] whpx: Added support for saving/restoring VM state

2022-05-13 Thread Ivan Shcherbakov
This patch adds support for the savevm/loadvm commands when using WHPX. It saves the XSAVE state and the relevant internal registers that were not otherwise captured into a separate "whpx/cpustate" object in the snapshot, and restores them when the snapshot is loaded. Note that due to the