From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alex Williamson Subject: Re: PCI device reverse engineering Date: Fri, 28 Feb 2014 11:48:23 -0700 Message-ID: <1393613303.26901.24.camel@ul30vt.home> References: Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Cc: kvm@vger.kernel.org To: ret val Return-path: Received: from mx1.redhat.com ([209.132.183.28]:18639 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751457AbaB1SsZ (ORCPT ); Fri, 28 Feb 2014 13:48:25 -0500 In-Reply-To: Sender: kvm-owner@vger.kernel.org List-ID: On Fri, 2014-02-28 at 13:39 -0500, ret val wrote: > I would like to use KVM to reverse engineer/debug a PCI driver. With a > IOMMU and a pass-through device setup, would it be possible to > monitor/log all PCI bus traffic to a device? How can I go about > enabling and viewing this? You can't monitor bus traffic, you'd still need a PCI analyzer for that, but you can track all driver and guest OS access to the device. So you can at least soft or reverse engineer the driver. To do that, uncomment the #define DEBUG_VFIO line near the top of hw/misc/vfio.c and change all the VFIO_ALLOW_FOO defines from 1 to 0, especially the MMAP one. Thanks, Alex