All of lore.kernel.org
 help / color / mirror / Atom feed
From: Igor Druzhinin <igor.druzhinin@citrix.com>
To: <xen-devel@lists.xenproject.org>
Cc: Igor Druzhinin <igor.druzhinin@citrix.com>, jbeulich@suse.com
Subject: [Xen-devel] [PATCH 1/2] efi/boot: fix set_color function
Date: Thu, 3 Oct 2019 14:49:14 +0100	[thread overview]
Message-ID: <1570110555-24287-2-git-send-email-igor.druzhinin@citrix.com> (raw)
In-Reply-To: <1570110555-24287-1-git-send-email-igor.druzhinin@citrix.com>

- 0 is a possible and allowed value for a color mask accroding to
  UEFI Spec 2.6 (11.9) especially for reserved mask
- add missing pointer dereference

Without these changes non-TrueColor modes won't work which will cause
GOP init to fail - observed while trying to boot EFI Xen with Cirrus VGA.

Signed-off-by: Igor Druzhinin <igor.druzhinin@citrix.com>
---
 xen/common/efi/boot.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/xen/common/efi/boot.c b/xen/common/efi/boot.c
index 9a89414..933db88 100644
--- a/xen/common/efi/boot.c
+++ b/xen/common/efi/boot.c
@@ -1113,10 +1113,14 @@ static int __init __maybe_unused set_color(u32 mask, int bpp, u8 *pos, u8 *sz)
    if ( bpp < 0 )
        return bpp;
    if ( !mask )
-       return -EINVAL;
+   {
+       *pos = 0;
+       *sz = 0;
+       return bpp;
+   }
    for ( *pos = 0; !(mask & 1); ++*pos )
        mask >>= 1;
-   for ( *sz = 0; mask & 1; ++sz)
+   for ( *sz = 0; mask & 1; ++*sz)
        mask >>= 1;
    if ( mask )
        return -EINVAL;
-- 
2.7.4


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

  reply	other threads:[~2019-10-03 13:49 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-03 13:49 [Xen-devel] [PATCH 0/2] EFI GOP fixes Igor Druzhinin
2019-10-03 13:49 ` Igor Druzhinin [this message]
2019-10-04 10:34   ` [Xen-devel] [PATCH 1/2] efi/boot: fix set_color function Jan Beulich
2019-10-04 10:54     ` Igor Druzhinin
2019-10-04 11:14       ` Jan Beulich
2019-10-04 11:25         ` Igor Druzhinin
2019-10-04 13:00           ` Jan Beulich
2019-10-03 13:49 ` [Xen-devel] [PATCH 2/2] efi/boot: make sure chosen mode is set even if firmware tell it is Igor Druzhinin
2019-10-04 10:40   ` Jan Beulich
2019-10-04 11:33     ` Igor Druzhinin
2019-10-04 13:04       ` Jan Beulich
2019-10-04 13:08         ` Igor Druzhinin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1570110555-24287-2-git-send-email-igor.druzhinin@citrix.com \
    --to=igor.druzhinin@citrix.com \
    --cc=jbeulich@suse.com \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.