[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] Question about libxc-migration-stream.pandoc



On 09/08/17 15:00, Bruno Alvisio wrote:
Hello,

In /docs/specs/libxc-migration-stream.pandoc "x86 HVM Guest" section states that:

"HVM\_PARAMS must precede HVM\_CONTEXT, as certain parameters can affect the validity of architectural state in the context." (line 679)

However, from the code it looks like the HVM_CONTEXT record is sent and processed before the HVM_PARAMS record:

/tools/libxc/xc_sr_save_x86_hvm.c:

static int x86_hvm_end_of_checkpoint(struct xc_sr_context *ctx)
{
    int rc;

    /* Write the TSC record. */
    rc = write_tsc_info(ctx);
    if ( rc )
        return rc;

    /* Write the HVM_CONTEXT record. */
    rc = write_hvm_context(ctx);
    if ( rc )
        return rc;
    /* Write HVM_PARAMS record contains applicable HVM params. */
    rc = write_hvm_params(ctx);
    if ( rc )
        return rc;

    return 0;
}

I wanted to confirm is this is just a typo in the documentation file or a bug on the code?

"Its Complicated".

I wrote the document like that because the statement is true.  (HVM_PARAMS such as PAE/NESTED_VIRT/VIRIDIAN really do contain data which should be used to audit the data in the HVM_CONTEXT record).

I then tried to make the code match, except it ended up causing problems in certain edgecases  (Some params have read and write side effects).  The code is as it is to match how the legacy code worked.


I'm currently working on further CPUID and MSR handling logic, which will eventually slot their way into the appropriate places in the stream, so do really do have data arriving in the correct order to verify subsequent data.

I should probably add a note to the document explaining the inconsistency.

~Andrew
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
https://lists.xen.org/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.