FEX-Emu / FEX-Emu/FEX

TCBs: Track metadata fragment metadata internally, not in InternalThreadState::DebugStore

Open
#1,772 0 comments 0 reactions 1 assignee Assigned to @skmp View on GitHub
Dominant language
C++
Stars
8k
Forks
351
Avg merge
12h 31m
Merged PRs (30d)
102

Description

#### Current Situation
Currently, debug metadata is tracked by its guest entrypoint, and it is assumed that there's an 1:1 mapping between fragments and guest entry points.

There are a number of cases where this is not true. The current fragment may be invalidated, but still executing. eg
- Cross thread SMC invalidation
- Signal or thunk return
- Shared memory mode migration
- Possibly others

There is also a race condition, as debug metadata corresponds to a specific version of a fragment, however a guest entrypoint is inherently not versioned.

#### Proposal
We can track debug (and other) metadata, as part of the host fragment translation. This way, we will be able to locate the correct version. Metadata clearing will also become a responsibility of the backend, which will reduce the context's responsibilities. To get debug data for a specific translation, a host TCB ptr will be required.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.