Skip to content

Conversation

@stettberger
Copy link
Member

Many architectures have different types of memory (flash, RAM, EEPROM,
etc), which is currently not well supported in the FAIL* toolchain.
Therefore, this change introduces memory types.

A memory type is a simple tag that is attached to memory events and
memory listeners. Furthermore, the generic-tracing experiment records
memory types and dump-trace displays them. Currently, they are not yet
used in importing. However, with SAIL integration, we require this
kind of disambiguation between different memory types.

This change should not break previous experiments and/or results.

@stettberger stettberger force-pushed the feature/memory-types branch 2 times, most recently from 4060c44 to 3d74a26 Compare December 15, 2020 14:36
@stettberger stettberger force-pushed the generic-experiment-improvements branch from a0a1970 to 9a5b560 Compare December 18, 2020 10:06
@stettberger stettberger changed the base branch from generic-experiment-improvements to master January 4, 2021 15:09
@stettberger stettberger force-pushed the feature/memory-types branch from 618993b to c7e4c74 Compare January 4, 2021 15:14
Copy link
Collaborator

@Rothu Rothu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are potential memory bugs in the commented locations.

BochsController::~BochsController()
{
delete m_Mem;
delete &getMemoryManager();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At this point only the MemoryManager for MEMTYPE_RAM would be deleted, since this is the default for getMemoryManager().

it = m_CPUs.erase(it);
}
delete m_Mem;
delete &getMemoryManager();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At this point only the MemoryManager for MEMTYPE_RAM would be deleted, since this is the default for getMemoryManager().

delete *it;
it = m_CPUs.erase(it);
}
delete &getMemoryManager();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At this point only the MemoryManager for MEMTYPE_RAM would be deleted, since this is the default for getMemoryManager().

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is fine for Panda, since there is only one kind of memor manager.

{
delete m_Regs;
delete m_Mem;
delete &getMemoryManager();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At this point only the MemoryManager for MEMTYPE_RAM would be deleted, since this is the default for getMemoryManager().

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is fine for QEMU, since there is only one kind of memor manager.

@schirmeier
Copy link
Member

The memory-leak issues aside (I could live with these for the time being), I observed this change to incur 6-18% slowdown for the generic-tracing experiment. I didn't test generic-experiment, but would expect a similar effect on FI-campaign runtime. Is it really necessary to call getMemoryManager(MEMTYPE_RAM) (which does an std::map lookup) and retrieve the read/written value for every memory access in FastWatchpoints.ah?

@stettberger
Copy link
Member Author

The memory-leak issues aside (I could live with these for the time being), I observed this change to incur 6-18% slowdown for the generic-tracing experiment. I didn't test generic-experiment, but would expect a similar effect on FI-campaign runtime. Is it really necessary to call getMemoryManager(MEMTYPE_RAM) (which does an std::map lookup) and retrieve the read/written value for every memory access in FastWatchpoints.ah?

I could not trace back a performance degredation back to this function call. I also tried to insert a special case for MEMTYPE_RAM to solve this problem, which circumvents the usage of the std::map() lookup(). However, I could not identify any difference in speed.

When looking at the Flamegraph (see flamegraph.zip) the getMemoryManager() has an overall run-time influence of 0.2% (If i use the search correctly)

stettberger and others added 2 commits August 9, 2021 15:43
Many architectures have different types of memory (flash, RAM, EEPROM,
etc), which is currently not well supported in the FAIL* toolchain.
Therefore, this change introduces memory types.

A memory type is a simple tag that is attached to memory events and
memory listeners. Furthermore, the generic-tracing experiment records
memory types and dump-trace displays them. Currently, they are not yet
used in importing. However, with SAIL integration, we require this
kind of disambiguation between different memory types.

Furthermore, MemoryAccessEvents now carry the memory area that was accessed.

This change should not break previous experiments and/or results.

Co-authored-by: Malte Bargholz <malte@screenri.de>
@stettberger stettberger force-pushed the feature/memory-types branch from c7e4c74 to 168203b Compare August 9, 2021 13:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants