From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932091AbbIIDjq (ORCPT ); Tue, 8 Sep 2015 23:39:46 -0400 Received: from mga02.intel.com ([134.134.136.20]:53941 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754012AbbIIDji (ORCPT ); Tue, 8 Sep 2015 23:39:38 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.17,494,1437462000"; d="scan'208";a="801152638" Date: Tue, 8 Sep 2015 20:39:37 -0700 From: Andi Kleen To: Shaohua Li Cc: Ingo Molnar , Thomas Gleixner , 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 Message-ID: <20150909033937.GH4524@tassilo.jf.intel.com> 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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150805162535.GA2461245@devbig257.prn2.facebook.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > 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. -Andi