From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932976Ab2GYMcf (ORCPT ); Wed, 25 Jul 2012 08:32:35 -0400 Received: from mx1.redhat.com ([209.132.183.28]:59194 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932089Ab2GYMce (ORCPT ); Wed, 25 Jul 2012 08:32:34 -0400 Message-ID: <500FE74C.4040907@redhat.com> Date: Wed, 25 Jul 2012 15:32:12 +0300 From: Avi Kivity User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:13.0) Gecko/20120615 Thunderbird/13.0.1 MIME-Version: 1.0 To: Stefan Bader CC: Cong Wang , Linux Kernel Mailing List , Ingo Molnar , Yinghai Lu , Tejun Heo Subject: Re: x86/mm: Limit 2/4M size calculation to x86_32 References: <5000259D.9020303@canonical.com> <500FCDF3.7080808@redhat.com> <500FD4FA.7020904@canonical.com> In-Reply-To: <500FD4FA.7020904@canonical.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 07/25/2012 02:14 PM, Stefan Bader wrote: > On 25.07.2012 12:44, Avi Kivity wrote: >> On 07/24/2012 06:52 PM, Cong Wang wrote: >> >>>> From 6b679d1af20656929c0e829f29eed60b0a86a74f Mon Sep 17 00:00:00 2001 >>>> From: Stefan Bader >>>> Date: Fri, 13 Jul 2012 15:16:33 +0200 >>>> Subject: [PATCH] x86/mm: Limit 2/4M size calculation to x86_32 >>>> >>>> commit 722bc6b (x86/mm: Fix the size calculation of mapping tables) >>>> did modify the extra space calculation for mapping tables in order >>>> to make up for the first 2/4M memory range using 4K pages. >>>> However this setup is only used when compiling for 32bit. On 64bit >>>> there is only the trailing area of 4K pages (which is already added). >>>> >>>> The code was already adapted once for things went wrong on a 8TB >>>> machine (bd2753b x86/mm: Only add extra pages count for the first memory >>>> range during pre-allocation early page table space), but it looks a bit >>>> like it currently would overdo things for 64bit. >>>> I only noticed while bisecting for the reason I could not make a crash >>>> kernel boot (which ended up on this patch). >>>> >>>> Signed-off-by: Stefan Bader >>>> Cc: WANG Cong >>>> Cc: Yinghai Lu >>>> Cc: Tejun Heo >>> >>> Acked-by: Cong Wang >>> >>> Sorry for that I was not aware of x86_64 is different with x86 in the >>> first 2/4M. >> >> Why would there be a difference? >> >> Shouldn't the IO space at 0xa0000-0x100000 be mapped with uncacheable >> attributes (or WC for VGA)? If it's done later, it can be done later >> for both. >> > arch/x86/mm/init.c > > unsigned long __init_refok init_memory_mapping(... > ... > ifdef CONFIG_X86_32 > /* > * Don't use a large page for the first 2/4MB of memory > * because there are often fixed size MTRRs in there > * and overlapping MTRRs into large pages can cause > * slowdowns. > */ > That's equally true for X86_64. Best would be to merge the MTRRs into PAT, but that might not work for SMM. -- error compiling committee.c: too many arguments to function