How to measure guest memory access (qemu_ld/qemu_st) time?
Quoted 5 lines
The idea looks nice, but instead of different TLB functions selected at configure time, the optimization should be enabled by default.
Maybe a 'call' instruction could be used to jump to the slow path, that way the slow path could be shared.
I had considered the approach of sharing slow path, actually argument settings for ld/st helper functions. However, the problem is that we don't know which runtime registers having arguments.
There are three possible solutions for sharing, I think.
1. Using code stub table including all the possible argument register combinations
2. Using register information flag constant generated at TCG time, and a special stub which parsing the flag and setting the arguments
3. Setting the arguments commonly for fast and slow paths, which needs additional stack or register cleanup for fast path
I think the solution #2 looks better for performance, however, it could be implemented using jump and assembly because using call could come together with unwanted code and register clobber by the prolog of callee. But it might be painful of implementing the parsing stub using assembly (or code generation). It is the weak point of solution #2.
How do you think about it?
__________________________________
Principal Engineer
VM Team
Yeongkyoon Lee
S-Core Co., Ltd.
D.L.: +82-31-696-7249
M.P.: +82-10-9965-1265
__________________________________
Quoted 8 lines · YeongKyoon Lee
Quoted 5 lines
The idea looks nice, but instead of different TLB functions selected at configure time, the optimization should be enabled by default.
Maybe a 'call' instruction could be used to jump to the slow path, that way the slow path could be shared.
I had considered the approach of sharing slow path, actually argument settings for ld/st helper functions. However, the problem is that we don't know which runtime registers having arguments.
Hm, I didn't consider that.
Quoted 10 lines
There are three possible solutions for sharing, I think.
1. Using code stub table including all the possible argument register combinations
2. Using register information flag constant generated at TCG time, and a special stub which parsing the flag and setting the arguments
3. Setting the arguments commonly for fast and slow paths, which needs additional stack or register cleanup for fast pathI think the solution #2 looks better for performance, however, it could be implemented using jump and assembly because using call could come together with unwanted code and register clobber by the prolog of callee. But it might be painful of implementing the parsing stub using assembly (or code generation). It is the weak point of solution #2.
How do you think about it?
I agree that #2 looks best.
Quoted 10 lines
__________________________________
Principal Engineer
VM Team
Yeongkyoon LeeS-Core Co., Ltd.
D.L.: +82-31-696-7249
M.P.: +82-10-9965-1265
__________________________________