NVlabs / NVBit

200 stars 18 forks source link

resource limitation for the injection function #1

Closed tjdhc3889 closed 4 years ago

tjdhc3889 commented 4 years ago

Nice work for open sourcing such great work!

But I have one question regarding the resource usage for the injection function. As the sample inst_count showing, it is suggested that we shall used like the managed varaible in the injection function, not the shared or const memory. As I see the reason for why not using the shared/const memory, I don't understand why the usage of managed resource could not hurt target's running. What if target also use the managed memory and their virutal addressing happen to be the one as the injection function used?

ovilla commented 4 years ago

Managed variables (declared simply with __managed__ or allocated with cudaMallocManaged) are in all cases dynamically allocated by the UVM driver, so the managed variable inside the tool (i.e. the one used by the injected function) will have its own virtual address.

The only way for the application to access that virtual address would be to know it (but the application does not have a pointer to that managed variable) or by accessing randomly the memory and by chance hitting (which would imply the application has a bug).

tjdhc3889 commented 4 years ago

I see. Thanks for your explaination!