From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52575) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zdzr5-0003MB-P7 for qemu-devel@nongnu.org; Mon, 21 Sep 2015 08:06:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zdzr0-0001u3-PF for qemu-devel@nongnu.org; Mon, 21 Sep 2015 08:05:59 -0400 Received: from mail-wi0-x22a.google.com ([2a00:1450:400c:c05::22a]:34839) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zdzr0-0001tu-Hf for qemu-devel@nongnu.org; Mon, 21 Sep 2015 08:05:54 -0400 Received: by wicge5 with SMTP id ge5so112674418wic.0 for ; Mon, 21 Sep 2015 05:05:53 -0700 (PDT) Sender: Paolo Bonzini References: <1442342713-29497-1-git-send-email-rth@twiddle.net> From: Paolo Bonzini Message-ID: <55FFF2A0.7070808@redhat.com> Date: Mon, 21 Sep 2015 14:05:52 +0200 MIME-Version: 1.0 In-Reply-To: <1442342713-29497-1-git-send-email-rth@twiddle.net> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit Subject: Re: [Qemu-devel] [PATCH 0/8] target-i386: Implement debug extensions List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Richard Henderson , qemu-devel@nongnu.org Cc: ehabkost@redhat.com On 15/09/2015 20:45, Richard Henderson wrote: > Best guess, since I can't find any code that actually uses them. > Linux actively turns them off at boot... I've sent a kvm-unit-tests patch to test debug extensions. It shows that debug extensions work, but the following needs to be squashed in patch 4: diff --git a/target-i386/bpt_helper.c b/target-i386/bpt_helper.c index c258598..b24e446 100644 --- a/target-i386/bpt_helper.c +++ b/target-i386/bpt_helper.c @@ -134,14 +134,14 @@ void cpu_x86_update_dr7(CPUX86State *env, uint32_t new_dr7) int mod = ((old_dr7 | old_dr7 * 2) ^ (new_dr7 | new_dr7 * 2)) & 0xff; for (i = 0; i < DR7_MAX_BP; i++) { - if (mod & (2 << i * 2)) { - /* We know that register i has changed enable state; - recheck what that state should be and apply. */ - if (hw_breakpoint_enabled(new_dr7, i)) { - iobpt |= hw_breakpoint_insert(env, i); - } else { - hw_breakpoint_remove(env, i); - } + if ((mod & (2 << i * 2)) && !hw_breakpoint_enabled(new_dr7, i)) { + hw_breakpoint_remove(env, i); + } + } + env->dr[7] = new_dr7 | DR7_FIXED_1; + for (i = 0; i < DR7_MAX_BP; i++) { + if (mod & (2 << i * 2) && hw_breakpoint_enabled(new_dr7, i)) { + iobpt |= hw_breakpoint_insert(env, i); } else if (hw_breakpoint_type(new_dr7, i) == DR7_TYPE_IO_RW && hw_breakpoint_enabled(new_dr7, i)) { iobpt |= HF_IOBPT_MASK; Otherwise, hw_breakpoint_insert doesn't work because it expects to see an updated env->dr[7]. There are a couple other issues that the tests expose, but they are not regressions so I will send patches later. Paolo