[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [QEMU PATCH v3 7/9] KVM: i386: Add support for save and
From: |
Liran Alon |
Subject: |
Re: [Qemu-devel] [QEMU PATCH v3 7/9] KVM: i386: Add support for save and restore nested state |
Date: |
Tue, 18 Jun 2019 18:50:50 +0300 |
> On 18 Jun 2019, at 18:48, Dr. David Alan Gilbert <address@hidden> wrote:
>
> * Liran Alon (address@hidden) wrote:
>>
>>> On 18 Jun 2019, at 12:03, Dr. David Alan Gilbert <address@hidden> wrote:
>>>
>>> * Liran Alon (address@hidden) wrote:
>>>>
>>>> +static const VMStateDescription vmstate_vmx_vmcs12 = {
>>>> + .name = "cpu/kvm_nested_state/vmx/vmcs12",
>>>> + .version_id = 1,
>>>> + .minimum_version_id = 1,
>>>> + .needed = vmx_vmcs12_needed,
>>>> + .fields = (VMStateField[]) {
>>>> + VMSTATE_UINT8_ARRAY(data.vmx[0].vmcs12,
>>>> + struct kvm_nested_state, 0x1000),
>>>
>>> Where did that magic 0x1000 come from?
>>
>> Currently, KVM folks (including myself), haven’t decided yet to expose
>> vmcs12 struct layout to userspace but instead to still leave it opaque.
>> The formal size of this size is VMCS12_SIZE (defined in kernel as 0x1000). I
>> was wondering if we wish to expose VMCS12_SIZE constant to userspace or not.
>> So currently I defined these __u8 arrays as 0x1000. But in case Paolo agrees
>> to expose VMCS12_SIZE, we can use that instead.
>
> Well if it's not defined it's bound to change at some state!
I agree it’s better to expose VMCS12_SIZE to userspace but I didn’t want to be
the one that decides this.
Let’s let Paolo decide and modify this patch accordingly if he decides to
expose it.
> Also, do we need to clear it before we get it from the kernel - e.g.
> is the kernel guaranteed to give us 0x1000 ?
Userspace don’t need to clear it before getting it from kernel.
It does guarantee to give you 0x1000. See vmx_get_nested_state() implementation
in kernel.
-Liran
>
> Dave
>
>> -Liran
>>
>>> --
>>> Dr. David Alan Gilbert / address@hidden / Manchester, UK
>>
> --
> Dr. David Alan Gilbert / address@hidden / Manchester, UK
- Re: [Qemu-devel] [QEMU PATCH v3 5/9] linux-headers: i386: Modify struct kvm_nested_state to have explicit fields for data, (continued)
[Qemu-devel] [QEMU PATCH v3 7/9] KVM: i386: Add support for save and restore nested state, Liran Alon, 2019/06/17
Re: [Qemu-devel] [QEMU PATCH v3 7/9] KVM: i386: Add support for save and restore nested state, Maran Wilson, 2019/06/18
[Qemu-devel] [QEMU PATCH v3 9/9] KVM: i386: Remove VMX migration blocker, Liran Alon, 2019/06/17
[Qemu-devel] [QEMU PATCH v3 8/9] KVM: i386: Add support for KVM_CAP_EXCEPTION_PAYLOAD, Liran Alon, 2019/06/17