From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [PATCH 05/17] qemu: Respect length of watchpoints Date: Tue, 07 Oct 2008 14:04:16 +0200 Message-ID: <48EB5040.9090703@redhat.com> References: <20081006091415.095241851@mchn012c.ww002.siemens.net> <20081006091416.087984430@mchn012c.ww002.siemens.net> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: kvm@vger.kernel.org To: Jan Kiszka Return-path: Received: from mx2.redhat.com ([66.187.237.31]:57856 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753106AbYJGMEV (ORCPT ); Tue, 7 Oct 2008 08:04:21 -0400 In-Reply-To: <20081006091416.087984430@mchn012c.ww002.siemens.net> Sender: kvm-owner@vger.kernel.org List-ID: Jan Kiszka wrote: > This adds length support for watchpoints. To keep things simple, only > aligned watchpoints are accepted. > > --- a/qemu/exec.c > +++ b/qemu/exec.c > @@ -1328,14 +1328,19 @@ static void breakpoint_invalidate(CPUSta > int cpu_watchpoint_insert(CPUState *env, target_ulong addr, target_ulong len, > int flags, CPUWatchpoint **watchpoint) > { > + target_ulong len_mask = ~(len - 1); > CPUWatchpoint *wp; > > + /* sanity checks: allow power-of-2 lengths, deny unaligned watchpoints */ > + if ((len != 1 && len != 2 && len != 4) || (addr & ~len_mask)) > + return -EINVAL; > + > It would be good to support 8-byte watchpoints (as x86-64 does); also, print a message if we deny a breakpoint due to bad alignment, so people know where to fix this. -- error compiling committee.c: too many arguments to function