Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp3082617ybb; Mon, 6 Apr 2020 01:29:27 -0700 (PDT) X-Google-Smtp-Source: APiQypLsZQmiJ7WdAGCnD6Se1F2voI9SiTmLSjI0eDMxxhfD5gA0Mfwm/hi521BlTNFz5dbQAS9A X-Received: by 2002:a4a:8926:: with SMTP id f35mr16495821ooi.97.1586161767770; Mon, 06 Apr 2020 01:29:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586161767; cv=none; d=google.com; s=arc-20160816; b=Z3VsB/myGsFCS0MZSPlkHe8esMifyTPGepFJXDIRyXvn5AWhLtDMlA8OOD4rTk8Fpq gp1QTRQGT8QB1aVmQKNle//Hb3KGjWjMPk31eDFl0aqWmfeeJjvfBNfxwh+DWb7U+BeL nMY1mb9t+Z1gjmD9J5yIgMFpSMZtuWHKG4IGgxAahqiJt+YVBkK1+jYNhRZNytaGY6gq KoyQa8hpvkZ7DV8O212M2CU1d30mLcJKWxhO8U/LbkEeNSm7V92KhypC6e8x9Pnsb9EK QCNBFFHE7IN7MicVk6ObcO2JyiZMkbtzfWAWgFMGsIHH5V9uiXFp9d10bEgQDEJmq/Y+ CeUw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature:dkim-signature; bh=f9JBRr+XhbC+CvGSQhNRe2L/ERwIGY84ZpI4+IQemfM=; b=PaHCgrXOcBeOvsF8J8D/d/QMUribQFqAvUe1/NLkaWKwprWBS+B500b5pIFUMUn7Ki lCUwd6MYsmGbQVGjRahhtllnQRkGErjT6SVr/753bu302wPCJs8RTK00uzNqeH6ErKZK +4qIOYu+VN5IJ/cx/EeO1zLQt0xk5QpRCjEJYdQsX7rD7x9M5rBGQdKd0puCOjXcX9bw 2Ys5xt0wsagFzzrN/1vylzq5NoJbYcT9DsFCuFMRIMqngc9ik0e6QSGOLOslc+Xxz8i4 9CWvAxWyXtzkxGjYKDpePCb23pHZf061MWHkSrKCLDtziO8NsqZjVrMm54jgu+erYvbk lfQg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cerno.tech header.s=fm2 header.b=pIMXjGrj; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=Fyyi3KV3; 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=NONE dis=NONE) header.from=cerno.tech Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w79si7186919oif.21.2020.04.06.01.29.15; Mon, 06 Apr 2020 01:29:27 -0700 (PDT) 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=@cerno.tech header.s=fm2 header.b=pIMXjGrj; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=Fyyi3KV3; 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=NONE dis=NONE) header.from=cerno.tech Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726651AbgDFI1g (ORCPT + 99 others); Mon, 6 Apr 2020 04:27:36 -0400 Received: from new1-smtp.messagingengine.com ([66.111.4.221]:33203 "EHLO new1-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726514AbgDFI1g (ORCPT ); Mon, 6 Apr 2020 04:27:36 -0400 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailnew.nyi.internal (Postfix) with ESMTP id 273DE5800E5; Mon, 6 Apr 2020 04:27:35 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Mon, 06 Apr 2020 04:27:35 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cerno.tech; h= date:from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=fm2; bh=f9JBRr+XhbC+CvGSQhNRe2L/ERw IGY84ZpI4+IQemfM=; b=pIMXjGrj8l2gSjLhTowqJmg7cVKQfqQQNt7JH5RcSJm 525J+EbU3EjWe1RfHZKli13PSS+kuMRl5UmgyAJRLT04uiEAyCW992YS77jZJQlv +rKHmvMMkkGM323eZBDxE0i4KejgnvxwFTbtvOvn8eYeBx6Vt9roYtaYeFxuwwGR ntELBKF5gXG5ZFAPe9Xmh5NpT3VEX5qWzW4gHRUctnBFfq6EsvA7IzvLvKi5f6ft Th/J7u+AO8wvG7KJbt8VE2/IU7GPJ0KWU5ObV7oy6HqN6N4l/T2JuV5SjXCOZqVI I3aarBglXwIs3TCwi1S8a+0o+57zuOqHlrI8z++kiTw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=f9JBRr +XhbC+CvGSQhNRe2L/ERwIGY84ZpI4+IQemfM=; b=Fyyi3KV32nrPIy5vKGKxZS IPq6wIkkMSPOYi3wHBbzrFi4xMfDJAt/HL21FD4ZqqqX6Kp3SA+KCmXewcLFFhni wzcg+bdztWsQlxbLIa85taJokNN+PvZ2+Yv+aQZi202x7Krrdysg1/2TkwGR1Qxy dBF8NCoTdTClJP7bRojjClayTFD2NfEw+0NwRD6Xc4x4jWej7NLBkyVsBdq2GGL3 bLa4oLsOB5xpPkLlRybtCT5Q8TyFf2Ul+UbWSnrtg+o3+YeRgxPs0bMdt8juNDJJ DoUsKIC7NTC+1wQxL+qrq8gqgzCkUjvr/ikPXG5io3scq/dpdfq8NT0xNpN1I7Mw == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduhedrudefgddthecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpeffhffvuffkfhggtggujgesghdtreertddtvdenucfhrhhomhepofgrgihimhgv ucftihhprghrugcuoehmrgigihhmvgestggvrhhnohdrthgvtghhqeenucffohhmrghinh epghhithhhuhgsrdgtohhmpdgrrhhmsghirghnrdgtohhmnecukfhppeeltddrkeelrdei kedrjeeinecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomh epmhgrgihimhgvsegtvghrnhhordhtvggthh X-ME-Proxy: Received: from localhost (lfbn-tou-1-1502-76.w90-89.abo.wanadoo.fr [90.89.68.76]) by mail.messagingengine.com (Postfix) with ESMTPA id E8DB8328005D; Mon, 6 Apr 2020 04:27:33 -0400 (EDT) Date: Mon, 6 Apr 2020 10:27:32 +0200 From: Maxime Ripard To: Icenowy Zheng Cc: Lorenzo Pieralisi , Andrew Murray , Bjorn Helgaas , Chen-Yu Tsai , Rob Herring , linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, linux-sunxi@googlegroups.com Subject: Re: [RFC PATCH] PCI: dwc: add support for Allwinner SoCs' PCIe controller Message-ID: <20200406082732.nt5d7puwn65j4nvl@gilmour.lan> References: <20200402160549.296203-1-icenowy@aosc.io> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="bxu46sevqgfhv5v4" Content-Disposition: inline In-Reply-To: <20200402160549.296203-1-icenowy@aosc.io> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --bxu46sevqgfhv5v4 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hi, On Fri, Apr 03, 2020 at 12:05:49AM +0800, Icenowy Zheng wrote: > The Allwinner H6 SoC uses DesignWare's PCIe controller to provide a PCIe > host. > > However, on Allwinner H6, the PCIe host has bad MMIO, which needs to be > workarounded. A workaround with the EL2 hypervisor functionality of ARM > Cortex cores is now available, which wraps MMIO operations. > > This patch is going to add a driver for the DWC PCIe controller > available in Allwinner SoCs, either the H6 one when wrapped by the > hypervisor (so that the driver can consider it as an ordinary PCIe > controller) or further not buggy ones. > > Signed-off-by: Icenowy Zheng > --- > There's no device tree binding patch available, because I still have > questions on the device tree compatible string. I want to use it to > describe that this driver doesn't support the "native Allwinner H6 PCIe > controller", but a wrapped version with my hypervisor. > > I think supporting a "para-physical" device is some new thing, so this > patch is RFC. > > My hypervisor is at [1], and some basic usage documentation is at [2]. > > [1] https://github.com/Icenowy/aw-el2-barebone > [2] https://forum.armbian.com/topic/13529-a-try-on-utilizing-h6-pcie-with-virtualization/ I'm a bit concerned to throw yet another mandatory, difficult to update, component in the already quite long boot chain. Getting fixes deployed in ATF or U-Boot is already pretty long, having another component in there will just make it worse, and it's another hard to debug component that we throw into the mix. And this prevents any use of virtualisation on the platform. I haven't found an explanation on what that hypervisor is doing exactly, but from a look at it it seems that it will trap all the accesses to the PCIe memory region to emulate a regular space on top of the restricted one we have? If so, can't we do that from the kernel directly by using a memory region that always fault with a fault handler like Framebuffer's deferred_io is doing (drivers/video/fbdev/core/fb_defio.c) ? Maxime --bxu46sevqgfhv5v4 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYIAB0WIQRcEzekXsqa64kGDp7j7w1vZxhRxQUCXorn9AAKCRDj7w1vZxhR xdV6AP4y+CTh2KPAJf/qouRZrEmCvj19E23Xp9w67VLU9qZHBQD7BVzW6hD0E0oG LnBT9kYGbeef7keRU4XuDbLzxH3hzQc= =0eCj -----END PGP SIGNATURE----- --bxu46sevqgfhv5v4--