public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
* [RFC] x86/e820: Add E820_RESERVED_GFX for graphics memory
@ 2016-04-22 13:29 Joonas Lahtinen
  2016-04-25 11:25 ` ✗ Fi.CI.BAT: failure for " Patchwork
  2016-04-25 13:25 ` [RFC] " Joonas Lahtinen
  0 siblings, 2 replies; 3+ messages in thread
From: Joonas Lahtinen @ 2016-04-22 13:29 UTC (permalink / raw)
  To: Intel graphics driver community testing & development
  Cc: daniel.vetter, ville.syrjala

Add a type of memory alongside E820_RESERVED_KERN that is specifically
reserved for graphics usage, E820_RESERVED_GFX. An example is Intel
Gen graphics stolen memory.

Cc: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
---
 arch/x86/include/uapi/asm/e820.h | 5 +++++
 arch/x86/kernel/e820.c           | 8 +++++++-
 arch/x86/kernel/early-quirks.c   | 2 +-
 arch/x86/kernel/tboot.c          | 3 ++-
 arch/x86/mm/init_64.c            | 9 ++++++---
 5 files changed, 21 insertions(+), 6 deletions(-)

diff --git a/arch/x86/include/uapi/asm/e820.h b/arch/x86/include/uapi/asm/e820.h
index 9dafe59..f5324f4 100644
--- a/arch/x86/include/uapi/asm/e820.h
+++ b/arch/x86/include/uapi/asm/e820.h
@@ -53,6 +53,11 @@
  */
 #define E820_RESERVED_KERN        128
 
