security/intel/cbnt: Fix logging

The wrong format was used. It looks like struct bitfields are of type
int according to gcc so %u needs to be used and not %lu.

Change-Id: I54419d722aec0d43e6f54a4bb4eb4d899c909fec
Signed-off-by: Arthur Heymans <arthur@aheymans.xyz>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/55847
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
Arthur Heymans 2021-06-25 17:09:30 +02:00 committed by Werner Zeh
parent 483880e225
commit bf4a8d6372
1 changed files with 13 additions and 13 deletions

View File

@ -121,25 +121,25 @@ void intel_cbnt_log_registers(void)
{ {
const union sacm_info acm_info = { .msr = rdmsr(MSR_BOOT_GUARD_SACM_INFO) }; const union sacm_info acm_info = { .msr = rdmsr(MSR_BOOT_GUARD_SACM_INFO) };
LOG("SACM INFO MSR (0x13A) raw: 0x%016llx\n", acm_info.raw); LOG("SACM INFO MSR (0x13A) raw: 0x%016llx\n", acm_info.raw);
LOG(" NEM status: %ul\n", acm_info.nem_enabled); LOG(" NEM status: %u\n", acm_info.nem_enabled);
LOG(" TPM type: %s\n", tpm_type[acm_info.tpm_type]); LOG(" TPM type: %s\n", tpm_type[acm_info.tpm_type]);
LOG(" TPM succes: %ul\n", acm_info.tpm_success); LOG(" TPM succes: %u\n", acm_info.tpm_success);
LOG(" FACB: %ul\n", acm_info.facb); LOG(" FACB: %u\n", acm_info.facb);
LOG(" measured boot: %ul\n", acm_info.measured_boot); LOG(" measured boot: %u\n", acm_info.measured_boot);
LOG(" verified boot: %ul\n", acm_info.verified_boot); LOG(" verified boot: %u\n", acm_info.verified_boot);
LOG(" revoked: %ul\n", acm_info.revoked); LOG(" revoked: %u\n", acm_info.revoked);
LOG(" BtG capable: %ul\n", acm_info.btg_cap); LOG(" BtG capable: %u\n", acm_info.btg_cap);
LOG(" TXT capable: %ul\n", acm_info.txt_cap); LOG(" TXT capable: %u\n", acm_info.txt_cap);
const union cbnt_bootstatus btsts = { const union cbnt_bootstatus btsts = {
.raw = read64p(CBNT_BOOTSTATUS), .raw = read64p(CBNT_BOOTSTATUS),
}; };
LOG("BOOTSTATUS (0xA0) raw: 0x%016llx\n", btsts.raw); LOG("BOOTSTATUS (0xA0) raw: 0x%016llx\n", btsts.raw);
LOG(" Bios trusted: %ul\n", btsts.bios_trusted); LOG(" Bios trusted: %u\n", btsts.bios_trusted);
LOG(" TXT disabled by policy: %ul\n", btsts.txt_dis_pol); LOG(" TXT disabled by policy: %u\n", btsts.txt_dis_pol);
LOG(" Bootguard startup error: %ul\n", btsts.btg_startup_err); LOG(" Bootguard startup error: %u\n", btsts.btg_startup_err);
LOG(" TXT ucode or ACM error: %ul\n", btsts.txt_err); LOG(" TXT ucode or ACM error: %u\n", btsts.txt_err);
LOG(" TXT measurement type 7: %ul\n", btsts.type7); LOG(" TXT measurement type 7: %u\n", btsts.type7);
const union cbnt_errorcode err = { const union cbnt_errorcode err = {
.raw = read32p(CBNT_ERRORCODE), .raw = read32p(CBNT_ERRORCODE),