Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AEM Qubes 4.2.3 rebase #25

Open
wants to merge 24 commits into
base: aem-qubes-4.2.3
Choose a base branch
from

Conversation

krystian-hebel
Copy link
Member

@krystian-hebel krystian-hebel commented Oct 22, 2024

Branch created by rebasing https://github.com/TrenchBoot/grub/commits/tb-2.12-57-v1 on top of what Qubes OS 4.2.3 uses, which is already in target branch for meaningful comparison.

Out of Qubes' changes, patches <1000 are part of grub2-2.06-124.fc41 (and most of them were already upstreamed), and remaining two are specific to Qubes.

@krystian-hebel krystian-hebel changed the title Aem qubes 4.2.3 rebase AEM Qubes 4.2.3 rebase Oct 22, 2024
Daniel Kiper and others added 24 commits October 22, 2024 16:13
It does not make sense to have separate headers for separate static
functions. Additionally, we have to add some constants with MSR addresses
in subsequent patches. So, make one common place to store them.

Signed-off-by: Daniel Kiper <[email protected]>
... to grub_rdmsr() and grub_wrmsr() respectively. New names are more
obvious than older ones.

Signed-off-by: Daniel Kiper <[email protected]>
Currently rdmsr and wrmsr commands have own MSR support detection code.
This code is the same. So, it is duplicated. Additionally, this code
cannot be reused by others. Hence, extract this code to a function and
make it public. By the way, improve a code a bit.

Additionally, use GRUB_ERR_BAD_DEVICE instead of GRUB_ERR_BUG to signal
an error because errors encountered by this new routine are not bugs.

Signed-off-by: Daniel Kiper <[email protected]>
...to avoid potential conflicts and confusion.

Signed-off-by: Daniel Kiper <[email protected]>
Subsequent patches will use that constant.

Signed-off-by: Daniel Kiper <[email protected]>
…acros

Subsequent patches will use those macros and constant.

Signed-off-by: Krystian Hebel <[email protected]>
The functions calculate lowest and highest available RAM
addresses respectively.

Both functions are needed to calculate PMR boundaries for
Intel TXT secure launcher introduced by subsequent patches.

Signed-off-by: Daniel Kiper <[email protected]>
...to avoid naming collision with TPM TIS and CRB driver introduced
by subsequent patch.

Signed-off-by: Daniel Kiper <[email protected]>
It will be used by Intel TXT secure launcher introduced
by subsequent patches.

Signed-off-by: Daniel Kiper <[email protected]>
Signed-off-by: Krystian Hebel <[email protected]>
Provide definitions of structures and basic functions for constructing
and parsing of SLRT.

Signed-off-by: Ross Philipson <[email protected]>
Signed-off-by: Sergii Dmytruk <[email protected]>
Signed-off-by: Krystian Hebel <[email protected]>
Some of the commands declared in header files will be implemented in
the follow-up commits.

Signed-off-by: Ross Philipson <[email protected]>
Signed-off-by: Daniel Kiper <[email protected]>
Signed-off-by: Krystian Hebel <[email protected]>
Signed-off-by: Sergii Dmytruk <[email protected]>
Signed-off-by: Ross Philipson <[email protected]>
Signed-off-by: Daniel Kiper <[email protected]>
Signed-off-by: Sergii Dmytruk <[email protected]>
Signed-off-by: Ross Philipson <[email protected]>
Signed-off-by: Daniel Kiper <[email protected]>
Signed-off-by: Michał Żygowski <[email protected]>
Signed-off-by: Krystian Hebel <[email protected]>
Signed-off-by: Sergii Dmytruk <[email protected]>
Signed-off-by: Ross Philipson <[email protected]>
Signed-off-by: Daniel Kiper <[email protected]>
Signed-off-by: Krystian Hebel <[email protected]>
Signed-off-by: Ross Philipson <[email protected]>
Signed-off-by: Daniel Kiper <[email protected]>
Signed-off-by: Krystian Hebel <[email protected]>
Signed-off-by: Michał Żygowski <[email protected]>
Signed-off-by: Krystian Hebel <[email protected]>
Signed-off-by: Ross Philipson <[email protected]>
Signed-off-by: Daniel Kiper <[email protected]>
Signed-off-by: Krystian Hebel <[email protected]>
Signed-off-by: Sergii Dmytruk <[email protected]>
…ressing

Simply returning didn't free file resource nor called
`grub_dl_ref(my_mod)`.  Jump to `fail` label instead.

Signed-off-by: Sergii Dmytruk <[email protected]>
GRUB_MULTIBOOT(get_mbi_size) doesn't look like an accurate source of the
final size, more like a minimal memory buffer size.

Signed-off-by: Sergii Dmytruk <[email protected]>
The code makes sure that MBI entry goes first in DRTM, so the payload
can measure it first on launch.

SLRT table is allocated on the heap first, size for it is reserved
inside TXT heap by TXT code and data is later copied into its final
place.

To avoid mismatch between OS SINIT data MLE size and MLE size from
MLE header, take the mle_size from MLE header as is (without aligning
it).

Signed-off-by: Michał Żygowski <[email protected]>
Signed-off-by: Tomasz Żyjewski <[email protected]>
Signed-off-by: Krystian Hebel <[email protected]>
Signed-off-by: Sergii Dmytruk <[email protected]>
This adds code for placing of SLB and initialization of SLRT for AMD
SKINIT.

Signed-off-by: Krystian Hebel <[email protected]>
Signed-off-by: Sergii Dmytruk <[email protected]>
Extend slaunch command to work on AMD CPUs.

Signed-off-by: Krystian Hebel <[email protected]>
Signed-off-by: Sergii Dmytruk <[email protected]>
Signed-off-by: Krystian Hebel <[email protected]>
Signed-off-by: Sergii Dmytruk <[email protected]>
Signed-off-by: Ross Philipson <[email protected]>
Signed-off-by: Daniel Kiper <[email protected]>
Signed-off-by: Sergii Dmytruk <[email protected]>
@krystian-hebel krystian-hebel marked this pull request as ready for review October 22, 2024 15:49
Copy link
Member

@SergiiDmytruk SergiiDmytruk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

According to

git range-diff 701514a..origin/tb-2.12-57-v1 origin/aem-qubes-4.2.3..origin/aem-qubes-4.2.3-rebase

there are no real changes except for one comment, which doesn't matter.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants