Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix incorrect sizes for Intel PT packets tma, pwrx, and vmcs #452

Merged
merged 2 commits into from
Dec 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 13 additions & 13 deletions ptdecode.c
Original file line number Diff line number Diff line change
Expand Up @@ -171,18 +171,18 @@ unsigned char ext_size_lut[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x10, 0x02, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x08, 0x08, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x07, 0x08, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x0a, 0x01, 0x00, 0x00, 0x00, 0x00,
0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00,
Expand Down Expand Up @@ -449,16 +449,16 @@ tracelet_cache_node *cache_find_node(uint64_t hash, decoder_state *state, unsign

void dump_lut(unsigned char *lut, char *lutname) {
printf("unsigned char %s[] = {\n", lutname);
for (int i = 0; i<16; i++) {
printf(" ");
for (int j = 0; j<16; j++) {
printf("%02x", lut[i * 16 + j]);
if (j != 15) printf(", ");
for (int i = 0; i<32; i++) {
printf("\t");
for (int j = 0; j<8; j++) {
printf("0x%02x", lut[i * 8 + j]);
if (j != 7) printf(", ");
}
if (i != 15) printf(",\n");
if (i != 31) printf(",\n");
else printf("\n");
}
printf("}; \n\n");
printf("};\n\n");
}

// function that was used to build the lookup tables for the packet decoder
Expand Down Expand Up @@ -644,15 +644,15 @@ void build_luts() {

//tma packet
ext_lut[pt_ext_tma] = ppt_tma;
ext_size_lut[pt_ext_tma] = 8;
ext_size_lut[pt_ext_tma] = 7;

//stop packet
ext_lut[pt_ext_stop] = ppt_stop;
ext_size_lut[pt_ext_stop] = 2;

//vmcs packet
ext_lut[pt_ext_vmcs] = ppt_vmcs;
ext_size_lut[pt_ext_vmcs] = 8;
ext_size_lut[pt_ext_vmcs] = 7;

//exstop packet
ext_lut[pt_ext_exstop] = ppt_exstop;
Expand All @@ -672,7 +672,7 @@ void build_luts() {

//pwrx packet
ext_lut[pt_ext_pwrx] = ppt_pwrx;
ext_size_lut[pt_ext_pwrx] = 8;
ext_size_lut[pt_ext_pwrx] = 7;

//ptw packet
for (int i = 0; i<2; i++) {
Expand Down
Loading