qemu with hax to log dma reads & writes jcs.org/2018/11/12/vfio

Merge remote-tracking branch 'remotes/stefanberger/tags/pull-tpm-2018-03-07-1' into staging

Merge tpm 2018/03/07

# gpg: Signature made Wed 07 Mar 2018 12:42:13 GMT
# gpg: using RSA key 75AD65802A0B4211
# gpg: Good signature from "Stefan Berger <stefanb@linux.vnet.ibm.com>"
# gpg: WARNING: This key is not certified with a trusted signature!
# gpg: There is no indication that the signature belongs to the owner.
# Primary key fingerprint: B818 B9CA DF90 89C2 D5CE C66B 75AD 6580 2A0B 4211

* remotes/stefanberger/tags/pull-tpm-2018-03-07-1:
tpm: convert tpm_tis.c to use trace-events
tpm: convert tpm_emulator.c to use trace-events
tpm: convert tpm_util.c to use trace-events
tpm: convert tpm_passthrough.c to use trace-events
tpm: convert tpm_crb.c to use trace-events

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

+135 -114
+1
Makefile.objs
··· 233 233 trace-events-subdirs += hw/hppa 234 234 trace-events-subdirs += hw/xen 235 235 trace-events-subdirs += hw/ide 236 + trace-events-subdirs += hw/tpm 236 237 trace-events-subdirs += ui 237 238 trace-events-subdirs += audio 238 239 trace-events-subdirs += net
+5 -12
hw/tpm/tpm_crb.c
··· 29 29 #include "sysemu/reset.h" 30 30 #include "tpm_int.h" 31 31 #include "tpm_util.h" 32 + #include "trace.h" 32 33 33 34 typedef struct CRBState { 34 35 DeviceState parent_obj; ··· 43 44 } CRBState; 44 45 45 46 #define CRB(obj) OBJECT_CHECK(CRBState, (obj), TYPE_TPM_CRB) 46 - 47 - #define DEBUG_CRB 0 48 - 49 - #define DPRINTF(fmt, ...) do { \ 50 - if (DEBUG_CRB) { \ 51 - printf(fmt, ## __VA_ARGS__); \ 52 - } \ 53 - } while (0) 54 47 55 48 #define CRB_INTF_TYPE_CRB_ACTIVE 0b1 56 49 #define CRB_INTF_VERSION_CRB 0b1 ··· 91 84 unsigned offset = addr & 3; 92 85 uint32_t val = *(uint32_t *)regs >> (8 * offset); 93 86 94 - DPRINTF("CRB read 0x" TARGET_FMT_plx " len:%u val: 0x%" PRIx32 "\n", 95 - addr, size, val); 87 + trace_tpm_crb_mmio_read(addr, size, val); 88 + 96 89 return val; 97 90 } 98 91 ··· 100 93 uint64_t val, unsigned size) 101 94 { 102 95 CRBState *s = CRB(opaque); 103 - DPRINTF("CRB write 0x" TARGET_FMT_plx " len:%u val: 0x%" PRIx64 "\n", 104 - addr, size, val); 96 + 97 + trace_tpm_crb_mmio_write(addr, size, val); 105 98 106 99 switch (addr) { 107 100 case A_CRB_CTRL_REQ:
+23 -22
hw/tpm/tpm_emulator.c
··· 40 40 #include "qapi/clone-visitor.h" 41 41 #include "qapi/qapi-visit-tpm.h" 42 42 #include "chardev/char-fe.h" 43 - 44 - #define DEBUG_TPM 0 45 - 46 - #define DPRINTF(fmt, ...) do { \ 47 - if (DEBUG_TPM) { \ 48 - fprintf(stderr, "tpm-emulator:"fmt"\n", ## __VA_ARGS__); \ 49 - } \ 50 - } while (0) 43 + #include "trace.h" 51 44 52 45 #define TYPE_TPM_EMULATOR "tpm-emulator" 53 46 #define TPM_EMULATOR(obj) \ ··· 152 145 { 153 146 ptm_loc loc; 154 147 155 - DPRINTF("%s : locality: 0x%x", __func__, locty_number); 156 - 157 148 if (tpm_emu->cur_locty_number == locty_number) { 158 149 return 0; 159 150 } 160 151 161 - DPRINTF("setting locality : 0x%x", locty_number); 152 + trace_tpm_emulator_set_locality(locty_number); 153 + 162 154 loc.u.req.loc = locty_number; 163 155 if (tpm_emulator_ctrlcmd(tpm_emu, CMD_SET_LOCALITY, &loc, 164 156 sizeof(loc), sizeof(loc)) < 0) { ··· 184 176 { 185 177 TPMEmulator *tpm_emu = TPM_EMULATOR(tb); 186 178 187 - DPRINTF("processing TPM command"); 179 + trace_tpm_emulator_handle_request(); 188 180 189 181 if (tpm_emulator_set_locality(tpm_emu, cmd->locty, errp) < 0 || 190 182 tpm_emulator_unix_tx_bufs(tpm_emu, cmd->in, cmd->in_len, ··· 196 188 197 189 static int tpm_emulator_probe_caps(TPMEmulator *tpm_emu) 198 190 { 199 - DPRINTF("%s", __func__); 200 191 if (tpm_emulator_ctrlcmd(tpm_emu, CMD_GET_CAPABILITY, 201 192 &tpm_emu->caps, 0, sizeof(tpm_emu->caps)) < 0) { 202 193 error_report("tpm-emulator: probing failed : %s", strerror(errno)); ··· 205 196 206 197 tpm_emu->caps = be64_to_cpu(tpm_emu->caps); 207 198 208 - DPRINTF("capabilities : 0x%"PRIx64, tpm_emu->caps); 199 + trace_tpm_emulator_probe_caps(tpm_emu->caps); 209 200 210 201 return 0; 211 202 } ··· 294 285 *actual_size = be32_to_cpu(psbs.u.resp.buffersize); 295 286 } 296 287 297 - DPRINTF("buffer size: %u, min: %u, max: %u\n", 288 + trace_tpm_emulator_set_buffer_size( 298 289 be32_to_cpu(psbs.u.resp.buffersize), 299 290 be32_to_cpu(psbs.u.resp.minsize), 300 291 be32_to_cpu(psbs.u.resp.maxsize)); ··· 315 306 goto err_exit; 316 307 } 317 308 318 - DPRINTF("%s", __func__); 309 + trace_tpm_emulator_startup_tpm(); 319 310 if (tpm_emulator_ctrlcmd(tpm_emu, CMD_INIT, &init, sizeof(init), 320 311 sizeof(init)) < 0) { 321 312 error_report("tpm-emulator: could not send INIT: %s", ··· 349 340 strerror(errno)); 350 341 return false; 351 342 } 352 - DPRINTF("got established flag: %0x", est.u.resp.bit); 343 + trace_tpm_emulator_get_tpm_established_flag(est.u.resp.bit); 353 344 354 345 tpm_emu->established_flag_cached = 1; 355 346 tpm_emu->established_flag = (est.u.resp.bit != 0); ··· 396 387 ptm_res res; 397 388 398 389 if (!TPM_EMULATOR_IMPLEMENTS_ALL_CAPS(tpm_emu, PTM_CAP_CANCEL_TPM_CMD)) { 399 - DPRINTF("Backend does not support CANCEL_TPM_CMD"); 390 + trace_tpm_emulator_cancel_cmd_not_supt(); 400 391 return; 401 392 } 402 393 ··· 522 513 goto err; 523 514 } 524 515 525 - DPRINTF("TPM Version %s", tpm_emu->tpm_version == TPM_VERSION_1_2 ? "1.2" : 526 - (tpm_emu->tpm_version == TPM_VERSION_2_0 ? "2.0" : "Unspecified")); 516 + switch (tpm_emu->tpm_version) { 517 + case TPM_VERSION_1_2: 518 + trace_tpm_emulator_handle_device_opts_tpm12(); 519 + break; 520 + case TPM_VERSION_2_0: 521 + trace_tpm_emulator_handle_device_opts_tpm2(); 522 + break; 523 + default: 524 + trace_tpm_emulator_handle_device_opts_unspec(); 525 + } 527 526 528 527 if (tpm_emulator_probe_caps(tpm_emu) || 529 528 tpm_emulator_check_caps(tpm_emu)) { ··· 533 532 return tpm_emulator_block_migration(tpm_emu); 534 533 535 534 err: 536 - DPRINTF("Startup error"); 535 + trace_tpm_emulator_handle_device_opts_startup_error(); 536 + 537 537 return -1; 538 538 } 539 539 ··· 574 574 { 575 575 TPMEmulator *tpm_emu = TPM_EMULATOR(obj); 576 576 577 - DPRINTF("%s", __func__); 577 + trace_tpm_emulator_inst_init(); 578 + 578 579 tpm_emu->options = g_new0(TPMEmulatorOptions, 1); 579 580 tpm_emu->cur_locty_number = ~0; 580 581 qemu_mutex_init(&tpm_emu->mutex);
+3 -10
hw/tpm/tpm_passthrough.c
··· 32 32 #include "qapi/clone-visitor.h" 33 33 #include "qapi/qapi-visit-tpm.h" 34 34 #include "tpm_util.h" 35 - 36 - #define DEBUG_TPM 0 37 - 38 - #define DPRINTF(fmt, ...) do { \ 39 - if (DEBUG_TPM) { \ 40 - fprintf(stderr, fmt, ## __VA_ARGS__); \ 41 - } \ 42 - } while (0) 35 + #include "trace.h" 43 36 44 37 #define TYPE_TPM_PASSTHROUGH "tpm-passthrough" 45 38 #define TPM_PASSTHROUGH(obj) \ ··· 138 131 { 139 132 TPMPassthruState *tpm_pt = TPM_PASSTHROUGH(tb); 140 133 141 - DPRINTF("tpm_passthrough: processing command %p\n", cmd); 134 + trace_tpm_passthrough_handle_request(cmd); 142 135 143 136 tpm_passthrough_unix_tx_bufs(tpm_pt, cmd->in, cmd->in_len, 144 137 cmd->out, cmd->out_len, &cmd->selftest_done, ··· 147 140 148 141 static void tpm_passthrough_reset(TPMBackend *tb) 149 142 { 150 - DPRINTF("tpm_passthrough: CALL TO TPM_RESET!\n"); 143 + trace_tpm_passthrough_reset(); 151 144 152 145 tpm_passthrough_cancel_cmd(tb); 153 146 }
+45 -53
hw/tpm/tpm_tis.c
··· 31 31 #include "sysemu/tpm_backend.h" 32 32 #include "tpm_int.h" 33 33 #include "tpm_util.h" 34 + #include "trace.h" 34 35 35 36 #define TPM_TIS_NUM_LOCALITIES 5 /* per spec */ 36 37 #define TPM_TIS_LOCALITY_SHIFT 12 ··· 86 87 87 88 #define DEBUG_TIS 0 88 89 89 - #define DPRINTF(fmt, ...) do { \ 90 - if (DEBUG_TIS) { \ 91 - printf(fmt, ## __VA_ARGS__); \ 92 - } \ 93 - } while (0) 94 - 95 90 /* local prototypes */ 96 91 97 92 static uint64_t tpm_tis_mmio_read(void *opaque, hwaddr addr, ··· 107 102 static void tpm_tis_show_buffer(const unsigned char *buffer, 108 103 size_t buffer_size, const char *string) 109 104 { 110 - #ifdef DEBUG_TIS 111 105 uint32_t len, i; 112 106 113 107 len = MIN(tpm_cmd_get_size(buffer), buffer_size); 114 - DPRINTF("tpm_tis: %s length = %d\n", string, len); 108 + printf("tpm_tis: %s length = %d\n", string, len); 115 109 for (i = 0; i < len; i++) { 116 110 if (i && !(i % 16)) { 117 - DPRINTF("\n"); 111 + printf("\n"); 118 112 } 119 - DPRINTF("%.2X ", buffer[i]); 113 + printf("%.2X ", buffer[i]); 120 114 } 121 - DPRINTF("\n"); 122 - #endif 115 + printf("\n"); 123 116 } 124 117 125 118 /* ··· 146 139 */ 147 140 static void tpm_tis_tpm_send(TPMState *s, uint8_t locty) 148 141 { 149 - tpm_tis_show_buffer(s->buffer, s->be_buffer_size, 150 - "tpm_tis: To TPM"); 142 + if (DEBUG_TIS) { 143 + tpm_tis_show_buffer(s->buffer, s->be_buffer_size, 144 + "tpm_tis: To TPM"); 145 + } 151 146 152 147 /* 153 148 * rw_offset serves as length indicator for length of data; ··· 175 170 176 171 if ((s->loc[locty].inte & TPM_TIS_INT_ENABLED) && 177 172 (s->loc[locty].inte & irqmask)) { 178 - DPRINTF("tpm_tis: Raising IRQ for flag %08x\n", irqmask); 173 + trace_tpm_tis_raise_irq(irqmask); 179 174 qemu_irq_raise(s->irq); 180 175 s->loc[locty].ints |= irqmask; 181 176 } ··· 223 218 224 219 s->active_locty = new_active_locty; 225 220 226 - DPRINTF("tpm_tis: Active locality is now %d\n", s->active_locty); 221 + trace_tpm_tis_new_active_locality(s->active_locty); 227 222 228 223 if (TPM_TIS_IS_VALID_LOCTY(new_active_locty)) { 229 224 /* set flags on the new active locality */ ··· 242 237 { 243 238 s->rw_offset = 0; 244 239 245 - DPRINTF("tpm_tis: tis_abort: new active locality is %d\n", s->next_locty); 240 + trace_tpm_tis_abort(s->next_locty); 246 241 247 242 /* 248 243 * Need to react differently depending on who's aborting now and ··· 310 305 s->loc[locty].state = TPM_TIS_STATE_COMPLETION; 311 306 s->rw_offset = 0; 312 307 313 - tpm_tis_show_buffer(s->buffer, s->be_buffer_size, 314 - "tpm_tis: From TPM"); 308 + if (DEBUG_TIS) { 309 + tpm_tis_show_buffer(s->buffer, s->be_buffer_size, 310 + "tpm_tis: From TPM"); 311 + } 315 312 316 313 if (TPM_TIS_IS_VALID_LOCTY(s->next_locty)) { 317 314 tpm_tis_abort(s, locty); ··· 339 336 tpm_tis_sts_set(&s->loc[locty], TPM_TIS_STS_VALID); 340 337 tpm_tis_raise_irq(s, locty, TPM_TIS_INT_STS_VALID); 341 338 } 342 - DPRINTF("tpm_tis: tpm_tis_data_read byte 0x%02x [%d]\n", 343 - ret, s->rw_offset - 1); 339 + trace_tpm_tis_data_read(ret, s->rw_offset - 1); 344 340 } 345 341 346 342 return ret; ··· 364 360 hwaddr base = addr & ~0xfff; 365 361 TPMState *s = opaque; 366 362 367 - DPRINTF("tpm_tis: active locality : %d\n" 368 - "tpm_tis: state of locality %d : %d\n" 369 - "tpm_tis: register dump:\n", 370 - s->active_locty, 371 - locty, s->loc[locty].state); 363 + printf("tpm_tis: active locality : %d\n" 364 + "tpm_tis: state of locality %d : %d\n" 365 + "tpm_tis: register dump:\n", 366 + s->active_locty, 367 + locty, s->loc[locty].state); 372 368 373 369 for (idx = 0; regs[idx] != 0xfff; idx++) { 374 - DPRINTF("tpm_tis: 0x%04x : 0x%08x\n", regs[idx], 375 - (int)tpm_tis_mmio_read(opaque, base + regs[idx], 4)); 370 + printf("tpm_tis: 0x%04x : 0x%08x\n", regs[idx], 371 + (int)tpm_tis_mmio_read(opaque, base + regs[idx], 4)); 376 372 } 377 373 378 - DPRINTF("tpm_tis: r/w offset : %d\n" 379 - "tpm_tis: result buffer : ", 380 - s->rw_offset); 374 + printf("tpm_tis: r/w offset : %d\n" 375 + "tpm_tis: result buffer : ", 376 + s->rw_offset); 381 377 for (idx = 0; 382 378 idx < MIN(tpm_cmd_get_size(&s->buffer), s->be_buffer_size); 383 379 idx++) { 384 - DPRINTF("%c%02x%s", 385 - s->rw_offset == idx ? '>' : ' ', 386 - s->buffer[idx], 387 - ((idx & 0xf) == 0xf) ? "\ntpm_tis: " : ""); 380 + printf("%c%02x%s", 381 + s->rw_offset == idx ? '>' : ' ', 382 + s->buffer[idx], 383 + ((idx & 0xf) == 0xf) ? "\ntpm_tis: " : ""); 388 384 } 389 - DPRINTF("\n"); 385 + printf("\n"); 390 386 } 391 387 #endif 392 388 ··· 506 502 val >>= shift; 507 503 } 508 504 509 - DPRINTF("tpm_tis: read.%u(%08x) = %08x\n", size, (int)addr, (int)val); 505 + trace_tpm_tis_mmio_read(size, addr, val); 510 506 511 507 return val; 512 508 } ··· 527 523 uint16_t len; 528 524 uint32_t mask = (size == 1) ? 0xff : ((size == 2) ? 0xffff : ~0); 529 525 530 - DPRINTF("tpm_tis: write.%u(%08x) = %08x\n", size, (int)addr, (int)val); 526 + trace_tpm_tis_mmio_write(size, addr, val); 531 527 532 528 if (locty == 4) { 533 - DPRINTF("tpm_tis: Access to locality 4 only allowed from hardware\n"); 529 + trace_tpm_tis_mmio_write_locty4(); 534 530 return; 535 531 } 536 532 ··· 560 556 if ((val & TPM_TIS_ACCESS_ACTIVE_LOCALITY)) { 561 557 /* give up locality if currently owned */ 562 558 if (s->active_locty == locty) { 563 - DPRINTF("tpm_tis: Releasing locality %d\n", locty); 559 + trace_tpm_tis_mmio_write_release_locty(locty); 564 560 565 561 uint8_t newlocty = TPM_TIS_NO_LOCALITY; 566 562 /* anybody wants the locality ? */ 567 563 for (c = TPM_TIS_NUM_LOCALITIES - 1; c >= 0; c--) { 568 564 if ((s->loc[c].access & TPM_TIS_ACCESS_REQUEST_USE)) { 569 - DPRINTF("tpm_tis: Locality %d requests use.\n", c); 565 + trace_tpm_tis_mmio_write_locty_req_use(c); 570 566 newlocty = c; 571 567 break; 572 568 } 573 569 } 574 - DPRINTF("tpm_tis: TPM_TIS_ACCESS_ACTIVE_LOCALITY: " 575 - "Next active locality: %d\n", 576 - newlocty); 570 + trace_tpm_tis_mmio_write_next_locty(newlocty); 577 571 578 572 if (TPM_TIS_IS_VALID_LOCTY(newlocty)) { 579 573 set_new_locty = 0; ··· 627 621 } 628 622 629 623 s->loc[locty].access |= TPM_TIS_ACCESS_SEIZE; 630 - DPRINTF("tpm_tis: TPM_TIS_ACCESS_SEIZE: " 631 - "Locality %d seized from locality %d\n", 632 - locty, s->active_locty); 633 - DPRINTF("tpm_tis: TPM_TIS_ACCESS_SEIZE: Initiating abort.\n"); 624 + 625 + trace_tpm_tis_mmio_write_locty_seized(locty, s->active_locty); 626 + trace_tpm_tis_mmio_write_init_abort(); 627 + 634 628 set_new_locty = 0; 635 629 tpm_tis_prep_abort(s, s->active_locty, locty); 636 630 break; ··· 677 671 s->loc[locty].ints &= ~val; 678 672 if (s->loc[locty].ints == 0) { 679 673 qemu_irq_lower(s->irq); 680 - DPRINTF("tpm_tis: Lowering IRQ\n"); 674 + trace_tpm_tis_mmio_write_lowering_irq(); 681 675 } 682 676 } 683 677 s->loc[locty].ints &= ~(val & TPM_TIS_INTERRUPTS_SUPPORTED); ··· 725 719 case TPM_TIS_STATE_EXECUTION: 726 720 case TPM_TIS_STATE_RECEPTION: 727 721 /* abort currently running command */ 728 - DPRINTF("tpm_tis: %s: Initiating abort.\n", 729 - __func__); 722 + trace_tpm_tis_mmio_write_init_abort(); 730 723 tpm_tis_prep_abort(s, locty, locty); 731 724 break; 732 725 ··· 780 773 s->loc[locty].state == TPM_TIS_STATE_COMPLETION) { 781 774 /* drop the byte */ 782 775 } else { 783 - DPRINTF("tpm_tis: Data to send to TPM: %08x (size=%d)\n", 784 - (int)val, size); 776 + trace_tpm_tis_mmio_write_data2send(val, size); 785 777 if (s->loc[locty].state == TPM_TIS_STATE_READY) { 786 778 s->loc[locty].state = TPM_TIS_STATE_RECEPTION; 787 779 tpm_tis_sts_set(&s->loc[locty],
+12 -17
hw/tpm/tpm_util.c
··· 28 28 #include "exec/memory.h" 29 29 #include "sysemu/tpm_backend.h" 30 30 #include "hw/qdev.h" 31 - 32 - #define DEBUG_TPM 0 33 - 34 - #define DPRINTF(fmt, ...) do { \ 35 - if (DEBUG_TPM) { \ 36 - fprintf(stderr, "tpm-util:"fmt"\n", ## __VA_ARGS__); \ 37 - } \ 38 - } while (0) 31 + #include "trace.h" 39 32 40 33 /* tpm backend property */ 41 34 ··· 279 272 280 273 if (be32_to_cpu(tpm_resp.hdr.len) != sizeof(tpm_resp) || 281 274 be32_to_cpu(tpm_resp.len) != sizeof(uint32_t)) { 282 - DPRINTF("tpm_resp->hdr.len = %u, expected = %zu\n", 283 - be32_to_cpu(tpm_resp.hdr.len), sizeof(tpm_resp)); 284 - DPRINTF("tpm_resp->len = %u, expected = %zu\n", 285 - be32_to_cpu(tpm_resp.len), sizeof(uint32_t)); 275 + trace_tpm_util_get_buffer_size_hdr_len( 276 + be32_to_cpu(tpm_resp.hdr.len), 277 + sizeof(tpm_resp)); 278 + trace_tpm_util_get_buffer_size_len(be32_to_cpu(tpm_resp.len), 279 + sizeof(uint32_t)); 286 280 error_report("tpm_util: Got unexpected response to " 287 281 "TPM_GetCapability; errcode: 0x%x", 288 282 be32_to_cpu(tpm_resp.hdr.errcode)); ··· 327 321 328 322 if (be32_to_cpu(tpm2_resp.hdr.len) != sizeof(tpm2_resp) || 329 323 be32_to_cpu(tpm2_resp.count) != 2) { 330 - DPRINTF("tpm2_resp->hdr.len = %u, expected = %zu\n", 331 - be32_to_cpu(tpm2_resp.hdr.len), sizeof(tpm2_resp)); 332 - DPRINTF("tpm2_resp->len = %u, expected = %u\n", 333 - be32_to_cpu(tpm2_resp.count), 2); 324 + trace_tpm_util_get_buffer_size_hdr_len2( 325 + be32_to_cpu(tpm2_resp.hdr.len), 326 + sizeof(tpm2_resp)); 327 + trace_tpm_util_get_buffer_size_len2( 328 + be32_to_cpu(tpm2_resp.count), 2); 334 329 error_report("tpm_util: Got unexpected response to " 335 330 "TPM2_GetCapability; errcode: 0x%x", 336 331 be32_to_cpu(tpm2_resp.hdr.errcode)); ··· 344 339 return -EFAULT; 345 340 } 346 341 347 - DPRINTF("buffersize of device: %zu\n", *buffersize); 342 + trace_tpm_util_get_buffer_size(*buffersize); 348 343 349 344 return 0; 350 345 }
+46
hw/tpm/trace-events
··· 1 + # See docs/devel/tracing.txt for syntax documentation. 2 + 3 + # hw/tpm/tpm_crb.c 4 + tpm_crb_mmio_read(uint64_t addr, unsigned size, uint32_t val) "CRB read 0x" TARGET_FMT_plx " len:%u val: 0x%" PRIx32 5 + tpm_crb_mmio_write(uint64_t addr, unsigned size, uint32_t val) "CRB write 0x" TARGET_FMT_plx " len:%u val: 0x%" PRIx32 6 + 7 + # hw/tpm/tpm_passthrough.c 8 + tpm_passthrough_handle_request(void *cmd) "processing command %p" 9 + tpm_passthrough_reset(void) "reset" 10 + 11 + # hw/tpm/tpm_util.c 12 + tpm_util_get_buffer_size_hdr_len(uint32_t len, size_t expected) "tpm_resp->hdr.len = %u, expected = %zu" 13 + tpm_util_get_buffer_size_len(uint32_t len, size_t expected) "tpm_resp->len = %u, expected = %zu" 14 + tpm_util_get_buffer_size_hdr_len2(uint32_t len, size_t expected) "tpm2_resp->hdr.len = %u, expected = %zu" 15 + tpm_util_get_buffer_size_len2(uint32_t len, size_t expected) "tpm2_resp->len = %u, expected = %zu" 16 + tpm_util_get_buffer_size(size_t len) "buffersize of device: %zu" 17 + 18 + # hw/tpm/tpm_emulator.c 19 + tpm_emulator_set_locality(uint8_t locty) "setting locality to %d" 20 + tpm_emulator_handle_request(void) "processing TPM command" 21 + tpm_emulator_probe_caps(uint64_t caps) "capabilities: 0x%"PRIx64 22 + tpm_emulator_set_buffer_size(uint32_t buffersize, uint32_t minsize, uint32_t maxsize) "buffer size: %u, min: %u, max: %u" 23 + tpm_emulator_startup_tpm(void) "startup" 24 + tpm_emulator_get_tpm_established_flag(uint8_t flag) "got established flag: %d" 25 + tpm_emulator_cancel_cmd_not_supt(void) "Backend does not support CANCEL_TPM_CMD" 26 + tpm_emulator_handle_device_opts_tpm12(void) "TPM Version 1.2" 27 + tpm_emulator_handle_device_opts_tpm2(void) "TPM Version 2" 28 + tpm_emulator_handle_device_opts_unspec(void) "TPM Version Unspecified" 29 + tpm_emulator_handle_device_opts_startup_error(void) "Startup error" 30 + tpm_emulator_inst_init(void) "" 31 + 32 + # hw/tpm/tpm_tis.c 33 + tpm_tis_raise_irq(uint32_t irqmask) "Raising IRQ for flag 0x%08x" 34 + tpm_tis_new_active_locality(uint8_t locty) "Active locality is now %d" 35 + tpm_tis_abort(uint8_t locty) "New active locality is %d" 36 + tpm_tis_data_read(uint32_t value, uint32_t off) "byte 0x%02x [%d]" 37 + tpm_tis_mmio_read(unsigned size, uint32_t addr, uint32_t val) " read.%u(0x%08x) = 0x%08x" 38 + tpm_tis_mmio_write(unsigned size, uint32_t addr, uint32_t val) "write.%u(0x%08x) = 0x%08x" 39 + tpm_tis_mmio_write_locty4(void) "Access to locality 4 only allowed from hardware" 40 + tpm_tis_mmio_write_release_locty(uint8_t locty) "Releasing locality %d" 41 + tpm_tis_mmio_write_locty_req_use(uint8_t locty) "Locality %d requests use" 42 + tpm_tis_mmio_write_next_locty(uint8_t locty) "Next active locality is %d" 43 + tpm_tis_mmio_write_locty_seized(uint8_t locty, uint8_t active) "Locality %d seized from locality %d" 44 + tpm_tis_mmio_write_init_abort(void) "Initiating abort" 45 + tpm_tis_mmio_write_lowering_irq(void) "Lowering IRQ" 46 + tpm_tis_mmio_write_data2send(uint32_t value, unsigned size) "Data to send to TPM: 0x%08x (size=%d)"