Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp503777pxu; Thu, 7 Jan 2021 10:17:56 -0800 (PST) X-Google-Smtp-Source: ABdhPJxe9xxrPh6rHXi/TF6Nc6NOicFkhCHmwwHQ9VLKhWldg7uBft06cHlWe2+L8Vo/3wi3Sd3Z X-Received: by 2002:a17:906:7fcf:: with SMTP id r15mr22460ejs.79.1610043476045; Thu, 07 Jan 2021 10:17:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610043476; cv=none; d=google.com; s=arc-20160816; b=Uci0GTD9j+N1eIuUEa/QPPIzBggM/wQ6jAqNkjch6yfP6NxyNgWKCPxqDFmWZxsUjq dKGxgciwkI0CyWUWpyZ6mem6x4B1ib91/klysEn4DkaVXbIepu8f26ndAuJ79XJpMyS6 9SKw/LbA/t0C/4CQD28pKLrhYmcjalaQF5Ui5QRPANgfQTis8u6adc023qP4npez05uH pRyEUn68Qfq98eq+QtdQnAruyPB2XO+IJhSJcTISh99YcRZToaR7Q0Rn2zzbglrKUals DrATowbWXK01QBHY92dFYfDsHBTnNF+q90pkF3n6zRZ0a7yBQNNpnpfv+mZhABKBNWZx WI+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=QY0c1j8LW9bvDnOGkGqSteqfhuI/tlTQDPKZk0YLY4Y=; b=UH0/N9lfqzaPf/X5O3NjJKNQKnvBjYEKl3C2A7w1Dv7MYLCa0LR+OP67RMWisEosVO Y44aIplt1+KfEXgScdyjJB1bUJ6P/TGK1K9S6fuBcNmYmgIqvzmgv71ltTg5wAB5FOFR eiSkJGholchk36VwI9g3UzVpd9o/RojYk4KDtRvxMxAH9jwTyhizPSRt2iQOCzqMJiNP 6KFwgglK7PFgUymhM3I/MkidD9S1wuchAPTVwKwqw3+v23fxjc+SO10goAPoK6AbfKS3 apCESoyXbyofVp9i0HBeHaUcoLoPLR9uYQQgbQNExkHyzzZER75Rtk+LKqlmbKl8a88W cYFg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Gy7+A3tQ; 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 l11si2647494ejx.27.2021.01.07.10.17.30; Thu, 07 Jan 2021 10:17:56 -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; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Gy7+A3tQ; 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 S1725835AbhAGSPD (ORCPT + 99 others); Thu, 7 Jan 2021 13:15:03 -0500 Received: from mail.kernel.org ([198.145.29.99]:35300 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726073AbhAGSPC (ORCPT ); Thu, 7 Jan 2021 13:15:02 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 6E3A723370; Thu, 7 Jan 2021 18:14:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1610043262; bh=/MSHsglIZApAzg6qbqUiSyTvVDKCfmIDw61iXbf+eFQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Gy7+A3tQLG/rL1UITFTM/OPgcLaxU5kxFTvdkt55Z852aRGwzDd6nHHm8v/LDjDYG C87mxApN9s3kSyhSWpUxeRlZBLQ+qHycoQ6I0UTqZRNMQr4xFD9VWLGF5buO/qCFzN /rtWCqvZ0xHf7YTwlSeZPKmrMwY8mD4FtG1YsFI/aQMSy6IoMbTgdEM6kDfkgPS9su nmSh3kbkqjA1mig6QwvjfkfLZ0VEIiXdw8AoUAXdcjUQ5xyqeZAm+JIB0wL0NLW5Un jdNC7cx1iOR3CZr4SPHXqvC2Y3ADLCEoU3095X5WnNfOxqyOQ0wBSDByha5/z2af7h OUDIzcCn2RXVA== Date: Thu, 7 Jan 2021 18:14:17 +0000 From: Will Deacon To: Jeremy Linton Cc: linux-arm-kernel@lists.infradead.org, linux-pci@vger.kernel.org, lorenzo.pieralisi@arm.com, bhelgaas@google.com, catalin.marinas@arm.com, robh@kernel.org, sudeep.holla@arm.com, mark.rutland@arm.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH] arm64: PCI: Enable SMC conduit Message-ID: <20210107181416.GA3536@willie-the-truck> References: <20210105045735.1709825-1-jeremy.linton@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210105045735.1709825-1-jeremy.linton@arm.com> User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jan 04, 2021 at 10:57:35PM -0600, Jeremy Linton wrote: > Given that most arm64 platform's PCI implementations needs quirks > to deal with problematic config accesses, this is a good place to > apply a firmware abstraction. The ARM PCI SMMCCC spec details a > standard SMC conduit designed to provide a simple PCI config > accessor. This specification enhances the existing ACPI/PCI > abstraction and expects power, config, etc functionality is handled > by the platform. It also is very explicit that the resulting config > space registers must behave as is specified by the pci specification. > > Lets hook the normal ACPI/PCI config path, and when we detect > missing MADT data, attempt to probe the SMC conduit. If the conduit > exists and responds for the requested segment number (provided by the > ACPI namespace) attach a custom pci_ecam_ops which redirects > all config read/write requests to the firmware. > > This patch is based on the Arm PCI Config space access document @ > https://developer.arm.com/documentation/den0115/latest Why does firmware need to be involved with this at all? Can't we just quirk Linux when these broken designs show up in production? We'll need to modify Linux _anyway_ when the firmware interface isn't implemented correctly... Will