On 08/10/2020 19:57, Paul Durrant wrote:
> +The record body contains the following fields:
> +
> +| Field         | Description                                   |
> +|---------------|-----------------------------------------------|
> +| `mode`        | 0x00000000: Default (emulate if necessary)    |
> +|               | 0x00000001: Always emulate                    |
> +|               | 0x00000002: Never emulate                     |
> +|               |                                               |
> +| `khz`         | The TSC frequency in kHz                      |
> +|               |                                               |
> +| `nsec`        | Elapsed time in nanoseconds                   |
> +|               |                                               |
> +| `incarnation` | Incarnation (counter indicating how many      |
> +|               | times the TSC value has been set)             |

It is how many set_tsc_info() (hyper)calls have been made, not how many
times the guest has written to the TSC MSR.

That said, it is totally useless now that PVRDTSCP mode has gone, other
than the fact that it appears in guest CPUID as an approximation of "how
many times has this domain been migrated".

I.e. its a number you'll want to actively squash in your usecase.

I'm not sure whether to suggest dropping the field entirely, or not.  I
highly doubt any user exists - IIRC, it was specifically for PVRDTSCP
userspace to notice that the frequency may have changed, and to
re-adjust its calculations.

> diff --git a/xen/include/public/save.h b/xen/include/public/save.h
> index bccbaadd0b..86881864cf 100644
> --- a/xen/include/public/save.h
> +++ b/xen/include/public/save.h
> @@ -50,6 +50,7 @@ enum {
>      DOMAIN_CONTEXT_END,
>      DOMAIN_CONTEXT_START,
>      DOMAIN_CONTEXT_SHARED_INFO,
> +    DOMAIN_CONTEXT_TSC_INFO,

At a minimum, this wants an /* x86 only */ comment.  Possibly an X86 infix.

~Andrew

Reply via email to