avadhpatel / marss

PTLsim and QEMU based Computer Architecture Research Simulator
http://www.marss86.org
129 stars 63 forks source link

about the Return Address Stack(RAS) #65

Open xubaqian opened 4 years ago

xubaqian commented 4 years ago

Hi. I have some questions about the RAS.

It seems the RAS is shared between OS and user program, and I wonder if it is shared between different threads. If it is, then if I configure a single core with 1 thread in config/default.conf

    min_contexts: 1
    max_contexts: 1

can this guarantee that the RAS is only occupied by one program at runtime?

And for multiple threads, how can I save/restore the RAS when context switch? Modify OS or MARSSx86?

If it is not shared, where is the code that saves/restores the RAS when context switch?