On 22.11.2023 10:06, Roger Pau Monné wrote:
> On Thu, Nov 16, 2023 at 02:32:47PM +0100, Jan Beulich wrote:
>> This was used by VMX only, and the intended VMCS write can as well
>> happen from vmx_set_tsc_offset(), invoked (directly or indirectly)
>> almost immediately after the present call sites of the hook.
>> vmx_set_tsc_offset() isn't invoked frequently elsewhere, so the extra
>> VMCS write shouldn't raise performance concerns.
>>
>> Signed-off-by: Jan Beulich <jbeul...@suse.com>
> 
> Acked-by: Roger Pau Monné <roger....@citrix.com>

Thanks.

> I would be lying if I told you I understand guest TSC management in
> Xen, but patch does keep the previous call sites with adding others
> that are indeed not hot paths.
> 
> I do wonder whether it would be possible to set this before the domain
> is started, as AFAICT the TSC scaling ratio is only set before the
> domain is started (either by domain create or other toolstack
> hypercalls).
> 
> Could we maybe further limit the write to the case where the vCPU is
> not running?

Possibly, but not straightforwardly: E.g. I think we'd need to actually
enforce tsc_set_info() to only ever act on non-running (perhaps even
not-yet-started) domains. And I mean not by looking where it's being
called from at present (which may already provide such kind-of-
guarantees), but in the function itself.

Jan

Reply via email to