From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39174) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1axd1x-0000kt-Jg for qemu-devel@nongnu.org; Tue, 03 May 2016 12:18:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1axd1l-00044y-T5 for qemu-devel@nongnu.org; Tue, 03 May 2016 12:18:32 -0400 Received: from mout.web.de ([212.227.17.11]:61448) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1axd1l-00040S-KD for qemu-devel@nongnu.org; Tue, 03 May 2016 12:18:25 -0400 References: <1461969763-5193-1-git-send-email-davidkiarie4@gmail.com> <1461969763-5193-2-git-send-email-davidkiarie4@gmail.com> <20160501141433.GA12422@redhat.com> From: Jan Kiszka Message-ID: <5728CF3D.30000@web.de> Date: Tue, 3 May 2016 18:18:05 +0200 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [V9 1/4] hw/i386: Introduce AMD IOMMU List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: David Kiarie , "Michael S. Tsirkin" Cc: QEMU Developers , Valentine Sinitsyn , imammedo@redhat.com, Marcel Apfelbaum , Peter Xu [please shorten too long replies] On 2016-05-03 18:11, David Kiarie wrote: > On Sun, May 1, 2016 at 5:14 PM, Michael S. Tsirkin wrote: >> On Sat, Apr 30, 2016 at 01:42:40AM +0300, David Kiarie wrote: >>> + >>> +#include "hw/hw.h" >>> +#include "hw/pci/pci.h" >>> +#include "hw/pci/msi.h" >>> +#include "hw/sysbus.h" >>> +#include "sysemu/dma.h" >>> + >>> +/* Capability registers */ >>> +#define IOMMU_CAPAB_HEADER 0x00 >>> +#define IOMMU_CAPAB_REV_TYPE 0x02 >>> +#define IOMMU_CAPAB_FLAGS 0x03 >>> +#define IOMMU_CAPAB_BAR_LOW 0x04 >>> +#define IOMMU_CAPAB_BAR_HIGH 0x08 >>> +#define IOMMU_CAPAB_RANGE 0x0C >>> +#define IOMMU_CAPAB_MISC 0x10 >>> +#define IOMMU_CAPAB_MISC1 0x14 >> >> >> Where are all these from? Most seem unused. >> >> Pls use AMD_IOMMU_ prefix to avoid polluting global namespace. > > Is it okay to move these macros to the amd_iommu.c file or to another > file since these macros/defines are already prefix with IOMMU. > Prefixing them with AMD_IOMMU makes them a bit too long I can barely > write a line of code spanning less than 80 chars. An alternative prefix: AMDVI (AMD-Vi is also used for "AMD IOMMU"). Jan