From nobody Sun Feb 8 08:43:08 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1532378395238556.3637278437634; Mon, 23 Jul 2018 13:39:55 -0700 (PDT) Received: from localhost ([::1]:36448 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fhhcM-0002ja-Bw for importer@patchew.org; Mon, 23 Jul 2018 16:39:42 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41220) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fhhIq-0001vg-9R for qemu-devel@nongnu.org; Mon, 23 Jul 2018 16:19:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fhhIp-0003ML-0J for qemu-devel@nongnu.org; Mon, 23 Jul 2018 16:19:32 -0400 Received: from mail-oi0-x230.google.com ([2607:f8b0:4003:c06::230]:40342) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fhhIo-0003Ky-Qe; Mon, 23 Jul 2018 16:19:30 -0400 Received: by mail-oi0-x230.google.com with SMTP id w126-v6so3472311oie.7; Mon, 23 Jul 2018 13:19:30 -0700 (PDT) Received: from localhost (76-251-165-188.lightspeed.austtx.sbcglobal.net. [76.251.165.188]) by smtp.gmail.com with ESMTPSA id p4-v6sm11150876oig.43.2018.07.23.13.19.27 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 23 Jul 2018 13:19:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=mpLWXbe+qyMbEN0pvvW1x3gz13gRdbpJPpr5HZeanew=; b=nzUZmoYsZLajiPV6WglYIbZIyuC6Jhx4uEc4asMpllrflFf5lvXDwluKrXfMshTdmj iWjjOPKQjJ4EBtW7x7Evvi9ak5W+XgrHy8H8eIUEynwZuhUht8B8EiBX5IH7Lz8fmjsN wW6p/BoxF+GoldCGsNa4c8k3cBDZqeKoLUc6J3r3SEBv8lawNStC8FiK51UPXygp25Wz khTJUPEhAANsBoo2e1blT8T/irjuzYOuXeaAn43pRN/xMXM4lSROeMg0hHObk882Ebxk pguZOUOSviYGWrq/BXO1dTkAUPrtiRLKMP3wd6KPfLAAHuQJo63nEH65qIRm0rhCjCWY ERaA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=mpLWXbe+qyMbEN0pvvW1x3gz13gRdbpJPpr5HZeanew=; b=lnVBeDNU8375RlOejEwvcVnC4TQH1c8kzSIJO+BLxDh5Z3ja8i8pFhh51ajSEpRP0S Yl9l1bpyZHcDW4Kww4YRiQwcfaHv7ynxqnpYzwGYpiy2tWvQ7sEqjY98d1abzDQf/N1w +xo9SNHl4P3n2nPsXm+ejfA/s7gTFgdEGBBH/aD+dMORa66f++VMf5bN3U5EaI+gDZ6p ZNtHl6ovV9bAbNrrgPrBv4n0BuFZmhcV7Z6wIV5VHuBz337uDt1SmwctmF/hoWA7I0o/ vM9HwPNmZbsK06JsPVy30mxAVaOVD1Vg/TSgO3TVTprmxs+KNSYzpxJJ8ZZcVJXWTlg6 Nuvg== X-Gm-Message-State: AOUpUlGQ007GEPWtILaoz9WeJmQK0l7ILK361UBWOREO02TZISWDVzh0 H0DmiTBAfMij6oPwrMq4u2T1G5gzuAY= X-Google-Smtp-Source: AAOMgpfT9d5e64S0NwiZ/9OtkBeL+mcLcUMV6Fs7i7OqM0eP3XX/fIuuvP19vgR83ZJ3AMBNw5IDEw== X-Received: by 2002:aca:b7c3:: with SMTP id h186-v6mr306524oif.54.1532377169694; Mon, 23 Jul 2018 13:19:29 -0700 (PDT) From: Michael Roth To: qemu-devel@nongnu.org Date: Mon, 23 Jul 2018 15:16:39 -0500 Message-Id: <20180723201748.25573-31-mdroth@linux.vnet.ibm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180723201748.25573-1-mdroth@linux.vnet.ibm.com> References: <20180723201748.25573-1-mdroth@linux.vnet.ibm.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4003:c06::230 Subject: [Qemu-devel] [PATCH 30/99] intel-iommu: pass in address space when page walk X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-stable@nongnu.org, Peter Xu , "Michael S . Tsirkin" Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Peter Xu We pass in the VTDAddressSpace too. It'll be used in the follow up patches. CC: QEMU Stable Signed-off-by: Peter Xu Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin (cherry picked from commit 2f764fa87d2a81812b313dd6d998e10126292653) Signed-off-by: Michael Roth --- 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 e247269659..a882894f49 100644 --- a/hw/i386/intel_iommu.c +++ b/hw/i386/intel_iommu.c @@ -754,9 +754,11 @@ typedef int (*vtd_page_walk_hook)(IOMMUTLBEntry *entry= , void *private); * @hook_fn: hook func to be called when detected page * @private: private data to be passed into hook func * @notify_unmap: whether we should notify invalid entries + * @as: VT-d address space of the device * @aw: maximum address width */ typedef struct { + VTDAddressSpace *as; vtd_page_walk_hook hook_fn; void *private; bool notify_unmap; @@ -1463,6 +1465,7 @@ static void vtd_iotlb_page_invalidate_notify(IntelIOM= MUState *s, .private =3D (void *)&vtd_as->iommu, .notify_unmap =3D true, .aw =3D s->aw_bits, + .as =3D vtd_as, }; =20 /* @@ -2943,6 +2946,7 @@ static void vtd_iommu_replay(IOMMUMemoryRegion *iommu= _mr, IOMMUNotifier *n) .private =3D (void *)n, .notify_unmap =3D false, .aw =3D s->aw_bits, + .as =3D vtd_as, }; =20 vtd_page_walk(&ce, 0, ~0ULL, &info); --=20 2.17.1