diff options
| author | Louis Burda <quent.burda@gmail.com> | 2022-11-22 15:03:02 +0100 |
|---|---|---|
| committer | Louis Burda <quent.burda@gmail.com> | 2022-11-22 15:03:02 +0100 |
| commit | 82d56ef77c114ac0b375fef04cea3a50f10f1843 (patch) | |
| tree | 397acfbcb5f1c2584a03f6201d95120d6f299361 /test/aes-detect_guest.c | |
| parent | afe49b52f6b2ac52efe8e610e64ee07c7c2efef4 (diff) | |
| download | cachepc-82d56ef77c114ac0b375fef04cea3a50f10f1843.tar.gz cachepc-82d56ef77c114ac0b375fef04cea3a50f10f1843.zip | |
Improved single stepping and added initial cpuid events
Diffstat (limited to 'test/aes-detect_guest.c')
| -rw-r--r-- | test/aes-detect_guest.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/test/aes-detect_guest.c b/test/aes-detect_guest.c index 4012b74..80a6a64 100644 --- a/test/aes-detect_guest.c +++ b/test/aes-detect_guest.c @@ -30,8 +30,24 @@ main(int argc, const char **argv) { struct kcapi_handle *kcapi; uint8_t block[128]; + uint8_t *buf; size_t n; + buf = NULL; + if (posix_memalign((void *)&buf, L1_LINESIZE * L1_SETS, L1_LINESIZE * L1_SETS)) + err(1, "memalign"); + memset(buf, 0, L1_LINESIZE * L1_SETS); + + while (1) { + CPC_CPUID_SIGNAL(CPC_CPUID_START_TRACK, 0); + + buf[L1_LINESIZE * 5] += 1; + + CPC_CPUID_SIGNAL(CPC_CPUID_START_TRACK, 0); + } + + return 0; + kcapi = NULL; if (kcapi_cipher_init(&kcapi, "ecb(aes)", 0)) err(1, "kcapi init"); |
