From patchwork Wed Apr 24 20:04:06 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Svetly Todorov X-Patchwork-Id: 13642455 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2128.outbound.protection.outlook.com [40.107.223.128]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5978913BC3A for ; Wed, 24 Apr 2024 20:04:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.223.128 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713989070; cv=fail; b=M/tO+XSKHRuejQdtNFwfSqC8xhHS1Q3blfwC/nyIKqkxJRwmxe2LKT5soApQ8ich73+A7sm+UGbbBk1Rj9h6pYCWxK8K7cpVdoddFXjJRdH01nGrtGWRzrh+ovrzHXDbtjI+0w9BpOaO7ka2qRD1aGGcKPZEgShuYZ5HgPnK+Lk= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713989070; c=relaxed/simple; bh=n6uLLVpW754pheV8P0lm/gJ67umDXl4IO0f47kciLqQ=; h=From:Date:Subject:Content-Type:Message-Id:References:In-Reply-To: To:Cc:MIME-Version; b=syiXJ2JXz4gCdvues2N2k3Y3boYbSoV94i9wZGuE2TF+SkU8ONzfAhD45Oc1eI5kpWhBUm5b8te8GKRKQwnXx++DEMkNhTNNq3qj4mzqaGQTYWNff/F8HXndl4rAsR66vDdfUGvnzvMMDt6Otbjx5SdTNjfTecWmPDdcTv/MBvI= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=memverge.com; spf=pass smtp.mailfrom=memverge.com; dkim=pass (1024-bit key) header.d=memverge.com header.i=@memverge.com header.b=s/q0O0x0; arc=fail smtp.client-ip=40.107.223.128 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=memverge.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=memverge.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=memverge.com header.i=@memverge.com header.b="s/q0O0x0" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Xp0ICyZ1sfA4Sw2tJX0l9DT63LdbIPrxb/5SOZkurb29mCUgqvu7PheikZ9pBDGqAAyIKFt2Kjv4CpwuNTHy12bMMd5dTDqIRhwqCtkdpzDaU/BU+tncA/sTUmnIGIZQN70eQmmKwaosCPmE2S04xfS0psw5gWLf/DqAxZFJKQDw7FJgMFiw3XL80M1Labf3oSduRuUg0SlX4xjTOkm9PqcCj2ibFHvePe5+wSZwjOmpIKy+IbXopVDwQ9sy6mpIqlnVS5jjobzLuhHpMjFAQNhQxnLPJ5eyfTmlQmt0Gx355DD4VXjMbtCeGQPU0yO8kShljKxh5lw/vF3smJCXhQ== 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=qnLdblsMRDSOzforEnHVVgC29eihoHuXi927zOmPpKo=; b=BM06Pbyx4NTojkaqYAkeEv83uTYt56x+UvtQua4Tc6uDquBR+j9GtUxG7z6UfCjDvh15QE8cLY8VWrzE+GcTrN5/cxcRQIlEWjt1yl/15YF71/nNYymGBtqMpRwq6Jw6nemTcJb0X965s/3REC/+PPT6WiPciZm4ECh8e1QnLkx+bD/OgllvSlRNZ62x1eSMI0oVmYPL0UggE+9hqkwi7kU9DvixVC+azq3+1QantIOQU3kv00NNP1EZj8D+jmUcuqamTHW8twKgtGHIYXhbKUSyI4TSUDS9gbtKVCMAltcJR7eZbOq6Q/bcTSWb5w1Q2xAfXsKWHWW5iqCwm+tV8A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=memverge.com; dmarc=pass action=none header.from=memverge.com; dkim=pass header.d=memverge.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=memverge.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=qnLdblsMRDSOzforEnHVVgC29eihoHuXi927zOmPpKo=; b=s/q0O0x0Bm7qb7c1mcqNlafTGInXxHY7yCtCNONhC/uNgJLbjSzjSMp2v8Ug2taff8VmVOJ06Qy49IHPOyl9NnCFhMOxEaUT4KphMZF/sKgeRhGaEW2ObITT+leUbh8/5tzGpdY2bXrncAtWV7JqH30qdyeZmmmVUofQKCv6bhU= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=memverge.com; Received: from IA0PR17MB6347.namprd17.prod.outlook.com (2603:10b6:208:435::22) by SN4PR17MB5846.namprd17.prod.outlook.com (2603:10b6:806:215::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7472.44; Wed, 24 Apr 2024 20:04:24 +0000 Received: from IA0PR17MB6347.namprd17.prod.outlook.com ([fe80::200e:df84:29a9:8c9a]) by IA0PR17MB6347.namprd17.prod.outlook.com ([fe80::200e:df84:29a9:8c9a%6]) with mapi id 15.20.7519.021; Wed, 24 Apr 2024 20:04:24 +0000 From: Svetly Todorov Date: Wed, 24 Apr 2024 13:04:06 -0700 Subject: [PATCH RFC v2 1/3] cxl-mailbox-utils: move CXLUpdateDCExtentListInPl into header Message-Id: <20240424-cxl-2024-04-22-pullahead-v2-1-a87fc4597795@memverge.com> References: <20240424-cxl-2024-04-22-pullahead-v2-0-a87fc4597795@memverge.com> In-Reply-To: <20240424-cxl-2024-04-22-pullahead-v2-0-a87fc4597795@memverge.com> To: qemu-devel@nongnu.org Cc: Svetly Todorov , Gregory Price , jonathan.cameron@huawei.com, linux-cxl@vger.kernel.org, nifan.cxl@gmail.com X-Mailer: b4 0.14-dev X-Developer-Signature: v=1; a=ed25519-sha256; t=1713989063; l=2156; i=svetly.todorov@memverge.com; s=20240312; h=from:subject:message-id; bh=n6uLLVpW754pheV8P0lm/gJ67umDXl4IO0f47kciLqQ=; b=NF0R9bPEmDxA0o18wloZn9HlVXqr89v6zaKjXN7GhBjqsO7E1hEStX3kiv6ycuffKFw07/ycf FtNZ8rFXREKC0bvxfubVbR2fZK8gD3vKaLOeS710Y2e4oYIkmJrEOhb X-Developer-Key: i=svetly.todorov@memverge.com; a=ed25519; pk=bo0spdkY5tAEf+QP9ZH+jA9biE/razmOR7VcBXnymUE= X-ClientProxiedBy: BY3PR03CA0005.namprd03.prod.outlook.com (2603:10b6:a03:39a::10) To IA0PR17MB6347.namprd17.prod.outlook.com (2603:10b6:208:435::22) Precedence: bulk X-Mailing-List: linux-cxl@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: IA0PR17MB6347:EE_|SN4PR17MB5846:EE_ X-MS-Office365-Filtering-Correlation-Id: 776b3926-f936-4a35-912d-08dc6499bd36 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: =?utf-8?q?YWSjU841vbR5LBIC/4oJP1veOxwEWRu?= =?utf-8?q?pfdeTRyKR1H1DGh/K8W9JAoOwOFk+kKYibc4agguxF6B8kjBqzGWOgsuHbuk4orAc?= =?utf-8?q?rpO8+kYCKgKbeqBrawUZHoged/V/VFzNuHRYda+nMXRpnWTj2v5RJ6NKzpecbN1jR?= =?utf-8?q?3QgBbwtojFzO1GFm5gJuQHApUX6xsDh9+ya9g8zRtb6CRwQkBKnrLcys8FRva+RFj?= =?utf-8?q?FFsw4R9BC/ehbw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/dC310hhSLFta4RWkTYVls1D0soVVvx3rf3O30N+Q5YlZPs?= =?utf-8?q?RUWYYuigz4/L//8ticU25ljFDlSN2b/sbVu8gdIHmNhn9/iY2cPDnfFRCF6i/ARRF?= =?utf-8?q?oLPMUPTeJRkLpYFaDJ5RuHujLP+d/fJ1FTCCnT64esO/R/etDnhL7HRU1LT9o+SUy?= =?utf-8?q?rjCYRzB9qullyMziYQx9vS01JYKKZ2VOm0Q=3D=3D?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:IA0PR17MB6347.namprd17.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(366007)(376005)(52116005)(1800799015)(38350700005);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?BYqYNNgMcGCiFhskTeXBVdKlLChl?= =?utf-8?q?brRDxtTvW48rCBayqVjY9pojuB1WPMNEst6ws5wxprOCnrca/hkXqi68mgKaYKZwU?= =?utf-8?q?rHqpT+Rb7s2PjKSCC1/j9HXAV3NPj5jbyfdEyKoqrx9S3yutV68twYbe7wPJhJn4r?= =?utf-8?q?UvzNFHFGMjG5/q8BPLZSA264Zqd6IXn8vtsZbNWP0u5q+pd3EGHdA7kY17NmxleJk?= =?utf-8?q?Hx/il/5bUdt3oPsRzsBlj1/3ev42Y+5KF09HTJDya5legO8QzWqgZW3zfNNv+tvCi?= =?utf-8?q?n4+7846xA6ha7GMKilPelMrMPb6lcbsjrGXd0GReBxZP0OXbxX/2LUn7wo86pLvx9?= =?utf-8?q?izJ8r/yxwBaXsHyNX+i15ClTWv/2gigG9sQ9EMlyuld5XNsCt4tA8R/Lr6zs0ZARi?= =?utf-8?q?htBTwqgMmq9/ZdqA7PTELIKWpL5R+hh59FU9PYXGwytYSQzWo4SAq4rz+M6QvsrTb?= =?utf-8?q?dBz6bFCqkprQrcYQ/PfbW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oHNMcjEjumKwSHt7HuprzLbz5Yhar8jXz6YnWe?= =?utf-8?q?1l+H5fR7GscFeYoiQzIDjreWkjdJxGW9foIsLHEsBFb1fNBXvuYSz35RECApZNHLX?= =?utf-8?q?+2+1wmLnGoMWrDjxvnJOSFhJ/bEtaucIv3xlNTikVYcSOvrPZ9/8p0CY1tNLy7XvU?= =?utf-8?q?M2QpWeguyaYopYg33Tz/+qQ+U8iSTvrvUonS5CspxOlrEcDG0x9FAzk=3D?= X-OriginatorOrg: memverge.com X-MS-Exchange-CrossTenant-Network-Message-Id: 776b3926-f936-4a35-912d-08dc6499bd36 X-MS-Exchange-CrossTenant-AuthSource: IA0PR17MB6347.namprd17.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Apr 2024 20:04:24.7841 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 5c90cb59-37e7-4c81-9c07-00473d5fb682 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: zJr6xDH85fuZO9Csgwwxpqkyml6SjK0V58/Jg2X2ZA6PpIegYMzFnZIXFVlmkSLYyn8HVukkf4O2Vr840K7t51cDLOYIOJuVtXA+tE+kz4g= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN4PR17MB5846 Allows other CXL devices to access host DCD-add-response payload. --- hw/cxl/cxl-mailbox-utils.c | 16 ---------------- include/hw/cxl/cxl_device.h | 16 ++++++++++++++++ 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/hw/cxl/cxl-mailbox-utils.c b/hw/cxl/cxl-mailbox-utils.c index 413673da59..dc916f5bb3 100644 --- a/hw/cxl/cxl-mailbox-utils.c +++ b/hw/cxl/cxl-mailbox-utils.c @@ -2184,22 +2184,6 @@ void cxl_extent_group_list_delete_front(CXLDCExtentGroupList *list) g_free(group); } -/* - * CXL r3.1 Table 8-168: Add Dynamic Capacity Response Input Payload - * CXL r3.1 Table 8-170: Release Dynamic Capacity Input Payload - */ -typedef struct CXLUpdateDCExtentListInPl { - uint32_t num_entries_updated; - uint8_t flags; - uint8_t rsvd[3]; - /* CXL r3.1 Table 8-169: Updated Extent */ - struct { - uint64_t start_dpa; - uint64_t len; - uint8_t rsvd[8]; - } QEMU_PACKED updated_entries[]; -} QEMU_PACKED CXLUpdateDCExtentListInPl; - /* * For the extents in the extent list to operate, check whether they are valid * 1. The extent should be in the range of a valid DC region; diff --git a/include/hw/cxl/cxl_device.h b/include/hw/cxl/cxl_device.h index cb95ccbd61..5c60342556 100644 --- a/include/hw/cxl/cxl_device.h +++ b/include/hw/cxl/cxl_device.h @@ -525,6 +525,22 @@ typedef struct CXLDCExtentGroup { } CXLDCExtentGroup; typedef QTAILQ_HEAD(, CXLDCExtentGroup) CXLDCExtentGroupList; +/* + * CXL r3.1 Table 8-168: Add Dynamic Capacity Response Input Payload + * CXL r3.1 Table 8-170: Release Dynamic Capacity Input Payload + */ +typedef struct CXLUpdateDCExtentListInPl { + uint32_t num_entries_updated; + uint8_t flags; + uint8_t rsvd[3]; + /* CXL r3.1 Table 8-169: Updated Extent */ + struct { + uint64_t start_dpa; + uint64_t len; + uint8_t rsvd[8]; + } QEMU_PACKED updated_entries[]; +} QEMU_PACKED CXLUpdateDCExtentListInPl; + typedef struct CXLDCRegion { uint64_t base; /* aligned to 256*MiB */ uint64_t decode_len; /* aligned to 256*MiB */