Received: by 2002:a19:ad09:0:0:0:0:0 with SMTP id t9csp813915lfc; Wed, 26 Aug 2020 07:38:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJysUIlMI5rsrIidbtCzODYgBCx5vlr9TAl6NncROzLFv6bp6EMv7rztbkKs7hCd3jW/vtY3 X-Received: by 2002:a25:4ed6:: with SMTP id c205mr22456256ybb.279.1598452685123; Wed, 26 Aug 2020 07:38:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598452685; cv=none; d=google.com; s=arc-20160816; b=WWcZhR7hrSwzdicIAfQHYsPi7uT7ny50wYTd/HPvDkEiDU48wF3v767c5YZy7ya9TZ OvUBebV0gA385x1oWjuYCrlxD8rPhedcjixmaJ6p9dnfXOkm1VbWbJv5ebpwvBWchAyp F0nJh9XYZWpC55FdAXQqKfDbXQ3ji8oMgFGzacRoPavoSnHLqkfiHdD9D1JZi7Ca10mC mIRyRoPPSz/AQnPBJhChC3xNj29q2833zL8wdUshf3P/8HNeFeTpZAhK0GvvzfIzZWgI U4/7pkMor++ukmRIH90TXEVduC61o+bYstv3Xq9RampbbHFnY/04hpU+NIYetPiVMTcR t7yA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=myzuQLMFrzrzm+iQjl6HxCd2/viSh0aOZ9bTWanImV8=; b=val8xBbQRZFVrAXJf//v50pMuVKr1oDyqMxJiwj+2tKCJDioxNbZxcnwKMnbEOAeiG 39/IbigEmi6xT+WQQWXZVC5pBZAs/onHqzM1Tfo/IzbR+hVkpW8ohDLTglxt1r/9CtD8 V3pk1yHQvVYAkoq9Egvy89dIgL45Af+DCJ1Lc4DKbvynSbQppDPNnDyoaZ+EaOeE//Zq d/4ic0ZWaCRSdBVUK0fNdsVkDRZAmk5D+EXuD46SxW71Ni32qnZfb2iB+5tKHUjT8Z+R xpb8x/hGrXVyQY1G+0vIPmm1BtoM6qdpyHUXZM8M9EubAkMcePywVkCGdicitWq8OfBq X00A== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@redhat.com header.s=mimecast20190719 header.b=BHT026J7; spf=pass (google.com: domain of qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id p137si2329819yba.410.2020.08.26.07.38.04 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 26 Aug 2020 07:38:05 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@redhat.com header.s=mimecast20190719 header.b=BHT026J7; spf=pass (google.com: domain of qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from localhost ([::1]:43816 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kAwYu-0005Lz-DR for alex.bennee@linaro.org; Wed, 26 Aug 2020 10:38:04 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46240) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kAwYW-0004pz-Ov for qemu-arm@nongnu.org; Wed, 26 Aug 2020 10:37:40 -0400 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:60459 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kAwYU-0006Ce-Tw for qemu-arm@nongnu.org; Wed, 26 Aug 2020 10:37:40 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1598452658; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=myzuQLMFrzrzm+iQjl6HxCd2/viSh0aOZ9bTWanImV8=; b=BHT026J70uVOjV/gQy7OvD06bdjUl9b5B2JZMspjz6RSL8M//heHYbhyTpW9E8HE1dkeif qxZvpe/8sqjYQIsr1CkffLpoR/9AWgYUuInYmZWW1G3gL3HnKeBetZ0vCOBte9bji9D0AJ VEYBjqopj+/ZJPdAPXmK1DTKvoBxUHY= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-491-ye5iZrQCM9O2I99XGP3gFQ-1; Wed, 26 Aug 2020 10:37:36 -0400 X-MC-Unique: ye5iZrQCM9O2I99XGP3gFQ-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id C448980F043; Wed, 26 Aug 2020 14:37:34 +0000 (UTC) Received: from eperezma.remote.csb (ovpn-115-59.ams2.redhat.com [10.36.115.59]) by smtp.corp.redhat.com (Postfix) with ESMTP id 04B2D76E00; Wed, 26 Aug 2020 14:37:27 +0000 (UTC) From: =?UTF-8?q?Eugenio=20P=C3=A9rez?= To: qemu-devel@nongnu.org, Peter Xu Subject: [RFC v6 02/13] memory: Add IOMMUTLBNotificationType to IOMMUTLBEntry Date: Wed, 26 Aug 2020 16:36:40 +0200 Message-Id: <20200826143651.7915-3-eperezma@redhat.com> In-Reply-To: <20200826143651.7915-1-eperezma@redhat.com> References: <20200625191651.5817-1-eperezma@redhat.com> <20200826143651.7915-1-eperezma@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=eperezma@redhat.com X-Mimecast-Spam-Score: 0.002 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=207.211.31.120; envelope-from=eperezma@redhat.com; helo=us-smtp-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/08/26 03:56:58 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -30 X-Spam_score: -3.1 X-Spam_bar: --- X-Spam_report: (-3.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.959, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-arm@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Aleksandar Rikalo , Yan Zhao , Eduardo Habkost , Juan Quintela , Jason Wang , "Michael S. Tsirkin" , Eric Auger , qemu-arm@nongnu.org, =?UTF-8?q?Herv=C3=A9=20Poussineau?= , Avi Kivity , Marcel Apfelbaum , Paolo Bonzini , Richard Henderson Errors-To: qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org Sender: "Qemu-arm" X-TUID: H6PFVB35VX4s This way we can tell between MAPs and UNMAP, and potentially avoid to send them to a notifier that does not require them. Signed-off-by: Eugenio Pérez --- include/exec/memory.h | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/include/exec/memory.h b/include/exec/memory.h index 22c5f564d1..f6d91c54aa 100644 --- a/include/exec/memory.h +++ b/include/exec/memory.h @@ -59,6 +59,12 @@ struct ReservedRegion { typedef struct IOMMUTLBEntry IOMMUTLBEntry; +typedef enum { + IOMMU_IOTLB_NONE = 0, + IOMMU_IOTLB_UNMAP = 1, + IOMMU_IOTLB_MAP = 2, +} IOMMUTLBNotificationType; + /* See address_space_translate: bit 0 is read, bit 1 is write. */ typedef enum { IOMMU_NONE = 0, @@ -70,11 +76,12 @@ typedef enum { #define IOMMU_ACCESS_FLAG(r, w) (((r) ? IOMMU_RO : 0) | ((w) ? IOMMU_WO : 0)) struct IOMMUTLBEntry { - AddressSpace *target_as; - hwaddr iova; - hwaddr translated_addr; - hwaddr addr_mask; /* 0xfff = 4k translation */ - IOMMUAccessFlags perm; + AddressSpace *target_as; + hwaddr iova; + hwaddr translated_addr; + hwaddr addr_mask; /* 0xfff = 4k translation */ + IOMMUAccessFlags perm; + IOMMUTLBNotificationType type; /* Only valid if it is a notification */ }; /* -- 2.18.1