+/*
+ * RAM to be reserved for graphics device use.
+ */
+#define E820_RESERVED_GFX         129
+
 #ifndef __ASSEMBLY__
 #include <linux/types.h>
 struct e820entry {
diff --git a/arch/x86/kernel/e820.c b/arch/x86/kernel/e820.c
index 621b501..9bbdbc0 100644
--- a/arch/x86/kernel/e820.c
+++ b/arch/x86/kernel/e820.c
@@ -136,6 +136,7 @@ static void __init e820_print_type(u32 type)
 	switch (type) {
 	case E820_RAM:
 	case E820_RESERVED_KERN:
+	case E820_RESERVED_GFX:
 		printk(KERN_CONT "usable");
 		break;
 	case E820_RESERVED:
@@ -694,7 +695,9 @@ void __init e820_mark_nosave_regions(unsigned long limit_pfn)
 
 		pfn = PFN_DOWN(ei->addr + ei->size);
 
-		if (ei->type != E820_RAM && ei->type != E820_RESERVED_KERN)
+		if (ei->type != E820_RAM &&
+		    ei->type != E820_RESERVED_KERN &&
+		    ei->type != E820_RESERVED_GFX)
 			register_nosave_region(PFN_UP(ei->addr), pfn);
 
 		if (pfn >= limit_pfn)
@@ -916,6 +919,7 @@ static const char *e820_type_to_string(int e820_type)
 {
 	switch (e820_type) {
 	case E820_RESERVED_KERN:
+	case E820_RESERVED_GFX:
 	case E820_RAM:	return "System RAM";
 	case E820_ACPI:	return "ACPI Tables";
 	case E820_NVS:	return "ACPI Non-volatile Storage";
@@ -930,6 +934,7 @@ static unsigned long e820_type_to_iomem_type(int e820_type)
 {
 	switch (e820_type) {
 	case E820_RESERVED_KERN:
+	case E820_RESERVED_GFX:
 	case E820_RAM:
 		return IORESOURCE_SYSTEM_RAM;
 	case E820_ACPI:
@@ -954,6 +959,7 @@ static unsigned long e820_type_to_iores_desc(int e820_type)
 	case E820_PRAM:
 		return IORES_DESC_PERSISTENT_MEMORY_LEGACY;
 	case E820_RESERVED_KERN:
+	case E820_RESERVED_GFX:
 	case E820_RAM:
 	case E820_UNUSABLE:
 	default:
diff --git a/arch/x86/kernel/early-quirks.c b/arch/x86/kernel/early-quirks.c
index d2f75b4..7c87b2f 100644
--- a/arch/x86/kernel/early-quirks.c
+++ b/arch/x86/kernel/early-quirks.c
@@ -539,7 +539,7 @@ intel_graphics_stolen(int num, int slot, int func,
 	       "0x%llx-0x%llx\n", base, base + size - 1);
 
 	/* Mark this space as reserved */
-	e820_add_region(base, size, E820_RESERVED);
+	e820_add_region(base, size, E820_RESERVED_GFX);
 	sanitize_e820_map(e820.map, ARRAY_SIZE(e820.map), &e820.nr_map);
 }
 
diff --git a/arch/x86/kernel/tboot.c b/arch/x86/kernel/tboot.c
index e72a07f..077d0c7 100644
--- a/arch/x86/kernel/tboot.c
+++ b/arch/x86/kernel/tboot.c
@@ -196,7 +196,8 @@ static int tboot_setup_sleep(void)
 
 	for (i = 0; i < e820.nr_map; i++) {
 		if ((e820.map[i].type != E820_RAM)
-		 && (e820.map[i].type != E820_RESERVED_KERN))
+		 && (e820.map[i].type != E820_RESERVED_KERN)
+		 && (e820.map[i].type != E820_RESERVED_GFX))
 			continue;
 
 		add_mac_region(e820.map[i].addr, e820.map[i].size);
diff --git a/arch/x86/mm/init_64.c b/arch/x86/mm/init_64.c
index 214afda..d426fae 100644
--- a/arch/x86/mm/init_64.c
+++ b/arch/x86/mm/init_64.c
@@ -415,7 +415,8 @@ phys_pte_init(pte_t *pte_page, unsigned long addr, unsigned long end,
 		if (addr >= end) {
 			if (!after_bootmem &&
 			    !e820_any_mapped(addr & PAGE_MASK, next, E820_RAM) &&
-			    !e820_any_mapped(addr & PAGE_MASK, next, E820_RESERVED_KERN))
+			    !e820_any_mapped(addr & PAGE_MASK, next, E820_RESERVED_KERN) &&
+			    !e820_any_mapped(addr & PAGE_MASK, next, E820_RESERVED_GFX))
 				set_pte(pte, __pte(0));
 			continue;
 		}
@@ -463,7 +464,8 @@ phys_pmd_init(pmd_t *pmd_page, unsigned long address, unsigned long end,
 		if (address >= end) {
 			if (!after_bootmem &&
 			    !e820_any_mapped(address & PMD_MASK, next, E820_RAM) &&
-			    !e820_any_mapped(address & PMD_MASK, next, E820_RESERVED_KERN))
+			    !e820_any_mapped(address & PMD_MASK, next, E820_RESERVED_KERN) &&
+			    !e820_any_mapped(address & PMD_MASK, next, E820_RESERVED_GFX))
 				set_pmd(pmd, __pmd(0));
 			continue;
 		}
@@ -537,7 +539,8 @@ phys_pud_init(pud_t *pud_page, unsigned long addr, unsigned long end,
 		if (addr >= end) {
 			if (!after_bootmem &&
 			    !e820_any_mapped(addr & PUD_MASK, next, E820_RAM) &&
-			    !e820_any_mapped(addr & PUD_MASK, next, E820_RESERVED_KERN))
+			    !e820_any_mapped(addr & PUD_MASK, next, E820_RESERVED_KERN) &&
+			    !e820_any_mapped(addr & PUD_MASK, next, E820_RESERVED_GFX))
 				set_pud(pud, __pud(0));
 			continue;
 		}
-- 
2.5.5

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* ✗ Fi.CI.BAT: failure for x86/e820: Add E820_RESERVED_GFX for graphics memory
  2016-04-22 13:29 [RFC] x86/e820: Add E820_RESERVED_GFX for graphics memory Joonas Lahtinen
@ 2016-04-25 11:25 ` Patchwork
  2016-04-25 13:25 ` [RFC] " Joonas Lahtinen
  1 sibling, 0 replies; 3+ messages in thread
From: Patchwork @ 2016-04-25 11:25 UTC (permalink / raw)
  To: Joonas Lahtinen; +Cc: intel-gfx

== Series Details ==

Series: x86/e820: Add E820_RESERVED_GFX for graphics memory
URL   : https://patchwork.freedesktop.org/series/6161/
State : failure

== Summary ==

Series 6161v1 x86/e820: Add E820_RESERVED_GFX for graphics memory
http://patchwork.freedesktop.org/api/1.0/series/6161/revisions/1/mbox/

Test drv_hangman:
        Subgroup error-state-basic:
                incomplete -> PASS       (snb-dellxps)
Test drv_module_reload_basic:
                pass       -> DMESG-WARN (bsw-nuc-2)
                pass       -> DMESG-WARN (skl-nuci5)
                pass       -> DMESG-WARN (hsw-gt2)
                pass       -> DMESG-WARN (bdw-ultra)
                pass       -> DMESG-WARN (skl-i7k-2)
                pass       -> DMESG-WARN (ivb-t430s)
                pass       -> DMESG-WARN (snb-x220t)
                pass       -> DMESG-FAIL (snb-dellxps)
                pass       -> DMESG-WARN (hsw-brixbox)
                pass       -> DMESG-WARN (ilk-hp8440p)
Test gem_exec_whisper:
        Subgroup basic:
                fail       -> PASS       (ilk-hp8440p)
Test kms_flip:
        Subgroup basic-flip-vs-wf_vblank:
                fail       -> PASS       (bdw-ultra)
        Subgroup basic-plain-flip:
                pass       -> INCOMPLETE (ivb-t430s)
Test kms_pipe_crc_basic:
        Subgroup nonblocking-crc-pipe-a-frame-sequence:
                pass       -> TIMEOUT    (ivb-t430s)
        Subgroup read-crc-pipe-a-frame-sequence:
                pass       -> SKIP       (skl-nuci5)
        Subgroup suspend-read-crc-pipe-b:
                pass       -> SKIP       (skl-nuci5)

bdw-ultra        total:193  pass:169  dwarn:1   dfail:0   fail:0   skip:23 
bsw-nuc-2        total:192  pass:152  dwarn:1   dfail:0   fail:0   skip:39 
hsw-brixbox      total:193  pass:168  dwarn:1   dfail:0   fail:0   skip:24 
hsw-gt2          total:193  pass:173  dwarn:1   dfail:0   fail:0   skip:19 
ilk-hp8440p      total:193  pass:135  dwarn:1   dfail:0   fail:0   skip:57 
ivb-t430s        total:48   pass:39   dwarn:1   dfail:0   fail:0   skip:6  
skl-i7k-2        total:193  pass:167  dwarn:1   dfail:0   fail:0   skip:25 
skl-nuci5        total:193  pass:179  dwarn:1   dfail:0   fail:0   skip:13 
snb-dellxps      total:193  pass:154  dwarn:0   dfail:1   fail:0   skip:38 
snb-x220t        total:193  pass:154  dwarn:1   dfail:0   fail:1   skip:37 
byt-nuc failed to connect after reboot

Results at /archive/results/CI_IGT_test/Patchwork_2059/

2725e5c353b4628e3e37b3e3e26fc6e75222e692 drm-intel-nightly: 2016y-04m-25d-10h-31m-27s UTC integration manifest
b0ea401 x86/e820: Add E820_RESERVED_GFX for graphics memory

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [RFC] x86/e820: Add E820_RESERVED_GFX for graphics memory
  2016-04-22 13:29 [RFC] x86/e820: Add E820_RESERVED_GFX for graphics memory Joonas Lahtinen
  2016-04-25 11:25 ` ✗ Fi.CI.BAT: failure for " Patchwork
@ 2016-04-25 13:25 ` Joonas Lahtinen
  1 sibling, 0 replies; 3+ messages in thread
From: Joonas Lahtinen @ 2016-04-25 13:25 UTC (permalink / raw)
  To: Intel graphics driver community testing & development; +Cc: Daniel Vetter

(Correcting the bad CC's.)

What do others think?

This failed in the CI due to i915 driver not being able to claim
RESERVED_GFX memory as it's handled like RESERVED_KERN in all places.
So that'll need some tweaking, still.

Regards, Joonas

On pe, 2016-04-22 at 16:29 +0300, Joonas Lahtinen wrote:
> Add a type of memory alongside E820_RESERVED_KERN that is specifically
> reserved for graphics usage, E820_RESERVED_GFX. An example is Intel
> Gen graphics stolen memory.
> 
> Cc: Chris Wilson <chris@chris-wilson.co.uk>
> Signed-off-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
> ---
>  arch/x86/include/uapi/asm/e820.h | 5 +++++
>  arch/x86/kernel/e820.c           | 8 +++++++-
>  arch/x86/kernel/early-quirks.c   | 2 +-
>  arch/x86/kernel/tboot.c          | 3 ++-
>  arch/x86/mm/init_64.c            | 9 ++++++---
>  5 files changed, 21 insertions(+), 6 deletions(-)
> 
> diff --git a/arch/x86/include/uapi/asm/e820.h b/arch/x86/include/uapi/asm/e820.h
> index 9dafe59..f5324f4 100644
> --- a/arch/x86/include/uapi/asm/e820.h
> +++ b/arch/x86/include/uapi/asm/e820.h
> @@ -53,6 +53,11 @@
>   */
>  #define E820_RESERVED_KERN        128
>  
> +/*
> + * RAM to be reserved for graphics device use.
> + */
> +#define E820_RESERVED_GFX         129
> +
>  #ifndef __ASSEMBLY__
>  #include 
>  struct e820entry {
> diff --git a/arch/x86/kernel/e820.c b/arch/x86/kernel/e820.c
> index 621b501..9bbdbc0 100644
> --- a/arch/x86/kernel/e820.c
> +++ b/arch/x86/kernel/e820.c
> @@ -136,6 +136,7 @@ static void __init e820_print_type(u32 type)
>  	switch (type) {
>  	case E820_RAM:
>  	case E820_RESERVED_KERN:
> +	case E820_RESERVED_GFX:
>  		printk(KERN_CONT "usable");
>  		break;
>  	case E820_RESERVED:
> @@ -694,7 +695,9 @@ void __init e820_mark_nosave_regions(unsigned long limit_pfn)
>  
>  		pfn = PFN_DOWN(ei->addr + ei->size);
>  
> -		if (ei->type != E820_RAM && ei->type != E820_RESERVED_KERN)
> +		if (ei->type != E820_RAM &&
> +		    ei->type != E820_RESERVED_KERN &&
> +		    ei->type != E820_RESERVED_GFX)
>  			register_nosave_region(PFN_UP(ei->addr), pfn);
>  
>  		if (pfn >= limit_pfn)
> @@ -916,6 +919,7 @@ static const char *e820_type_to_string(int e820_type)
>  {
>  	switch (e820_type) {
>  	case E820_RESERVED_KERN:
> +	case E820_RESERVED_GFX:
>  	case E820_RAM:	return "System RAM";
>  	case E820_ACPI:	return "ACPI Tables";
>  	case E820_NVS:	return "ACPI Non-volatile Storage";
> @@ -930,6 +934,7 @@ static unsigned long e820_type_to_iomem_type(int e820_type)
>  {
>  	switch (e820_type) {
>  	case E820_RESERVED_KERN:
> +	case E820_RESERVED_GFX:
>  	case E820_RAM:
>  		return IORESOURCE_SYSTEM_RAM;
>  	case E820_ACPI:
> @@ -954,6 +959,7 @@ static unsigned long e820_type_to_iores_desc(int e820_type)
>  	case E820_PRAM:
>  		return IORES_DESC_PERSISTENT_MEMORY_LEGACY;
>  	case E820_RESERVED_KERN:
> +	case E820_RESERVED_GFX:
>  	case E820_RAM:
>  	case E820_UNUSABLE:
>  	default:
> diff --git a/arch/x86/kernel/early-quirks.c b/arch/x86/kernel/early-quirks.c
> index d2f75b4..7c87b2f 100644
> --- a/arch/x86/kernel/early-quirks.c
> +++ b/arch/x86/kernel/early-quirks.c
> @@ -539,7 +539,7 @@ intel_graphics_stolen(int num, int slot, int func,
>  	       "0x%llx-0x%llx\n", base, base + size - 1);
>  
>  	/* Mark this space as reserved */
> -	e820_add_region(base, size, E820_RESERVED);
> +	e820_add_region(base, size, E820_RESERVED_GFX);
>  	sanitize_e820_map(e820.map, ARRAY_SIZE(e820.map), &e820.nr_map);
>  }
>  
> diff --git a/arch/x86/kernel/tboot.c b/arch/x86/kernel/tboot.c
> index e72a07f..077d0c7 100644
> --- a/arch/x86/kernel/tboot.c
> +++ b/arch/x86/kernel/tboot.c
> @@ -196,7 +196,8 @@ static int tboot_setup_sleep(void)
>  
>  	for (i = 0; i < e820.nr_map; i++) {
>  		if ((e820.map[i].type != E820_RAM)
> -		 && (e820.map[i].type != E820_RESERVED_KERN))
> +		 && (e820.map[i].type != E820_RESERVED_KERN)
> +		 && (e820.map[i].type != E820_RESERVED_GFX))
>  			continue;
>  
>  		add_mac_region(e820.map[i].addr, e820.map[i].size);
> diff --git a/arch/x86/mm/init_64.c b/arch/x86/mm/init_64.c
> index 214afda..d426fae 100644
> --- a/arch/x86/mm/init_64.c
> +++ b/arch/x86/mm/init_64.c
> @@ -415,7 +415,8 @@ phys_pte_init(pte_t *pte_page, unsigned long addr, unsigned long end,
>  		if (addr >= end) {
>  			if (!after_bootmem &&
>  			    !e820_any_mapped(addr & PAGE_MASK, next, E820_RAM) &&
> -			    !e820_any_mapped(addr & PAGE_MASK, next, E820_RESERVED_KERN))
> +			    !e820_any_mapped(addr & PAGE_MASK, next, E820_RESERVED_KERN) &&
> +			    !e820_any_mapped(addr & PAGE_MASK, next, E820_RESERVED_GFX))
>  				set_pte(pte, __pte(0));
>  			continue;
>  		}
> @@ -463,7 +464,8 @@ phys_pmd_init(pmd_t *pmd_page, unsigned long address, unsigned long end,
>  		if (address >= end) {
>  			if (!after_bootmem &&
>  			    !e820_any_mapped(address & PMD_MASK, next, E820_RAM) &&
> -			    !e820_any_mapped(address & PMD_MASK, next, E820_RESERVED_KERN))
> +			    !e820_any_mapped(address & PMD_MASK, next, E820_RESERVED_KERN) &&
> +			    !e820_any_mapped(address & PMD_MASK, next, E820_RESERVED_GFX))
>  				set_pmd(pmd, __pmd(0));
>  			continue;
>  		}
> @@ -537,7 +539,8 @@ phys_pud_init(pud_t *pud_page, unsigned long addr, unsigned long end,
>  		if (addr >= end) {
>  			if (!after_bootmem &&
>  			    !e820_any_mapped(addr & PUD_MASK, next, E820_RAM) &&
> -			    !e820_any_mapped(addr & PUD_MASK, next, E820_RESERVED_KERN))
> +			    !e820_any_mapped(addr & PUD_MASK, next, E820_RESERVED_KERN) &&
> +			    !e820_any_mapped(addr & PUD_MASK, next, E820_RESERVED_GFX))
>  				set_pud(pud, __pud(0));
>  			continue;
>  		}
-- 
Joonas Lahtinen
Open Source Technology Center
Intel Corporation
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-04-25 13:24 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-04-22 13:29 [RFC] x86/e820: Add E820_RESERVED_GFX for graphics memory Joonas Lahtinen
2016-04-25 11:25 ` ✗ Fi.CI.BAT: failure for " Patchwork
2016-04-25 13:25 ` [RFC] " Joonas Lahtinen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox