public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH] BaseTools/Source/C/GenFv/GenFvInternalLib.c
@ 2016-08-11 15:23 Leo Duran
  2016-08-11 15:23 ` Leo Duran
  0 siblings, 1 reply; 8+ messages in thread
From: Leo Duran @ 2016-08-11 15:23 UTC (permalink / raw)
  To: edk2-devel; +Cc: yonghong.zhu, liming.gao, Leo Duran

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



^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2016-08-15 15:16 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-08-11 15:23 [PATCH] BaseTools/Source/C/GenFv/GenFvInternalLib.c Leo Duran
2016-08-11 15:23 ` 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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox