Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757898AbZJNINW (ORCPT ); Wed, 14 Oct 2009 04:13:22 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1757660AbZJNINV (ORCPT ); Wed, 14 Oct 2009 04:13:21 -0400 Received: from vpn.id2.novell.com ([195.33.99.129]:32929 "EHLO vpn.id2.novell.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755033AbZJNINU convert rfc822-to-8bit (ORCPT ); Wed, 14 Oct 2009 04:13:20 -0400 Message-Id: <4AD5A4540200007800019CE9@vpn.id2.novell.com> X-Mailer: Novell GroupWise Internet Agent 8.0.1 Date: Wed, 14 Oct 2009 09:13:40 +0100 From: "Jan Beulich" To: "Thomas Schlichter" Cc: "Jeremy Fitzhardinge" , "Robert Hancock" , "Henrique de Moraes Holschuh" , "Suresh Siddha" , "Venkatesh Pallipadi" , "Tejun Heo" , , "Yinghai Lu" , "Thomas Gleixner" , "Arjan van de Ven" , , "Ingo Molnar" , , , "Thomas Hellstrom" , "H. Peter Anvin" Subject: Re: [RFC Patch] use MTRR for write combining if PAT is not available References: <4AD449A702000078000197EE@vpn.id2.novell.com> <200910132329.05152.thomas.schlichter@web.de> In-Reply-To: <200910132329.05152.thomas.schlichter@web.de> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 8BIT Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1148 Lines: 27 >>> Thomas Schlichter 13.10.09 23:29 >>> >Jan Beulich wrote: >> >>> Thomas Schlichter 12.10.09 20:32 >>> >> >+ if (!pat_enabled) { >> >+ void __iomem *ret = ioremap_nocache(phys_addr, size); >> >+ if (ret) >> >+ mtrr_add(phys_addr, size, MTRR_TYPE_WRCOMB, false); >> >> This won't work if phys_addr or size aren't page aligned, or if size isn't >> a power of two. > >No, at least the comments in mtrr_add and mtrr_check state that it is just >required that phys_addr and size are multiple of PAGE_SIZE. And I'm not sure >if it is always safe to round these up/down to the next PAGE boundary. If it >is not, maybe it is better to fail... That function isn't the limiting factor, generic_validate_add_page() is what you need to look at (plus the spec on how the MTRR ranges are calculated by the CPU from the base/mask register pairs). Jan -- 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/