Skip to contentSkip to conversation

efi: avoid error message when booting under Xen

PATCH Superseded Juergen Gross 3 participants 7 messages Jun 10, 2020 – Jul 10, 2020

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 efi: avoid error message when booting under Xen

efifb_probe() will issue an error message in case the kernel is booted as Xen dom0 from UEFI as EFI_MEMMAP won't be set in this case. Avoid that message by calling efi_mem_desc_lookup() only if EFI_PARAVIRT isn't set.

Fixes 38ac0287b7f4 ("fbdev/efifb: Honour UEFI memory map attributes when mapping the FB")
---
 drivers/video/fbdev/efifb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/video/fbdev/efifb.c +1 -1
index 65491ae74808..f5eccd1373e9 100644
@@ -453,7 +453,7 @@ static int efifb_probe(struct platform_device *dev)
 	info->apertures->ranges[0].base = efifb_fix.smem_start;
 	info->apertures->ranges[0].size = size_remap;
 
-	if (efi_enabled(EFI_BOOT) &&
+	if (efi_enabled(EFI_BOOT) && !efi_enabled(EFI_PARAVIRT) &&
 	    !efi_mem_desc_lookup(efifb_fix.smem_start, &md)) {
 		if ((efifb_fix.smem_start + efifb_fix.smem_len) >
 		    (md.phys_addr + (md.num_pages << EFI_PAGE_SHIFT))) {
Signature · 1 line
2.26.2
#1 lore raw

Ping?

Quoted 25 lines · Juergen Gross

efifb_probe() will issue an error message in case the kernel is booted as Xen dom0 from UEFI as EFI_MEMMAP won't be set in this case. Avoid that message by calling efi_mem_desc_lookup() only if EFI_PARAVIRT isn't set.

Fixes 38ac0287b7f4 ("fbdev/efifb: Honour UEFI memory map attributes when mapping the FB")
---
  drivers/video/fbdev/efifb.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/video/fbdev/efifb.c +1 -1
index 65491ae74808..f5eccd1373e9 100644
@@ -453,7 +453,7 @@ static int efifb_probe(struct platform_device *dev)
  	info->apertures->ranges[0].base = efifb_fix.smem_start;
  	info->apertures->ranges[0].size = size_remap;
 
-	if (efi_enabled(EFI_BOOT) &&
+	if (efi_enabled(EFI_BOOT) && !efi_enabled(EFI_PARAVIRT) &&
  	    !efi_mem_desc_lookup(efifb_fix.smem_start, &md)) {
  		if ((efifb_fix.smem_start + efifb_fix.smem_len) >
  		    (md.phys_addr + (md.num_pages << EFI_PAGE_SHIFT))) {
#2 lore raw
Quoted 15 lines · Jürgen Groß

Ping?

Quoted 12 lines · Juergen Gross

efifb_probe() will issue an error message in case the kernel is booted as Xen dom0 from UEFI as EFI_MEMMAP won't be set in this case. Avoid that message by calling efi_mem_desc_lookup() only if EFI_PARAVIRT isn't set.

Fixes 38ac0287b7f4 ("fbdev/efifb: Honour UEFI memory map attributes

when mapping the FB")

---
  drivers/video/fbdev/efifb.c | 2 +-

  1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 14 lines
Quoted 10 lines
drivers/video/fbdev/efifb.c +1 -1
index 65491ae74808..f5eccd1373e9 100644
@@ -453,7 +453,7 @@ static int efifb_probe(struct platform_device *dev)
       info->apertures->ranges[0].base = efifb_fix.smem_start;
       info->apertures->ranges[0].size = size_remap;
-    if (efi_enabled(EFI_BOOT) &&
+    if (efi_enabled(EFI_BOOT) && !efi_enabled(EFI_PARAVIRT) &&
           !efi_mem_desc_lookup(efifb_fix.smem_start, &md)) {
Quoted 3 lines

          if ((efifb_fix.smem_start + efifb_fix.smem_len) > (md.phys_addr + (md.num_pages << EFI_PAGE_SHIFT))) {

In case I see no reaction from the maintainer for another week I'll take this patch through the Xen tree.

Juergen

#3 lore raw

[ added EFI Maintainer & ML to Cc: ]

Hi,

Quoted 30 lines · Jürgen Groß
Quoted 14 lines · Jürgen Groß

Ping?

Quoted 11 lines · Juergen Gross

efifb_probe() will issue an error message in case the kernel is booted as Xen dom0 from UEFI as EFI_MEMMAP won't be set in this case. Avoid that message by calling efi_mem_desc_lookup() only if EFI_PARAVIRT isn't set.

Fixes 38ac0287b7f4 ("fbdev/efifb: Honour UEFI memory map attributes when mapping the FB")

---
  drivers/video/fbdev/efifb.c | 2 +-

  1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 14 lines
Quoted 10 lines
drivers/video/fbdev/efifb.c +1 -1
index 65491ae74808..f5eccd1373e9 100644
@@ -453,7 +453,7 @@ static int efifb_probe(struct platform_device *dev)
       info->apertures->ranges[0].base = efifb_fix.smem_start;
       info->apertures->ranges[0].size = size_remap;
-    if (efi_enabled(EFI_BOOT) &&
+    if (efi_enabled(EFI_BOOT) && !efi_enabled(EFI_PARAVIRT) &&
           !efi_mem_desc_lookup(efifb_fix.smem_start, &md)) {
Quoted 3 lines

          if ((efifb_fix.smem_start + efifb_fix.smem_len) > (md.phys_addr + (md.num_pages << EFI_PAGE_SHIFT))) {

Quoted 2 lines

In case I see no reaction from the maintainer for another week I'll take this patch through the Xen tree.

From fbdev POV this change looks fine to me and I'm OK with merging it through Xen or EFI tree:

Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics

maintainer
#4 lore raw
Quoted 16 lines · Bartlomiej Zolnierkiewicz

[ added EFI Maintainer & ML to Cc: ]

Hi,

Quoted 9 lines · Jürgen Groß
Quoted 8 lines · Jürgen Groß

Ping?

Quoted 5 lines · Juergen Gross

efifb_probe() will issue an error message in case the kernel is booted as Xen dom0 from UEFI as EFI_MEMMAP won't be set in this case. Avoid that message by calling efi_mem_desc_lookup() only if EFI_PARAVIRT isn't set.

Why not test for EFI_MEMMAP instead of EFI_BOOT?

Quoted 34 lines
Quoted 21 lines
Quoted 6 lines
Quoted 6 lines
Fixes 38ac0287b7f4 ("fbdev/efifb: Honour UEFI memory map attributes when mapping the FB")
---
  drivers/video/fbdev/efifb.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 14 lines

drivers/video/fbdev/efifb.c static int efifb_probe(struct platform_device *dev) · line 459

Quoted 13 lines
drivers/video/fbdev/efifb.c +1 -1
index 65491ae74808..f5eccd1373e9 100644
@@ -453,7 +453,7 @@ static int efifb_probe(struct platform_device *dev)
      info->apertures->ranges[0].base = efifb_fix.smem_start;
      info->apertures->ranges[0].size = size_remap;
-    if (efi_enabled(EFI_BOOT) &&
+    if (efi_enabled(EFI_BOOT) && !efi_enabled(EFI_PARAVIRT) &&
          !efi_mem_desc_lookup(efifb_fix.smem_start, &md)) {
          if ((efifb_fix.smem_start + efifb_fix.smem_len) >
              (md.phys_addr + (md.num_pages << EFI_PAGE_SHIFT))) {
 
Quoted 2 lines

In case I see no reaction from the maintainer for another week I'll take this patch through the Xen tree.

From fbdev POV this change looks fine to me and I'm OK with merging it through Xen or EFI tree:

Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics

#5 lore raw
Quoted 12 lines · Ard Biesheuvel
Quoted 10 lines · Bartlomiej Zolnierkiewicz

[ added EFI Maintainer & ML to Cc: ]

Hi,

Quoted 3 lines · Jürgen Groß
Quoted 2 lines · Jürgen Groß

Ping?

Quoted 8 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines · Juergen Gross
Quoted 5 lines

efifb_probe() will issue an error message in case the kernel is booted as Xen dom0 from UEFI as EFI_MEMMAP won't be set in this case. Avoid that message by calling efi_mem_desc_lookup() only if EFI_PARAVIRT isn't set.

Why not test for EFI_MEMMAP instead of EFI_BOOT?

Honestly I'm not sure EFI_BOOT is always set in that case. If you tell me it is fine to just replace the test to check for EFI_MEMMAP I'm fine to modify my patch.

Juergen

maintainer
#6 lore raw
Quoted 21 lines · Jürgen Groß
Quoted 19 lines · Ard Biesheuvel
Quoted 16 lines · Bartlomiej Zolnierkiewicz

[ added EFI Maintainer & ML to Cc: ]

Hi,

Quoted 9 lines · Jürgen Groß
Quoted 8 lines · Jürgen Groß

Ping?

Quoted 5 lines · Juergen Gross

efifb_probe() will issue an error message in case the kernel is booted as Xen dom0 from UEFI as EFI_MEMMAP won't be set in this case. Avoid that message by calling efi_mem_desc_lookup() only if EFI_PARAVIRT isn't set.

Quoted 6 lines
Quoted 1 line

Why not test for EFI_MEMMAP instead of EFI_BOOT?

Honestly I'm not sure EFI_BOOT is always set in that case. If you tell me it is fine to just replace the test to check for EFI_MEMMAP I'm fine to modify my patch.

Yes please