Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp479376pxb; Mon, 8 Nov 2021 17:03:01 -0800 (PST) X-Google-Smtp-Source: ABdhPJzXlRX/le9joVFjrkwRW++UsAm6omRvoURVKQani5zXe+aqg14B8vfFoRO1hUHApf7n8yBA X-Received: by 2002:a17:907:1c85:: with SMTP id nb5mr4489493ejc.502.1636419781589; Mon, 08 Nov 2021 17:03:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1636419781; cv=none; d=google.com; s=arc-20160816; b=tNKkzgp3YwPyN0UTXHpmDAxu85FttmgL/hZONgdiLieckEzAkqL8lMi1IovMISMZKg A5547zwDHvicRGAoOYV6jtCLN2gnzGOztHOC7TQM/74AnpBwSWRE7uV5YxiF5YDQCedX Pxm+9uT7Gik2lOnR/aKWDuAqdNWMCcmXxMBYAd1cSealYFMpSxgOyNEHEEETnvlUerY8 UjG7ML4kL39+m8YELALHNJiT49fs9WWQX/6BLIbTdo+n7oeJhucT/HWBEcVvp2QxmoQ+ ODfR4OYUlyXwBOe3tjkFHLG+Dp+a15R6/iMQGoFvPHatyPlcLTDDvHTRBWQnHmO7GIZF QafA== 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; bh=DbPR4h+E9h9XE9psWpJtfQjAFGmivSSWzUAI3lSnRZ8=; b=fCP9aOwp764tLIWbCX4s5Z/2tlPLHq4KzQ7h90Lv3sRcsiu8j09fHQ0593FkeEehxA +N8jIhec8EbX8d0RNtFdiDRhfdpHOnjsOuVcqP4g8+J+23mQyQ9EpB9oHfIMUXy/A5Y4 sulyy+1V2+kmrRnUAnQ80+7wOY62YqPEzmjIMVG9PQCJG4dpYI8Fc/VsfldKIKfd95/s giRIKrjC8BqCzq1w33mxD75nmVgL7r1Y+hEWsHEgO5kwlCO8qLa6pe+dz2Zx/3gMf2Uu PkVBoZwyvTcaPZSsDv5Ca3JzaGqblF909FbOXlzUGrZ39KnuABe3HZhSYQ65VVa2fgno 1YVA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e6si28215257ejb.600.2021.11.08.17.02.33; Mon, 08 Nov 2021 17:03:01 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S238043AbhKHT4s (ORCPT + 99 others); Mon, 8 Nov 2021 14:56:48 -0500 Received: from mail.kernel.org ([198.145.29.99]:32848 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237891AbhKHT4r (ORCPT ); Mon, 8 Nov 2021 14:56:47 -0500 Received: from disco-boy.misterjones.org (disco-boy.misterjones.org [51.254.78.96]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 9793F619E1; Mon, 8 Nov 2021 19:54:02 +0000 (UTC) Received: from sofa.misterjones.org ([185.219.108.64] helo=wait-a-minute.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1mkAiO-004Dv6-7A; Mon, 08 Nov 2021 19:54:00 +0000 Date: Mon, 08 Nov 2021 19:53:58 +0000 Message-ID: <87lf1ye84p.wl-maz@kernel.org> From: Marc Zyngier To: Brad Larson Cc: Mark Rutland , Linux ARM , Arnd Bergmann , Linus Walleij , Bartosz Golaszewski , Mark Brown , Serge Semin , Adrian Hunter , Ulf Hansson , Olof Johansson , "open list:GPIO SUBSYSTEM" , linux-spi , linux-mmc , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , Linux Kernel Mailing List Subject: Re: [PATCH v3 11/11] arm64: dts: Add Pensando Elba SoC support In-Reply-To: References: <20211025015156.33133-1-brad@pensando.io> <20211025015156.33133-12-brad@pensando.io> <20211025091731.GA2001@C02TD0UTHF1T.local> <87zgqi96nh.wl-maz@kernel.org> 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: brad@pensando.io, mark.rutland@arm.com, linux-arm-kernel@lists.infradead.org, arnd@arndb.de, linus.walleij@linaro.org, bgolaszewski@baylibre.com, broonie@kernel.org, fancer.lancer@gmail.com, adrian.hunter@intel.com, ulf.hansson@linaro.org, olof@lixom.net, linux-gpio@vger.kernel.org, linux-spi@vger.kernel.org, linux-mmc@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 08 Nov 2021 19:35:14 +0000, Brad Larson wrote: > > Hi Mark, s/k/c/ > > On Fri, Nov 5, 2021 at 4:35 AM Marc Zyngier wrote: > > > > > > >> + interrupts = ; > > > > >> + > > > > >> + gic_its: msi-controller@820000 { > > > > >> + compatible = "arm,gic-v3-its"; > > > > >> + msi-controller; > > > > >> + #msi-cells = <1>; > > > > >> + reg = <0x0 0x820000 0x0 0x10000>; > > > > >> + socionext,synquacer-pre-its = > > > > >> + <0xc00000 0x1000000>; > > > > >> + }; > > > > >> + }; > > > > > > > > > > Is there any shared lineage with Synquacer? The commit message didn't > > > > > describe this quirk. > > > > > > > > Funny, it looks like there is a sudden outburst of stupid copy/paste > > > > among HW designers. TI did the exact same thing recently. > > > > > > > > This totally negates all the advantages of having an ITS and makes > > > > sure that you have all the overhead. Facepalm... > > > > > > Some background may help explain. To generate an LPI a peripheral must > > > write to the GITS_TRANSLATER (a specific address). For the ITS to know > > > which translations apply to the generated interrupts, it must know which > > > peripheral performed the write. The ID of the peripheral is known as its > > > DeviceID, which is often carried along with the write as an AXI sideband > > > signal. > > > > Yes, I happen to be vaguely familiar with the GIC architecture. > > > > > The Elba SoC doesn't carry the DeviceID, so we have to conjure one up > > > between the peripheral and the ITS. Instead of telling a peripheral to target > > > the GITS_TRANSLATER directly, we instead direct it to a specific offset > > > within a pre-ITS address range (our own IP block). For writes that land in > > > that memory range, we derive the DeviceID from (offset >> 2). The pre-ITS > > > block then sends (DeviceID, data) to the GITS_TRANSLATER. > > > > > > The hardware designer came up with the Pre-ITS mechanism in Feb 2018. > > > When we looked at the upstream kernel later (we developed on 4.14) > > > we found that not only did it support something similar, it supported the > > > exact scheme we are using. > > > > And this scheme is totally wrong. It breaks interrupt isolation. > > > > Instead of having a single doorbell and getting the ITS to segregate > > between devices itself, you end-up with multiple ones, allowing a > > rogue device to impersonate another one by targeting another doorbell. > > You can't even use an SMMU to preserve some isolation, because all the > > doorbells are in the *same page*. Unmitigated disaster. > > > > At this stage, why did you bother having an ITS at all? You get none > > of the security features. Only the excess area, memory allocation, > > additional latency and complexity. All you get is a larger INTID > > space. > > > > This only shows that the hardware designer didn't understand the ITS > > at all. Which seems a common pattern, unfortunately. > > The Elba SoC is an embedded chip and not intended as a SBSA-compliant > general platform. This has nothing to do with following a standard. It has to do with following the intended use of the architecture. What you have here is the system architecture equivalent of trusting userspace to build the kernel page tables. It can work in limited cases. But would you want to deploy such construct at scale? Probably not. > In this implementation the ITS is used to provide message-based > interrupts for our (potentially large set) of hardware based > platform device instances. Virtualization is not a consideration. > We don't have a SMMU. Interrupt isolation isn't a practical > consideration for this product. Because you have foreseen all use cases for this HW ahead of time, and can already tell how SW is going to make use of it? Oh well... > Propose adding a comment to the dts. > > + /* > + * Elba SoC implemented a pre-ITS that happened to > + * be the same implementation as synquacer. > + */ Which contains zero information. What you really want is: "We have decided to ignore the system architecture, good luck". M. -- Without deviation from the norm, progress is not possible.