public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: Leo Duran <leo.duran@amd.com>
To: <edk2-devel@lists.01.org>
Cc: <yonghong.zhu@intel.com>, <liming.gao@intel.com>,
	Leo Duran <leo.duran@amd.com>
Subject: [PATCH] BaseTools/Source/C/GenFv/GenFvInternalLib.c
Date: Thu, 11 Aug 2016 10:23:15 -0500	[thread overview]
Message-ID: <1470928996-4545-1-git-send-email-leo.duran@amd.com> (raw)

We have a situation where an x86 processor does not start fetching code
at the traditional hardware reset vector address 0xFFFFFFF0.
The implication is that the hidden base address part of the CS register
is initialized with a value different than the traditional 0xFFFF0000.

In our case:
CS = 0xF000 (as expected)
EIP = 0xFFF0 (as expected)
CSLIMIT = 0xFFFF (as expected)
CSBASE = 0x####0000 (where #### is not the traditional 0xFFFF)

Thus in our case execution starts at: CSBASE+EIP = 0x####FFF0.

To account for this behavior, we define an FDF address override
to force a rebase of the FV section containing the VTF file.
For example, last FV section defined as:
[FV.FvSecPei]
FvBaseAddress = $(FV_BOOT_BASE)
FvForceRebase = TRUE

However, when the GenFv tool parses that section it is unware
of the possible rebasing, and assumes the section ends at the
traditional 4G-byte boundary. This patch solves this by simply
adding a check for a possible rebase scenario.

Leo Duran (1):
  BaseTools/Source/C/GenFv/GenFvInternalLib.c

 BaseTools/Source/C/GenFv/GenFvInternalLib.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

-- 
1.9.1



             reply	other threads:[~2016-08-11 15:25 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-11 15:23 Leo Duran [this message]
2016-08-11 15:23 ` [PATCH] BaseTools/Source/C/GenFv/GenFvInternalLib.c Leo Duran
2016-08-12  8:32   ` Gao, Liming
2016-08-14 15:05     ` Duran, Leo
2016-08-14 19:24       ` Ard Biesheuvel
2016-08-15  0:15         ` Zhu, Yonghong
2016-08-15 13:13           ` Duran, Leo
2016-08-15 15:16             ` Gao, Liming

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-list 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=1470928996-4545-1-git-send-email-leo.duran@amd.com \
    --to=devel@edk2.groups.io \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox