[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <BY2PR0301MB1654FA5967C5A3630A83F5C2A0850@BY2PR0301MB1654.namprd03.prod.outlook.com>
Date: Mon, 20 Jul 2015 18:50:52 +0000
From: KY Srinivasan <kys@...rosoft.com>
To: Dexuan Cui <decui@...rosoft.com>,
"gregkh@...uxfoundation.org" <gregkh@...uxfoundation.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"devel@...uxdriverproject.org" <devel@...uxdriverproject.org>,
"olaf@...fle.de" <olaf@...fle.de>,
"apw@...onical.com" <apw@...onical.com>,
"vkuznets@...hat.com" <vkuznets@...hat.com>,
"jasowang@...hat.com" <jasowang@...hat.com>
Subject: RE: [PATCH 5/5] Drivers: hv: vmbus: Implement a clocksource based on
the TSC page
> -----Original Message-----
> From: Dexuan Cui
> Sent: Monday, July 20, 2015 5:14 AM
> To: KY Srinivasan; gregkh@...uxfoundation.org; linux-
> kernel@...r.kernel.org; devel@...uxdriverproject.org; olaf@...fle.de;
> apw@...onical.com; vkuznets@...hat.com; jasowang@...hat.com
> Subject: RE: [PATCH 5/5] Drivers: hv: vmbus: Implement a clocksource based
> on the TSC page
>
> > From: devel [mailto:driverdev-devel-bounces...linuxdriverproject.org] On
> Behalf
> > Of K. Y. Srinivasan
> > Sent: Monday, July 20, 2015 11:37
> >
> > The current Hyper-V clock source is based on the per-partition reference
> counter
> > and this counter is being accessed via s synthetic MSR -
> > HV_X64_MSR_TIME_REF_COUNT.
> > Hyper-V has a more efficient way of computing the per-partition reference
> > counter value that does not involve reading a synthetic MSR. We
> implement
> > a time source based on this mechanism.
> > ...
> > diff --git a/arch/x86/include/uapi/asm/hyperv.h
> > @@ -183,6 +233,22 @@ int hv_init(void)
> >
> > hv_context.hypercall_page = virtaddr;
> >
> > +#ifdef CONFIG_X86_64
> > + if (ms_hyperv.features &
> HV_X64_MSR_REFERENCE_TSC_AVAILABLE) {
> > + va_tsc = __vmalloc(PAGE_SIZE, GFP_KERNEL,
> PAGE_KERNEL);
> > + if (!va_tsc)
> > + goto cleanup;
> > + hv_context.tsc_page = va_tsc;
> > +
> > + rdmsrl(HV_X64_MSR_REFERENCE_TSC, tsc_msr.as_uint64);
> > +
> > + tsc_msr.enable = 1;
> > + tsc_msr.guest_physical_address = vmalloc_to_pfn(va_tsc);
> > +
> > + wrmsrl(HV_X64_MSR_REFERENCE_TSC, tsc_msr.as_uint64);
> > + clocksource_register_hz(&hyperv_cs_tsc,
> NSEC_PER_SEC/100);
> > + }
> > +#endif
>
> Should we disable the mechanism and vfree() the page in hv_cleanup() for
> kexec/kdump?
Thanks Dexuan. I will update the patch and resend.
Regards,
K. Y
>
> -- Dexuan
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists