Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1743291

Re: [PATCH v5 3/4] x86/xen/time: setup vcpu 0 time info page

From Boris Ostrovsky <boris.ostrovsky@oracle.com>
Newsgroups linux.kernel
Subject Re: [PATCH v5 3/4] x86/xen/time: setup vcpu 0 time info page
Date 2017-10-02 22:50 +0200
Message-ID <uwfPd-ur-197@gated-at.bofh.it> (permalink)
References <uwfP4-ur-17@gated-at.bofh.it> <uwfPd-ur-199@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


> +
> +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;
> +}
> +
>  

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v5 0/4] x86/xen: pvclock vdso support Joao Martins <joao.m.martins@oracle.com> - 2017-10-02 22:50 +0200
  Re: [PATCH v5 3/4] x86/xen/time: setup vcpu 0 time info page Boris Ostrovsky <boris.ostrovsky@oracle.com> - 2017-10-02 22:50 +0200
  [PATCH v5 1/4] x86/pvclock: add setter for pvclock_pvti_cpu0_va Joao Martins <joao.m.martins@oracle.com> - 2017-10-02 22:50 +0200
  [PATCH v5 4/4] MAINTAINERS: xen, kvm: track pvclock-abi.h changes Joao Martins <joao.m.martins@oracle.com> - 2017-10-02 22:50 +0200
  [PATCH v5 3/4] x86/xen/time: setup vcpu 0 time info page Joao Martins <joao.m.martins@oracle.com> - 2017-10-02 22:50 +0200

csiph-web