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>
Cc: linux-kernel@vger.kernel.org, xen-devel@lists.xen.org,
	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: Tue, 5 Jan 2016 12:20:15 +0000	[thread overview]
Message-ID: <568BB4FF.6030605@oracle.com> (raw)
In-Reply-To: <568AE553.5030303@oracle.com>



On 01/04/2016 09:34 PM, Boris Ostrovsky wrote:
> On 01/04/2016 03:41 PM, Joao Martins wrote:
>>
>> On 01/04/2016 04:07 PM, Boris Ostrovsky wrote:
>>> On 12/28/2015 04:52 PM, Joao Martins wrote:
>>>
>>>> +
>>>> +	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?
> 
> You could try setting it back to NULL. e.g.
>      if (!HYPERVISOR_vcpu_op(VCPUOP_register_vcpu_time_memory_area, cpu, 
> NULL))
>          free_page(..);
> 
Ah, forgot about that option. Thanks! We can't register it explicitly as NULL as
the hypercall would return -EFAULT but having a valid argument with NULL as the
address works nicely.

> -boris
> 

  reply	other threads:[~2016-01-05 12:20 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
2016-01-04 21:34       ` Boris Ostrovsky
2016-01-05 12:20         ` Joao Martins [this message]
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=568BB4FF.6030605@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