From: Boris Ostrovsky <boris.ostrovsky@oracle.com>
To: Joao Martins <joao.m.martins@oracle.com>,
linux-kernel@vger.kernel.org, xen-devel@lists.xenproject.org
Cc: Thomas Gleixner <tglx@linutronix.de>,
Ingo Molnar <mingo@redhat.com>, "H. Peter Anvin" <hpa@zytor.com>,
x86@kernel.org, Juergen Gross <jgross@suse.com>,
Andy Lutomirski <luto@amacapital.net>
Subject: Re: [PATCH v5 3/4] x86/xen/time: setup vcpu 0 time info page
Date: Mon, 2 Oct 2017 14:44:20 -0400 [thread overview]
Message-ID: <5eb802fb-c802-b501-9182-3e18af8b8651@oracle.com> (raw)
In-Reply-To: <20171002183122.3961-4-joao.m.martins@oracle.com>
> +
> +static void xen_setup_vsyscall_time_info(void)
> +{
> + struct vcpu_register_time_memory_area t;
> + struct pvclock_vsyscall_time_info *ti;
> + int ret;
In the previous version you'd return immediately if
PVCLOCK_TSC_STABLE_BIT was not set. Don't you still need to check this?
Especially give...
> +
> + ti = (struct pvclock_vsyscall_time_info *)get_zeroed_page(GFP_KERNEL);
> + if (!ti)
> + return;
> +
> + t.addr.v = &ti->pvti;
> +
> + ret = HYPERVISOR_vcpu_op(VCPUOP_register_vcpu_time_memory_area, 0, &t);
> + if (ret) {
> + pr_notice("xen: VCLOCK_PVCLOCK not supported (err %d)\n", ret);
> + free_page((unsigned long)ti);
> + return;
> + }
> +
> + /*
> + * If primary time info had this bit set, secondary should too since
... this comment?
-boris
> + * it's the same data on both just different memory regions. But we
> + * still check it in case hypervisor is buggy.
> + */
> + if (!(ti->pvti.flags & PVCLOCK_TSC_STABLE_BIT)) {
> + t.addr.v = NULL;
> + ret = HYPERVISOR_vcpu_op(VCPUOP_register_vcpu_time_memory_area,
> + 0, &t);
> + if (!ret)
> + free_page((unsigned long)ti);
> +
> + pr_notice("xen: VCLOCK_PVCLOCK not supported (tsc unstable)\n");
> + return;
> + }
> +
> + xen_clock = ti;
> + pvclock_set_pvti_cpu0_va(xen_clock);
> +
> + xen_clocksource.archdata.vclock_mode = VCLOCK_PVCLOCK;
> +}
> +
>
next prev parent reply other threads:[~2017-10-02 18:44 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-02 18:31 [PATCH v5 0/4] x86/xen: pvclock vdso support Joao Martins
2017-10-02 18:31 ` [PATCH v5 1/4] x86/pvclock: add setter for pvclock_pvti_cpu0_va Joao Martins
2017-10-02 18:31 ` [PATCH v5 2/4] x86/xen/time: set pvclock flags on xen_time_init() Joao Martins
2017-10-02 18:39 ` Boris Ostrovsky
2017-10-02 18:31 ` [PATCH v5 3/4] x86/xen/time: setup vcpu 0 time info page Joao Martins
2017-10-02 18:44 ` Boris Ostrovsky [this message]
2017-10-02 20:58 ` Joao Martins
2017-10-02 18:31 ` [PATCH v5 4/4] 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=5eb802fb-c802-b501-9182-3e18af8b8651@oracle.com \
--to=boris.ostrovsky@oracle.com \
--cc=hpa@zytor.com \
--cc=jgross@suse.com \
--cc=joao.m.martins@oracle.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®