From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: Kernel debugging with KVM? Date: Sat, 27 Jan 2007 10:36:29 +0200 Message-ID: <45BB0F0D.7090105@qumranet.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org To: Jun Koi Return-path: In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org Errors-To: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org List-Id: kvm.vger.kernel.org Jun Koi wrote: > Hi, > > I am investigating the possibility of debugging guest kernel with KVM. > Anybody may shed some lights into how KVM handles breakpoints? > > Suppose that we put a breakpoint (0xCC opcode in x86) into guest > kernel. When the kernel hits the breakpoint, which one will handle the > event? > > Looks like qemu will handle the breakpoint first, then next the guest > kernel itself have a chance to process it. Is that correct? > > And is there any chance for the host (VMM) to get notified about the event? > > kvm supports using hardware breakpoints to debug a guest. See the KVM_GUEST_DEBUG ioctl. The modified qemu shipped with kvm allows gdb to connect and debug a kvm guest. It's been a long while since I tested this, so it may or may not work. -- Do not meddle in the internals of kernels, for they are subtle and quick to panic. ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV