Message ID | 20241129074332.87535-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 0EB1DD6EBE2 for <qemu-devel@archiver.kernel.org>; Fri, 29 Nov 2024 07:46:54 +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 1tGvfk-000827-0K; Fri, 29 Nov 2024 02:44:16 -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 1tGvfb-0007z9-FS for qemu-devel@nongnu.org; Fri, 29 Nov 2024 02:44:09 -0500 Received: from smarthost3.eviden.com ([80.78.11.84]) 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 1tGvfT-0002iu-JD for qemu-devel@nongnu.org; Fri, 29 Nov 2024 02:44:00 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=eviden.com; i=@eviden.com; q=dns/txt; s=mail; t=1732866239; x=1764402239; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-id:content-transfer-encoding: mime-version; bh=dSbec9u073dxNs0vgQ5NpjaCt5YwLh5q+Zos3VDB6P0=; b=MqBf2sbe5a50fkmMwswahGEaO8nGKhYqnuEwGnESK2b9e008b8mLCXos PSuuPTlJ3hkJf4kOuR/+PVi+2OPhbOcRnBdjcW14fc9+a2D1RSXuG04Uv vSPThX2Til5Ppf3KzMJIRABkXP3vFc4FOuIVBNCSLKDVDSWPvUI7IXlpV k+BwXDqC4KG3F3scLMfnN/WnZiY94bAykXpHo23BgHWO70REKcTewVXCa NgvQGax7XfdfPUTLhRsqcasS5Wk+EkPCsYD5GVegsnyJhWBX5qxrcenRC nMNGKJrgZ/wuh1Vckv53HVcqad3fmN7P2oZocHJC2UTljSavQrBsiZVHG g==; X-IronPort-AV: E=Sophos;i="6.12,194,1728943200"; d="scan'208";a="25663422" X-MGA-submission: MDHdK7Kwv4sPI/A4mSEm5AOL3xkbWZby6lGG21BA0zYRys2IS5w7jmaFe1UP8LzbhDdTHPTaBr/Jh4ErKOnnczdO3B0tnBnYbZJ0mAH8/91067LeCsLr+FnABOVzCqEoN4EvYnpo6ckp9wU18z4UyNuk5WskkHlfx7nYhqCDFlH8Xg== Received: from mail-am6eur05lp2107.outbound.protection.outlook.com (HELO EUR05-AM6-obe.outbound.protection.outlook.com) ([104.47.18.107]) by smarthost3.eviden.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Nov 2024 08:43:54 +0100 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Wi/K6EKjfOPp+1LZwpKzLbo23IS74cb1Q3QYpjNsmrPMlJQU7HYp72TIMMYG87TmpKvOU16+sqEOUj5VnVe8DOyzoXLoPsCzmFGGwvAlc+nYtdflE/PpJAxj3OoQqwn+e1nPOXRgkHwcM0s4hXmfmk06VU1OheJmCW2gJeJBlWYJ30oSO4a03wXM4nbCgO6IezXzNvNeQQSLmG5Nwb2W3pFpOamtcfRKHXE82ZG+C6uKnnF3k9EmpAX7cJD+WU3NMhdiy0xcSrEXfgC3X5w+83VeWq7stn1bsNZ4YXRtcknecd/dmBWTUbXVpK+yMkR1XXJZUwyx7PAYtqCHCRqzCg== 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=dSbec9u073dxNs0vgQ5NpjaCt5YwLh5q+Zos3VDB6P0=; b=y1o5PlrvByXi9PxtMGVGF9xfXkzIz7kzo1xmIl5cLbP1qo0yV9B1zw7KAxMGqGnpB0qc7A80zpghMcNSdXtar2Z3B4qzN2aeVyrrkMeBnlRns+mYkk6rj9rsN9LmF9tPC6j4ZPGK69IAtSSa9nt8dApjH5WuJiev6VaAHPbcFgasYv1B9YeWpHb1qvto2LD1JLBjmfyJAMpHEM6futpA0eaee6doyAwhWCStFApsAkCsuUXkbVgZf0vc+PBy58zPCH63GzQPcaelo6QlKXJVisd38wcaz5VNPRYr8qzfmGsC7sWQYLB+8+xnI8spGKkgdgfGvVQx/QAkoLxnl54kVg== 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=dSbec9u073dxNs0vgQ5NpjaCt5YwLh5q+Zos3VDB6P0=; b=PDagTgmSS7us4b1h1/PBZ55h4i9/O+xNyCOs/Dk7fNSMaXRveXXdcmwsCiX+poE9uge+SHAVqdfPOSZxsk+GD9BOCjOg1SxWipiNnfVGQmlCrQ0z4jnCK5lGFU7q93C4Qtv2Bg1Z43mmTUZPuhQgVtWj3cbi52E5XR0UtZ/OWm/Ji7XHjZi8wVF7RpHVqKboz/V94YkSobchttpSPQGWHcEZ5349bdAeiEGosnQB+ow5Uu2PjvxVj8yR01PIIODkMHq23vVDLoW4LGBBgU4mW6jZbHRi6RL/yBSB7bcncWmmz09PadN4t9EEh0Fx9Vg15jDf1Wk4G6B88I5BUeUAUQ== Received: from AM8PR07MB7602.eurprd07.prod.outlook.com (2603:10a6:20b:24b::7) by AS8PR07MB7847.eurprd07.prod.outlook.com (2603:10a6:20b:39e::21) 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:43:53 +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:43:53 +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 v1 06/19] pcie: Helper functions to check if PASID is enabled Thread-Topic: [PATCH v1 06/19] pcie: Helper functions to check if PASID is enabled Thread-Index: AQHbQjJwXoyduQYO3UOuG9p1h7xK9g== Date: Fri, 29 Nov 2024 07:43:53 +0000 Message-ID: <20241129074332.87535-7-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_|AS8PR07MB7847:EE_ x-ms-office365-filtering-correlation-id: 34b96ed7-9690-4bfc-84aa-08dd10499293 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; ARA:13230040|366016|7416014|1800799024|376014|38070700018; x-microsoft-antispam-message-info: =?utf-8?q?Kt6MI1CovMLU//FO07hpRGqJyyYDZqk?= =?utf-8?q?Kcoq+NWPbRF++Q9Y7LKPv/HKVCrHAalyTGbrq7oQvirdoDqm2SaO36JyEmQENRodx?= =?utf-8?q?Z7Jc+0sHW4YnERbPFTu0TJTT9Os2SjH2Y0zf13PvcdA2dhh9i5c0UfUq5L6ftYwvy?= =?utf-8?q?OvsMCZ6V3gi5abwlXHZwU3WPJWqRH34HqRi42eyVGU1YSnUTM48iw0pH2ltMhEON+?= =?utf-8?q?A+mT3QUjhoN/gJaMO5C3GW4pCGA8qn3kaHmo7eKsxidBVYCnPbB86+fUyye7chZee?= =?utf-8?q?NJESymmKoRLE2bnpufR0WkhxD2ubpijuIBeqQTIDyqRqjMfRKNKHWeOenwmjnqMlv?= =?utf-8?q?/o2Xej94eXeVFwlcT0nUfYs+Vm7D15yZs6BHHBMLawQjP826sZK01ZP2ePv0RRAhK?= =?utf-8?q?s72lyUx/F1nAJZQgReVUTWDdMmyWYd2Me+/R1PRqY/mwtWRaUANt1VIzAaqadwIoM?= =?utf-8?q?f3ow4L9AIpLGSmAJOfz7vXddrgaloVB+G+XdT3rgmx+l/si8QpJL4gBBoHx/KFFhl?= =?utf-8?q?ZtANCFDn2WpVaa217dmFionMh7LnALxqCmotfR1vB8ZdCFBOZOwOUWSpHVZp66HaZ?= =?utf-8?q?t+fmpjRZFjiVwlhpwm/ljI/hyY5u7fXmw888SOMgRIcgOnTy/j9bHb1U+8fVKDzag?= =?utf-8?q?46YdfsHHwV6DyFCht95N6TFMyXcNo9mSWRmn5f7e1FMUWR4UyRACGwKub42z/R7ap?= =?utf-8?q?lc1UDmkZ6UNgmEuDL2iTiRz6ss0FWTib3CZasKLDnKKFHsmE9bwj0QNcfJEtA4Jz1?= =?utf-8?q?j/1Xaf7zqRpizNeVKsf9xLdT/cBBqxef2bDwU+6HRdjk5oS3zaN4LYa5qbhWOdHIy?= =?utf-8?q?vaQZ3IjHjq4grqW0FDRVoZgT6BwxCgT+Ej2vK7p9cY81foPpK5R3Z/pbe4DuxsXFr?= =?utf-8?q?wy3op+Il5N6bnRIhDv2HckgsVWse7filT1cAHnVYdFDa52sEAFSMndBPIXnA8XQes?= =?utf-8?q?MyZUwP5rGj6OsfUu2i4TN9yRHPW1oftfNF3ErFusvAkzsZWUO8GNOjt7GtxGzJB8c?= =?utf-8?q?tQczTxSqUOvXSjU0ylqfJh6vWJANbrc2y2YlXVcU+wR7UTKjO5fTuUMxkm92jSTSF?= =?utf-8?q?BD1xeTzg8dTA7pjidVGMlKRO5MvtgCEduhdSmI021xliviXqoZPy21rTiJsoqG1S5?= =?utf-8?q?VFYnBXD6Cn8QbT9QTOXiDx/NFl6VMiLchJYfnF5y2hFBg5uvU53tDVpY5TQ0f6tUa?= =?utf-8?q?GwWpAxgNMOg7pUetVLpbxlneF2jePVUXhMTJ6KCMRom3C5Mzx50Cds0APFRVHzdYP?= =?utf-8?q?Gj98c1+1XuI61W3f2eXzbhlBaOB52kgYvkCDRCbUylvrJbGqFO1CvBTZhL/LAeh8l?= =?utf-8?q?Wq+VSodMuM/3MRLl8lK8uQn/OdKwjTsNwQ=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)(7416014)(1800799024)(376014)(38070700018); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-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/ehyP3Qr4n0jxRgrveduzQtM61qSdr933VL+Y3yS0x0ZZawVY00?= =?utf-8?q?QWAlZ6quZtlOOnEaNmhydDNYu9qDF7Zm5EhW5inC6gUVUytrq25/ZFDfoKW6D8qkS?= =?utf-8?q?t/xO4r8aVdgkQoQ9y4WtIAi3cxTLZEwVEE3s2NxRTMMXmBV8Muy4RExf6VOcMY5+1?= =?utf-8?q?8h/I8I5tuEwUsXjFppxom0UKkrvHHCuXdDQzfRCI1ax6HyS3yMqB1vmbH7/p0xvd2?= =?utf-8?q?WfVkk57VFk4hzFCK+Ecqcbjywa7idZjS4zZO6pqhN3ypFVON1CT0FKnJrdlg7iCl7?= =?utf-8?q?8jJ1vAXj2owye7CCHG/xPasub1KzJMUaUOK1chQPzarrQYGn1nq6rObKaDNWqM9tl?= =?utf-8?q?eI7fQzOkklEDEUPtrY/Q48TW7nI+K47JhcTMwTtgrmLqsONou7vnK5HyinSHIx+cl?= =?utf-8?q?qNuNY3uDTUxR5HZb78m9V5CIsWAk2YhvgkhIZj88vPxfOQ7th0IMMugZZyFcc7zYi?= =?utf-8?q?6zcBBrejB2+SSHLy1YU4HhZApL7lUPNuIXiEJBN3Irq2i2eFRMUK5+SdpcUG3jmMw?= =?utf-8?q?Oa06OfAbJJe6x/AZ7UwRrYwBicIdHj2Tld/tvmGHjHE3MCaS6dOJvKfc+SAc21tPz?= =?utf-8?q?bWP8Ynop7wiBMO2ApcYFTIMvXfLoq/JDNdk1t1sEuzBYhVFzbZBdbHuC3OiEVFtf6?= =?utf-8?q?wNyPPGavmHGpi5tpmBy8NH+akINbpIQB8JQ8vit89tE9ZXG05i+ArAc=3D?= Content-Type: text/plain; charset="utf-8" Content-ID: <BC9D357E79CFBD419D843D5D4F1DF293@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: 34b96ed7-9690-4bfc-84aa-08dd10499293 X-MS-Exchange-CrossTenant-originalarrivaltime: 29 Nov 2024 07:43:53.3763 (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: 821KS86VsF6wrb+D+z6VIN79YkA33cBwZ9aDZnkD3ytqjiOq/G0sl4KQcJXMyV5h531n8JaodAxWqwsQUI6Pe6NeJtIAA6ZIgx8tMBPG3RBL9UEqV+1saYg2PeW5NWQ0 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR07MB7847 Received-SPF: pass client-ip=80.78.11.84; envelope-from=clement.mathieu--drif@eviden.com; helo=smarthost3.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: <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 |
Rebase ATS onto lastest Qemu mailing list state
|
expand
|
diff --git a/hw/pci/pcie.c b/hw/pci/pcie.c index 5b896496ae..b6e84acc93 100644 --- a/hw/pci/pcie.c +++ b/hw/pci/pcie.c @@ -1234,3 +1234,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 */