From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753803AbbHaQFh (ORCPT ); Mon, 31 Aug 2015 12:05:37 -0400 Received: from mail-ob0-f169.google.com ([209.85.214.169]:33469 "EHLO mail-ob0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753761AbbHaQFe (ORCPT ); Mon, 31 Aug 2015 12:05:34 -0400 Subject: Fwd: [PATCH] x86: Use larger chunks in mtrr_cleanup References: <55E477DE.2060106@gmail.com> To: tglx@linutronix.de, mingo@redhat.com, "H. Peter Anvin" Cc: linux-kernel@vger.kernel.org, x86@kernel.org, prarit@redhat.com From: Stuart Hayes X-Forwarded-Message-Id: <55E477DE.2060106@gmail.com> Message-ID: <55E47B4D.1050103@gmail.com> Date: Mon, 31 Aug 2015 11:05:33 -0500 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-Version: 1.0 In-Reply-To: <55E477DE.2060106@gmail.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 Increase the range of chunk sizes tried in mtrr_cleanup() so it is able to map large memory configs into MTRRs. Currently, mtrr_cleanup() will fail with large memory configurations, because it limits chunk_size to 2GB, which means that each MTRR can only cover 2GB of memory. With a memory size of, say, 256GB, and ten variable MTRRs (such as some recent Intel CPUs have), it is not possible to set up the MTRRs to cover all of memory. Signed-off-by: Stuart Hayes --- --- linux-4.2-rc7/arch/x86/kernel/cpu/mtrr/cleanup.c.orig 2015-08-16 18:34:13.000000000 -0500 +++ linux-4.2-rc7/arch/x86/kernel/cpu/mtrr/cleanup.c 2015-08-27 12:29:51.908579247 -0500 @@ -517,10 +517,11 @@ struct mtrr_cleanup_result { /* * gran_size: 64K, 128K, 256K, 512K, 1M, 2M, ..., 2G - * chunk size: gran_size, ..., 2G - * so we need (1+16)*8 + * chunk size: gran_size, ..., 2G, ..., 1<= NUM_RESULT)