From mboxrd@z Thu Jan 1 00:00:00 1970 Received: by 2002:a19:ad09:0:0:0:0:0 with SMTP id t9csp427835lfc; Thu, 3 Sep 2020 04:06:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwDdOp4MvpdQ6N2OhrHeZRwk1QRyyReNZSXWlietOoVMIF2op3H6BAD76t0ZuaaiIOls73i X-Received: by 2002:a25:ba4c:: with SMTP id z12mr1961436ybj.253.1599131209632; Thu, 03 Sep 2020 04:06:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599131209; cv=none; d=google.com; s=arc-20160816; b=m2IXwT0WZPhqaOaZsbG8fA1G/StG1jOo+Me+uaZZyZP8FFLWw6yFnu4X9n3F83z+na F9wROa3zMoUMVNPvnHBp8Ri1Yk6Doocev6dHq9z/beuFRVxpGhbj/Ryj2WDYM1tZViW4 rCwroiiUxGVsKCprrdN7++JpXs0mWBb0A//VwPJKhCQRoamrdOvYl2RsfBj5onuwM9JM lTuH5+h7y5evjZd0240c54fIQuM0gQjsrTTfVd9StxW/sp6LaZzdGUA3BJdMcJ85dXTB P5dJfC7ET7egGDFcUDOewAOdaauQUETuGlE+CyccxWEJ6CEtxBGtYIjouOBeY22kCF4L YIgQ== 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-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:to:subject:dkim-signature; bh=2FdU5gdh4xFvnFBywEfr90MIaoYD85nZvYnLyquklHQ=; b=zTEe8LL6Hr9yRA4JjU34W15y2RobaNPOCmaEgiUhT9N4DLMLx5O9nobOg52xTkYWRK t6vjgo2oD53zija8O82kb+iB80VGXSYvN93TrxZ8yfN5+DfEtCuCBjxusOa0LzTBHqvV 38jGCHj3V4VT2PwFpq93fFnz6LyzJFJoQ1u0v3XAknZUOfEy+FB/xx09l2W0OnvbxyVG HW6qvIhD2bJPHmCwYYPwIi0xneFbOQ3ECTE2dnkQ7p1C9o/uKi2YGoJ9KuKqOumip8t5 vPcXFLAIareCon+3XL+raEjqR6QrnuMNleSzrN4N7WRQlSu2Hg4B1i/Jz3qiFP59E5gy 8diQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@redhat.com header.s=mimecast20190719 header.b=Y3cS5ofv; 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 d38si2919348ybi.51.2020.09.03.04.06.49 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 03 Sep 2020 04:06:49 -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=Y3cS5ofv; 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]:51090 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kDn4q-0004XW-WA for alex.bennee@linaro.org; Thu, 03 Sep 2020 07:06:49 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33216) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kDn4T-0004AY-JN for qemu-arm@nongnu.org; Thu, 03 Sep 2020 07:06:25 -0400 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:49035) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kDn4Q-0005bf-ID for qemu-arm@nongnu.org; Thu, 03 Sep 2020 07:06:25 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1599131181; 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=2FdU5gdh4xFvnFBywEfr90MIaoYD85nZvYnLyquklHQ=; b=Y3cS5ofv2b9tft2CfUX7OPA41tIWXtOrLuogfCDwyJh1sc3rhNth8BPoVmBVJfOaDkaIHG QVXu7g/GgaJNxPTO2vv2gXIjsgUhKZ+Pq4tGF0ddqrRivCqhAsYWW0SL1wai3vX2aUPRZB Fseoo1Cv8z6YxnwpRWQVJdThDoT7oH4= 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-510-mGlZfL66NCSyJTLm6lMOsA-1; Thu, 03 Sep 2020 07:06:18 -0400 X-MC-Unique: mGlZfL66NCSyJTLm6lMOsA-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 4EEB3100670D; Thu, 3 Sep 2020 11:06:15 +0000 (UTC) Received: from [10.36.112.51] (ovpn-112-51.ams2.redhat.com [10.36.112.51]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 049BE60250; Thu, 3 Sep 2020 11:06:01 +0000 (UTC) Subject: Re: [RFC v8 3/5] memory: Add IOMMU_DEVIOTLB_UNMAP IOMMUTLBNotificationType To: Eugenio Perez Martin References: <20200901142608.24481-1-eperezma@redhat.com> <20200901142608.24481-4-eperezma@redhat.com> <58783cf8-ef7f-1481-8c5e-acd76a8b752f@redhat.com> From: Auger Eric Message-ID: <99c1436d-7701-e7d9-ec3a-c47566aa1ce2@redhat.com> Date: Thu, 3 Sep 2020 13:06:00 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.5.0 MIME-Version: 1.0 In-Reply-To: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=eric.auger@redhat.com X-Mimecast-Spam-Score: 0.002 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Content-Language: en-US Received-SPF: pass client-ip=63.128.21.124; envelope-from=eric.auger@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/09/03 04:23:54 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -44 X-Spam_score: -4.5 X-Spam_bar: ---- X-Spam_report: (-4.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, NICE_REPLY_A=-2.403, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable 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 , "Michael S. Tsirkin" , Jason Wang , Juan Quintela , qemu-level , Peter Xu , qemu-arm@nongnu.org, qemu-ppc@nongnu.org, Avi Kivity , Paolo Bonzini , David Gibson , Richard Henderson , =?UTF-8?Q?Herv=c3=a9_Poussineau?= Errors-To: qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org Sender: "Qemu-arm" X-TUID: rF8oGxfOfagP Hi Eugenio, On 9/3/20 12:13 PM, Eugenio Perez Martin wrote: > Hi Eric, > > On Wed, Sep 2, 2020 at 12:32 PM Auger Eric wrote: >> >> Hi Eugenio, >> >> On 9/1/20 4:26 PM, Eugenio Pérez wrote: >>> Adapt intel and vhost to use this new notification type >> I think you should explain in the commit message what is the benefice to >> introduce this new event type. > > Will do, thanks! > >>> >>> Signed-off-by: Eugenio Pérez >>> --- >>> hw/i386/intel_iommu.c | 2 +- >>> hw/virtio/vhost.c | 2 +- >>> include/exec/memory.h | 2 ++ >>> 3 files changed, 4 insertions(+), 2 deletions(-) >>> >>> diff --git a/hw/i386/intel_iommu.c b/hw/i386/intel_iommu.c >>> index 0c4aef5cb5..cdddb089e7 100644 >>> --- a/hw/i386/intel_iommu.c >>> +++ b/hw/i386/intel_iommu.c >>> @@ -2468,7 +2468,7 @@ static bool vtd_process_device_iotlb_desc(IntelIOMMUState *s, >>> sz = VTD_PAGE_SIZE; >>> } >>> >>> - event.type = IOMMU_NOTIFIER_UNMAP; >>> + event.type = IOMMU_NOTIFIER_DEVIOTLB; >> If this is used only for device IOTLB cache invalidation, shouldn't this >> be named IOMMU_NOTIFIER_DEVIOTLB_UNMAP to be consistent with the rest? >>> event.entry.target_as = &vtd_dev_as->as; >>> event.entry.addr_mask = sz - 1; >>> event.entry.iova = addr; >>> diff --git a/hw/virtio/vhost.c b/hw/virtio/vhost.c >>> index 1a1384e7a6..6ca168b47e 100644 >>> --- a/hw/virtio/vhost.c >>> +++ b/hw/virtio/vhost.c >>> @@ -729,7 +729,7 @@ static void vhost_iommu_region_add(MemoryListener *listener, >>> iommu_idx = memory_region_iommu_attrs_to_index(iommu_mr, >>> MEMTXATTRS_UNSPECIFIED); >>> iommu_notifier_init(&iommu->n, vhost_iommu_unmap_notify, >>> - IOMMU_NOTIFIER_UNMAP, >>> + IOMMU_NOTIFIER_DEVIOTLB, >>> section->offset_within_region, >>> int128_get64(end), >>> iommu_idx); >>> diff --git a/include/exec/memory.h b/include/exec/memory.h >>> index 8a56707169..215e23973d 100644 >>> --- a/include/exec/memory.h >>> +++ b/include/exec/memory.h >>> @@ -87,6 +87,8 @@ typedef enum { >>> IOMMU_NOTIFIER_UNMAP = 0x1, >>> /* Notify entry changes (newly created entries) */ >>> IOMMU_NOTIFIER_MAP = 0x2, >>> + /* Notify changes on device IOTLB entries */ >>> + IOMMU_NOTIFIER_DEVIOTLB = 0x04, >>> } IOMMUNotifierFlag; >>> >>> #define IOMMU_NOTIFIER_ALL (IOMMU_NOTIFIER_MAP | IOMMU_NOTIFIER_UNMAP) >> shouldn't we rename this one?? >>> >> > > Agree, but I'm not sure about the right name. IOMMU_NOTIFIER_ALL_ROOT? > IOMMU_NOTIFIER_ALL_REGULAR? I would rather name it IOMMU_NOTIFIER_IOTLB_EVENTS versus IOMMU_NOTIFIER_DEVIOTLB_EVENTS? This is the cache type that differs, isn't it? Thanks Eric > > Thanks! > >> Thanks >> >> Eric >> > >