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

Re: [PATCH v10 06/11] x86/time: add a domain context record for tsc_info...


  • To: Paul Durrant <paul@xxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • Date: Mon, 25 Jan 2021 19:24:06 +0000
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ioQgahv3Zqc9sw6wAfwg2eFG0FqLvwRELHvZL3Fo4a8=; b=N45oNPK95jPhfIb9kjAlSCrmaGblR3lqxzRRYjqHvOsCIfVusyQwxV/XsEBHCjajueBgvW2wQ+DGhvJu5k0p5AdCk+pTaW1EXyuRYPawbQpeu05edZEtEBlwyV48fRetqf5mUOR3zFyV4mpv4q769wZkDwqlgIoNaBYKCdMLZjcuSaa3LxXJBY0yknrTWbRy5BTGB0LXGHmXbPvrgFr/1ZijISqBExeKwnhmlhmGV0rkb+T5Vu4g1/IRQHuBq+PNl4JG7OLsehOv3NqsUhj/xPnqDXyymdFxwuFbvB1pIgTf1sGNZ5dkHSHG+tdGbkspEgHT82AyV7FHwZ8ERyMpUw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nG7+CEwNelIhMeKriCneS0+E6bGXrGZkIlgb0iSNyEA85er2Nroe4wHykQJLDnTOvpEvd1QWEVexbjHBTJiZcrSo0ZP8b8KrJMGE9v7CuhOl9qxPEtObn4JyvAILF8TcYpsUBcgQ7mKohHVkEEsGvyHflEjD5m8fgwc+4GF3cDeCWlVRH0fl9d6ZT5YkF9yv88gJxq0D3F3fXaFO6bwLhbQdFX9bV6sOG9SnHgH9/XxiukNmiQX3E5cd2+wBUpeDpTC4viLco4YbFx5pJH312gUYZvLS3cc9C2ndIfNvgY7WVChtV7i2M9yInLKSPsy92xZFNHVWt/OEQ8X9EoewyA==
  • Authentication-results: esa6.hc3370-68.iphmx.com; dkim=pass (signature verified) header.i=@citrix.onmicrosoft.com
  • Cc: Paul Durrant <pdurrant@xxxxxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Ian Jackson <iwj@xxxxxxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Delivery-date: Mon, 25 Jan 2021 19:24:23 +0000
  • Ironport-sdr: 4Yj2f9ds4BJ4pURJzXrUzv0G39aWbxdL7z+9y0tRk+4Iqu8gnekR4R3dlBIuz+LKZTjgxDC7UI jTWZQ16iSBAeyyyxfBJmU2WxyXpEj72fFeUPh1j8EUfSehKflYe02ngCRd9JUA6HxTPPy92Tpk P4KO5VtyjVdkqao5l8yjB3ppfgbiE9Wue/o3heefqn2qfl8p8Dket7rtAVT5g5AbExeKKLWl69 ZbEMsqrRMDUgCa9ORJqdTiO+dy1wbuquXZnmcU/vK0ECQo4jhpL0zl9Xn7whEKUGiotbE/x9Cl hL0=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

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



 


Rackspace

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