From patchwork Mon Jun 3 05:59:44 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: 13683282 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 51521C25B76 for ; Mon, 3 Jun 2024 06:03:59 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sE0js-0006qz-C1; Mon, 03 Jun 2024 02:00:12 -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 ) id 1sE0jf-0006in-Si for qemu-devel@nongnu.org; Mon, 03 Jun 2024 01:59:59 -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 ) id 1sE0jd-00071T-OS for qemu-devel@nongnu.org; Mon, 03 Jun 2024 01:59:59 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=eviden.com; i=@eviden.com; q=dns/txt; s=mail; t=1717394398; x=1748930398; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-id:content-transfer-encoding: mime-version; bh=ey8tYT5sCKUkGtrJEMnAddjrE5No915u2Azs6R/nCDY=; b=HsFrMHGgdnvktfB1HLPLErWMFZwvDXsvGfuFfdethNjKnN/9J6tpjXfH G8y2yIoLW7+LrMlzqcInX7i5zmFkJUp+DQJyiQqxGvh72tlLppmK7WruS RPvqo5+MqscxskVTR+HceHKQgCKkLkERADprSyghfvRdwvnZMS8/9OCNG Qy8Q3ZdQBXz3M5CGUo/lo7BkKIErQ8J9JA0Y3b37t31dc5CFOf9X8kmIQ UhE0Y0MZzrFUrfHDwBC6pVGuA9DhbyC5j5DLo9CRSNpEYqD37yYbLi8dM bDsVKwfNvylpyNlTx4OLiWC2cQ+a6EBS7DhqUpyJfAYyq59mWzyi0zUJz Q==; X-IronPort-AV: E=Sophos;i="6.08,210,1712613600"; d="scan'208";a="13815877" X-MGA-submission: MDHPB3uxTsU0FTN3hc/He/pMVu92DkVcNj7oAl90C6y60heWDtd8llBA8wG7IHnJC/tykY1RGLeKF0br0dMny9s0G/hK+DFgfeK9I8gN/4/rds6+qrdCTEPgRhCKQN3fsn3flFHD2Pkh2AkBwQ1MsJYA2yhmQjsItIWMjC412BiS9w== Received: from mail-he1eur01lp2050.outbound.protection.outlook.com (HELO EUR01-HE1-obe.outbound.protection.outlook.com) ([104.47.0.50]) by smarthost4.eviden.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Jun 2024 07:59:48 +0200 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Bmi0sx8CULh6aemUQcQO0ElMtJCUnTzsosJvX2tYlk5CdnxJR0QvsCWuBXw5Cs7JCevpY813M93fvGORi8DmwzORK2zE273Ftzbw1qaSNP9gj90nVaAuNW9EUAM8Zwe86qEKdzBHCkiVXqdWO03R8apqee6hcH56dvQnCIeLaOaXklFdbFAK6pF8QkvyMECXWlNUy6iIyANop2MXjULqGpU4VWhNcaTmDQWpf7G+uk81SPoi1FMDLhasvsOwi6Dfq2ynLjdKrB8PtTHiL2tIG35oeqcbWOwJSykVovA536oy07aKPpZgyxhHjsyyG7WVvsdLRPTZUpC3HR4VH8edgw== 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=ey8tYT5sCKUkGtrJEMnAddjrE5No915u2Azs6R/nCDY=; b=Ntor+Cw/FQT6lKAOps3T8qlrkMQzPVnFULBeIHNIM1h+HZWM6IMh4UFpgOMpy44mltIwcedu/oyxQ7WpgJHHNhBF097f80wifyLxpUCWANRt4Rz4v8sI37fRYOATb6/OzvHoBljbdLp0LSP+8C9NymEtcXMpkjdEzUIkky16sezVNriqRX67i0iosbuqm7cenPd/wuWMMDaDV55J8kY52FWhY3TmXPRYPUhcCjMBxUuKhdSVcX4tKHkIY4eTkttmNxRcriG3G0kqOsJIxyHJp2CyAfCDY3lMh5s+pmITLMr+vaYhqQNLyRELv+frkrmhc/SS8PttuOG6Hlt7r7ixdg== 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=ey8tYT5sCKUkGtrJEMnAddjrE5No915u2Azs6R/nCDY=; b=qJWAVcpm/lpTNxDTpkoRUlR+f0Xpgkgn9OKsmNt0OxXZ39bohOZNam1ECHTIYPHxMwcFH7H8quqVC+WUFqYT0T1qfWkyYawjQ4Bz+aJplIdXqsY1arC8h+sxpOJQZ9zTs59obhkZI7BxGu9yxeyjuC22b2s650jT4SgJG+4xDWD4knaRtMqjcy1JpVtDOwO+spJX1vf/SUm6yWF1RVu6b0g0jP6LVk3unqpYLLZSUBatouppxT4NrQuEot4eVa8a09hLMXQCw/2zLMPKzRY8isBcTdDOodIdLVQ2wzyGQU0qSfBLdhjnWDzqNn2GyfXobOzVOMrfUQBnL3QYv+8W3w== Received: from AM8PR07MB7602.eurprd07.prod.outlook.com (2603:10a6:20b:24b::7) by VI1PR07MB6238.eurprd07.prod.outlook.com (2603:10a6:800:136::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.21; Mon, 3 Jun 2024 05:59: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.7633.021; Mon, 3 Jun 2024 05:59:44 +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" , CLEMENT MATHIEU--DRIF Subject: [PATCH ats_vtd v5 06/22] pcie: add helper to declare PASID capability for a pcie device Thread-Topic: [PATCH ats_vtd v5 06/22] pcie: add helper to declare PASID capability for a pcie device Thread-Index: AQHatXs7fkIAOjQiy0K665R5BPGZQA== Date: Mon, 3 Jun 2024 05:59:44 +0000 Message-ID: <20240603055917.18735-7-clement.mathieu--drif@eviden.com> References: <20240603055917.18735-1-clement.mathieu--drif@eviden.com> In-Reply-To: <20240603055917.18735-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_|VI1PR07MB6238:EE_ x-ms-office365-filtering-correlation-id: d5d6cd20-3be4-40e5-0487-08dc83925e03 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; ARA:13230031|376005|366007|1800799015|38070700009; x-microsoft-antispam-message-info: =?utf-8?q?pQn5MGoPHIbXT77nc8YvvmE2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-8?q?SX5Z8gm2KB31nhyXNYAsm9nGF2pZANeCDI39A8LFCZKZw8lDbb0qKMUH5Ukj7vJQm?= =?utf-8?q?kDraDJ/TcLuxD7QV679WGIBWvfR9tnLxNcVZhdmfQ+nzoe91cHK3R5ttgusC1YhvK?= =?utf-8?q?J8GUeYvE/SILVIVt2zRi5fLLCCsOcAx02jAT47DJ4129/1T69/RHAF0v47CoK2POl?= =?utf-8?q?BHejzwQLWcVPWjOaBrY+SX6nuPPzU8aQT9AjyWW6bn1WiZsWtAS/AE+PgwXQ7jPkP?= =?utf-8?q?7C8aXE05tDHPQyD/h6oVS2NIoHbW0/bAsgsYMGj8c32dpQmZbrUrYa830liP7gYuF?= =?utf-8?q?sw2sJU9dHyPXajfMGcYB3VCEjW01I+70gKNOfLcWNehrRXi4eAHHlE7YCa0rtKnAH?= =?utf-8?q?JMBFJdvSPtk1wIIKXh4s1n7/itleXnTvgXQ=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:(13230031)(376005)(366007)(1800799015)(38070700009); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?utf-8?q?BrRX1b1vGYeHF1BbbOzSx+g74eyF?= =?utf-8?q?+X4PzBcCFHAt2ZLdkvyi4RDWE4n/Ggh24SBGavWo4NU5M9nTQ7B8heMibv+oIPKkz?= =?utf-8?q?BHbuidKYPYfRXBd0JTEREHgJYCgGUCHl5ppX5i4yFaCSckus8Ek0uIgYdZQptrGxk?= =?utf-8?q?6hWbXp3R+I1c8kZsQUhOg4W/A3cwuO9+NFK2gK4EhiON181HMhuM6OZPjUQCQSblV?= =?utf-8?q?LoKd5OhN/0HCMYyeGKM2ckuyz2sdSBmYHAs/LvBI8V3CwUBPG0+VL4iW1R9s54rjG?= =?utf-8?q?k/pI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?gCs1uCGTUYl4Al6HhTx2TLopCigz7vdQIWa7tiXNNS3xFcyI/mVn8nnJl0ZUZvw8g?= =?utf-8?q?A+4fO4Fy5rVFKgGI/Bmu3Qi4bu8xeYofTDt9t+E4eYIy4p3U+iQqC8n7BrwLfl8nr?= =?utf-8?q?BHLUM2QAJ/4UgEr/LB/LDGvPaGSOyggmEXfuxIO8e3qotYmnKhJpS9b3mltFHWwhh?= =?utf-8?q?k886CP2qNyOdVAkMyrvxEWG6yaxTV3WWe/sX0lgCoZohYqg9wrSxBl5G8AfbCZ0Zu?= =?utf-8?q?W0hkIhqgh0UnyhFY8Bz+M3wZM+ezpgvpenH21nIUZVLUpAdUlYXTBZIVq3plplfj4?= =?utf-8?q?BwnFCCsA9hYHUMLcgrhEbxo3Ha/8JepOc7qNohjFb0IEPdVeHEwDEpiM/NblFKyqi?= =?utf-8?q?d9MzWy+avjpO1y3RaAKZKIphoigLCJH0sKGbEHRgseoIqlzwMH1uL+w=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: d5d6cd20-3be4-40e5-0487-08dc83925e03 X-MS-Exchange-CrossTenant-originalarrivaltime: 03 Jun 2024 05:59:44.4939 (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: 4c8N9YAUsKDQvguNVVBmuJVmF7xsvXWVky5+l+ga3CSdau8zuWz79LxhqLndk0Td/FpyxGCEj5tuOkgETUn9szryxtzBpa+D0qfCVVzTzM4gqKNPnusqptQVNtW8VxK/ X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR07MB6238 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, T_SCC_BODY_TEXT_LINE=-0.01 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/pci/pcie.c | 24 +++++++++++++++++++++++ include/hw/pci/pcie.h | 6 +++++- include/hw/pci/pcie_regs.h | 3 +++ include/standard-headers/linux/pci_regs.h | 1 + 4 files changed, 33 insertions(+), 1 deletion(-) diff --git a/hw/pci/pcie.c b/hw/pci/pcie.c index 4b2f0805c6..d6a052b616 100644 --- a/hw/pci/pcie.c +++ b/hw/pci/pcie.c @@ -1177,3 +1177,27 @@ void pcie_acs_reset(PCIDevice *dev) pci_set_word(dev->config + dev->exp.acs_cap + PCI_ACS_CTRL, 0); } } + +/* PASID */ +void pcie_pasid_init(PCIDevice *dev, uint16_t offset, uint8_t pasid_width, + bool exec_perm, bool priv_mod) +{ + assert(pasid_width <= PCI_EXT_CAP_PASID_MAX_WIDTH); + static const uint16_t control_reg_rw_mask = 0x07; + uint16_t capability_reg = pasid_width; + + pcie_add_capability(dev, PCI_EXT_CAP_ID_PASID, PCI_PASID_VER, offset, + PCI_EXT_CAP_PASID_SIZEOF); + + capability_reg <<= PCI_PASID_CAP_WIDTH_SHIFT; + capability_reg |= exec_perm ? PCI_PASID_CAP_EXEC : 0; + capability_reg |= priv_mod ? PCI_PASID_CAP_PRIV : 0; + pci_set_word(dev->config + offset + PCI_PASID_CAP, capability_reg); + + /* Everything is disabled by default */ + pci_set_word(dev->config + offset + PCI_PASID_CTRL, 0); + + pci_set_word(dev->wmask + offset + PCI_PASID_CTRL, control_reg_rw_mask); + + dev->exp.pasid_cap = offset; +} diff --git a/include/hw/pci/pcie.h b/include/hw/pci/pcie.h index 5eddb90976..b870958c99 100644 --- a/include/hw/pci/pcie.h +++ b/include/hw/pci/pcie.h @@ -72,8 +72,9 @@ struct PCIExpressDevice { uint16_t aer_cap; PCIEAERLog aer_log; - /* Offset of ATS capability in config space */ + /* Offset of ATS and PASID capabilities in config space */ uint16_t ats_cap; + uint16_t pasid_cap; /* ACS */ uint16_t acs_cap; @@ -150,4 +151,7 @@ void pcie_cap_slot_unplug_cb(HotplugHandler *hotplug_dev, DeviceState *dev, Error **errp); void pcie_cap_slot_unplug_request_cb(HotplugHandler *hotplug_dev, DeviceState *dev, Error **errp); + +void pcie_pasid_init(PCIDevice *dev, uint16_t offset, uint8_t pasid_width, + bool exec_perm, bool priv_mod); #endif /* QEMU_PCIE_H */ diff --git a/include/hw/pci/pcie_regs.h b/include/hw/pci/pcie_regs.h index 9d3b6868dc..0a86598f80 100644 --- a/include/hw/pci/pcie_regs.h +++ b/include/hw/pci/pcie_regs.h @@ -86,6 +86,9 @@ typedef enum PCIExpLinkWidth { #define PCI_ARI_VER 1 #define PCI_ARI_SIZEOF 8 +/* PASID */ +#define PCI_PASID_VER 1 +#define PCI_EXT_CAP_PASID_MAX_WIDTH 20 /* AER */ #define PCI_ERR_VER 2 #define PCI_ERR_SIZEOF 0x48 diff --git a/include/standard-headers/linux/pci_regs.h b/include/standard-headers/linux/pci_regs.h index a39193213f..406dce8e82 100644 --- a/include/standard-headers/linux/pci_regs.h +++ b/include/standard-headers/linux/pci_regs.h @@ -935,6 +935,7 @@ #define PCI_PASID_CAP_EXEC 0x0002 /* Exec permissions Supported */ #define PCI_PASID_CAP_PRIV 0x0004 /* Privilege Mode Supported */ #define PCI_PASID_CAP_WIDTH 0x1f00 +#define PCI_PASID_CAP_WIDTH_SHIFT 8 #define PCI_PASID_CTRL 0x06 /* PASID control register */ #define PCI_PASID_CTRL_ENABLE 0x0001 /* Enable bit */ #define PCI_PASID_CTRL_EXEC 0x0002 /* Exec permissions Enable */