From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Nzq8r-0004W0-8c for qemu-devel@nongnu.org; Thu, 08 Apr 2010 07:43:25 -0400 Received: from [140.186.70.92] (port=34085 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Nzq8q-0004VU-11 for qemu-devel@nongnu.org; Thu, 08 Apr 2010 07:43:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1Nzq8o-0005zC-5X for qemu-devel@nongnu.org; Thu, 08 Apr 2010 07:43:23 -0400 Received: from mx20.gnu.org ([199.232.41.8]:30441) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Nzq8n-0005yy-Np for qemu-devel@nongnu.org; Thu, 08 Apr 2010 07:43:22 -0400 Received: from mail.codesourcery.com ([38.113.113.100]) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Nzq8m-0000Ne-Rj for qemu-devel@nongnu.org; Thu, 08 Apr 2010 07:43:21 -0400 From: Paul Brook Subject: Re: [Qemu-devel] [PATCH] Basic Intel IOMMU DMAR emulation Date: Thu, 8 Apr 2010 12:43:13 +0100 References: <8DC5AC30-AF5C-461F-BA46-69F6C583C9EA@gmail.com> In-Reply-To: <8DC5AC30-AF5C-461F-BA46-69F6C583C9EA@gmail.com> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201004081243.13932.paul@codesourcery.com> List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Muli Ben-Yehuda , Nadav Amit >1. DMAR tables must be loaded by command line ( -acpitable > sig=DMAR,data=hw/DMAR.dat ) Why? > +void cpu_physical_memory_rw_io(target_phys_addr_t addr, uint8_t *buf, > + int len, int is_write, uint16_t devfn, > + int* err); This appears to be PCI specific, which is wrong. You should be using the qdev infrastructure. >+/* Mapping related structures */ >+struct IommuRootEntry { >+ uint32_t p : 1 ; >+ uint32_t res1 : 11 ; >+ uint64_t ctp : 52 ; >+ uint64_t res2 : 64 ; >+}; This is almost certainly wrong on some hosts. You can not assume anything about bitfield layout. Do not use these if an exact binary representation is required. Paul