From patchwork Fri Nov 29 07:44:05 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: CLEMENT MATHIEU--DRIF X-Patchwork-Id: 13888461 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 90B8FD6EBE5 for ; Fri, 29 Nov 2024 07:48:37 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tGvfp-00085Z-Mp; Fri, 29 Nov 2024 02:44:21 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tGvfi-00081U-Ji for qemu-devel@nongnu.org; Fri, 29 Nov 2024 02:44:14 -0500 Received: from smarthost2.eviden.com ([80.78.11.83]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tGvfg-0002nM-MR for qemu-devel@nongnu.org; Fri, 29 Nov 2024 02:44:14 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=eviden.com; i=@eviden.com; q=dns/txt; s=mail; t=1732866253; x=1764402253; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-id:content-transfer-encoding: mime-version; bh=r1cIMR2bydzS/r8/JNnPbdEFMy5ycwRYByzUFRA40/o=; b=Upp4fDke0KFj5Ng8a7k5ScWFxhCLYAtWa7Lq23wAgx5wg8+NUz0IoWH7 ZGzl80VaLlFxq3pLvvE9rdYPEo+JC1cCEgVMvhTXgniiD2vnO/jfuAF7U E5vKXVLMrDQXRXXCiURwqLuG7ap9N1fUn9Fsn84AoFZ97FGeO95b/gDYA 4Rt0t9Z2Ph1SAjI9RpmTwbjNdJ4qj1Ek7g0NdLBj0gTWQ8zOkXP69Nmd8 ZBtC8vg7auPDekfZ2m1yH0Di8SEn3mGsM+3jptxY53vbdKR8Oq6i2mjxL dhCwf080olNQniIqncnFZb2OkjA/Kn43+8BcCKJ29asUixwJlrTPU/aHw w==; X-IronPort-AV: E=Sophos;i="6.12,194,1728943200"; d="scan'208";a="25670820" X-MGA-submission: MDHwBCCxTrnBU+wELJSvXKCeujxKx9y/MTdV3vhMu9wh91zH4uF18ynTEZjP/wZIhsAgtt+1xjZX3sBiF44zZUOgd930LdoGgKFh8PGgihE9p7I89pIMma3VGZ3+vpNm2dxCV4Kx/RXzE16yCyJ8cNoEXwbOa57IiW8U40Jvdt8nrQ== Received: from mail-norwayeastazlp17013077.outbound.protection.outlook.com (HELO OSPPR02CU001.outbound.protection.outlook.com) ([40.93.81.77]) by smarthost2.eviden.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Nov 2024 08:44:07 +0100 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Im0+fdXMmMYpvO48Xpzdus41smX8ohQ0num5t2H/2bTRwkfKwy8DbuNxROriHEnTLtz+567O2i0ItMEL31EiFpvb3cTzDqJ2RZE2mGxLTDLUsUjS8TAMzESlEtSo7T6rgi5cBi5RzWddZ8fxIvlVXlhToyXleiOWcdPckGxHm0tv+pTpzIUtJRW2ud441hGi66sbiQHG2SeZvQqWClw+Tkeg+yp/ZT+cfh77JZMgYzWwQ+Yfr75KIldOnmPnevCM9XNKcbTXYiuseVospj1A+Mem7M/ssO4dXeBi8HPyxAp2tN0P6/jPRR9Pz6nyRDXPqb4xaPhmIpivjvkS6E53qg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=r1cIMR2bydzS/r8/JNnPbdEFMy5ycwRYByzUFRA40/o=; b=Xce/7jtyut1Enl37oStbC8WjWdpepdvfvgaRah7/6lJhx6a3x3oTyXOO4XlfdirmjhGQPzidYUuUmj9evePQ7r0r3rIexyQMUr9xXhVHkLh4O4WSzRr+e3rrqjFSQATLR4uXiiVmjpeFQnNJDxWwTy4O7E7TTcLB/eFpnZEpROzAQ9zsr1CpDF8/QI7BWdO/3sB45oKvDGAX6sXYjftVlCzw6FniRXkgQuRk9B/Wj6LOvEa0kIkwZT0wEYpm1ZZKRVUwYDHqGdqFzztJFksep14pxvFK+3k/cUTVcXQwhQ0FxOBn5pbcQQLuzL91ZGDnPfSmxGkzQV5nU4l4nAjNwA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=eviden.com; dmarc=pass action=none header.from=eviden.com; dkim=pass header.d=eviden.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Eviden.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=r1cIMR2bydzS/r8/JNnPbdEFMy5ycwRYByzUFRA40/o=; b=JM3+6h5n/3JVfta6gShLiNyPv8ZUOOCcZFaIfZ9PYlEkNNSLno5Su3dCF2wiNdbub+1lsxMBmULm/OMEYY09L8v34Q1zbmWyPZnI/ER1JsZ/6UH4hxPB53Pa6Q687iUnZ3U9boGmRSNCnLNllMSMPDpSNcNRA0Q8zsBPu6pPfPzo6AQjMEFz5zMaqViLQLcFGw59Q2m4z01MwZIBgBzuG6IH0m2ofull19ILQ30HMlv3rLy05dCXy7wx8poFCsZzmu1PRmSqycjtg0FQ+cGnxi78CS3gMOrcidzLMm8WiaF91Mes59J+RqZXZ1Z5gOMI2HENA05D6g93qjdk1bGnPw== Received: from AM8PR07MB7602.eurprd07.prod.outlook.com (2603:10a6:20b:24b::7) by VI1PR07MB6414.eurprd07.prod.outlook.com (2603:10a6:800:139::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8207.15; Fri, 29 Nov 2024 07:44:05 +0000 Received: from AM8PR07MB7602.eurprd07.prod.outlook.com ([fe80::fbd7:ca71:b636:6f9d]) by AM8PR07MB7602.eurprd07.prod.outlook.com ([fe80::fbd7:ca71:b636:6f9d%5]) with mapi id 15.20.8207.014; Fri, 29 Nov 2024 07:44:05 +0000 From: CLEMENT MATHIEU--DRIF To: "qemu-devel@nongnu.org" CC: "jasowang@redhat.com" , "zhenzhong.duan@intel.com" , "kevin.tian@intel.com" , "yi.l.liu@intel.com" , "joao.m.martins@oracle.com" , "peterx@redhat.com" , "mst@redhat.com" , "tjeznach@rivosinc.com" , "minwoo.im@samsung.com" , CLEMENT MATHIEU--DRIF Subject: [PATCH v1 19/19] intel_iommu: Add support for ATS Thread-Topic: [PATCH v1 19/19] intel_iommu: Add support for ATS Thread-Index: AQHbQjJ3Jcu7IEEYSky5Kq9PmWavTQ== Date: Fri, 29 Nov 2024 07:44:05 +0000 Message-ID: <20241129074332.87535-20-clement.mathieu--drif@eviden.com> References: <20241129074332.87535-1-clement.mathieu--drif@eviden.com> In-Reply-To: <20241129074332.87535-1-clement.mathieu--drif@eviden.com> Accept-Language: en-GB, fr-FR, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=eviden.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: AM8PR07MB7602:EE_|VI1PR07MB6414:EE_ x-ms-office365-filtering-correlation-id: 6f7abee3-0bb4-4a99-a328-08dd1049998f x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; ARA:13230040|366016|376014|7416014|1800799024|38070700018; x-microsoft-antispam-message-info: =?utf-8?q?qwfg32hRraFCdqDkMahgd+BbL6/CR4E?= =?utf-8?q?7umLJvOfxgp4oL0/h77LK/PKHPiojuVaxRbwrgvseq5CWMmeq5rPyi+C01s6Pn1Zg?= =?utf-8?q?0iEHdI8sTGw4aK9L4cvd3uLto9wc4OanCvYEuMc6ZGdSn5gHnEEJvCgKYc2+4e3ye?= =?utf-8?q?j+gnMZXv/HAVytlyldVKV35Fh4DgKtudW/TwApMXoSJ2i/gIR1LnNShSrxUxPfXYM?= =?utf-8?q?zLxCCftJyzlDrg4JZOuFn1n9AlmBv86tblonvhW2zxeMbGfBJPvL272UKhUbom3Fa?= =?utf-8?q?cJ7Q5yYsNTKxlPgUnLckC1qGO/0Jj9XUgJrEMj9rH/EbfegpO2c6NDm98cyIKkaPy?= =?utf-8?q?gfWmZZ71k5dadma2CuXRydkVopf8++OkLophtqKF9tipt9Zg8APxR0PYHi++alk93?= =?utf-8?q?o7NT8LYywphgAzLbbRzUgIUwQhKq29oy6P/FuHoIr/mbgu+jLGadEU5zLq+W67ael?= =?utf-8?q?cvPAwFowBmAlfxeRXdY9O1vGlFXml+AfNr5JVHgKcsyDTOP29Gf3zswBIFFJoxqMa?= =?utf-8?q?L5/2gH69VhbgISoXQNPaiObeU96a6h/4pZ++2TJIRmvn8ZDOKWNbIj3geSi4xUF1i?= =?utf-8?q?x3hqdglgsWdgfQ9TWNOeRWESW47ZhRpY5jB5Yd1c8ZrONGGNzn4+juNGPI21IRqSU?= =?utf-8?q?ufPjT7P9pzxVyHZK72AlsciPIy+9yl9LMOortyHFYsdOOIIUsCbcMlVOl3mt9I8UW?= =?utf-8?q?LxNmhFTtcU5Nfabvqa4gsPb0PkGgTUjIqijPZlyW193t9TlLKNK7Hp9+aO/74iiMx?= =?utf-8?q?SsHGH8HuxHxbsMzVNQw0SaPc4zTrVqqty04UmQP7K/gEVKdCXJ7Ji9gIDgjv9UR5o?= =?utf-8?q?rJK3oWfyPG1EffM+mm13z3qcTPcYJkjpHm+R2t/sWNXUfvz34lqlXPnDpG/Gu+1ai?= =?utf-8?q?6Tz2+rCshvkL/pOaIGuPAFERNs+K0eR6agA5CRC5eZsRvsQB2neA0hK0zdP7Sf6ma?= =?utf-8?q?PeKBgN4K1PjLGZAHp0xKeXRxMJZn7f7wy2VrUFyN0XjxiWdkR9BqzkuYOReLyequd?= =?utf-8?q?jxgMYrw1FuB4y9qV+VwYAEHwKgpidNCHUltfN0NqirS6ZU3xgw6kAhl72p2fB4H9S?= =?utf-8?q?CbGtlFzD6dtjukLfRV0v6aTCyvlakJImbp4E/6zjozUXnvNoEga8tDNRTr+YQVeaC?= =?utf-8?q?RQPfEvuNhnbDrML04U/2g53uv8P033v3EHiFypXMrzUlaxhjHoI352UQ00ThPYjph?= =?utf-8?q?uoavKCZKdwsQHHzXMhacuOoDplyYP3t1+QNyinCp26l2yDomN2tYIHbgqk1lxSZOW?= =?utf-8?q?xjp/cXQW05ca0bACKOKhIB8QCNq3ElHlK/SlPL0OItlz3pa0f3dStbaeIBCyVXl25?= =?utf-8?q?Mms1ArpnN/i6U74g8NCF5rOR/uZL56pucg=3D=3D?= x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM8PR07MB7602.eurprd07.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(366016)(376014)(7416014)(1800799024)(38070700018); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?utf-8?q?SwQsyvBrEEQR1TnIf9YXyBz2c4Bu?= =?utf-8?q?ZY1cKDjDNgauHLj3nJh8B5XPk0fn6laPWnQs24zVfwXND2p1VaAP4b8PCGtBIrYd/?= =?utf-8?q?npzNqcCGmDxQ7jNYz4A55GLQsyNaWHa96hcnPTjEQFQ9FDh31Y45Fg4wDh9TVpG4f?= =?utf-8?q?VWzlsQimykR490R3TOKO3YQ1ACSxFefVJtJS0Hj4yHSU5mwJlhGdyXsY2t6f0On0A?= =?utf-8?q?Luej/YCPegzb+ZL2HW9NAtbXjhdUcaCNWg9tMmhLr8i2fXI0Cyg5f4BdsavBOFFLQ?= =?utf-8?q?MD5B9DmqrjE+facO4Uv4nEn26wKp5+gNP01v6umcfLNalaRBILoqEXY2QU5n2B5WU?= =?utf-8?q?CGtS65NSTUMQn/MW/iQi1wisdpWoA9bBuIN/PLiAKQZW6QtH+yMURonLzYLqz7DVY?= =?utf-8?q?VWIzUt0GZVW2vM7873NuTO4TFnEQy+UlGzAr8AGvI3j2jMW5gAg0y54ijr9uJO/sM?= =?utf-8?q?osPQKzwrCms8V/LCAFbb4swgVGcIy3C+yxmDEN0I6RFfiWb+/E1B/L0bnbcDV9E0K?= =?utf-8?q?oFjM/VH1n7BMojLxGz55oeDNsjuIGTKgEERD2niCQCFNy6xH/2KtUTsuQ4V0kDLmv?= =?utf-8?q?DBqlwflAVoWfceiM/CbUZpxFGtfsFYB2Vjj5BhWjc0xU6gntWXK7Jl2dNeR5Hus1M?= =?utf-8?q?Vz0pZDKxtS5xccKgXUJK47GuauceYvapkI+9i7MbnX9ZknW4nGZSUtcVljlptyus4?= =?utf-8?q?bMfYgExvNhS251H8vA+veE+4xgp5Q0Thn6hAMZhZjvdEmAi6xCcv03dHxJ+PnOr65?= =?utf-8?q?8KFkIce9Pkli90pzj3E4Ywd8IjP0Flnh5FQehk3tqH/bbVd3LL4E+vjRdEIaPvhx9?= =?utf-8?q?XEXdVUzhRAbYPbXnA9JtJvMyBH00Yuqs9mY5sQkmUonWrmGXBTED/Bnp9Ue6PnQ8e?= =?utf-8?q?en0TjTnzy2rtmjgavqkN9a0NKaXMzHunz55r39+H6cB4AZwRXy+llLQeh1aoFIBrW?= =?utf-8?q?WJFVBaKNG+TkzUnbCmd/q6yO01d1Cf4q/7R/Bk6baZpgk6iD1q8LoRJDt9soXMvoC?= =?utf-8?q?pyuGUmwY4ND/c2xewuY03d+3yN6RXEHA7TxuojNFd21HfVeHFaDYwbkVELstZJM0I?= =?utf-8?q?z1nXqM3RNZ9pz8zaL61st4Bz54GiAEsxMQ+TqzEBpadzG+cuTkFWTE5ZCNxIdCkhH?= =?utf-8?q?MivEyg8BFS7vU9hozWk6nAiFl9kDj6AHYURw7Xuc+ONIVp8/uyHfwtcb0Hz8KwiWv?= =?utf-8?q?fIF49qMk9c3+vkajrlJBnxLP/frHgIsJqkbQvckOAyB4aET0cdzuG8Urer6ChQ77v?= =?utf-8?q?Fc5ueuFpkKxfNARhhlZyUrrc+VYdSIrA0SlWIH5pg/exUT5jydPKearEP97mjp9WP?= =?utf-8?q?LiU5mXECEs5iB4epnlc7F+/nssIQq+7/gdg9EuNewLn4lrsu2yk6jFss4DB4lIv7x?= =?utf-8?q?PnDvgCtJLyFzE8TbADGQKn9kDmkf/9xX6/XMAsUD43LJGebzuqn8N7npDHyTHriC1?= =?utf-8?q?cA7kN0JxXslZlKPVUFXXDXmZxLTiO2d3utLidS3R7ntSDv+3YxstsmKDVq9uvimh+?= =?utf-8?q?MwBE9S8MYCEd0taJsJg287e4TzPsZwMNvjntRqwLEPIvx2JAigHqjMM=3D?= Content-ID: MIME-Version: 1.0 X-OriginatorOrg: eviden.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: AM8PR07MB7602.eurprd07.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6f7abee3-0bb4-4a99-a328-08dd1049998f X-MS-Exchange-CrossTenant-originalarrivaltime: 29 Nov 2024 07:44:05.1044 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 7d1c7785-2d8a-437d-b842-1ed5d8fbe00a X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: TP/tzPD3nPveRRb0kJEavlOQ1vMnSMn/2VQB52H7/c3dXdsd68wtTHfn37cbcQM/XolfXsBUNuXP/StKA2sSuWTmpH6NB+MoQ6ukwgsV2WeiU1lg7spB4R7HA84pJH38 X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR07MB6414 Received-SPF: pass client-ip=80.78.11.83; envelope-from=clement.mathieu--drif@eviden.com; helo=smarthost2.eviden.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_PASS=-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.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org From: Clément Mathieu--Drif Signed-off-by: Clément Mathieu--Drif --- hw/i386/intel_iommu.c | 71 ++++++++++++++++++++++++++++++++-- hw/i386/intel_iommu_internal.h | 1 + 2 files changed, 69 insertions(+), 3 deletions(-) diff --git a/hw/i386/intel_iommu.c b/hw/i386/intel_iommu.c index a3e972af75..899c8506de 100644 --- a/hw/i386/intel_iommu.c +++ b/hw/i386/intel_iommu.c @@ -4166,12 +4166,10 @@ static void vtd_report_ir_illegal_access(VTDAddressSpace *vtd_as, bool is_fpd_set = false; VTDContextEntry ce; - assert(vtd_as->pasid != PCI_NO_PASID); - /* Try out best to fetch FPD, we can't do anything more */ if (vtd_dev_to_context_entry(s, bus_n, vtd_as->devfn, &ce) == 0) { is_fpd_set = ce.lo & VTD_CONTEXT_ENTRY_FPD; - if (!is_fpd_set && s->root_scalable) { + if (!is_fpd_set && s->root_scalable && vtd_as->pasid != PCI_NO_PASID) { vtd_ce_get_pasid_fpd(s, &ce, &is_fpd_set, vtd_as->pasid); } } @@ -4745,6 +4743,71 @@ static IOMMUMemoryRegion *vtd_get_memory_region_pasid(PCIBus *bus, return &vtd_as->iommu; } +static IOMMUTLBEntry vtd_iommu_ats_do_translate(IOMMUMemoryRegion *iommu, + hwaddr addr, + IOMMUAccessFlags flags, + int iommu_idx) +{ + IOMMUTLBEntry entry; + VTDAddressSpace *vtd_as = container_of(iommu, VTDAddressSpace, iommu); + + if (vtd_is_interrupt_addr(addr)) { + vtd_report_ir_illegal_access(vtd_as, addr, flags & IOMMU_WO); + entry.iova = 0; + entry.translated_addr = 0; + entry.addr_mask = ~VTD_PAGE_MASK_4K; + entry.perm = IOMMU_NONE; + entry.pasid = PCI_NO_PASID; + } else { + entry = vtd_iommu_translate(iommu, addr, flags, iommu_idx); + } + return entry; +} + +static ssize_t vtd_iommu_ats_request_translation(IOMMUMemoryRegion *iommu, + bool priv_req, bool exec_req, + hwaddr addr, size_t length, + bool no_write, + IOMMUTLBEntry *result, + size_t result_length, + uint32_t *err_count) +{ + IOMMUAccessFlags flags = IOMMU_ACCESS_FLAG_FULL(true, !no_write, exec_req, + priv_req, false, false); + ssize_t res_index = 0; + hwaddr target_address = addr + length; + IOMMUTLBEntry entry; + + *err_count = 0; + + while ((addr < target_address) && (res_index < result_length)) { + entry = vtd_iommu_ats_do_translate(iommu, addr, flags, 0); + if (!IOMMU_TLB_ENTRY_TRANSLATION_ERROR(&entry)) { /* Translation done */ + /* + * 4.1.2 : Global Mapping (G) : Remapping hardware provides a value + * of 0 in this field + */ + entry.perm &= ~IOMMU_GLOBAL; + } else { + *err_count += 1; + } + result[res_index] = entry; + res_index += 1; + addr = (addr & (~entry.addr_mask)) + (entry.addr_mask + 1); + } + + /* Buffer too small */ + if (addr < target_address) { + return -ENOMEM; + } + return res_index; +} + +static uint64_t vtd_get_min_page_size(IOMMUMemoryRegion *iommu) +{ + return VTD_PAGE_SIZE; +} + static PCIIOMMUOps vtd_iommu_ops = { .get_address_space = vtd_host_dma_iommu, .get_memory_region_pasid = vtd_get_memory_region_pasid, @@ -4922,6 +4985,8 @@ static void vtd_iommu_memory_region_class_init(ObjectClass *klass, imrc->translate = vtd_iommu_translate; imrc->notify_flag_changed = vtd_iommu_notify_flag_changed; imrc->replay = vtd_iommu_replay; + imrc->iommu_ats_request_translation = vtd_iommu_ats_request_translation; + imrc->get_min_page_size = vtd_get_min_page_size; } static const TypeInfo vtd_iommu_memory_region_info = { diff --git a/hw/i386/intel_iommu_internal.h b/hw/i386/intel_iommu_internal.h index 238f1f443f..7e2071cd4d 100644 --- a/hw/i386/intel_iommu_internal.h +++ b/hw/i386/intel_iommu_internal.h @@ -192,6 +192,7 @@ #define VTD_ECAP_SC (1ULL << 7) #define VTD_ECAP_MHMV (15ULL << 20) #define VTD_ECAP_SRS (1ULL << 31) +#define VTD_ECAP_NWFS (1ULL << 33) #define VTD_ECAP_PSS (19ULL << 35) #define VTD_ECAP_PASID (1ULL << 40) #define VTD_ECAP_SMTS (1ULL << 43)