On 21/06/2017 16:15, Theodore Dubois wrote: > Hi, I’ve got a question about the addend field in the TLB. Why use > this instead of a pointer to the host page? I would think the speed > difference would be unmeasurable.
After the TLB check you have computed "x & ~(PAGE_SIZE - 1)", but not "x & (PAGE_SIZE - 1)". Without the addend field you would need an extra instruction for the latter and you would have more complicated register allocations. It would probably be small but measurable. If you think it simplifies the code and it is not measurable, do it and send a patch! :) Paolo