Return-Path: Received: from www.linutronix.de ([62.245.132.108]:60033 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751557AbbIIHgI (ORCPT ); Wed, 9 Sep 2015 03:36:08 -0400 Date: Wed, 9 Sep 2015 09:35:22 +0200 (CEST) From: Thomas Gleixner To: Andi Kleen cc: Shaohua Li , Ingo Molnar , x86@kernel.org, linux-kernel@vger.kernel.org, Kernel-team@fb.com, Suresh Siddha , "H. Peter Anvin" , stable@vger.kernel.org, lenb@kernel.org, fenghua.yu@intel.com Subject: Re: [PATCH] x86: serialize LVTT and TSC_DEADLINE write In-Reply-To: <20150909033937.GH4524@tassilo.jf.intel.com> Message-ID: References: <75ed9226b028a31e37861fbba51cdffbcfe04eda.1438300532.git.shli@fb.com> <20150802154948.GA1432307@devbig257.prn2.facebook.com> <20150803235801.GA1461084@devbig257.prn2.facebook.com> <20150805084424.GB21506@gmail.com> <20150805162535.GA2461245@devbig257.prn2.facebook.com> <20150909033937.GH4524@tassilo.jf.intel.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: stable-owner@vger.kernel.org List-ID: Andi, On Tue, 8 Sep 2015, Andi Kleen wrote: > > Hmm, I didn't mean mfence can't serialize the instructions. For a true > > IO, a serialization can't guarantee device finishes the IO, we generally > > read some safe IO registers to wait IO finish. I completely don't know > > if this case fits here though. > > Sorry for the late answer. We (Intel) analyzed this case in detail and > can confirm that the following sequence > > 1. Memory-mapped write to LVT Timer Register, setting bits 18:17 to 10b. > 23. MFENCE. > 4. WRMSR to the IA32_TSC_DEADLINE MSR the desired deadline. > > has the same effect as the loop algorithm described in the SDM on all Intel > CPUs. So it's fine to use MFENCE here. Thanks for the confirmation. It would have been really surprising if that wouldn't work. Thanks, tglx