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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 014C6C38145 for ; Thu, 8 Sep 2022 11:50:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Content-Type: Content-Transfer-Encoding:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:From:References:Cc:To:Subject: MIME-Version:Date:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=+N2clZjpaDeex3LQRJ7+QccIgPXT3hpAI+CpcVUoy7g=; b=cAdZRrO8OKeCLG hUIRigy3bXCuvh/4CKftjfDi5axKjgHAWfVYGv/O5va570kxa341EYpg7DKqcNrAVC8g0uWJgZkl3 bqM3i9aHBvmJlrl3LY2Zcgcnej6PvON3XJFXtjS8X/RC+1xyD3TAn51UByjxFfzwxu7ZmMIyzrkVi ungHT8RcN1jJV7wQJyhyfEtGdLiWkMUQihiHbrZywE7rv0N8Ho0QE+esnUZkCBbvtlpGJsSH2f+6g 3kVMKGkXj69W8i3hM+glpYEhedPPsSDAjS4GUsWKN6+o4fsb7Qmojl2/Xx+7Pkxxl4QBCbMKB+G0l Eqw/w8iXB4uuEjv+zS1A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oWG2C-002tzp-Ea; Thu, 08 Sep 2022 11:49:28 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oWG28-002twt-Qt for linux-arm-kernel@lists.infradead.org; Thu, 08 Sep 2022 11:49:26 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 5E47B14BF; Thu, 8 Sep 2022 04:49:28 -0700 (PDT) Received: from [10.57.15.197] (unknown [10.57.15.197]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 4DC473F71A; Thu, 8 Sep 2022 04:49:12 -0700 (PDT) Message-ID: <919bfaae-0a1d-de88-8211-f9fa476e6ebf@arm.com> Date: Thu, 8 Sep 2022 12:49:05 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; rv:102.0) Gecko/20100101 Thunderbird/102.2.1 Subject: Re: [RFC PATCH v3 4/7] bus/cdx: add cdx-MSI domain with gic-its domain as parent Content-Language: en-GB To: "Radovanovic, Aleksandar" , Marc Zyngier Cc: Jason Gunthorpe , "Gupta, Nipun" , "robh+dt@kernel.org" , "krzysztof.kozlowski+dt@linaro.org" , "gregkh@linuxfoundation.org" , "rafael@kernel.org" , "eric.auger@redhat.com" , "alex.williamson@redhat.com" , "cohuck@redhat.com" , "Gupta, Puneet (DCG-ENG)" , "song.bao.hua@hisilicon.com" , "mchehab+huawei@kernel.org" , "f.fainelli@gmail.com" , "jeffrey.l.hugo@gmail.com" , "saravanak@google.com" , "Michael.Srba@seznam.cz" , "mani@kernel.org" , "yishaih@nvidia.com" , "will@kernel.org" , "joro@8bytes.org" , "masahiroy@kernel.org" , "ndesaulniers@google.com" , "linux-arm-kernel@lists.infradead.org" , "linux-kbuild@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "devicetree@vger.kernel.org" , "kvm@vger.kernel.org" , "okaya@kernel.org" , "Anand, Harpreet" , "Agarwal, Nikhil" , "Simek, Michal" , "git (AMD-Xilinx)" References: <20220803122655.100254-1-nipun.gupta@amd.com> <20220906134801.4079497-1-nipun.gupta@amd.com> <20220906134801.4079497-5-nipun.gupta@amd.com> <87leqvv3g7.wl-maz@kernel.org> <87illzuzyw.wl-maz@kernel.org> <87edwmuw4f.wl-maz@kernel.org> From: Robin Murphy In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220908_044925_016699_D86B24D8 X-CRM114-Status: GOOD ( 13.06 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 2022-09-08 10:51, Radovanovic, Aleksandar wrote: > [AMD Official Use Only - General] > > > >> -----Original Message----- >> From: Marc Zyngier >> Sent: 08 September 2022 09:08 >> To: Radovanovic, Aleksandar >> Cc: Jason Gunthorpe ; Gupta, Nipun >> ; robh+dt@kernel.org; >> krzysztof.kozlowski+dt@linaro.org; gregkh@linuxfoundation.org; >> rafael@kernel.org; eric.auger@redhat.com; alex.williamson@redhat.com; >> cohuck@redhat.com; Gupta, Puneet (DCG-ENG) >> ; song.bao.hua@hisilicon.com; >> mchehab+huawei@kernel.org; f.fainelli@gmail.com; >> jeffrey.l.hugo@gmail.com; saravanak@google.com; >> Michael.Srba@seznam.cz; mani@kernel.org; yishaih@nvidia.com; >> robin.murphy@arm.com; will@kernel.org; joro@8bytes.org; >> masahiroy@kernel.org; ndesaulniers@google.com; linux-arm- >> kernel@lists.infradead.org; linux-kbuild@vger.kernel.org; linux- >> kernel@vger.kernel.org; devicetree@vger.kernel.org; kvm@vger.kernel.org; >> okaya@kernel.org; Anand, Harpreet ; Agarwal, >> Nikhil ; Simek, Michal ; >> git (AMD-Xilinx) >> Subject: Re: [RFC PATCH v3 4/7] bus/cdx: add cdx-MSI domain with gic-its >> domain as parent >> >> [CAUTION: External Email] >> >> OK, so you definitely need a mapping, but it cannot be a translation, and it >> needs to be in all the possible address spaces. OMG. > > Could you elaborate why it needs to be in all the possible address spaces? I'm in no way familiar with kernel IOVA allocation, so not sure I understand this requirement. Note that each CDX device will have its own unique StreamID (in general case, equal to DeviceID sent to the GIC), so, from a SMMU perspective, the mapping can be specific to that device. As long as that IOVA is not allocated to any DMA region for _that_ device, things should be OK? But, I appreciate it might not be that simple from a kernel perspective. That's the point - any device could could have its own mapping, therefore that hole has to be punched in *every* mapping that any of those devices could use, so that MSI writes don't unexpectedly fault, or corrupt memory if that address is free to be used to map a DMA buffer. At least the HiSilicon PCI quirk is functionally similar (for slightly different underlying reasons) so there's already precedent and an example that you can follow to a reasonable degree. Robin. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel