From mboxrd@z Thu Jan 1 00:00:00 1970 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.xenproject.org (lists.xenproject.org [192.237.175.120]) (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 58C66C25B7A for ; Wed, 22 May 2024 13:20:22 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.727635.1132206 (Exim 4.92) (envelope-from ) id 1s9lt6-0002uD-N5; Wed, 22 May 2024 13:20:12 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 727635.1132206; Wed, 22 May 2024 13:20:12 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1s9lt6-0002u6-KC; Wed, 22 May 2024 13:20:12 +0000 Received: by outflank-mailman (input) for mailman id 727635; Wed, 22 May 2024 13:20:11 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1s9lt5-0002sc-10 for xen-devel@lists.xenproject.org; Wed, 22 May 2024 13:20:11 +0000 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on20601.outbound.protection.outlook.com [2a01:111:f403:2416::601]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 02de5ed5-183e-11ef-90a0-e314d9c70b13; Wed, 22 May 2024 15:20:09 +0200 (CEST) Received: from DM6PR18CA0025.namprd18.prod.outlook.com (2603:10b6:5:15b::38) by MW4PR12MB5642.namprd12.prod.outlook.com (2603:10b6:303:187::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7587.36; Wed, 22 May 2024 13:20:05 +0000 Received: from CY4PEPF0000E9D6.namprd05.prod.outlook.com (2603:10b6:5:15b:cafe::4b) by DM6PR18CA0025.outlook.office365.com (2603:10b6:5:15b::38) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7611.20 via Frontend Transport; Wed, 22 May 2024 13:20:04 +0000 Received: from SATLEXMB03.amd.com (165.204.84.17) by CY4PEPF0000E9D6.mail.protection.outlook.com (10.167.241.69) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7611.14 via Frontend Transport; Wed, 22 May 2024 13:20:04 +0000 Received: from SATLEXMB06.amd.com (10.181.40.147) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Wed, 22 May 2024 08:20:04 -0500 Received: from SATLEXMB04.amd.com (10.181.40.145) by SATLEXMB06.amd.com (10.181.40.147) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Wed, 22 May 2024 08:20:03 -0500 Received: from [10.252.147.188] (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server id 15.1.2507.35 via Frontend Transport; Wed, 22 May 2024 08:20:02 -0500 X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 02de5ed5-183e-11ef-90a0-e314d9c70b13 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=T++K8TuLf8+kKlPCIGYoDDpxLlk0txDOpSrH6tkWvSsoxjUUDiOlwLTYkJEyNBlYk0jm9kYQMJMu9I5ZVPlVVsm/8kW8OKPFXgbiAb1lt12oNJNlH9RLpYJQdg94wW3dQHlPbStsZpF+WH2pmT/K1sX/F9RsITJpVgCSB5lJ4SDwAD2MLNDx+vt4IppD+Bt07hTUdsgjcxtlrDSBIgylyoVHEIl/mQK8H0nT0C5MmFzSUldoDt77ONchLC1y+VHD+FppxoluWKNM06Ck9iiP7QLCWcD6LBpjEnEZRPDqZ8C27LOqyNmkwErKIkFUUvX3y9/abQqlS7Q7COiqfc4kpA== 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=EO6KUCu3JGuzHIVuVIM4KDT+40PD1yt4ONaC+056r/Q=; b=awrdrld6ja5ztkDiI5Y0TcTAKW/kN0AFEYFwBUTYeZd4yy470twnlCRiPoucsltVBwDfSTifMAJMzv7KE0WME6+HyNj2IyugZwQH+lO1bg++wvsBdV8HhZhel+6gMOes47Y9J5fjT2N8uOzLl61uBOK5X4WTkBkIcqdAWd1WHAF/6CPfXRchUGjX/XWkBDolrFo6vnyC7B46oHmF3jk2wrkohYkEy+jvDfmt0pMZGzeUnND941yUHvQi7CSRWuZ5J4PGc1bO/P8P0f7HmIJlHPf/gFyWoxvi8Ye3fRcNpRKdxOmgu2Oowzfymxtpv0BTjZ8N0E4WpdHc4Lkytu8GSA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=arm.com smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=EO6KUCu3JGuzHIVuVIM4KDT+40PD1yt4ONaC+056r/Q=; b=n30hk+LbIc0yBUqisXM61wOtU5CkBP4nQZ5zf1qhuTj6TKk263+gH1V8izz9REYAGeIe6vowQvBBrdQcR4Ww6wHJtkdYC9a/7FTGm+JD/TK7hQ0QkPWxkeuSS13gLe4/L7RWssnR6D0GTPbfysulhxojku94pPfQVMnlhDVQ/EU= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB03.amd.com; pr=C Message-ID: <6ea06251-4e47-426a-aa7a-ef951100e8cf@amd.com> Date: Wed, 22 May 2024 15:19:57 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v3 6/7] xen/arm: Implement the logic for static shared memory from Xen heap To: Luca Fancellu , CC: Stefano Stabellini , Julien Grall , Bertrand Marquis , "Volodymyr Babchuk" References: <20240522075151.3373899-1-luca.fancellu@arm.com> <20240522075151.3373899-7-luca.fancellu@arm.com> Content-Language: en-US From: Michal Orzel In-Reply-To: <20240522075151.3373899-7-luca.fancellu@arm.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CY4PEPF0000E9D6:EE_|MW4PR12MB5642:EE_ X-MS-Office365-Filtering-Correlation-Id: e3ff5888-8a79-496b-9557-08dc7a61e4a6 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|376005|1800799015|82310400017|36860700004; X-Microsoft-Antispam-Message-Info: =?utf-8?B?djVvcFpTTVBhYytaQmFQTUg3L1pDWjl0SDM0SnRGTW43RzdYbUh1VXhjRlQ5?= =?utf-8?B?b29nWTRDU1BUV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antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB03.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230031)(376005)(1800799015)(82310400017)(36860700004);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 May 2024 13:20:04.5369 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e3ff5888-8a79-496b-9557-08dc7a61e4a6 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB03.amd.com] X-MS-Exchange-CrossTenant-AuthSource: CY4PEPF0000E9D6.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW4PR12MB5642 Hi Luca, On 22/05/2024 09:51, Luca Fancellu wrote: > > > This commit implements the logic to have the static shared memory banks > from the Xen heap instead of having the host physical address passed from > the user. > > When the host physical address is not supplied, the physical memory is > taken from the Xen heap using allocate_domheap_memory, the allocation > needs to occur at the first handled DT node and the allocated banks > need to be saved somewhere. > > Introduce the 'shm_heap_banks' for that reason, a struct that will hold > the banks allocated from the heap, its field bank[].shmem_extra will be > used to point to the bootinfo shared memory banks .shmem_extra space, so > that there is not further allocation of memory and every bank in > shm_heap_banks can be safely identified by the shm_id to reconstruct its > traceability and if it was allocated or not. > > A search into 'shm_heap_banks' will reveal if the banks were allocated > or not, in case the host address is not passed, and the callback given > to allocate_domheap_memory will store the banks in the structure and > map them to the current domain, to do that, some changes to > acquire_shared_memory_bank are made to let it differentiate if the bank > is from the heap and if it is, then assign_pages is called for every > bank. > > When the bank is already allocated, for every bank allocated with the > corresponding shm_id, handle_shared_mem_bank is called and the mapping > are done. > > Signed-off-by: Luca Fancellu Reviewed-by: Michal Orzel ~Michal