On 2024-10-09 13:21, Daniel P. Smith wrote:
On 10/8/24 12:13, Jason Andryuk wrote:
On 2024-10-06 17:49, Daniel P. Smith wrote:
Iterate through the unclaimed struct boot_module to see if any are an
XSM FLASK
policy. If one is located, mark it as an xsm policy.
Signed-off-by: Daniel P. Smith <dpsm...@apertussolutions.com>
@@ -161,6 +162,14 @@ int __init xsm_multiboot_init(
}
ret = xsm_core_init(policy_buffer, policy_size);
+ if ( ret == 0 )
+ {
+ int idx = first_boot_module_index(bi, BOOTMOD_XSM_POLICY);
+
+ /* If the policy was loaded from a boot module, mark it
consumed */
+ if ( idx >= 0 )
+ bi->mods[idx].flags |= BOOTMOD_FLAG_X86_CONSUMED;
Maybe xsm_multiboot_policy_init() should return the idx used instead
of having a second search? (Also, xsm_multiboot_policy_init() can't
fail?)
I was debating on whether to make similar changes because the existing
logic just seems sub-optimal. Currently I am looking to just write an
independent XSM patch that looks at both this function and the device
tree version of the function. Specifically, looking to use the
IS_ENABLED() macro instead of #ifdef to reduce code, provide better code
coverage, and to refine the logic.
Ok.
+ }
bootstrap_map(NULL);
return 0;
The other changes look okay.
R-b then?
Reviewed-by: Jason Andryuk <jason.andr...@amd.com>
Regards,
Jason