From nobody Tue Nov 18 01:22:02 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1606908085; cv=none; d=zohomail.com; s=zohoarc; b=duy9oWNywU4Jh6k8ilAtEFFx0WOLYvyC9bbf14jzICbB5rEsniw09K6lss+1pYO91dAIkwPbCch2HRaqx1bn2sZNO0sLwiduiwxqnKqpSfDOj6EuTxe+nUSMeJ2hDtfQp4klj2j4dfLmBJrgWzsCXnXhR8Mvg0z010gW3lESFhw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1606908085; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=LOFadtS8P+HipB+dMXVoHfndgHAL2KBXN7L2k6t4OKo=; b=Aje4VFHxvqVPwOlIT5mWZILZI12Zy3WgDPiCI2YY618q6TMP8smIQgtYeDY8nMPa6smz4DFjxBPY+EyXHIZHwAJXCOCl15men9yKqAqc1pY98UJjp7lbmid1NtIgcCyeiFohkEttpEYy2vcXh/jlxX18PyQoSoPlMlu5oREhI04= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1606908085691962.6274509871927; Wed, 2 Dec 2020 03:21:25 -0800 (PST) Received: from localhost ([::1]:34512 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kkQCK-00048T-Dv for importer@patchew.org; Wed, 02 Dec 2020 06:21:24 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:39040) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kkPzT-0006lW-0p for qemu-devel@nongnu.org; Wed, 02 Dec 2020 06:08:07 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:38724) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kkPzQ-0004Yc-Kd for qemu-devel@nongnu.org; Wed, 02 Dec 2020 06:08:06 -0500 Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-584-emRIhzgXNkOPA0fxQES1Nw-1; Wed, 02 Dec 2020 06:03:24 -0500 Received: by mail-wr1-f69.google.com with SMTP id w17so3327780wrl.8 for ; Wed, 02 Dec 2020 03:03:24 -0800 (PST) Received: from redhat.com (bzq-79-176-44-197.red.bezeqint.net. [79.176.44.197]) by smtp.gmail.com with ESMTPSA id i16sm1667455wru.92.2020.12.02.03.03.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Dec 2020 03:03:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1606907283; 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=LOFadtS8P+HipB+dMXVoHfndgHAL2KBXN7L2k6t4OKo=; b=itmuQvkehMAaUGVUrepB0jtpU4MWfm9JKC3cr4xXITdBBRjyED3nO/OY71LqmC6GVmnXw5 p2Q1/W1sOdBmhdyZaf5+twSPpWs9saTsA92IvZO2xkyyCvVHyC8dSMLU5a1khvyLtSmRWn udnzLx7vVfKs96EbGbcUIXtv97UYXuA= X-MC-Unique: emRIhzgXNkOPA0fxQES1Nw-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to; bh=LOFadtS8P+HipB+dMXVoHfndgHAL2KBXN7L2k6t4OKo=; b=h7Ayg+tFqzAIJfMkcufzqoskD/vVd9pjtO3Qi18DBxR6SHjiiAPwKLhDvGloM4kQp/ Kmm1jP5nuzxINU07dOhWqSZ5Pmy0F15GxF8voeyVoi1lnKmJlXbPJ1ewZMe7Ix0G7l5T k69Yg06O5Tl3p/nUDqd11xS4N4tLcFzIVydYe4kwHUvbFh3rWz+wPBza8X29LV+DhNA7 M1PGFRTBZ41n/Kdzf0B713i4n7TiQfx7gilbInuxt2KF2rbCyvf7N8323cehhJpPh6x1 GXRcewBpsdKSwZ3rmux+Col39qqT2W8o+aXdP4y+Kde7OUmlpQXHO8Gzw2wo5p9zvSBE 2RYw== X-Gm-Message-State: AOAM531meN9NuuuFv5oNUuRmIZg+jBzVK9EtNWmmB/Sv1afjC1vYFwmo htGw+r6+zXDNoNwTT0XYRrkENXFwoV34flDRyISdvMNQFXfzsY4UCbb4Nqin4JmZvucSVVcrcvk 46+lhTMdVfPESZLRuxA35Tm/b+Ooz3c1AzoVGLfcW2TnXmGBIl7odLoHYCB6Z X-Received: by 2002:adf:dd09:: with SMTP id a9mr2736169wrm.128.1606907002926; Wed, 02 Dec 2020 03:03:22 -0800 (PST) X-Google-Smtp-Source: ABdhPJyZEcw9h18148/+x9Vx8uxRpofgzQNaSfwww6H0KZDfXX4pDEhfZuivS7KGY9UdXBTNKu0C1g== X-Received: by 2002:adf:dd09:: with SMTP id a9mr2736043wrm.128.1606907001659; Wed, 02 Dec 2020 03:03:21 -0800 (PST) Date: Wed, 2 Dec 2020 06:03:19 -0500 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Subject: [PULL 5/6] intel_iommu: Skip page walking on device iotlb invalidations Message-ID: <20201202101655.122214-6-mst@redhat.com> References: <20201202101655.122214-1-mst@redhat.com> MIME-Version: 1.0 In-Reply-To: <20201202101655.122214-1-mst@redhat.com> X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=mst@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=63.128.21.124; envelope-from=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -35 X-Spam_score: -3.6 X-Spam_bar: --- X-Spam_report: (-3.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.497, 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_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@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 , Eduardo Habkost , Jason Wang , Richard Henderson , Peter Xu , Eugenio =?utf-8?B?UMOpcmV6?= , Paolo Bonzini Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) From: Eugenio P=C3=A9rez Although they didn't reach the notifier because of the filtering in memory_region_notify_iommu_one, the vt-d was still splitting huge memory invalidations in chunks. Skipping it. This improves performance in case of netperf with vhost-net: * TCP_STREAM: From 1923.6Mbit/s to 2175.13Mbit/s (13%) * TCP_RR: From 8464.73 trans/s to 8932.703333 trans/s (5.5%) * UDP_RR: From 8562.08 trans/s to 9005.62/s (5.1%) * UDP_STREAM: No change observed (insignificant 0.1% improvement) Signed-off-by: Eugenio P=C3=A9rez Acked-by: Jason Wang Message-Id: <20201116165506.31315-5-eperezma@redhat.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- hw/i386/intel_iommu.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/hw/i386/intel_iommu.c b/hw/i386/intel_iommu.c index edc3090f91..0cc71e4057 100644 --- a/hw/i386/intel_iommu.c +++ b/hw/i386/intel_iommu.c @@ -1478,6 +1478,10 @@ static int vtd_sync_shadow_page_table(VTDAddressSpac= e *vtd_as) VTDContextEntry ce; IOMMUNotifier *n; =20 + if (!(vtd_as->iommu.iommu_notify_flags & IOMMU_NOTIFIER_IOTLB_EVENTS))= { + return 0; + } + ret =3D vtd_dev_to_context_entry(vtd_as->iommu_state, pci_bus_num(vtd_as->bus), vtd_as->devfn, &ce); --=20 MST