From: Joao Martins <joao.m.martins@oracle.com>
To: Juergen Gross <jgross@suse.com>
Cc: linux-kernel@vger.kernel.org, xen-devel@lists.xenproject.org,
Thomas Gleixner <tglx@linutronix.de>,
Ingo Molnar <mingo@redhat.com>, "H. Peter Anvin" <hpa@zytor.com>,
x86@kernel.org, Boris Ostrovsky <boris.ostrovsky@oracle.com>,
Andy Lutomirski <luto@amacapital.net>
Subject: Re: [PATCH v3 2/3] x86/xen/time: setup vcpu 0 time info page
Date: Wed, 27 Sep 2017 14:59:42 +0100 [thread overview]
Message-ID: <b86057a5-51af-4fa1-4bdd-706be238376d@oracle.com> (raw)
In-Reply-To: <766eedf2-9345-31bd-9658-bdba125b9bc6@suse.com>
On 09/27/2017 01:14 PM, Juergen Gross wrote:
> On 27/09/17 14:00, Joao Martins wrote:
[...]
>> diff --git a/include/xen/interface/vcpu.h b/include/xen/interface/vcpu.h
>> index 98188c87f5c1..b4a1eabcf1c4 100644
>> --- a/include/xen/interface/vcpu.h
>> +++ b/include/xen/interface/vcpu.h
>> @@ -178,4 +178,46 @@ DEFINE_GUEST_HANDLE_STRUCT(vcpu_register_vcpu_info);
>>
>> /* Send an NMI to the specified VCPU. @extra_arg == NULL. */
>> #define VCPUOP_send_nmi 11
>> +
>> +/*
>> + * Get the physical ID information for a pinned vcpu's underlying physical
>> + * processor. The physical ID informmation is architecture-specific.
>> + * On x86: id[31:0]=apic_id, id[63:32]=acpi_id.
>> + * This command returns -EINVAL if it is not a valid operation for this VCPU.
>> + */
>> +#define VCPUOP_get_physid 12 /* arg == vcpu_get_physid_t */
>> +struct vcpu_get_physid {
>> + uint64_t phys_id;
>> +};
>> +DEFINE_GUEST_HANDLE_STRUCT(vcpu_get_physid_t);
>
> DEFINE_GUEST_HANDLE_STRUCT(vcpu_get_physid);
>
>> +#define xen_vcpu_physid_to_x86_apicid(physid) ((uint32_t)(physid))
>> +#define xen_vcpu_physid_to_x86_acpiid(physid) ((uint32_t)((physid) >> 32))
>> +
>> +/*
>> + * Register a memory location to get a secondary copy of the vcpu time
>> + * parameters. The master copy still exists as part of the vcpu shared
>> + * memory area, and this secondary copy is updated whenever the master copy
>> + * is updated (and using the same versioning scheme for synchronisation).
>> + *
>> + * The intent is that this copy may be mapped (RO) into userspace so
>> + * that usermode can compute system time using the time info and the
>> + * tsc. Usermode will see an array of vcpu_time_info structures, one
>> + * for each vcpu, and choose the right one by an existing mechanism
>> + * which allows it to get the current vcpu number (such as via a
>> + * segment limit). It can then apply the normal algorithm to compute
>> + * system time from the tsc.
>> + *
>> + * @extra_arg == pointer to vcpu_register_time_info_memory_area structure.
>> + */
>> +#define VCPUOP_register_vcpu_time_memory_area 13
>> +DEFINE_GUEST_HANDLE_STRUCT(vcpu_time_info_t);
>
> DEFINE_GUEST_HANDLE_STRUCT(vcpu_time_info);
>
>> +struct vcpu_register_time_memory_area {
>> + union {
>> + GUEST_HANDLE(vcpu_time_info_t) h;
>
> GUEST_HANDLE(vcpu_time_info) h;
>
>> + struct pvclock_vcpu_time_info *v;
>> + uint64_t p;
>> + } addr;
>> +};
>> +DEFINE_GUEST_HANDLE_STRUCT(vcpu_register_time_memory_area_t);
>
> DEFINE_GUEST_HANDLE_STRUCT(vcpu_register_time_memory_area);
Oh sorry - I forgot to remove the suffix. In the meantime I sent over v4
addressing the above.
Joao
next prev parent reply other threads:[~2017-09-27 14:00 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-27 12:00 [PATCH v3 0/3] x86/xen: pvclock vdso support Joao Martins
2017-09-27 12:00 ` [PATCH v3 1/3] x86/pvclock: add setter for pvclock_pvti_cpu0_va Joao Martins
2017-09-27 12:00 ` [PATCH v3 2/3] x86/xen/time: setup vcpu 0 time info page Joao Martins
2017-09-27 12:14 ` Juergen Gross
2017-09-27 13:59 ` Joao Martins [this message]
2017-09-27 12:00 ` [PATCH v3 3/3] MAINTAINERS: xen, kvm: track pvclock-abi.h changes Joao Martins
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=b86057a5-51af-4fa1-4bdd-706be238376d@oracle.com \
--to=joao.m.martins@oracle.com \
--cc=boris.ostrovsky@oracle.com \
--cc=hpa@zytor.com \
--cc=jgross@suse.com \
--cc=linux-kernel@vger.kernel.org \
--cc=luto@amacapital.net \
--cc=mingo@redhat.com \
--cc=tglx@linutronix.de \
--cc=x86@kernel.org \
--cc=xen-devel@lists.xenproject.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®