Skip to content

Commit

Permalink
KVM: selftests: Fix printf() format goof in SEV smoke test
Browse files Browse the repository at this point in the history
Print out the index of mismatching XSAVE bytes using unsigned decimal
format.  Some versions of clang complain about trying to print an integer
as an unsigned char.

  x86/sev_smoke_test.c:55:51: error: format specifies type 'unsigned char'
                                     but the argument has type 'int' [-Werror,-Wformat]

Fixes: 8c53183 ("selftests: kvm: add test for transferring FPU state into VMSA")
Link: https://lore.kernel.org/r/20250228233852.3855676-1-seanjc@google.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
  • Loading branch information
Sean Christopherson committed Mar 3, 2025
1 parent d88ed5f commit 3b2d3db
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tools/testing/selftests/kvm/x86/sev_smoke_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ static void compare_xsave(u8 *from_host, u8 *from_guest)
bool bad = false;
for (i = 0; i < 4095; i++) {
if (from_host[i] != from_guest[i]) {
printf("mismatch at %02hhx | %02hhx %02hhx\n", i, from_host[i], from_guest[i]);
printf("mismatch at %u | %02hhx %02hhx\n",
i, from_host[i], from_guest[i]);
bad = true;
}
}
Expand Down

0 comments on commit 3b2d3db

Please sign in to comment.