[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 4/8] target-i386: Re-introduce optimal breakpoin
From: |
Paolo Bonzini |
Subject: |
Re: [Qemu-devel] [PATCH 4/8] target-i386: Re-introduce optimal breakpoint removal |
Date: |
Wed, 16 Sep 2015 10:57:57 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 |
On 15/09/2015 20:45, Richard Henderson wrote:
> + /* Fold the global and local enable bits together into the
> + global fields, then xor to show which registers have
> + changed collective enable state. */
> + int mod = ((old_dr7 | old_dr7 * 2) ^ (new_dr7 | new_dr7 * 2)) & 0xff;
The AND is not needed at all but, if you add it, you might as well use
"& 0xaa" which is clearer. But even better, just do:
target_ulong old_dr7 = env->dr[7];
int mod = old_dr7 ^ new_dr7;
...
if ((mod & ~0xff) == 0) {
and test with
if (mod & (3 << i * 2))
inside the loop.
Otherwise looks good, I'll write a kvm-unit-tests patch for this.
Paolo
- [Qemu-devel] [PATCH 0/8] target-i386: Implement debug extensions, Richard Henderson, 2015/09/15
- [Qemu-devel] [PATCH 5/8] target-i386: Move hw_*breakpoint_* functions, Richard Henderson, 2015/09/15
- [Qemu-devel] [PATCH 6/8] target-i386: Optimize setting dr[0-3], Richard Henderson, 2015/09/15
- [Qemu-devel] [PATCH 8/8] target-i386: Check CR4[DE] for processing DR4/DR5, Richard Henderson, 2015/09/15
- [Qemu-devel] [PATCH 7/8] target-i386: Handle I/O breakpoints, Richard Henderson, 2015/09/15
- [Qemu-devel] [PATCH 1/8] target-i386: Move breakpoint related functions to new file, Richard Henderson, 2015/09/15
- Re: [Qemu-devel] [PATCH 0/8] target-i386: Implement debug extensions, Paolo Bonzini, 2015/09/21