Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp1115900ybt; Wed, 8 Jul 2020 22:02:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwngjABUytRatFt1K6pj+B82Hsr8StVWmMqlu0yH2j0wTb6B0Tt9HPwmGXIgUSerukcuMOJ X-Received: by 2002:a17:906:511:: with SMTP id j17mr53053517eja.434.1594270930777; Wed, 08 Jul 2020 22:02:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594270930; cv=none; d=google.com; s=arc-20160816; b=aE6HTmv2XDp8zlm3b3dC2uCackK4vsI7xykTiZLRusyybAUnSNtubu3+pTEbSbkpCj WMhFEAq3/Yza7IeJUpuZi8yGN1eYjdLqwY0CzuSQmiaa3gQiJzy35tOtgjFRQKZdNjFj /F8/fBH6vAMuvyFLGj8g/vTiX0bsgjaOIU5jHOfYXWt5Nr/h0P7yW0o+ZTpBaitC3YuA Y3YTbRy5TPMxR+dMCEz7JwT/i9TIbyth//hAVQL9xNTEL71V1i99M/xVLVj3//wcIJ81 EF70Qv+Koepmj0cY+JIzSLX+wu4XUh2WKiXy0lc6zw+9XJbq+VFNoABbWR46JHgq/Wmb gQcw== 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:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=uN2T4CF/tRygg+rOfQBDGtucvrJg7l2si9rKgMZR/j0=; b=VCt9F1fhni6qmjx7B4yxApLU6EBDsneDoqKW/WChBoADDJyQRDmfN1ElIk4wUORwn+ 9RVndEPINr7kUOkloZxn4IRslThMwMidBqzlxIO6TidX0icyOUooQiLzKT08F1gJlyEG htV2Tw3viz3jVXta9Uz4mr1sel3/lSlt12jW0973fV6lSigiqC/GMvE4QeoQ4CRM61mv o6CJ7lFLD174VhgRKigpCmiPhGI6GK87CuPDaX2N7PdTY4gHDdj04T/ghEXH2yOr8LyP gEYGiwQzxr7mmzwXEMYF/63wkeyYW60tSSe3dFCZfGmqBfT8AV5qKsvVn0aVj/uAh4hr o+eQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=BXPSxo5V; 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=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bu5si1400446edb.553.2020.07.08.22.01.47; Wed, 08 Jul 2020 22:02:10 -0700 (PDT) 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=@linaro.org header.s=google header.b=BXPSxo5V; 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=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726099AbgGIFBn (ORCPT + 99 others); Thu, 9 Jul 2020 01:01:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43728 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726064AbgGIFBl (ORCPT ); Thu, 9 Jul 2020 01:01:41 -0400 Received: from mail-pg1-x542.google.com (mail-pg1-x542.google.com [IPv6:2607:f8b0:4864:20::542]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E4F0BC061A0B for ; Wed, 8 Jul 2020 22:01:40 -0700 (PDT) Received: by mail-pg1-x542.google.com with SMTP id z5so446360pgb.6 for ; Wed, 08 Jul 2020 22:01:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=uN2T4CF/tRygg+rOfQBDGtucvrJg7l2si9rKgMZR/j0=; b=BXPSxo5VbjQ5clTT5R39r8mnuahuMmSnFAX8dVZrldk0UdIVgqWclLWUaFgB9EEvGs 5iz3KpwAkAgn90jBHAhrbXixnEOIEYtjcRThFOHPaMP1iW7G5A9VtiBNmc4MAkl+PePn X8Qxrz9Owin3O+N62O6MOn8S4A+iGJ6Wxb9sX2WIiLAY51C87Q29o3eXidoSP6ooqh+D qS6uu3fHwmtVABvqz/lvBdCP/QxOAANNR/YrgTRHreSoizLsqM/gfFPjeLgGJoCsorW3 bcPBMKwdryQ+Fp3uaE4IZn7ZWggNMNBSXgKfxkkYCqUvqDoX7YBNX084BbbLThuTS7Ou LIZg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=uN2T4CF/tRygg+rOfQBDGtucvrJg7l2si9rKgMZR/j0=; b=etM0z3+yUcvME8/GGjISymArIv0VRhyPyeB+MzRRGKg8k4XV52BA9hhoIRqoxW8ShV S+bIYiZfSO+c3ZCVS9APGoYIszUM176S/ikZmEAC2rrfS82yMURyEEbEBUW2Xg3Xs9EA yKBDa6k9N0HwSEizPcGuUyHh2wCK6Rq7i70I+XJjbAO/6e+Inu1eWoGSnuOefVJonilh I6Do3sQm1cXm4oZWXq5FkgVt24TubNMfoKISLE6GhtK3kDTRgf662xfJfht/io2R77kb 5SUwndeKjTMCkFU+Iranrvkt1+aWkuHDCY9HROQ9KQYNoEBqEyZwasdsW3PW0S3vGMH3 VeVQ== X-Gm-Message-State: AOAM533MvQOaAAU557+Wy0ClUWQP6x8zMaLnhukO9kOGA58WrO7eT40b lxtPfPlp65CrZX8QKVl95HTPxQ== X-Received: by 2002:a62:346:: with SMTP id 67mr14522608pfd.111.1594270900163; Wed, 08 Jul 2020 22:01:40 -0700 (PDT) Received: from localhost.localdomain (104-188-17-28.lightspeed.sndgca.sbcglobal.net. [104.188.17.28]) by smtp.gmail.com with ESMTPSA id h15sm999974pjc.14.2020.07.08.22.01.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Jul 2020 22:01:39 -0700 (PDT) From: Bjorn Andersson To: Will Deacon , Robin Murphy , Joerg Roedel , Thierry Reding , Laurentiu Tudor Cc: linux-arm-kernel@lists.infradead.org, iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org, Jonathan Marek , linux-arm-msm@vger.kernel.org Subject: [PATCH 0/5] iommu/arm-smmu: Support maintaining bootloader mappings Date: Wed, 8 Jul 2020 22:01:40 -0700 Message-Id: <20200709050145.3520931-1-bjorn.andersson@linaro.org> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Based on previous attempts and discussions this is the latest attempt at inheriting stream mappings set up by the bootloader, for e.g. boot splash or efifb. The first patch is an implementation of Robin's suggestion that we should just mark the relevant stream mappings as BYPASS. Relying on something else to set up the stream mappings wanted - e.g. by reading it back in platform specific implementation code. The series then tackles the problem seen in most versions of Qualcomm firmware, that the hypervisor intercepts BYPASS writes and turn them into FAULTs. It does this by allocating context banks for identity domains as well, with translation disabled. Lastly it amends the stream mapping initialization code to allocate a specific identity domain that is used for any mappings inherited from the bootloader, if above Qualcomm quirk is required. The series has been tested and shown to allow booting SDM845, SDM850, SM8150, SM8250 with boot splash screen setup by the bootloader. Specifically it also allows the Lenovo Yoga C630 to boot with SMMU and efifb enabled. Bjorn Andersson (5): iommu/arm-smmu: Make all valid stream mappings BYPASS iommu/arm-smmu: Emulate bypass by using context banks iommu/arm-smmu: Move SMR and S2CR definitions to header file iommu/arm-smmu-qcom: Consstently initialize stream mappings iommu/arm-smmu: Setup identity domain for boot mappings drivers/iommu/arm-smmu-qcom.c | 48 +++++++++++++ drivers/iommu/arm-smmu.c | 124 +++++++++++++++++++++++++++++----- drivers/iommu/arm-smmu.h | 21 ++++++ 3 files changed, 175 insertions(+), 18 deletions(-) -- 2.26.2