Message ID | 20250120174033.308518-7-clement.mathieu--drif@eviden.com (mailing list archive) |
---|---|
State | New |
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 E87AFC02181 for <qemu-devel@archiver.kernel.org>; Mon, 20 Jan 2025 17:43:44 +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 1tZvmd-0004eK-6H; Mon, 20 Jan 2025 12:41:55 -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 <clement.mathieu--drif@eviden.com>) id 1tZvmc-0004c2-3f for qemu-devel@nongnu.org; Mon, 20 Jan 2025 12:41:54 -0500 Received: from smarthost1.eviden.com ([80.78.11.82]) 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 1tZvmX-0000ZN-O0 for qemu-devel@nongnu.org; Mon, 20 Jan 2025 12:41:53 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=eviden.com; i=@eviden.com; q=dns/txt; s=mail; t=1737394909; x=1768930909; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=kX2S2fq6b8D1k6opTFdMUw64SYd+sruvzT3Q+IJnIUc=; b=ImoQRL6ArGGNg9oBVcfI/8rusnlpyHrup3pP9zxEYiyNHeXXw3cuMGvm GAKIPRXEdzxyPOUsFYrNoUXhclKXHqOryQ+7gBhv2iOIQ8ShJxsruxFVo pb9luDshSmJAJVaonK/jFvdGsYm+RmFV+pnbTOVF5eyuBjlQOP8uCBM8T kEo2EyR87Z9j/MQEhe2YWjSemTcYtXn44wTqrKYCJrOv5+rJAdHJHHFWO 2xMN2RVx75VmExQhGKSEwzGVezieiBbHAG34ftdR01zxp+8sBVwoXcDwn +EdlPWYZBU9P0ED/KVr+9y1MWfy2NmRBatIS/IncnvujdIA8nPplrEtXn A==; X-CSE-ConnectionGUID: L/KexgJvQNyo7sgych1f7g== X-CSE-MsgGUID: I4Jr+GR9QYGKqou3y8PdSA== X-IronPort-AV: E=Sophos;i="6.13,219,1732575600"; d="scan'208";a="29133395" X-MGA-submission: MDFpzbeiaUZhiNazcwuLI3kO2akcxy7lRnst2o85N3lAhz64BtBl4rvRz8Nwv+iwJRFxzx8a5D2RsH9i9d6lszY2pDxwz/pFxt/fZ813swOD6KTvJE0FqladSvm7xEuTB8luUVx1/W0egNGrLsFnhi5C620eVMaWP/hYxNx4R5379w== Received: from mail-db8eur05lp2104.outbound.protection.outlook.com (HELO EUR05-DB8-obe.outbound.protection.outlook.com) ([104.47.17.104]) by smarthost1.eviden.com with ESMTP/TLS/TLS_AES_256_GCM_SHA384; 20 Jan 2025 18:41:45 +0100 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=NQo9+Xt+BSfjOXP66x7xNQYInX6dHTMctrbild9vsMCMoYRXeD7JH0v0qCdTqERjNLBmh+YkZj8BU1oJkPSyutXdKXKwOx1YUlOPBpVyVsNlDGl9n6WV8XGVYOg2+E01kP68g17rv3Cp2PBAFYXrtYxzzuAFs0SfO9xhzip3tPcd33rdj4RsOm83WpU/eiIm5lwLSlU5RxuG2jcgC0nQBbwRPdo0zm/BaxIP1msSC20hv0kIlmW7uP+WPBIrIhhQBEHy++L8KhIYRJyoZ2ypiLAAJgC/JDYE0eqeFiEjOF2gIpsIoMHYxNakpDtZmjK6pdt/NLkrOXhUitHS14ijjg== 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=iflbwMKRHPu/81SZW+ngwd/GXI6yY0hn/LYJYOaw8bI=; b=FPoewcIsKYLgxBllCZ0acXxIxM/tMs82EvDNAFBj+qBe7XQOscEtgxrklk2I/sIZMhhC3rx8H4hucL9+SexAbQJC0kfZ2dKMjrZuQ0kKnTYTWW+2kV6PiDbm4oayI1LDeJqWr5bEARe9Ny37OTathm+0qJitP3IgrCeO5eAmDkU9OPN9JSzj7FNUV2d5u1KhB2CCUXYokobhkod1D5wEZslfJazk9feupaIpi3wlPX+QpTSpKs2rKvUJmI7Ql6hFM1RzHfpy07upBfdbJx4RW4z5pPZnBJofywhFUqyieJpEb4baJpSMa8eF75L8AeGHektVp7pZQtZ6WJaEAS+mkQ== 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=iflbwMKRHPu/81SZW+ngwd/GXI6yY0hn/LYJYOaw8bI=; b=sk8a+oeoBFAamxRmMCgZitambQNTvVEO1lB+bqYc0kvsJ+nnFKWNzAfw1TbeuZutAjGptYKdEpub3mk+szgs7qyz5LmYaNXxP1nPDIoIgjDFu6tC9g8B7Cw4C9Zdx6FfyWlOfO8WxuGJmlFGi3H/ko7Lhuka6Fpe6aF6XM2pjiXKdB7IpFP4PJxl2soQZLqQqdAin05g9Z/bh5yy5s958bz3n9dkWgGDdf/L9cbPCo+Caq5VcvDc0boSdLidUEYN41fS2kTqK6T/gV9bdbaCOUK1WYF76V5vc2tIQ+loVSokV0UbrJQmJFdozlTvJS75P2gLIQkRMHTDNfpbwhwP0w== Received: from AM8PR07MB7602.eurprd07.prod.outlook.com (2603:10a6:20b:24b::7) by DBBPR07MB7548.eurprd07.prod.outlook.com (2603:10a6:10:1eb::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8356.21; Mon, 20 Jan 2025 17:41:44 +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.8356.020; Mon, 20 Jan 2025 17:41:44 +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>, "tjeznach@rivosinc.com" <tjeznach@rivosinc.com>, "minwoo.im@samsung.com" <minwoo.im@samsung.com>, CLEMENT MATHIEU--DRIF <clement.mathieu--drif@eviden.com> Subject: [PATCH v2 06/19] pcie: Helper functions to check if PASID is enabled Thread-Topic: [PATCH v2 06/19] pcie: Helper functions to check if PASID is enabled Thread-Index: AQHba2KSYJRjLgZTYkGGJ4ezUhqhcA== Date: Mon, 20 Jan 2025 17:41:44 +0000 Message-ID: <20250120174033.308518-7-clement.mathieu--drif@eviden.com> References: <20250120174033.308518-1-clement.mathieu--drif@eviden.com> In-Reply-To: <20250120174033.308518-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_|DBBPR07MB7548:EE_ x-ms-office365-filtering-correlation-id: c8589477-c3f2-4c7e-c212-08dd3979b4e8 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; ARA:13230040|1800799024|366016|7416014|376014|38070700018; x-microsoft-antispam-message-info: =?iso-8859-1?q?ciJLkcap7W4WB9tsxT+OwsRU8l?= =?iso-8859-1?q?mmotqSXFQjo6h4m0lLwaJ1Ha3/Efp/g+iS9cyKe6fT4WxABbOP7RIVHcvk3T?= =?iso-8859-1?q?Gl2bLo6IEAqfLvBUuXm7Apd69xCYmMUOsyhdQNrd8EBAYa6kf4c/ecN9Ez4h?= =?iso-8859-1?q?xd7ofSCRUy2xJqA2am/rQkWip41wowJV64giNFsNX/1LYLQnDKKgFaTw9W+t?= =?iso-8859-1?q?UOU4QtqJNrw14cKNYS7gcEDzV+oMC2nXo2oP95BP6YdXwsiKecjcwpkdiza4?= =?iso-8859-1?q?hHF80d8fnJBL5lK3Sdq+G8euZKJUxQ4J+NkcBIL63Mvt9nAexEIbE65eyb2S?= =?iso-8859-1?q?rXLeiFhE7pqSt8ddcbnufaNh5JBgaO0u9MD4Tr/QGVnWVue5C/d9dPTDpCVa?= =?iso-8859-1?q?cGniqxmeZ1mPXh2WDcmazv6xb7OjElhkj7pyxnAxJa1X7IF8p4Mg7Ml7qtcm?= =?iso-8859-1?q?stSefGHe+arkJ4XhXSoOM+5zcV0EQpCd7+Whh3+Gw1kTTztdkNXrhoTfT8k0?= =?iso-8859-1?q?YP/K8g1p788X+n30G7/wivXl+iNtvS5v2kiiNWBVQQUltU4XX1Glw/zArWAN?= =?iso-8859-1?q?T0n4NCUBPp6vYKWpEtnUAexOoMnkyx5EReDeeb0B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Z?= =?iso-8859-1?q?Kmrl92?= 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)(7416014)(376014)(38070700018); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-8859-1?q?xTGv2G+mzmekMvvQ+F4HG+C?= =?iso-8859-1?q?/I5/bRIp7XcdcTygvRYVdyVEL+8OTWUTafbBm+KH/BpsZ/7KrtJ/iVNujz0u?= =?iso-8859-1?q?Pm7Hm4pIH7OGAZYRw9G8gtpy1mXtyqHlIQZGsB4GEBKI/a4GENc8Tt3/RS0j?= =?iso-8859-1?q?p5Pfqs8bSIi2frM2y1l9gsMnXKUk5E0syn+J/4c+OS36FuFywUCXTEaPA9kV?= =?iso-8859-1?q?3bzc7XBAbfomv9c0K/BmHElhg0xp43yDttwb5keALWPOlGQeKSGFkn3HZwNu?= =?iso-8859-1?q?Z9T4bwk5qtAZXVn2dwdNCYJzuVPRaiOGEQz+OdPIDDcZUazFfT/FXDhnPXRY?= =?iso-8859-1?q?TIjFxqlaOVoSvNwzpAvrTtRnDn8kSAoup1ppawFiz+7KoJU3zdX6DIIaYcdd?= =?iso-8859-1?q?m7AQuMYIISiiR0I4ldjU4Oe6C42VsCS9R6owImFd4hJChTUlndGkvS2OaU1B?= =?iso-8859-1?q?lL8Bi7DUtWtuRxs+S6m0hSDFiBWm9uQK2wJgRzkxLu67fHouItfNfhFqgayV?= =?iso-8859-1?q?3ZYqSvLxEDN78KGlSjbw3No3IVv0rBMF4Ltk/IORxqVXiB+wBw/sLD42v7Ky?= =?iso-8859-1?q?cfOSgUMltibTgwY6k210nOaWNw/wZGyuN8NtK2gIaYnNI7VMlohT5tVOI5qA?= =?iso-8859-1?q?hZjguUy3FBfU2Ythy25UuKE5MEgACdkLIw/Vd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so-8859-1?q?mQ7K/GmmX/KSWXE/fwBmuLIOWXUftlX0v7QpAQTC3HQBvZ/cGKQLTPerM/sc?= =?iso-8859-1?q?wbES9rqdyN4EPZOME1yZzKfn3cAqvK13OJNEiGvO7Mgjd+n1qvt8FmEvbYk8?= =?iso-8859-1?q?=3D?= Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable 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: c8589477-c3f2-4c7e-c212-08dd3979b4e8 X-MS-Exchange-CrossTenant-originalarrivaltime: 20 Jan 2025 17:41:44.5235 (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: 82rOd/sXJMYWmz3c3tYeiXc1dM9mZk0AIySSbdiL1uKQIpGtLxS5R3iGG4ZD7UZjgVr4BwO7YnP6Rk6Y1Q2U93/tfy/iw0kVVYwRBYdSH+uyhwl8SW16+TaYOuU/T6gd X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR07MB7548 Received-SPF: pass client-ip=80.78.11.82; envelope-from=clement.mathieu--drif@eviden.com; helo=smarthost1.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_MSPIKE_H2=-0.036, 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: <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 |
intel_iommu: Add ATS support
|
expand
|
diff --git a/hw/pci/pcie.c b/hw/pci/pcie.c index f42a256f15..8186d64234 100644 --- a/hw/pci/pcie.c +++ b/hw/pci/pcie.c @@ -1238,3 +1238,12 @@ void pcie_pasid_init(PCIDevice *dev, uint16_t offset, uint8_t pasid_width, dev->exp.pasid_cap = offset; } + +bool pcie_pasid_enabled(const PCIDevice *dev) +{ + if (!pci_is_express(dev) || !dev->exp.pasid_cap) { + return false; + } + return (pci_get_word(dev->config + dev->exp.pasid_cap + PCI_PASID_CTRL) & + PCI_PASID_CTRL_ENABLE) != 0; +} diff --git a/include/hw/pci/pcie.h b/include/hw/pci/pcie.h index aa040c3e97..63604ccc6e 100644 --- a/include/hw/pci/pcie.h +++ b/include/hw/pci/pcie.h @@ -156,4 +156,6 @@ void pcie_cap_slot_unplug_request_cb(HotplugHandler *hotplug_dev, void pcie_pasid_init(PCIDevice *dev, uint16_t offset, uint8_t pasid_width, bool exec_perm, bool priv_mod); + +bool pcie_pasid_enabled(const PCIDevice *dev); #endif /* QEMU_PCIE_H */