[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <e748dc167d444e85b16c649cb8437165@SN2PR03MB061.namprd03.prod.outlook.com>
Date: Tue, 27 Aug 2013 16:37:32 +0000
From: KY Srinivasan <kys@...rosoft.com>
To: Jan Beulich <JBeulich@...e.com>
CC: "olaf@...fle.de" <olaf@...fle.de>,
"apw@...onical.com" <apw@...onical.com>,
"x86@...nel.org" <x86@...nel.org>,
"devel@...uxdriverproject.org" <devel@...uxdriverproject.org>,
"gregkh@...uxfoundation.org" <gregkh@...uxfoundation.org>,
"jasowang@...hat.com" <jasowang@...hat.com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"hpa@...or.com" <hpa@...or.com>
Subject: RE: [PATCH 1/1] X86: Hyper-V: Get the local APIC timer frequency
from the hypervisor
> -----Original Message-----
> From: Jan Beulich [mailto:JBeulich@...e.com]
> Sent: Tuesday, August 27, 2013 12:26 AM
> To: KY Srinivasan
> Cc: olaf@...fle.de; apw@...onical.com; x86@...nel.org;
> devel@...uxdriverproject.org; gregkh@...uxfoundation.org;
> jasowang@...hat.com; linux-kernel@...r.kernel.org; hpa@...or.com
> Subject: Re: [PATCH 1/1] X86: Hyper-V: Get the local APIC timer frequency from
> the hypervisor
>
> >>> On 27.08.13 at 01:42, "K. Y. Srinivasan" <kys@...rosoft.com> wrote:
> > Hyper-V supports a mechanism for retrieving the local API frequency.
>
> "APIC"?
>
> > @@ -27,6 +27,13 @@
> > #define HV_X64_MSR_VP_RUNTIME_AVAILABLE (1 << 0)
> > /* Partition Reference Counter (HV_X64_MSR_TIME_REF_COUNT) available*/
> > #define HV_X64_MSR_TIME_REF_COUNT_AVAILABLE (1 << 1)
> > +
> > +/* Local APIC timer frequency MSR (HV_X64_MSR_APIC_FREQUENCY) is
> available */
> > +#define HV_X64_MSR_APIC_FREQUENCY_AVAILABLE (1 << 11)
> > +
> > +/* TSC frequency MSR (HV_X64_MSR_TSC_FREQUENCY) is available */
> > +#define HV_X64_MSR_TSC_FREQUENCY_AVAILABLE (1 << 11)
>
> Are these two really the same bit? If so, why two different names?
>
> > @@ -136,6 +143,12 @@
> > /* MSR used to read the per-partition time reference counter */
> > #define HV_X64_MSR_TIME_REF_COUNT 0x40000020
> >
> > +/* MSR used to retrive the TSC frequency */
> > +#define HV_X64_MSR_TSC_FREQUENCY 0x40000022
> > +
> > +/* MSR used to retrive the local APIC timer frequency */
> > +#define HV_X64_MSR_APIC_FREQUENCY 0x40000023
>
> "retrieve" (twice)?
>
> > @@ -76,6 +77,22 @@ static void __init ms_hyperv_init_platform(void)
> > printk(KERN_INFO "HyperV: features 0x%x, hints 0x%x\n",
> > ms_hyperv.features, ms_hyperv.hints);
> >
> > + if (ms_hyperv.features & HV_X64_MSR_APIC_FREQUENCY_AVAILABLE) {
> > + /*
> > + * There is no need to calibrate APIC timer frequency;
> > + * nor is there a need to calibrate timer.
> > + */
> > + legacy_pic = &null_legacy_pic;
>
> This clearly disables more than just the calibration, so the comment
> may be misleading to future readers.
>
> > +
> > + /*
> > + * Get the APIC frequency.
> > + */
> > + rdmsrl(HV_X64_MSR_APIC_FREQUENCY,
> lapic_timer_frequency);
> > + lapic_timer_frequency /= HZ;
>
> Is this safe? I.e. are the high 32 bits of the MSR guaranteed to
> be zero, now and forever?
>
> > + printk(KERN_INFO "HyperV: LAPIC Timer Frequency: 0x%x\n",
> > + lapic_timer_frequency);
>
> As a minor note, I generally recommend using %#x as being one
> byte shorter than the spelled out 0x%x.
>
> Jan
Thanks Jan. I will fix the issues you have pointed out and resubmit the patch.
Regards,
K. Y
--
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