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 shelob.surriel.com (shelob.surriel.com [96.67.55.147]) (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 AFFD3EB64D7 for ; Wed, 21 Jun 2023 14:21:30 +0000 (UTC) Received: from localhost ([::1] helo=shelob.surriel.com) by shelob.surriel.com with esmtp (Exim 4.96) (envelope-from ) id 1qBygZ-0004Wq-30; Wed, 21 Jun 2023 10:19:51 -0400 Received: from mscreen.etri.re.kr ([129.254.9.16]) by shelob.surriel.com with esmtps (TLS1.2) tls TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA (Exim 4.96) (envelope-from ) id 1qBygS-0004WT-17 for kernelnewbies@kernelnewbies.org; Wed, 21 Jun 2023 10:19:50 -0400 Received: from unknown (HELO send002-relay.gov-dooray.com) (211.180.235.153) by 129.254.9.16 with ESMTP; 21 Jun 2023 23:19:29 +0900 X-Original-SENDERIP: 211.180.235.153 X-Original-MAILFROM: ckim@etri.re.kr X-Original-RCPTTO: kernelnewbies@kernelnewbies.org Received: from [10.162.225.106] (HELO smtp001-imp.gov-dooray.com) ([10.162.225.106]) by send002-relay.gov-dooray.com with SMTP id 20d93917649306f1; Wed, 21 Jun 2023 23:19:29 +0900 DKIM-Signature: a=rsa-sha256; b=y0BWuS1Iw0rMvi3rxDarEqblK+xg985d6ayXEOsUtWdFdYG+Hdk7/EC6aeZOay2NzXqrNohg40 E4fLEKOvu1xVZ7NlQj81GlzzyPEJPDbusRJYLWjK+QIMletavtPPJNjWcpkXj9rjIYnB9vUKQaRZ n9kM4KHyzv6EonimniWkIGzfu/RWGS5bB497FbT+dfOR551Hs8/f5gkjIPavVqfyGxOo1PaYqdyV KVbfgMGO/xbb7tdRWVmRPBMpC7aDcOYvztDNZ2zvk2AVHuRJSFbzxjhGpTOIaeT84AQ2DgfzSCHS ekuh++mIVvbIgLyvuY7L1Kj66hf6VFfu92FC8VwQ==; c=relaxed/relaxed; s=selector; d=dooray.com; v=1; bh=OwWx6wEw9FFngnjEr0vHunZqxT7RO1pb4G5apSND3Lk=; h=From:To:Subject:Message-ID; Received: from [129.254.132.39] (HELO CHANKIMPC) ([129.254.132.39]) by smtp001-imp.gov-dooray.com with SMTP id c257fb24649306f0; Wed, 21 Jun 2023 23:19:28 +0900 From: "Chan Kim" To: Subject: How is 'addr_space' filled in the pcie endpoint controller device tree node? Date: Wed, 21 Jun 2023 23:19:28 +0900 Message-ID: <00c201d9a44b$63e36650$2baa32f0$@etri.re.kr> MIME-Version: 1.0 X-Mailer: Microsoft Outlook 16.0 Thread-Index: AdmkSGESK2SXIdN6T+u0soFXBvvQQw== Content-Language: ko X-BeenThere: kernelnewbies@kernelnewbies.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Learn about the Linux kernel List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: kernelnewbies-bounces@kernelnewbies.org Hello linux experts and users, When I analyze https://elixir.bootlin.com/linux/v5.15.68/source/drivers/pci/controller/dwc/ pcie-designware-ep.c#L777, The struct dw_pcie_ep contains a member msi_mem and the driver generates msi interrupt by writing the given data at that address. (see line 533 of the dw_pcie_ep_raise_msi_irq function) So that address (ep->msi_mem) is the host address (probably GICV3's ITS's GITS_TRANSLATER register address) that the host has told the endpoint. But when I trace the code how the msi_mem (virtual address) is decided, I see (in processing order in the dw_pcie_ep_init function) : res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "addr_space"); ep->phys_base = res->start; ep->addr_size = resource_size(res); ret = pci_epc_mem_init(epc, ep->phys_base, ep->addr_size, ep->page_size); ep->msi_mem = pci_epc_mem_alloc_addr(epc, &ep->msi_mem_phys, epc->mem->window.page_size); the allocate function allocates some port of the "addr_space" range and returns the virtual address (and fills the second argument with physical address). Then is this 'addr_space' filled by the boot loader? How can I know the host's ITS register range seen from the endpoint? (I mean the host PCI bridge will have a translation function that converts upstream PCI address --> host CPU's physical address, or IO virtual address if the host uses IOMMU betwen the PCIe and ITS). Any comment will be really appreciated. Thank you! Chan Kim _______________________________________________ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies