mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Dexuan Cui <decui@microsoft.com>
To: KY Srinivasan <kys@microsoft.com>,
	"gregkh@linuxfoundation.org" <gregkh@linuxfoundation.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"devel@linuxdriverproject.org" <devel@linuxdriverproject.org>,
	"olaf@aepfle.de" <olaf@aepfle.de>,
	"apw@canonical.com" <apw@canonical.com>,
	"vkuznets@redhat.com" <vkuznets@redhat.com>,
	"jasowang@redhat.com" <jasowang@redhat.com>
Subject: RE: [PATCH 5/5] Drivers: hv: vmbus: Implement a clocksource based on the TSC page
Date: Mon, 20 Jul 2015 12:14:11 +0000	[thread overview]
Message-ID: <bd8c7f484f2c475b9020f06166134df6@SIXPR30MB031.064d.mgd.msft.net> (raw)
In-Reply-To: <1437363447-3554-5-git-send-email-kys@microsoft.com>

> 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?

-- Dexuan

  reply	other threads:[~2015-07-20 12:14 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-20  3:36 [PATCH 0/5] Drivers: hv: vmbus: Miscellaneous improvements and fixes K. Y. Srinivasan
2015-07-20  3:37 ` [PATCH 1/5] Drivers: hv: vmbus: Improve the CPU affiliation for channels K. Y. Srinivasan
2015-07-20  3:37   ` [PATCH 2/5] Drivers: hv: vmbus: Further improve CPU affiliation logic K. Y. Srinivasan
2015-07-20  3:37   ` [PATCH 3/5] Drivers: hv_vmbus: Fix signal to host condition K. Y. Srinivasan
2015-07-20 11:33     ` Dexuan Cui
2015-07-20  3:37   ` [PATCH 4/5] drivers/hv: Migrate to new 'set-state' interface K. Y. Srinivasan
2015-07-20  3:37   ` [PATCH 5/5] Drivers: hv: vmbus: Implement a clocksource based on the TSC page K. Y. Srinivasan
2015-07-20 12:14     ` Dexuan Cui [this message]
2015-07-20 18:50       ` KY Srinivasan

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=bd8c7f484f2c475b9020f06166134df6@SIXPR30MB031.064d.mgd.msft.net \
    --to=decui@microsoft.com \
    --cc=apw@canonical.com \
    --cc=devel@linuxdriverproject.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=jasowang@redhat.com \
    --cc=kys@microsoft.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=olaf@aepfle.de \
    --cc=vkuznets@redhat.com \
    /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®