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


Groups > linux.kernel > #1740798

Re: [PATCH v4 2/3] x86/xen/time: setup vcpu 0 time info page

From Boris Ostrovsky <boris.ostrovsky@oracle.com>
Newsgroups linux.kernel
Subject Re: [PATCH v4 2/3] x86/xen/time: setup vcpu 0 time info page
Date 2017-09-27 16:50 +0200
Message-ID <uulOV-4rv-13@gated-at.bofh.it> (permalink)
References <uukSS-3A0-13@gated-at.bofh.it> <uukST-3A0-31@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;
> +	struct pvclock_vcpu_time_info *pvti;
> +	int ret;
> +
> +	pvti = &__this_cpu_read(xen_vcpu)->time;
> +
> +	/*
> +	 * We check ahead on the primary time info if this
> +	 * bit is supported hence speeding up Xen clocksource.
> +	 */
> +	if (!(pvti->flags & PVCLOCK_TSC_STABLE_BIT))
> +		return;
> +
> +	pvclock_set_flags(PVCLOCK_TSC_STABLE_BIT);

Is it OK to have this flag set if anything below fails?

(I can see in the changelog that apparently at some point I've asked
about this at v1 but I can't remember/find what exactly it was)

-boris

> +
> +	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 the check above succedded this one should too since it's the
> +	 * same data on both primary and secondary time infos just different
> +	 * memory regions. But we still check it in case hypervisor is buggy.
> +	 */
> +	pvti = &ti->pvti;
> +	if (!(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 v4 0/3] x86/xen: pvclock vdso support Joao Martins <joao.m.martins@oracle.com> - 2017-09-27 15:50 +0200
  [PATCH v4 3/3] MAINTAINERS: xen, kvm: track pvclock-abi.h changes Joao Martins <joao.m.martins@oracle.com> - 2017-09-27 15:50 +0200
    Re: [PATCH v4 3/3] MAINTAINERS: xen, kvm: track pvclock-abi.h changes Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> - 2017-09-27 21:40 +0200
      Re: [PATCH v4 3/3] MAINTAINERS: xen, kvm: track pvclock-abi.h changes Paolo Bonzini <pbonzini@redhat.com> - 2017-09-28 13:00 +0200
  [PATCH v4 2/3] x86/xen/time: setup vcpu 0 time info page Joao Martins <joao.m.martins@oracle.com> - 2017-09-27 15:50 +0200
    Re: [PATCH v4 2/3] x86/xen/time: setup vcpu 0 time info page Juergen Gross <jgross@suse.com> - 2017-09-27 16:20 +0200
    Re: [PATCH v4 2/3] x86/xen/time: setup vcpu 0 time info page Boris Ostrovsky <boris.ostrovsky@oracle.com> - 2017-09-27 16:50 +0200
      Re: [PATCH v4 2/3] x86/xen/time: setup vcpu 0 time info page Joao Martins <joao.m.martins@oracle.com> - 2017-09-27 17:30 +0200
        Re: [PATCH v4 2/3] x86/xen/time: setup vcpu 0 time info page Boris Ostrovsky <boris.ostrovsky@oracle.com> - 2017-09-27 22:30 +0200
          Re: [PATCH v4 2/3] x86/xen/time: setup vcpu 0 time info page Joao Martins <joao.m.martins@oracle.com> - 2017-09-27 23:00 +0200
            Re: [PATCH v4 2/3] x86/xen/time: setup vcpu 0 time info page Boris Ostrovsky <boris.ostrovsky@oracle.com> - 2017-09-28 00:50 +0200
              Re: [PATCH v4 2/3] x86/xen/time: setup vcpu 0 time info page Joao Martins <joao.m.martins@oracle.com> - 2017-09-28 01:50 +0200
                Re: [PATCH v4 2/3] x86/xen/time: setup vcpu 0 time info page Joao Martins <joao.m.martins@oracle.com> - 2017-09-28 12:20 +0200
  [PATCH v4 1/3] x86/pvclock: add setter for pvclock_pvti_cpu0_va Joao Martins <joao.m.martins@oracle.com> - 2017-09-27 15:50 +0200

csiph-web