From: Boris Ostrovsky <boris.ostrovsky@oracle.com>
To: Jan Beulich <JBeulich@suse.com>
Cc: kevin.tian@intel.com, eddie.dong@intel.com,
jun.nakajima@intel.com, suravee.suthikulpanit@amd.com,
xen-devel@lists.xen.org
Subject: Re: [PATCH v3 1/1] x86/HVM: Use fixed TSC value when saving or restoring domain
Date: Thu, 10 Apr 2014 10:33:50 -0400 [thread overview]
Message-ID: <5346ABCE.70401@oracle.com> (raw)
In-Reply-To: <53465C73020000780000777E@nat28.tlf.novell.com>
On 04/10/2014 02:55 AM, Jan Beulich wrote:
>
>> --- a/xen/arch/x86/hvm/hvm.c
>> +++ b/xen/arch/x86/hvm/hvm.c
>> @@ -255,16 +255,20 @@ int hvm_set_guest_pat(struct vcpu *v, u64 guest_pat)
>> return 1;
>> }
>>
>> -void hvm_set_guest_tsc(struct vcpu *v, u64 guest_tsc)
>> +void hvm_set_guest_tsc_fixed(struct vcpu *v, u64 guest_tsc, u64 at_tsc)
> What I now started wondering is (namely with the struct
> hvm_function_table pointer also gaining the extra argument): Is
> this ever being called with a zero at_tsc when
> v->domain->arch.chkpt_tsc is non-zero? If not, rather than passing
> around the value I guess the function could simply read it itself. And
> yes, this is meant only for the "set" version, I'm relatively convinced
> that the "get" ones would (or could easily become) different.
I couldn't convince myself that v->domain->arch.chkpt_tsc is always the
same as at_tsc. I think it is (and that's why arch_hvm_save_done() was
added) but I was worried that there may be some other path to
hvm_set_guest_tsc().
The other reason was for symmetry with the the "get" counterpart.
>
>> --- a/xen/include/asm-x86/domain.h
>> +++ b/xen/include/asm-x86/domain.h
>> @@ -308,6 +308,8 @@ struct arch_domain
>> (possibly other cases in the future */
>> uint64_t vtsc_kerncount; /* for hvm, counts all vtsc */
>> uint64_t vtsc_usercount; /* not used for hvm */
>> + uint64_t chkpt_tsc; /* TSC value that VCPUs use to calculate their
>> + tsc_offset value. Used during save/restore */
> I'm sorry for not asking earlier - why does this get put in struct
> arch_domain rather than struct hvm_domain?
Right. hvm_domain seems like a better place given that this is only
relevant to HVM.
-boris
next prev parent reply other threads:[~2014-04-10 14:33 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-04-09 17:29 [PATCH v3 0/1] Time-related fixes for migration Boris Ostrovsky
2014-04-09 17:29 ` [PATCH v3 1/1] x86/HVM: Use fixed TSC value when saving or restoring domain Boris Ostrovsky
2014-04-10 6:55 ` Jan Beulich
2014-04-10 14:33 ` Boris Ostrovsky [this message]
2014-04-10 14:37 ` Jan Beulich
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5346ABCE.70401@oracle.com \
--to=boris.ostrovsky@oracle.com \
--cc=JBeulich@suse.com \
--cc=eddie.dong@intel.com \
--cc=jun.nakajima@intel.com \
--cc=kevin.tian@intel.com \
--cc=suravee.suthikulpanit@amd.com \
--cc=xen-devel@lists.xen.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.