On 16/06/2016 21:07, Richard Henderson wrote:
>> && ((addr >> 41) & 3) == 2
>> - && addr >> TARGET_VIRT_ADDR_SPACE_BITS == addr >> 63);
>> + && addr >> TARGET_VIRT_ADDR_SPACE_BITS == 1);
What you want here is
+ addr >> TARGET_VIRT_ADDR_SPACE_BITS == -1
since that's what addr >> 63 is. With this change the patch should be fine.
Alternatively, combining this condition with addr < 0 should be
(uint64_t)addr >= (-1ull << TARGET_VIRT_ADDR_SPACE_BITS)
I think (I might have an off by one here, sorry). If you go this way,
it's of course nicer to change the argument type to uint64_t.
Paolo