Received: by 2002:ac0:8845:0:0:0:0:0 with SMTP id g63csp1384556img; Tue, 26 Feb 2019 21:05:38 -0800 (PST) X-Google-Smtp-Source: AHgI3IaQTQW5M1D2vHLrh+q3Zi3jiJ97hLSLPFJWOaZrJBgWrbU0OjXRzsWd964lpZ20Yo0NZMuY X-Received: by 2002:a62:39c5:: with SMTP id u66mr29500836pfj.245.1551243938302; Tue, 26 Feb 2019 21:05:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551243938; cv=none; d=google.com; s=arc-20160816; b=M2piabuIN+4Q5dveuHIDWfQ6TZ8RAo+gIO3ChRRwklgxYCwPQUg29Jwl0bhAcJs1go 9t+ucLvBbQFvQR+n19iSRkjSsmeacQXsIqfhnjLCpNs2Jgj8BRHaw2aISyQLXuHTrYHc 7/PvOv/L3W6TuVSBt4zS6zdDZbrKTY+KvNge8Gqhp4jWcnNvjUIn1hCOTXrl+YEso9XZ fqb9rw5p3KLNP+5yiNCyo5VrkaAVuU329x5HDF7SSK0tGaQrhb/0AyQDg172iPSpA2R1 D5/uTRl3I3G3qoakBpA2rURgsHRVi3iH6XnXghHEzLcDYMzg/cS1IfMsiQ++mA+Wf7X5 yfKw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:autocrypt:openpgp:from:references:cc:to:subject :dkim-signature; bh=y6MKlThRi7iocLXrinu5vt4XQ93V36AlWjL0gnRGdjg=; b=p5+hjD6VNyZUSX8GIZUqno4e390EQFCiQhRo84qeukr14Obx2VaYnVG42Ulb3i4NUL +049FYcARcLcWVKAs8culOAMx4wYrQJIfw/5VKnlF3/jwPSskPZsF6EBZl795U0WA7HM gIdMe2V6dkgHOC84jGTjJBuv1x6hOiVaUNO8gKLUGpiHSbWuZld2zpMYHrWW7DDV7CYs WyeDkV6uysui+6WX88btcfLqffY28IMLCb3hQb59naz+xp/fDBytYskPXxQhQeK/Z0aM I/XWhgA5f0subZ16rK+zQEadhnb0wzNYxetuxHYD126P6ukeGsr/Mp3vr6sawoUeSCxE QKAw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Lerh3YpV; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y8si13746729pfm.31.2019.02.26.21.05.23; Tue, 26 Feb 2019 21:05:38 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Lerh3YpV; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726069AbfB0FFB (ORCPT + 99 others); Wed, 27 Feb 2019 00:05:01 -0500 Received: from mail-pf1-f195.google.com ([209.85.210.195]:44684 "EHLO mail-pf1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725914AbfB0FFB (ORCPT ); Wed, 27 Feb 2019 00:05:01 -0500 Received: by mail-pf1-f195.google.com with SMTP id a3so7378572pff.11 for ; Tue, 26 Feb 2019 21:05:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:openpgp:autocrypt:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=y6MKlThRi7iocLXrinu5vt4XQ93V36AlWjL0gnRGdjg=; b=Lerh3YpVKS+TbKb7D5L+/YZkEV7c0elTvkZLzLswUS3OuddSSSALZt2OsuwEhP7mt1 0K2DXwHYJOARFOK/nYU69pTvk+S71YnyiW/rfx9LcD2LoNDgq412CZ95PJUveBn7q8cq 1B10F903IwKwYklQJu1wgtnce8TPFZOq1Hj7MXSAsnpRFzuEvW1h15icilKLlhKNQdJP RqSJNY3qUUsNFUcCgM//omJvAARDOmq28749F+rBbc9F8scRMgyyO1OCt4Q7Oj35FR9U 0mCwmCJ3L8Tazh23uT+Q+pOfy33TSA/+kQ8Rka/p20anRZSCkhv2LbwjoTDmnMSZTIAv ZAKw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:openpgp:autocrypt :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=y6MKlThRi7iocLXrinu5vt4XQ93V36AlWjL0gnRGdjg=; b=leGu2yxEtyOZnDMWN+SxYr/QVlcvAehA+V/S6TQysDzOALTWPLYqzfLdghdfS3FJnM rWI7h4dqsE7QAKaBiBq3iztzRWSggCq0hIxvak9U8mzegAk/lZnosXBhG1RJesak94LM tXh9JxvH3aDl8dVG7IRypI4Ah2CgwqZAxR1qJ4J5j0lAY181zHRRBuW1uWzy+eKgAkiX VeAmsyparr+ht/+I0oi63Jw7YwpzQ3Fu6uqgF90tyJHqWUOhEUGD8alYH7PChua/u+Ko CkwvqHneIq8wYn0Kyj3V7u7v42TtGnZIC3eEdeTM8eRlDHajcWqSUfIkV1C8eRIx8M81 A+Ww== X-Gm-Message-State: AHQUAuY/E2lViVdSdArrD6RJe8DvgRK3ppnwfY0uwENdPRPehlRl/9rH DKZrPKOyi8okX/2e2wsedgY= X-Received: by 2002:a65:5108:: with SMTP id f8mr1153951pgq.441.1551243900258; Tue, 26 Feb 2019 21:05:00 -0800 (PST) Received: from [10.230.1.150] ([192.19.228.250]) by smtp.gmail.com with ESMTPSA id h64sm28585378pfj.40.2019.02.26.21.04.56 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 26 Feb 2019 21:04:59 -0800 (PST) Subject: Re: [PATCH 2/2] drivers/misc: Add Aspeed P2A control driver To: Patrick Venture , arnd@arndb.de, gregkh@linuxfoundation.org, joel@jms.id.au, andrew@aj.id.au Cc: linux-aspeed@lists.ozlabs.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org References: <20190221222537.137331-1-venture@google.com> From: Florian Fainelli Openpgp: preference=signencrypt Autocrypt: addr=f.fainelli@gmail.com; keydata= mQENBFPAG8ABCAC3EO02urEwipgbUNJ1r6oI2Vr/+uE389lSEShN2PmL3MVnzhViSAtrYxeT M0Txqn1tOWoIc4QUl6Ggqf5KP6FoRkCrgMMTnUAINsINYXK+3OLe7HjP10h2jDRX4Ajs4Ghs JrZOBru6rH0YrgAhr6O5gG7NE1jhly+EsOa2MpwOiXO4DE/YKZGuVe6Bh87WqmILs9KvnNrQ PcycQnYKTVpqE95d4M824M5cuRB6D1GrYovCsjA9uxo22kPdOoQRAu5gBBn3AdtALFyQj9DQ KQuc39/i/Kt6XLZ/RsBc6qLs+p+JnEuPJngTSfWvzGjpx0nkwCMi4yBb+xk7Hki4kEslABEB AAG0KEZsb3JpYW4gRmFpbmVsbGkgPGZhaW5lbGxpQGJyb2FkY29tLmNvbT6JAccEEAECALEF AlPAG9YXCgABv0jL/n0t8VEFmtDa8j7qERo7AN0gFAAAAAAAFgABa2V5LXVzYWdlLW1hc2tA cGdwLmNvbY4wFIAAAAAAIAAHcHJlZmVycmVkLWVtYWlsLWVuY29kaW5nQHBncC5jb21wZ3Bt aW1lCAsJCAcDAgEKAhkBBReAAAAAGRhsZGFwOi8va2V5cy5icm9hZGNvbS5jb20FGwMAAAAD FgIBBR4BAAAABBUICQoACgkQgTG1xCm8ZqD+Dgf9HhhzqvJYIPomNeg+ll7/TbzWb871E+HQ Ta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XVDq+vO4QPmdC +SEACgkQgTG1xCm8ZqC6BwgAl3kRh7oozpjpG8jpO8en5CBtTl3G+OpKJK9qbQyzdCsuJ0K1 qe1wZPZbP/Y+VtmqSgnExBzjStt9drjFBK8liPQZalp2sMlS9S7csSy6cMLF1auZubAZEqpm tpXagbtgR12YOo57Reb83F5KhtwwiWdoTpXRTx/nM0cHtjjrImONhP8OzVMmjem/B68NY++/ qt0F5XTsP2zjd+tRLrFh3W4XEcLt1lhYmNmbJR/l6+vVbWAKDAtcbQ8SL2feqbPWV6VDyVKh ya/EEq0xtf84qEB+4/+IjCdOzDD3kDZJo+JBkDnU3LBXw4WCw3QhOXY+VnhOn2EcREN7qdAK w0j9Sw== Message-ID: <9ab3a0e6-fa1e-11c7-adad-7e14bfe28059@gmail.com> Date: Tue, 26 Feb 2019 21:04:52 -0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.5.1 MIME-Version: 1.0 In-Reply-To: <20190221222537.137331-1-venture@google.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2/21/2019 2:25 PM, Patrick Venture wrote: > The ASPEED AST2400, and AST2500 in some configurations include a > PCI-to-AHB MMIO bridge. This bridge allows a server to read and write > in the BMC's memory space. This feature is especially useful when using > this bridge to send large files to the BMC. > > The host may use this to send down a firmware image by staging data at a > specific memory address, and in a coordinated effort with the BMC's > software stack and kernel, transmit the bytes. > > This driver enables the BMC to unlock the PCI bridge on demand, and > configure it via ioctl to allow the host to write bytes to an agreed > upon location. In the primary use-case, the region to use is known > apriori on the BMC, and the host requests this information. Once this > request is received, the BMC's software stack will enable the bridge and > the region and then using some software flow control (possibly via IPMI > packets), copy the bytes down. Once the process is complete, the BMC > will disable the bridge and unset any region involved. > > The default behavior of this bridge when present is: enabled and all > regions marked read-write. This driver will fix the regions to be > read-only and then disable the bridge entirely. A complete drive by review, so I could be completely off here (most likely am), but have you considered using virtio and doing some sort of rudimentary features (regions here) negotiation over that interface? If I get your description right in premise maybe emulating the AHB side on the BMC as a PCI end-point device driver, and using it as a seemingly regular PCI EP from the host side with BARs and stuff might make sense here and be less of a security hole than it currently looks like. -- Florian