Received: from list by lists.gnu.org with archive (Exim 4.71) id 1fYBra-0001Zc-FJ for mharc-grub-devel@gnu.org; Wed, 27 Jun 2018 10:56:06 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54919) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fYBrY-0001YY-9t for grub-devel@gnu.org; Wed, 27 Jun 2018 10:56:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fYBrU-0005JM-Vc for grub-devel@gnu.org; Wed, 27 Jun 2018 10:56:04 -0400 Received: from mail-pf0-x241.google.com ([2607:f8b0:400e:c00::241]:32869) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fYBrU-0005IW-Ox for grub-devel@gnu.org; Wed, 27 Jun 2018 10:56:00 -0400 Received: by mail-pf0-x241.google.com with SMTP id b17-v6so1094172pfi.0 for ; Wed, 27 Jun 2018 07:56:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:reply-to; bh=N1wc8jT1zxBrj/Ez4yWNBKSRQ3AvzpabkUu5qNUrrRM=; b=HV2MydDyozXlHy+PE70fZuVkg1EcSMA7griIGr8MGyZx+e3MyYda3cORXr1auEUnh2 mtcikbdAunRrXnYz2g+kAEN2goK1NXLgctGmsAUitfEZHLVtlKt2/ej3gYcbKuOUskLc FNp5jMwaFfQ/+7poAqacwONUpj5ZnOJ/WAeusFs+9UOjMRalmC3liTt1MFtIWWoIVFak W/cbk+06X5ubGM9AiSH7e7+bCjVHNvhn+391i0zT07hRSJM4il8LfMlhbh8Cjttj7BWp f5h3/gF11bHX2lT4BKp/akrxh/xrUZj9+IHGJ3NPM6X6W/B6CSmziZYCpKPW8BGU1+Bd GkzQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :reply-to; bh=N1wc8jT1zxBrj/Ez4yWNBKSRQ3AvzpabkUu5qNUrrRM=; b=gxZgL6GboggFRSWHp85/BmnlA5m7O6EtinfKTtDD/QzqJHLOUKQbjcyptrjQ98S09P k+x9rVEY7SOLmEDe5ABUFBRH5oRhpT7yx4PF+KwUyfdk+PyXLGfcoDnKrpQAm1qUVKZp uQIxQ25SCoVIaQQgkqDmGh8Pfv8xOsy6iEerl3TUkriycXrsOHdI0jCRnOK5ByF5uvNz oxxshgZVE6ZNBelyl0ZO57GAxiq5sLz8oqPR4N63XsWzhxjHrU+2cwaxKSV9vnTGSPWe wGgqrB7spcMaZeisrd17VDGA47KtSlSCMvIFa0r+daQAa0VdqLIQFgnpvexH3K41T8yA hdhw== X-Gm-Message-State: APt69E1yP9ghIbTwePFi623XyIdbiaFn8iTMKrGXPGUn8pudb6XwOKp/ Hcm0uDMDLN7b2lKoiFOSusPkUsYj7MlbVg== X-Google-Smtp-Source: AAOMgpfhxbGN760qY7L6y89AakXM91fipn8/0OezU+1xuLnj2s6EwmCvIuWCU/3pY9qvKLMgNmkKVw== X-Received: by 2002:a62:642:: with SMTP id 63-v6mr6281630pfg.222.1530111359208; Wed, 27 Jun 2018 07:55:59 -0700 (PDT) Received: from emb-Wallaby.amd.com ([202.56.249.162]) by smtp.gmail.com with ESMTPSA id 67-v6sm7273713pga.9.2018.06.27.07.55.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 27 Jun 2018 07:55:58 -0700 (PDT) Sender: Arindam Nath From: Arindam Nath To: grub-devel@gnu.org Cc: Arindam Nath Subject: [PATCH] i386/linux: add support for ext_lfb_base Date: Wed, 27 Jun 2018 20:25:41 +0530 Message-Id: <20180627145541.3652-1-arindam.nath@amd.com> X-Mailer: git-send-email 2.17.1 Reply-To: Arindam Nath X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400e:c00::241 X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jun 2018 14:56:05 -0000 The EFI Graphics Output Protocol can return a 64-bit linear frame buffer address in some firmware/BIOS implementations. We currently only store the lower 32-bits in the lfb_base. This will eventually be passed to Linux kernel and the efifb driver will incorrectly interpret the framebuffer address as 32-bit address. The Linux kernel has already added support to handle 64-bit linear framebuffer address in the efifb driver since quite some time now. This patch adds the support for 64-bit linear frame buffer address in GRUB to address the above mentioned scenario. Signed-off-by: Arindam Nath --- grub-core/loader/i386/linux.c | 2 ++ include/grub/i386/linux.h | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/grub-core/loader/i386/linux.c b/grub-core/loader/i386/linux.c index 083f9417c..1644e8132 100644 --- a/grub-core/loader/i386/linux.c +++ b/grub-core/loader/i386/linux.c @@ -306,6 +306,8 @@ grub_linux_setup_video (struct linux_kernel_params *params) params->lfb_line_len = mode_info.pitch; params->lfb_base = (grub_size_t) framebuffer; + params->ext_lfb_base = (grub_size_t) (((grub_uint64_t)(grub_size_t) framebuffer) >> 32); + params->capabilities |= VIDEO_CAPABILITY_64BIT_BASE; params->lfb_size = ALIGN_UP (params->lfb_line_len * params->lfb_height, 65536); params->red_mask_size = mode_info.red_mask_size; diff --git a/include/grub/i386/linux.h b/include/grub/i386/linux.h index da0ca3b83..e3f91e7c0 100644 --- a/include/grub/i386/linux.h +++ b/include/grub/i386/linux.h @@ -188,8 +188,11 @@ struct linux_kernel_params grub_uint16_t lfb_pages; /* 32 */ grub_uint16_t vesa_attrib; /* 34 */ grub_uint32_t capabilities; /* 36 */ +#define VIDEO_CAPABILITY_SKIP_QUIRKS (1 << 0) +#define VIDEO_CAPABILITY_64BIT_BASE (1 << 1) /* Frame buffer base is 64-bit */ + grub_uint32_t ext_lfb_base; /* 3a */ - grub_uint8_t padding3[0x40 - 0x3a]; + grub_uint8_t padding3[0x40 - 0x3e]; grub_uint16_t apm_version; /* 40 */ grub_uint16_t apm_code_segment; /* 42 */ -- 2.17.1