Merged
Conversation
Member
|
@IsaacWoods Thanks for the PRs! From a quick glance the changes look good to me. I'll take a closer look next week, because I'm short on time at the moment. |
Member
|
That's an interesting feature. Nobody seems to know whether this actually has any effect, but everybody does it, including Linux :D. But it is at least documented and a seems to be a nop if not supported, so I think there is no harm in merging it. And who knows, maybe it improves performance or fixes SMM bugs^^. |
Member
|
Thanks @IsaacWoods! |
Member
Author
|
Yep, I have no idea if it has any real effects, but I figured it can't hurt and some OEMs might make use of it |
Nickforall
pushed a commit
to Nickforall/bootloader
that referenced
this pull request
Dec 17, 2018
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This sets the Target Operating Mode in the second stage before we enter Long Mode. This tells the firmware that we are only planning to operate in 64-bit mode and will not switch back to Legacy Mode, allowing it to make optimisations that it otherwise wouldn't be able to make safely.
Afaict, this was first implemented by AMD for the Opteron in ~2003, and is documented in section 12.21 of this document. Other docs are sparse, but it should be a nop on processors that don't support the function, and this should handle the error codes correctly (it sets the carry flag if the function is not supported).
While the docs only specify that it allows the BIOS to make optimizations that are not visible to system software, the default mode only allows the processor to run in Legacy Mode, and so I wonder if any firmwares that have SMM bugs in x86_64 mode may be fixed by this - that is just postulation tho
Edit: Travis failure is not related - merging #17 should fix this build as well