From: Chris Wilson Subject: [PATCH 1/3] x86: Use a custom name for the Intel Graphics Stolen reservation Date: Thu, 25 Jul 2013 23:27:15 +0100 Message-ID: <1374791237-31089-1-git-send-email-chris@chris-wilson.co.uk> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from fireflyinternet.com (s16502780.onlinehome-server.info [87.106.93.118]) by gabe.freedesktop.org (Postfix) with ESMTP id 8BA40E631C for ; Thu, 25 Jul 2013 15:27:36 -0700 (PDT) List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org Errors-To: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org To: intel-gfx@lists.freedesktop.org List-Id: intel-gfx@lists.freedesktop.org By giving the stolen a region a unique type and name, we then insert it into the iomem_resource as a known resource. This clear identifies it to the user when printing the e820 map (and later the iomem resources), and exposes it to the driver for later use. v2: Also need to add the string to a second id-to-name switch Signed-off-by: Chris Wilson Cc: Jesse Barnes --- arch/x86/include/uapi/asm/e820.h | 2 ++ arch/x86/kernel/e820.c | 5 +++++ arch/x86/kernel/early-quirks.c | 12 ++---------- 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/arch/x86/include/uapi/asm/e820.h b/arch/x86/include/uapi/asm/e820.h index bbae024..72384ce 100644 --- a/arch/x86/include/uapi/asm/e820.h +++ b/arch/x86/include/uapi/asm/e820.h @@ -38,6 +38,8 @@ #define E820_NVS 4 #define E820_UNUSABLE 5 +#define E820_STOLEN_IGFX 6 +#define E820_STOLEN_IGFX_STRING "Intel Graphics Stolen" /* * reserved RAM used by kernel itself diff --git a/arch/x86/kernel/e820.c b/arch/x86/kernel/e820.c index d32abea..3918f4d3 100644 --- a/arch/x86/kernel/e820.c +++ b/arch/x86/kernel/e820.c @@ -149,6 +149,10 @@ static void __init e820_print_type(u32 type) case E820_UNUSABLE: printk(KERN_CONT "unusable"); break; + + case E820_STOLEN_IGFX: + printk(KERN_CONT E820_STOLEN_IGFX_STRING); + break; default: printk(KERN_CONT "type %u", type); break; @@ -915,6 +919,7 @@ static inline const char *e820_type_to_string(int e820_type) case E820_ACPI: return "ACPI Tables"; case E820_NVS: return "ACPI Non-volatile Storage"; case E820_UNUSABLE: return "Unusable memory"; + case E820_STOLEN_IGFX: return E820_STOLEN_IGFX_STRING; default: return "reserved"; } } diff --git a/arch/x86/kernel/early-quirks.c b/arch/x86/kernel/early-quirks.c index bff8a6f..27b6d17 100644 --- a/arch/x86/kernel/early-quirks.c +++ b/arch/x86/kernel/early-quirks.c @@ -350,18 +350,10 @@ static void __init intel_graphics_stolen(int num, int slot, int func) size = stolen_size(num, slot, func); start = intel_stolen_base(num, slot, func); if (size && start) - goto found; - else - break; + e820_add_region(start, size, E820_STOLEN_IGFX); + return; } } - - /* No match or invalid data, don't bother reserving */ - return; -found: - /* Mark this space as reserved */ - e820_add_region(start, size, E820_RESERVED); - return; } #define QFLAG_APPLY_ONCE 0x1 -- 1.8.3.2