mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Joao Martins <joao.m.martins@oracle.com>
To: Boris Ostrovsky <boris.ostrovsky@oracle.com>,
	linux-kernel@vger.kernel.org, xen-devel@lists.xen.org
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
	David Vrabel <david.vrabel@citrix.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>, "H. Peter Anvin" <hpa@zytor.com>,
	x86@kernel.org
Subject: Re: [PATCH RFC 2/3] x86/xen/time: setup vcpu 0 time info page
Date: Mon, 4 Jan 2016 20:41:23 +0000	[thread overview]
Message-ID: <568AD8F3.2050600@oracle.com> (raw)
In-Reply-To: <568A98D9.9090501@oracle.com>



On 01/04/2016 04:07 PM, Boris Ostrovsky wrote:
> On 12/28/2015 04:52 PM, Joao Martins wrote:
>> +
>> +static int xen_setup_vsyscall_time_info(int cpu)
>> +{
>> +	struct pvclock_vsyscall_time_info *ti;
>> +	struct vcpu_register_time_memory_area t;
>> +	struct pvclock_vcpu_time_info *pvti;
>> +	unsigned long mem;
>> +	int ret, size;
>> +	u8 flags;
>> +
>> +	ret = HYPERVISOR_vcpu_op(VCPUOP_register_vcpu_time_memory_area,
>> +				 cpu, NULL);
>> +	if (ret == -ENOSYS) {
>> +		pr_debug("xen: vcpu_time_info placement not supported\n");
>> +		return -ENOTSUPP;
>> +	}
> 
> I don't think this is necessary.
> 
OK, I will remove it.

>> +
>> +	size = PAGE_ALIGN(sizeof(struct pvclock_vsyscall_time_info));
>> +	mem = memblock_alloc(size, PAGE_SIZE);
>> +	if (!mem)
>> +		return -ENOMEM;
>> +
>> +	ti = __va(mem);
>> +	memset(ti, 0, size);
> 
> Can you just use get_zeroed_page()? (struct pvclock_vsyscall_time_info 
> is always less than a page, isn't it?).
Yeah, I can use get_zeroed_page() (struct pvclock_vsyscall_time_info is always
less than a page).

Additionally perhaps this region shouldn't be freed if PVCLOCK_TSC_STABLE_BIT
isn't supported, because otherwise I would end up corrupting data elsewhere
since the pvti would still be periodically updated by Xen, right?

> 
> 
> -boris
> 

  reply	other threads:[~2016-01-04 20:41 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-28 21:52 [PATCH RFC 0/3] x86/xen: pvclock vdso support Joao Martins
2015-12-28 21:52 ` [PATCH RFC 1/3] x86/pvclock: add setter for pvclock_pvti_cpu0_va Joao Martins
2015-12-28 23:45   ` Andy Lutomirski
2015-12-29 12:50     ` Joao Martins
2015-12-29 13:03       ` Andy Lutomirski
2015-12-28 21:52 ` [PATCH RFC 2/3] x86/xen/time: setup vcpu 0 time info page Joao Martins
2016-01-04 16:07   ` Boris Ostrovsky
2016-01-04 20:41     ` Joao Martins [this message]
2016-01-04 21:34       ` Boris Ostrovsky
2016-01-05 12:20         ` Joao Martins
2015-12-28 21:52 ` [PATCH RFC 3/3] xen/Kconfig: add XEN_TIME_VSYSCALL option Joao Martins
2016-01-04 16:12   ` [Xen-devel] " David Vrabel
2016-01-04 16:15     ` Boris Ostrovsky
2016-01-04 20:41       ` 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=568AD8F3.2050600@oracle.com \
    --to=joao.m.martins@oracle.com \
    --cc=boris.ostrovsky@oracle.com \
    --cc=david.vrabel@citrix.com \
    --cc=hpa@zytor.com \
    --cc=konrad.wilk@oracle.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome