Message ID | 20240702055221.1337035-15-clement.mathieu--drif@eviden.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show
Return-Path: <qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org> 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 2575FC3064D for <qemu-devel@archiver.kernel.org>; Tue, 2 Jul 2024 05:55:26 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from <qemu-devel-bounces@nongnu.org>) id 1sOWRf-00081U-Bi; Tue, 02 Jul 2024 01:52:51 -0400 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 <clement.mathieu--drif@eviden.com>) id 1sOWRd-0007zq-FY for qemu-devel@nongnu.org; Tue, 02 Jul 2024 01:52:49 -0400 Received: from smarthost4.eviden.com ([80.78.11.85]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <clement.mathieu--drif@eviden.com>) id 1sOWRb-0006Ul-Dj for qemu-devel@nongnu.org; Tue, 02 Jul 2024 01:52:49 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=eviden.com; i=@eviden.com; q=dns/txt; s=mail; t=1719899567; x=1751435567; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-id:content-transfer-encoding: mime-version; bh=iQZ8LUYTZUklKaeRuFrltuVPELET5rAe9WchMbRYKbc=; b=p30yJ1oOxoyX7O3IUUQLY3MrQR/J+FJ82CtmkzR+mRP4IGkSYc59kLTD M02C4YkTpwjlXSoTn3OJ/OI5t/oKKXySRESpLthN5KlL5h8mQii5IjFwR f49ViQF+9mz9YocsSCK/bfqfyo2va/3F45STRUzjjbeeQ8iMnAZBMWfLA EdCGiS2fNdnE/JXErqcZ9xdmayuKE4YBz5DL3jKpFdezd5TEj+Gi3paNr WL0poavZLL3r6r482xuPskrbxs7DIYZ3kSlNqOl9n1JTB+c79pHX8sn42 +a7EgElHvs08W7bQXfWFMbHyqO/K6lVvrYPA9MdgLjvdn0VBvpMKVeFz7 Q==; X-IronPort-AV: E=Sophos;i="6.09,178,1716242400"; d="scan'208";a="15813268" X-MGA-submission: MDFw91toBX7UOyo149xQV8DoBLZdIXyMn2rKy3NVwESrMKn9UjGlA6xYP3YYrwVQKErlMKIrFtxLuv5JB42pJ5ukAJ47YmErl4h+tE7Jf36tc6o4SJzcU9s953N/+lh3w3YjbFDQzCvQV1NiJv7sqtWb2vlUI8qHqKizuIUKMmPyKw== Received: from mail-am6eur05lp2113.outbound.protection.outlook.com (HELO EUR05-AM6-obe.outbound.protection.outlook.com) ([104.47.18.113]) by smarthost4.eviden.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Jul 2024 07:52:42 +0200 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jKMGFd+sddORh9r7yOvN5bIP36I33pPm2ZrShhbEvNeS2zj1ubWTNi+oQppGFGaPb1JpkBhW2LNpXXCTa2DSsfEsmVZFojsj8MTxbpxB/dw6sXKI3M+ymYcFx5JIl+Iekle+ifUzh9o2U3YjVg9Wer3sVbJ6YLgbsceiA4mdU/b5GUM6ch+1g246FN/XVwsvA/5LXI/GtVLa//e3xVhweUnuTLQYlmXb9uBZHSklt8EnMVgEqHAP36750OQeIoYYGvu+Cmp3PM8l5LRCO54ueNdC9CjR2jJVFxQFaNeRUYUkel8B6eskKhooz1VloK8dF09spc+ee083g5dnGMOBLQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=iQZ8LUYTZUklKaeRuFrltuVPELET5rAe9WchMbRYKbc=; b=grVxYb5wNQX7vTLBvvA+aW86JqVZpk2AqL7aDjqjEi4lsFrTP8eQgztEoyJSJngaTRfCx2iUG+5X4A5gISKvSIFOats1pcNqoyGP6JDuSbmcjkgYp3yTOrWRyHn/53Xmc184w8eEeiWfn+ladtG3eWQ20Cnc1fvmoM1ggRoYUFxcoieFTQBTs3tcCA0LvmCtwloTuMaIl67vNvGmEq/jIJ2pQ8ypXr+zutg6hATMx/TGdtI25MUO8Q4iykkSlCplph4Gnre80pGQg9lCaYYJASq5WKpzZcRoJjENd8u+ZZi7/Nr83rC6DhmQSps6XCuFZgIgjKWqGnqtI2IsI5wJQg== 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=iQZ8LUYTZUklKaeRuFrltuVPELET5rAe9WchMbRYKbc=; b=jBaKtcaaFpzETPEW5rGWGTujnHKhlxdrEvcEc9KSC6A/AAqvA8pNLQwQgmmv3reK2ICnwmTH0S/+nuDmHHpBTrsWNR+S3VI3uPD1yHNBLVxjomXUk3HZfY+MKC2Hsb7BP6ymvZJLuY+qbbspyM70izkjGt00FKkUr24WzWDlNvr+LONdFYaQsG45JwHzJlhWEyemzOS38VfWxenIQq7Yr3FOCUBzhA9w/fUXfWF5zNL78pL6FoHwMnjd/E/zNo1CeH/H+oKvUcewxMKgG7lnsXhipMEv4R6/Dc6VzFgIDGgqmU8eVeoJUnAM1bFctQAYbvl9OttCw+i2UYOivvuChg== Received: from AM8PR07MB7602.eurprd07.prod.outlook.com (2603:10a6:20b:24b::7) by AS8PR07MB7080.eurprd07.prod.outlook.com (2603:10a6:20b:239::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7741.21; Tue, 2 Jul 2024 05:52:41 +0000 Received: from AM8PR07MB7602.eurprd07.prod.outlook.com ([fe80::fbd7:ca71:b636:6f9d]) by AM8PR07MB7602.eurprd07.prod.outlook.com ([fe80::fbd7:ca71:b636:6f9d%4]) with mapi id 15.20.7741.017; Tue, 2 Jul 2024 05:52:41 +0000 From: CLEMENT MATHIEU--DRIF <clement.mathieu--drif@eviden.com> To: "qemu-devel@nongnu.org" <qemu-devel@nongnu.org> CC: "jasowang@redhat.com" <jasowang@redhat.com>, "zhenzhong.duan@intel.com" <zhenzhong.duan@intel.com>, "kevin.tian@intel.com" <kevin.tian@intel.com>, "yi.l.liu@intel.com" <yi.l.liu@intel.com>, "joao.m.martins@oracle.com" <joao.m.martins@oracle.com>, "peterx@redhat.com" <peterx@redhat.com>, "mst@redhat.com" <mst@redhat.com>, CLEMENT MATHIEU--DRIF <clement.mathieu--drif@eviden.com> Subject: [PATCH ats_vtd v5 14/22] intel_iommu: implement the get_memory_region_pasid iommu operation Thread-Topic: [PATCH ats_vtd v5 14/22] intel_iommu: implement the get_memory_region_pasid iommu operation Thread-Index: AQHazEQNLMlXcNcNXEOjFPH7XeKvtA== Date: Tue, 2 Jul 2024 05:52:41 +0000 Message-ID: <20240702055221.1337035-15-clement.mathieu--drif@eviden.com> References: <20240702055221.1337035-1-clement.mathieu--drif@eviden.com> In-Reply-To: <20240702055221.1337035-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_|AS8PR07MB7080:EE_ x-ms-office365-filtering-correlation-id: 70656887-d168-4284-65b5-08dc9a5b2f94 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; ARA:13230040|1800799024|366016|376014|38070700018; x-microsoft-antispam-message-info: =?utf-8?q?W3zhacq+DcMlWwWvijB1b7SyT1oC/7m?= =?utf-8?q?BOTVfrsR4B/KIJfVKPyM0g9BQdX61xrVBmT70AtxsBxlFp4cPoHxVzi6nv0GLDdZD?= =?utf-8?q?vFJEq/DLXvJWvbUNJx742Euxhksfh0RfV8Kc+OAXA+TuGP5c+U76bV0+zULTdVgmY?= =?utf-8?q?CwvamcHz5hK+jm1TvMYWcLLQ21bVl/ZZVI+Pb6gM7miPuUvddzUbfArz/GIum8+Za?= =?utf-8?q?g5s2sf5jg1JQuL3oebVT13tXLJlg2AVN2tIfcDC7fa2esr5KkRcdln7pTgRcYuWBX?= =?utf-8?q?42lQHZSNbkjI4933OCS0aN0kW4Thn5F4z+60rjtjHOy9P+aVew0YoNt9FfhBNIecx?= =?utf-8?q?pg3W0waBxxbPr2kY8OW0zu6uYTkB+FLxTgSJa8NEE9yZDLF0+IKDl5Gg9G/ctdKb9?= =?utf-8?q?RMu//xykQ4e6QZMQB25B0bFruFgYfpcLtVj8cZs2GV0PHb63Ywxf9GXqfG/VZIH74?= =?utf-8?q?ba1JJIJONq05hZD4viZ+zQIF3uM4VFOLs1SV8obKeqSWkd1+PDu80VJymvovxMhe0?= =?utf-8?q?Vm+hJlXgUanj45KX9znuDWoFzeCHFyOKiwDUrFsz6iWVex5Xvb8dGf1Z9fiB4b1j+?= =?utf-8?q?+uTtMYbHI+YQisR79A7AlEYt4lLB0hals59i9Ydl7bL4glt/S2sQeOo4gUKvoPfSo?= =?utf-8?q?MIDuVKLnAybaR7Vzx8fPn2EyQk2H7k8QO4m+MCdJBbOTgDffbLwJTSBc3vNrTvUdU?= =?utf-8?q?cL74gn6ycDr0M4Q8nKgs5dv+GqnrOWGOs/5M173j8nALfpIqJcx+hJxWXPQD0yX++?= =?utf-8?q?Dts+P3+NfxmuNktjZTsfyivq7FwfS6+k0Vd9OyMW3oFNXI4NGpSExhd5KvSIXZ0dK?= =?utf-8?q?7FMIyctYNVz9EIV4iJ1WrSaIO1+d8EnGUA/mpn0GhF+t1CD1gxXSV9hi494b4EdgV?= =?utf-8?q?HWG4u4El6IDsm/XWxEwGTTawp1rc7tBBq7znykEc3qr97P2tKyGDHsLNoTniLEar0?= =?utf-8?q?IYtGwSrX0zbFF/sxUci++tDfBt61ZKprb/rlGSBAg5ygZMvtpz6XGLXVakPz3hiqm?= =?utf-8?q?1xlb2vKImtb803drQce+LniE2L/eZDTCOTV9KOlUHHD9WoqgrLqUUhu4huV+n3x8m?= =?utf-8?q?VbddPbSlgJ3ZlvgUSlGttwBuKrZQdkVdnAmpqsizNrpU696Zl5QLXxogA3Rkwq7DM?= =?utf-8?q?rW53bCGjl3sk+89iF8iI7zuq6f7wpIclHLs1w7Nl/8mYla+yUhY22e1VbHlUWOHi0?= =?utf-8?q?f2H4PM9/1/0ixJhApCxz9kNW6IMDZqoYbZ42mnrQqz599sAcJSqixxMbdsmMMWTH9?= =?utf-8?q?EFDV4y4x7uCx8UdtC8A7z82qbP0f8p+kGsjlqHF0tK5H3+TJ7iPFj5LEyfg87N5OL?= =?utf-8?q?mJni838QY6Lkb+d+4+2iuf+Mt4pwKTs/Mw=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)(1800799024)(366016)(376014)(38070700018); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?utf-8?q?II3p0svfWU/rAfetRrG2EoOUS/4Q?= =?utf-8?q?Jq5Q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KyixU8lNcsDilLB0X/i2Dad6vZKsUl6Q+rj8cmh7PnKIoPOZp9?= =?utf-8?q?/iWQjrJbnLzzPy3+65xx0OFNfvSFZx+tnKWUbUt3OjSAdDiQ48M5cNslVbj8TbaOB?= =?utf-8?q?BBUJdx2NkMTZulYONuczGD6n7q+8c3QDlEsrAXh5iTGm5MFZkc5g14Ho7tcOlYO8w?= =?utf-8?q?RGZttlhnlgrgMc9VklDdOLGL4UxIqPf3TguKIvEc1hvCwyYPO+29FSyrkhQzlBwp8?= =?utf-8?q?r07eoZeegReAWNXgGvVyKTjfQnjBY6M38XrZjPgm8NKcdckaLHUt8K9ZiBbHliD7Z?= =?utf-8?q?aE4kO8NwP5kpIg1QGBRRAtXTlvHIIa3bD6qmlg0xgR+rBWL0kPPOdqe64xS627SDT?= =?utf-8?q?vHrwANxdiSUBUIQxWnD7aU8V2b++4LP0DkepUcOsft9ez+XiuOWhsgBkgTx8vO/vU?= =?utf-8?q?RHryYpp0sSBgLSlhNrG9eY7fjKdPkAa5CFokM27JeqC54luA7SZ5Nk9VVOclWeSth?= =?utf-8?q?yCHIoe5yA1EdWmmZWEhlfNH0jyaNY0IDVJpyxurDKPsbSj6vWOKcwSPqqayDq2x6X?= =?utf-8?q?OVVSnQaXW5fjWv3U9LG508v9jnU6QeUjC/z715oI8b2/cwevEtefEckOYjDcc8Mos?= =?utf-8?q?dg+13UQ1/J8+7gSuXf6U4aCfCz9A8d9j68VPuYtvUiTvkE+LkNeY+kE=3D?= Content-Type: text/plain; charset="utf-8" Content-ID: <166F1D4FA61437468282F07BE24DE5C8@eurprd07.prod.outlook.com> Content-Transfer-Encoding: base64 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: 70656887-d168-4284-65b5-08dc9a5b2f94 X-MS-Exchange-CrossTenant-originalarrivaltime: 02 Jul 2024 05:52:41.0137 (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: 4+HgNqCYUAXD/5XPXwF0mHIvQc4ruiYpSnP7cjNcbmE2Z6B79dPk5W0sQ8HDDoT+tB6b4WdKJ/mYV8+BnP2LluXuXERoP8uwYj56bdV3uvu682eN1IK2rZJzNX0i/Ym7 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR07MB7080 Received-SPF: pass client-ip=80.78.11.85; envelope-from=clement.mathieu--drif@eviden.com; helo=smarthost4.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, 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: <qemu-devel.nongnu.org> List-Unsubscribe: <https://lists.nongnu.org/mailman/options/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=unsubscribe> List-Archive: <https://lists.nongnu.org/archive/html/qemu-devel> List-Post: <mailto:qemu-devel@nongnu.org> List-Help: <mailto:qemu-devel-request@nongnu.org?subject=help> List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=subscribe> Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org |
Series |
ATS support for VT-d
|
expand
|
diff --git a/hw/i386/intel_iommu.c b/hw/i386/intel_iommu.c index e047d2ca83..2e4f535dd1 100644 --- a/hw/i386/intel_iommu.c +++ b/hw/i386/intel_iommu.c @@ -6012,9 +6012,24 @@ static AddressSpace *vtd_host_dma_iommu(PCIBus *bus, void *opaque, int devfn) return vtd_host_dma_iommu_pasid(bus, opaque, devfn, PCI_NO_PASID); } +static IOMMUMemoryRegion *vtd_get_memory_region_pasid(PCIBus *bus, + void *opaque, + int devfn, + uint32_t pasid) +{ + IntelIOMMUState *s = opaque; + VTDAddressSpace *vtd_as; + + assert(0 <= devfn && devfn < PCI_DEVFN_MAX); + + vtd_as = vtd_find_add_as(s, bus, devfn, pasid); + return &vtd_as->iommu; +} + static PCIIOMMUOps vtd_iommu_ops = { .get_address_space = vtd_host_dma_iommu, .get_address_space_pasid = vtd_host_dma_iommu_pasid, + .get_memory_region_pasid = vtd_get_memory_region_pasid, .set_iommu_device = vtd_dev_set_iommu_device, .unset_iommu_device = vtd_dev_unset_iommu_device, };