diff mbox series

efi: avoid error message when booting under Xen

Message ID 20200610141052.13258-1-jgross@suse.com (mailing list archive)
State Superseded, archived
Headers show
Series efi: avoid error message when booting under Xen | expand

Commit Message

Jürgen Groß June 10, 2020, 2:10 p.m. UTC
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")
Signed-off-by: Juergen Gross <jgross@suse.com>
---
 drivers/video/fbdev/efifb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Jürgen Groß June 28, 2020, 8:50 a.m. UTC | #1
Ping?

On 10.06.20 16:10, Juergen Gross wrote:
> 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")
> Signed-off-by: Juergen Gross <jgross@suse.com>
> ---
>   drivers/video/fbdev/efifb.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/video/fbdev/efifb.c b/drivers/video/fbdev/efifb.c
> index 65491ae74808..f5eccd1373e9 100644
> --- a/drivers/video/fbdev/efifb.c
> +++ b/drivers/video/fbdev/efifb.c
> @@ -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))) {
>
Jürgen Groß July 9, 2020, 9:17 a.m. UTC | #2
On 28.06.20 10:50, Jürgen Groß wrote:
> Ping?
> 
> On 10.06.20 16:10, Juergen Gross wrote:
>> 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")
>> Signed-off-by: Juergen Gross <jgross@suse.com>
>> ---
>>   drivers/video/fbdev/efifb.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/video/fbdev/efifb.c b/drivers/video/fbdev/efifb.c
>> index 65491ae74808..f5eccd1373e9 100644
>> --- a/drivers/video/fbdev/efifb.c
>> +++ b/drivers/video/fbdev/efifb.c
>> @@ -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))) {
>>
> 

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


Juergen
Bartlomiej Zolnierkiewicz July 10, 2020, 10:16 a.m. UTC | #3
[ added EFI Maintainer & ML to Cc: ]

Hi,

On 7/9/20 11:17 AM, Jürgen Groß wrote:
> On 28.06.20 10:50, Jürgen Groß wrote:
>> Ping?
>>
>> On 10.06.20 16:10, Juergen Gross wrote:
>>> 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")
>>> Signed-off-by: Juergen Gross <jgross@suse.com>
>>> ---
>>>   drivers/video/fbdev/efifb.c | 2 +-
>>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/drivers/video/fbdev/efifb.c b/drivers/video/fbdev/efifb.c
>>> index 65491ae74808..f5eccd1373e9 100644
>>> --- a/drivers/video/fbdev/efifb.c
>>> +++ b/drivers/video/fbdev/efifb.c
>>> @@ -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))) {
>>>
>>
> 
> 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:

Acked-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>

Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics
Ard Biesheuvel July 10, 2020, 1:27 p.m. UTC | #4
On Fri, 10 Jul 2020 at 13:17, Bartlomiej Zolnierkiewicz
<b.zolnierkie@samsung.com> wrote:
>
>
> [ added EFI Maintainer & ML to Cc: ]
>
> Hi,
>
> On 7/9/20 11:17 AM, Jürgen Groß wrote:
> > On 28.06.20 10:50, Jürgen Groß wrote:
> >> Ping?
> >>
> >> On 10.06.20 16:10, Juergen Gross wrote:
> >>> 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?


> >>> Fixes: 38ac0287b7f4 ("fbdev/efifb: Honour UEFI memory map attributes when mapping the FB")
> >>> Signed-off-by: Juergen Gross <jgross@suse.com>
> >>> ---
> >>>   drivers/video/fbdev/efifb.c | 2 +-
> >>>   1 file changed, 1 insertion(+), 1 deletion(-)
> >>>
> >>> diff --git a/drivers/video/fbdev/efifb.c b/drivers/video/fbdev/efifb.c
> >>> index 65491ae74808..f5eccd1373e9 100644
> >>> --- a/drivers/video/fbdev/efifb.c
> >>> +++ b/drivers/video/fbdev/efifb.c
> >>> @@ -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))) {
> >>>
> >>
> >
> > 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:
>
> Acked-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
>
> Best regards,
> --
> Bartlomiej Zolnierkiewicz
> Samsung R&D Institute Poland
> Samsung Electronics
Jürgen Groß July 10, 2020, 1:38 p.m. UTC | #5
On 10.07.20 15:27, Ard Biesheuvel wrote:
> On Fri, 10 Jul 2020 at 13:17, Bartlomiej Zolnierkiewicz
> <b.zolnierkie@samsung.com> wrote:
>>
>>
>> [ added EFI Maintainer & ML to Cc: ]
>>
>> Hi,
>>
>> On 7/9/20 11:17 AM, Jürgen Groß wrote:
>>> On 28.06.20 10:50, Jürgen Groß wrote:
>>>> Ping?
>>>>
>>>> On 10.06.20 16:10, Juergen Gross wrote:
>>>>> 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
Ard Biesheuvel July 10, 2020, 1:41 p.m. UTC | #6
On Fri, 10 Jul 2020 at 16:38, Jürgen Groß <jgross@suse.com> wrote:
>
> On 10.07.20 15:27, Ard Biesheuvel wrote:
> > On Fri, 10 Jul 2020 at 13:17, Bartlomiej Zolnierkiewicz
> > <b.zolnierkie@samsung.com> wrote:
> >>
> >>
> >> [ added EFI Maintainer & ML to Cc: ]
> >>
> >> Hi,
> >>
> >> On 7/9/20 11:17 AM, Jürgen Groß wrote:
> >>> On 28.06.20 10:50, Jürgen Groß wrote:
> >>>> Ping?
> >>>>
> >>>> On 10.06.20 16:10, Juergen Gross wrote:
> >>>>> 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.
>


Yes please
diff mbox series

Patch

diff --git a/drivers/video/fbdev/efifb.c b/drivers/video/fbdev/efifb.c
index 65491ae74808..f5eccd1373e9 100644
--- a/drivers/video/fbdev/efifb.c
+++ b/drivers/video/fbdev/efifb.c
@@ -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))) {