From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53780) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fQBst-0000SG-HM for qemu-devel@nongnu.org; Tue, 05 Jun 2018 09:20:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fQBsn-0006VZ-U5 for qemu-devel@nongnu.org; Tue, 05 Jun 2018 09:20:23 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:45920 helo=mx1.redhat.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fQBsn-0006Uy-J9 for qemu-devel@nongnu.org; Tue, 05 Jun 2018 09:20:17 -0400 From: Peter Xu Date: Tue, 5 Jun 2018 21:19:43 +0800 Message-Id: <20180605131944.14649-3-peterx@redhat.com> In-Reply-To: <20180605131944.14649-1-peterx@redhat.com> References: <20180605131944.14649-1-peterx@redhat.com> Subject: [Qemu-devel] [RFC 2/3] memory: add MemTxAttrs to IOMMUTLBEntry List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Eric Auger , Richard Henderson , David Gibson , =?UTF-8?q?Alex=20Benn=C3=A9e?= , peterx@redhat.com, Alex Williamson , Peter Maydell It should never be used for translate() calls since the caller should be the one who passes in the MemTxAttrs. However it could be used when we want to generate an IOMMU translation notification with specific translation attributes. Signed-off-by: Peter Xu --- include/exec/memory.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/include/exec/memory.h b/include/exec/memory.h index 6b0ced554d..12865a4890 100644 --- a/include/exec/memory.h +++ b/include/exec/memory.h @@ -72,6 +72,13 @@ struct IOMMUTLBEntry { hwaddr translated_addr; hwaddr addr_mask; /* 0xfff = 4k translation */ IOMMUAccessFlags perm; + /* + * Attributes that were bound to the DMA translation. Note that + * this field is meaningless when the IOMMUTLBENtry is generated + * by a translate() call. It can be used as a hint when we want + * to send IOMMU notifications with specific permission flags. + */ + MemTxAttrs attrs; }; /* -- 2.17.0