Received: by 2002:a05:6358:489b:b0:bb:da1:e618 with SMTP id x27csp507889rwn; Thu, 8 Sep 2022 05:09:48 -0700 (PDT) X-Google-Smtp-Source: AA6agR4AVnY5bqksfQyxH0rm/TYplccobHdrhQUfoysdRxVXMzSXfc6Ky7UMNf6Zr0X5IuNCuNgo X-Received: by 2002:a17:907:2e01:b0:730:a098:7257 with SMTP id ig1-20020a1709072e0100b00730a0987257mr5879961ejc.705.1662638988522; Thu, 08 Sep 2022 05:09:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662638988; cv=none; d=google.com; s=arc-20160816; b=rjazfLcz9vCExs1bnunvMSc128atvoBJmW1gSpPwW6sa8GL0IMyOdOqS+XCC+Z5qPQ quRDIbryxaRmBonMHCoPrjqZpwZ10r8stBA1EH6ty33ZaU2GpmtWofRtXoYbfyZM37VS 7EJ+JR+D7HIpBBydTF8qs0GAIY0uly+5l008jkl/Wtf6O7FJpyK12+VswipqEjRQT//G 8tCJn6oRY4ocfJaYyA5DLClQDUGukcsfhLgC+T8V6pdrLM7i5cziOfHh1TtRkMOxPKEJ n0x5HBeTIU4ELXpccgJysCDohyPhcIr9px+StxU6a04zwScox1RA67St42lN1Z6WiiOe BHWQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=uyPoVog5vkxYfPn1u1XuSZLcOg+k4/CbFzHslLmr80g=; b=K4qwtElZ7Qn1egCBWpZSAVyPwe4egI0sn6Fpe2L2b/9bSDW1LSbMfW3/t+Sv8rzudt VGJV9mieXv6YHb0UNS5eAqzqY8wZXT0zpR4oYiUJ3Eydtot1+Hkku7TLJFaHBf8mbEqR JhYkqr5sWvl/qUcoXHdQTtr3pklDTA8aN7YVPZzub95VW+kHs+JBVl8LYjp/J4BT7KSB iFtwYbfaKUSHHd93MINeC78iydX5PHJdmMWS8RvTZwJfF63NaVX6EsRQVB3X3fpPRPvH GgujtFe1sXlrcdaGO8+YsOAw/nwN9WxZvJROQgiWGC3lPsh+3tXqskZu4Hcizwk9mZDt WG0A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id nb42-20020a1709071caa00b007414e53fb47si2056515ejc.180.2022.09.08.05.09.22; Thu, 08 Sep 2022 05:09:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231477AbiIHLtZ (ORCPT + 99 others); Thu, 8 Sep 2022 07:49:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35958 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229644AbiIHLtX (ORCPT ); Thu, 8 Sep 2022 07:49:23 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 5733AB5; Thu, 8 Sep 2022 04:49:22 -0700 (PDT) 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: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-10.1 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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.