From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail202.messagelabs.com (mail202.messagelabs.com [216.82.254.227]) by kanga.kvack.org (Postfix) with ESMTP id 8A85F6B0083 for ; Sat, 21 Feb 2009 11:25:26 -0500 (EST) Message-ID: <49A029F9.40902@cs.helsinki.fi> Date: Sat, 21 Feb 2009 18:21:13 +0200 From: Pekka Enberg MIME-Version: 1.0 Subject: Re: [PATCH] kmemcheck: disable fast string operations on P4 CPUs References: <1235223364-2097-1-git-send-email-vegard.nossum@gmail.com> <1235223364-2097-2-git-send-email-vegard.nossum@gmail.com> In-Reply-To: <1235223364-2097-2-git-send-email-vegard.nossum@gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Sender: owner-linux-mm@kvack.org To: Vegard Nossum Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, Ingo Molnar List-ID: Vegard Nossum wrote: > This patch may allow us to remove the REP emulation code from > kmemcheck. > > Signed-off-by: Vegard Nossum Looks good to me! Acked-by: Pekka Enberg > +#ifdef CONFIG_KMEMCHECK > + /* > + * P4s have a "fast strings" feature which causes single- > + * stepping REP instructions to only generate a #DB on > + * cache-line boundaries. > + * > + * Ingo Molnar reported a Pentium D (model 6) and a Xeon > + * (model 2) with the same problem. > + */ Minor nit: I'd move the latter part of the comment to the changelog. > + if (c->x86 == 15) { > + u64 misc_enable; > + > + rdmsrl(MSR_IA32_MISC_ENABLE, misc_enable); > + > + if (misc_enable & MSR_IA32_MISC_ENABLE_FAST_STRING) { > + printk(KERN_INFO "kmemcheck: Disabling fast string operations\n"); > + > + misc_enable &= ~MSR_IA32_MISC_ENABLE_FAST_STRING; > + wrmsrl(MSR_IA32_MISC_ENABLE, misc_enable); > + } > + } > +#endif > } > > #ifdef CONFIG_X86_32 -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org