Received: by 2002:a05:6358:bb9e:b0:b9:5105:a5b4 with SMTP id df30csp5649344rwb; Wed, 7 Sep 2022 06:10:02 -0700 (PDT) X-Google-Smtp-Source: AA6agR5V2DDDVpYANHy0X0ykzWBU+FFQM9zs4UYw+RsL+OBXMC5yq6f/+zZFYKtX4hb5RS/vPs5g X-Received: by 2002:a17:902:e5cc:b0:16f:1e31:da6c with SMTP id u12-20020a170902e5cc00b0016f1e31da6cmr3902845plf.66.1662556202641; Wed, 07 Sep 2022 06:10:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662556202; cv=none; d=google.com; s=arc-20160816; b=ZZ223XjlN42zNvowZIW8ZYI2RKQD8cmogHJtVqcisXtXt5oPajf9/49n2GomH3vbzs u0NAuz/GWpqbpFGfNT38Zjsk1CG5Y9hvf4tXjPhHiQWL3QEUedINgit1gebtS5wChYU2 3zCPkyupRpZZ9gq6KaQxFLzMOfV2TU/BFL7BZAMygoxt3bFReCGXKLevW/4oee2QQf6V WLmlHIiWSycbrlKpid57nrkEtNhuSt/I7WAMydAf4I4nwqpw2MiewmDy8izmtxfAdUQh Z+jsyHIST903HB/5gnqWe7/iQdn73OQkevrbBXGfPTPSMdgnogvpMPkSDKZGy+v/tJoe m8Eg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:references:in-reply-to :subject:cc:to:from:message-id:date:dkim-signature; bh=87X4L3rAJyvF1/AgHAdLCh3dvQPRZomrREYi6w4tKrg=; b=ToR8KXzLcioNSxugGUwqe2EfMGkjuGrR7wpbey8XkwvJhxTJlIh8MfOpTlxWDfdHx6 d6NxkSFPaWPjXuPhahQ/y67pgb2lvAB+3FAu9Pcu8ktNvK9rpAdkIxZY7698FvGekgDD 8N1f2tWIwitp52YmJVKr90rZqsmvZuX3KM4sbBr34+KETOBf7MQSS/DUZkp9X30PCOfH KS1VHty0RcxfXLUaHtSftbCzo9/wXq8cKKjuR5HwRUDlS0qg6Hk39fgKZOLuU+xGGPoA 5gAkBShsQZKiYrXVbD/Ehjz6dIhyJL7pfAvwB9OemfzngnPhitXXnxMvdNtdcpSUwbYk jqsw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=hzFdNkFe; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k15-20020a63560f000000b0042b6eb3b46dsi16403538pgb.346.2022.09.07.06.09.49; Wed, 07 Sep 2022 06:10:02 -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; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=hzFdNkFe; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229981AbiIGMPC (ORCPT + 99 others); Wed, 7 Sep 2022 08:15:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50024 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229517AbiIGMO7 (ORCPT ); Wed, 7 Sep 2022 08:14:59 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4F8BE27FD8; Wed, 7 Sep 2022 05:14:58 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id D1186618B8; Wed, 7 Sep 2022 12:14:57 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2E6B2C433D6; Wed, 7 Sep 2022 12:14:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1662552897; bh=aZ2WeP3U336s63udprictr4067p8RlQvpxaoMNPC+So=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=hzFdNkFe7FXDKMFLXF3Ak1yGqDSjqHDYM1cgeHmZyvL3wRZhLI+o5x/fppba/nQXr BmzuvTkpIOpwukz1ple0VUnSDKKXXHuR8cL0hOt1dZYUjuS040Pjx4DdG6cEXM+Ess yUG4iczoGb/1Mj0OaaQXTFseDLpSpKVBT/lHieKa6DHojxysT7iLAp/A2I0IjLJWPV kl1kBGyeIsdrCNqIVdzFcORbNp4E7HfCT2qi2+cKy9wwjWUN21FKPvd3ECXaeax6Yv aZEuaYpYRO9RmBTKVf93H2OychjIDjn9OKs3abmlWxE5mKD0xw/84ji/zbOGohq+/h Hf9/1INmx37mw== Received: from sofa.misterjones.org ([185.219.108.64] helo=why.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1oVtxG-008dZY-V5; Wed, 07 Sep 2022 13:14:55 +0100 Date: Wed, 07 Sep 2022 13:14:54 +0100 Message-ID: <87k06fv0sh.wl-maz@kernel.org> From: Marc Zyngier To: Robin Murphy Cc: Jason Gunthorpe , Nipun Gupta , 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, puneet.gupta@amd.com, 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, harpreet.anand@amd.com, nikhil.agarwal@amd.com, michal.simek@amd.com, aleksandar.radovanovic@amd.com, git@amd.com Subject: Re: [RFC PATCH v3 4/7] bus/cdx: add cdx-MSI domain with gic-its domain as parent In-Reply-To: <4ca6383e-bd21-59bf-cc4e-cf3313164957@arm.com> 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> <4ca6383e-bd21-59bf-cc4e-cf3313164957@arm.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/27.1 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: robin.murphy@arm.com, jgg@nvidia.com, nipun.gupta@amd.com, 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, puneet.gupta@amd.com, 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, harpreet.anand@amd.com, nikhil.agarwal@amd.com, michal.simek@amd.com, aleksandar.radovanovic@amd.com, git@amd.com X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,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 Wed, 07 Sep 2022 12:33:12 +0100, Robin Murphy wrote: > > On 2022-09-07 12:17, Marc Zyngier wrote: > > On Tue, 06 Sep 2022 18:19:06 +0100, > > Jason Gunthorpe wrote: > >> > >> On Tue, Sep 06, 2022 at 07:17:58PM +0530, Nipun Gupta wrote: > >> > >>> +static void cdx_msi_write_msg(struct irq_data *irq_data, > >>> + struct msi_msg *msg) > >>> +{ > >>> + /* > >>> + * Do nothing as CDX devices have these pre-populated > >>> + * in the hardware itself. > >>> + */ > >>> +} > >> > >> Huh? > >> > >> There is no way it can be pre-populated, the addr/data pair, > >> especially on ARM, is completely under SW control. > > > > There is nothing in the GIC spec that says that. > > > >> There is some commonly used IOVA base in Linux for the ITS page, but > >> no HW should hardwire that. > > > > That's not strictly true. It really depends on how this block is > > integrated, and there is a number of existing blocks that know *in HW* > > how to signal an LPI. > > > > See, as the canonical example, how the mbigen driver doesn't need to > > know about the address of GITS_TRANSLATER. > > > > Yes, this messes with translation (the access is downstream of the > > SMMU) if you relied on it to have some isolation, and it has a "black > > hole" effect as nobody can have an IOVA that overlaps with the > > physical address of the GITS_TRANSLATER register. > > > > But is it illegal as per the architecture? No. It's just stupid. > > If that were the case, then we'd also need a platform quirk so the > SMMU driver knows about it. Yuck. Yup. As I said, this is stupid. > But even then, are you suggesting there is some way to convince the > ITS driver to allocate a specific predetermined EventID when a driver > requests an MSI? Asking for a friend... Of course not. Whoever did that has decided to hardcode the Linux behaviour into the HW, because it is well known that SW behaviour never changes. Nononono. I am >this< tempted to sneak a change into the allocation scheme to start at 5 or 13 (alternatively), and to map LPIs top-down. That should get people thinking. Cheers, M. -- Without deviation from the norm, progress is not possible.