Skip to content

Commit

Permalink
Merge pull request #573 from msft-jlange/hyperv
Browse files Browse the repository at this point in the history
igvmbuilder: set VTL2 protection flag where required
  • Loading branch information
joergroedel authored Dec 16, 2024
2 parents 93ad654 + 744d38f commit 928e8ff
Showing 1 changed file with 17 additions and 6 deletions.
23 changes: 17 additions & 6 deletions igvmbuilder/src/igvm_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -313,12 +313,23 @@ impl IgvmBuilder {
}

// Describe the kernel RAM region
self.directives.push(IgvmDirectiveHeader::RequiredMemory {
gpa: param_block.kernel_base,
compatibility_mask: COMPATIBILITY_MASK.get(),
number_of_bytes: param_block.kernel_size,
vtl2_protectable: false,
});
if COMPATIBILITY_MASK.contains(!VSM_COMPATIBILITY_MASK) {
self.directives.push(IgvmDirectiveHeader::RequiredMemory {
gpa: param_block.kernel_base,
compatibility_mask: COMPATIBILITY_MASK.get() & !VSM_COMPATIBILITY_MASK,
number_of_bytes: param_block.kernel_size,
vtl2_protectable: false,
});
}

if COMPATIBILITY_MASK.contains(VSM_COMPATIBILITY_MASK) {
self.directives.push(IgvmDirectiveHeader::RequiredMemory {
gpa: param_block.kernel_base,
compatibility_mask: VSM_COMPATIBILITY_MASK,
number_of_bytes: param_block.kernel_size,
vtl2_protectable: true,
});
}

// Create the two parameter areas for memory map and general parameters.
self.directives.push(IgvmDirectiveHeader::ParameterArea {
Expand Down

0 comments on commit 928e8ff

Please sign in to comment.