On 03/07/2017 22:19, Richard Henderson wrote:
> On 07/03/2017 09:34 AM, Paolo Bonzini wrote:
>> @@ -215,10 +215,12 @@ void breakpoint_handler(CPUState *cs)
>> if (cs->watchpoint_hit) {
>> if (cs->watchpoint_hit->flags & BP_CPU) {
>> cs->watchpoint_hit = NULL;
>> - if (check_hw_breakpoints(env, false)) {
>> - raise_exception(env, EXCP01_DB);
>> - } else {
>> - cpu_loop_exit_noexc(cs);
>> + if (tcg_enabled()) {
>> + if (check_hw_breakpoints(env, false)) {
>> + raise_exception(env, EXCP01_DB);
>> + } else {
>> + cpu_loop_exit_noexc(cs);
>> + }
>
> This seems like an odd place for the tcg_enabled check. It seems like
> it should be much higher in the if/call chain.
>
> Why are we doing all these bp checks only to disable the final raising
> of an exception?
>
> Indeed, what in bpt_helper.c needs to be compiled in when !tcg_enabled?
Only cpu_x86_update_dr7, but it's not used by KVM (I was worried about
guest debug aka gdbstub mode). So that's my own brain fart; I'll wrap
the cpu_x86_update_dr7 with tcg_enabled and drop the file altogether.
Paolo