From: Jeremy Fitzhardinge Subject: [PATCH 27 of 36] x86_64: __switch_to(): Move arch_leave_lazy_cpu_mode() to the right place Date: Wed, 25 Jun 2008 00:19:23 -0400 Message-ID: <2281dbcc167afedbee49.1214367563@localhost> References: Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Ingo Molnar Cc: Mark McLoughlin , xen-devel , Eduardo Habkost , Stephen Tweedie , x86@kernel.org, LKML List-Id: xen-devel@lists.xenproject.org We must leave lazy mode before switching the %fs and %gs selectors. (patch should be merged with previous __switch_to()/arch_leave_lazy_cpu_mode() patch) Signed-off-by: Eduardo Habkost Signed-off-by: Jeremy Fitzhardinge --- arch/x86/kernel/process_64.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/arch/x86/kernel/process_64.c b/arch/x86/kernel/process_64.c --- a/arch/x86/kernel/process_64.c +++ b/arch/x86/kernel/process_64.c @@ -603,6 +603,15 @@ load_TLS(next, cpu); + /* + * Leave lazy mode, flushing any hypercalls made here. + * This must be done before restoring TLS segments so + * the GDT and LDT are properly updated, and must be + * done before math_state_restore, so the TS bit is up + * to date. + */ + arch_leave_lazy_cpu_mode(); + /* * Switch FS and GS. */