Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp475422img; Wed, 20 Mar 2019 04:46:32 -0700 (PDT) X-Google-Smtp-Source: APXvYqwUQSJvX0sJjadcRNarcEQH9KqZUHQbAis8pnvYTiu9QKOTlVpDZeINsZBtV8Z7g+2yyAmN X-Received: by 2002:a63:f544:: with SMTP id e4mr7000240pgk.145.1553082392034; Wed, 20 Mar 2019 04:46:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553082392; cv=none; d=google.com; s=arc-20160816; b=pCZbnbO/0D2PA4S973FBuQXH5CkAStR5hlGZXP/re2GAEivXYJuE/N6d+iK7l/otaW 8UEMJxe8sGInQ68pWVueZESEYmiWb41AxMpHt/V0kEK8ACCTLyiWXIWNwkpritdSi0EX 0s5nAHvx3qa5hKS0ifQAntw+wnjpGueUAa1+gKIAuQw/E5+3s6yJxzGYlT7dVTQXukaA wGMVYVR6rGBxdCLO9c4tRAltQ+91dUOizFuOK7vUH7wG6RxE9g6qKXjyd8CL9aNuLlZE 5izBrjc/NqPPK/ok40zjuc/zaAMFtinAsMfbkffGoPqeDEMx4bst2ZeZIi5/JSbD0/+K UyNA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=Pb9BBWRMDf0NMbm5WI5qoWMAvnwsvdVTg76HNYPXrdE=; b=VON+fWvl5eeAZjWiK3fXgvhvPQgUJsoQoWQ7cNLJKLjmo+W/ETOh5guv/2NwoYqK+6 sRQePWQMB7M9euv7GaLMrIJmjtH80YcqH2HcJ70d96BKvUcCtPCJMhxOfbfTIE8jAe/8 f7haABv49UevM3LJwwB94K9tvs5aLoEy/9bUagRmov7WqtKj3ELcuBscgtPBoX0YSeaD eamG99Uf33cBKPwEonBuZJGH9XidJMmdA6BQuY9JG/h+pebB7P/qo9Stnd5yL6Hk3I0k XQU5gkaJfsSsKh7lc1mVZA9SAbLoqt4gWI6uNAqutlTpeqoyRjY9QUX/MeibVAG00hPe CbPw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=zAQFlvTY; 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=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b38si777033pgb.107.2019.03.20.04.46.16; Wed, 20 Mar 2019 04:46:32 -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=@linaro.org header.s=google header.b=zAQFlvTY; 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=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727933AbfCTLo6 (ORCPT + 99 others); Wed, 20 Mar 2019 07:44:58 -0400 Received: from mail-oi1-f196.google.com ([209.85.167.196]:40567 "EHLO mail-oi1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727653AbfCTLo5 (ORCPT ); Wed, 20 Mar 2019 07:44:57 -0400 Received: by mail-oi1-f196.google.com with SMTP id 3so866556oir.7 for ; Wed, 20 Mar 2019 04:44:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=Pb9BBWRMDf0NMbm5WI5qoWMAvnwsvdVTg76HNYPXrdE=; b=zAQFlvTYOBHLpoCFXuN78FGCf2O/JqnuWJS6zP/rwWDolySAwreRWu6MhuCKZqo2gN a5eQWd42hyW1hCn1SEYG1FyJKvTKyIEGleRIWNSGFaFJfdXafI4RU3bqKsh5kIUHPGnW IhobsAfnCiPkwpJwZQk3+QyNXbX1OKPKW9YWiTZ9LCQZiWug1vBZN2reIZS/I0deZmUk JjzKGoQwJofSD8OAvOrHeQ3Q9Y657QqOBa66Zkru9rArlPZYCVGmX4ZJdFA+UNUkE+K+ pbqiy/IsOJdQb+HnfB/Iu1GuAGanGaLVE043OZEMccDQRxqPZYVFi4M9tle4MnI18RCE JStg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=Pb9BBWRMDf0NMbm5WI5qoWMAvnwsvdVTg76HNYPXrdE=; b=gXPpO99W22p42REoE9MvKpuO9LJGvd6uQDKfDtsHqWP1u/gSj0CrGG4U463D9ee4WW RUclU/1Xk3A47twf44Qw9vA6EFF5CEtDNQty0w1LpF2dXWl1FdgtCrNc++bSV/4MlMIU 22QstOp9AE2AJOv0RdQFXyxOPd15zgV1bTKmIHeHuHQerPVhNBqFZVME5mcBkWA/mKRy k3E0rbBVGrqxCmWdp6HUaOCudeN3ah6X0MLFtheG180EIjd+a/DtimHN2OleU1nnKpuU UZKEeqAAVRHwm+Z9+rJSuMXiarW48NFBHaXVMqgOApJCgVJZHP02rWIDdiU/ZC2Oe2SQ sBLw== X-Gm-Message-State: APjAAAWa3Maq4xwT6+9Qyp3ZZT38HSq+cA5cg94VVANtPRWwUKgXBNTZ X9q+bEnpaKBleZfZKjBz0zRfPA== X-Received: by 2002:aca:e84c:: with SMTP id f73mr4980047oih.163.1553082296914; Wed, 20 Mar 2019 04:44:56 -0700 (PDT) Received: from leoy-ThinkPad-X240s (li808-42.members.linode.com. [104.237.132.42]) by smtp.gmail.com with ESMTPSA id a14sm706759otl.46.2019.03.20.04.44.53 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 20 Mar 2019 04:44:55 -0700 (PDT) Date: Wed, 20 Mar 2019 19:44:50 +0800 From: Leo Yan To: Robin Murphy Cc: Liviu Dudau , Sudeep Holla , Lorenzo Pieralisi , Rob Herring , Mark Rutland , linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] arm64: dts: juno: Enable smmu_pcie for Juno r1/r2 Message-ID: <20190320114450.GB17539@leoy-ThinkPad-X240s> References: <20190320083105.8954-1-leo.yan@linaro.org> <2566ce76-a8b2-c8ac-9f3f-4b99101f7661@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2566ce76-a8b2-c8ac-9f3f-4b99101f7661@arm.com> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Robin, On Wed, Mar 20, 2019 at 11:24:18AM +0000, Robin Murphy wrote: > Hi Leo, > > On 20/03/2019 08:31, Leo Yan wrote: > > Though PCIe controller has been enabled on Juno r1/r2, but it misses to > > enable its connected SMMU. From the testing, even without set this SMMU > > status property to 'okay', the PCIe NIC device still works well. Since > > the SMMU is not enabled in DT binding and its iommu_groups is not > > created properly, finally this prevents to enable vfio-pci for NIC > > device with KVM. > > FWIW, whilst it might appear to be fine, there are still potential issues > once the DMA API sees this SMMU and starts using it, which is why this > particular change remains as one of my oldest local hacks that I've never > yet considered upstreamable. > > The IOMMU DMA ops happen to work for light usage now as a side-effect of > 122fac030e912 combined with the current top-down allocation behaviour, but > as soon as IOVA usage/fragmentation leads to 32-bit DMA addresses below > 0x8000000, or full 40-bit addresses, being allocated then data loss and > other problems will happen (for the reasons explained on the other thread). > Similarly, it's also going to be fragile to any internal changes in the IOVA > allocator. > > Until we have a decent solution for handling such 'windowed' DMA > restrictions (there do exist other systems with similar behaviour) I'd be > very wary of enabling the PCIe SMMU for all users who may not be aware of > the caveats. Given that the lack of stream IDs and SR-IOV support prevents > Juno from being a realistic virtualisation platform anyway, I'm not > convinced there's enough benefit to justify the risk. Ah, I didn't connect the 'windowde' DMA restriction with the IOMMU property setting in dt, which actually is deliberate. Please drop this patch and will leave it to you. Thanks a lot for related info. [...] Thanks, Leo Yan