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


Groups > linux.kernel > #1197963

Re: [PATCH] x86: serialize LVTT and TSC_DEADLINE write

Path csiph.com!aioe.org!bofh.it!news.nic.it!robomod
From Thomas Gleixner <tglx@linutronix.de>
Newsgroups linux.kernel
Subject Re: [PATCH] x86: serialize LVTT and TSC_DEADLINE write
Date Sat, 01 Aug 2015 12:20:01 +0200
Message-ID <pSC3v-1Jd-3@gated-at.bofh.it> (permalink)
References <pSqOJ-2jd-7@gated-at.bofh.it>
X-Original-To Shaohua Li <shli@fb.com>
User-Agent Alpine 2.11 (DEB 23 2013-08-11)
MIME-Version 1.0
Content-Type TEXT/PLAIN; charset=US-ASCII
X-Linutronix-Spam-Score -1.0
X-Linutronix-Spam-Level -
X-Linutronix-Spam-Status No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 33
Organization linux.* mail to news gateway
X-Original-Cc x86@kernel.org, linux-kernel@vger.kernel.org, Kernel-team@fb.com, Suresh Siddha <suresh.b.siddha@intel.com>, "H. Peter Anvin" <hpa@zytor.com>, Ingo Molnar <mingo@kernel.org>, stable@vger.kernel.org, v3.7+@devbig257.prn2.facebook.com
X-Original-Date Sat, 1 Aug 2015 12:10:41 +0200 (CEST)
X-Original-Message-ID <alpine.DEB.2.11.1508011202080.3825@nanos>
X-Original-References <75ed9226b028a31e37861fbba51cdffbcfe04eda.1438300532.git.shli@fb.com>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref aioe.org linux.kernel:1197963

Show key headers only | View raw


On Fri, 31 Jul 2015, Shaohua Li wrote:
> @@ -336,6 +336,22 @@ static void __setup_APIC_LVTT(unsigned int clocks, int oneshot, int irqen)
>  	apic_write(APIC_LVTT, lvtt_value);
>  
>  	if (lvtt_value & APIC_LVT_TIMER_TSCDEADLINE) {
> +		u64 msr;
> +
> +		/*
> +		 * See Intel SDM: TSC-Deadline Mode chapter. In xAPIC mode,
> +		 * writing APIC LVTT and TSC_DEADLINE MSR isn't serialized.
> +		 * This uses the algorithm described in Intel SDM to serialize
> +		 * the two writes
> +		 * */
> +		while (1) {
> +			wrmsrl(MSR_IA32_TSC_DEADLINE, -1L);
> +			rdmsrl(MSR_IA32_TSC_DEADLINE, msr);
> +			if (msr)
> +				break;
> +		}
> +		wrmsrl(MSR_IA32_TSC_DEADLINE, 0);


I think this is exceptionally silly. A proper fence after the
apic_write() should have the same effect.

Thanks,

	tglx
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

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


Thread

Re: [PATCH] x86: serialize LVTT and TSC_DEADLINE write Thomas Gleixner <tglx@linutronix.de> - 2015-08-01 12:20 +0200
  Re: [PATCH] x86: serialize LVTT and TSC_DEADLINE write Thomas Gleixner <tglx@linutronix.de> - 2015-08-02 21:50 +0200
    Re: [PATCH] x86: serialize LVTT and TSC_DEADLINE write Shaohua Li <shli@fb.com> - 2015-08-04 02:00 +0200
  Re: [PATCH] x86: serialize LVTT and TSC_DEADLINE write Shaohua Li <shli@fb.com> - 2015-08-02 18:00 +0200

csiph-web