From patchwork Fri Jul 17 00:16:14 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Andersson X-Patchwork-Id: 11668601 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 52AE7138C for ; Fri, 17 Jul 2020 00:18:11 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 29B8820787 for ; Fri, 17 Jul 2020 00:18:11 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="Cmob357e"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="BowF3PwO" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 29B8820787 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:To:From: Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender :Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=/dRSMhKmbqbc5o3Cq3wPLY1BnQKiXA6rafrrOG6xha4=; b=Cmob357etfd/a5kYzQSwUi5JdY WNFCCuOic7MjbbbMZQZohCBqoW+ilkkylUReBfMSI3bWLXe1CbLkgBC32XwWo3Obs1SmPouTn8YE1 C1M/T6wNK8kCKp8JFK2//WcOYNz1r2N5GsHQZfujrMM1kJgXJ9CQCh0PasYhBOE9pj6BQzsf3YxWa +IL1BhQVJqORWrcqCmLAvNZaHEGsEUjFSNvbSmRPvRhq7wH5F8fWA36w85DJ2EewxMWE0bA9q0WQN l3ark6mnWkspfoSgKgajNGByw/DaWg/XP/sVHY0jmhK9Hi8hnvq8JUfeGmbWogT8ZAdHYXFsE53Nt s265YBYQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jwE3B-0005bi-O2; Fri, 17 Jul 2020 00:16:29 +0000 Received: from mail-pf1-x443.google.com ([2607:f8b0:4864:20::443]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jwE37-0005ZV-H6 for linux-arm-kernel@lists.infradead.org; Fri, 17 Jul 2020 00:16:27 +0000 Received: by mail-pf1-x443.google.com with SMTP id a23so2902033pfk.13 for ; Thu, 16 Jul 2020 17:16:23 -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=Sl4GNsmArDLipzZLi4IQVk0TOodt16D37OUgWF5KbPo=; b=BowF3PwOju4VnW5jUNBztNr1QHxUEqy6HgjuXfuKh5dztvWW9CDzCYmzt53X4es9xV RlSOQ69RWaykSCNTQqfIuQTyahoqTJ1Qq+wjNd4t3mq49H33azZSu94Wo3tTp/EzNMSV Y7UAuPuqAEvl7l9bkXQPh6qsQiSrCiD4TjJykBMTSgncyJJM0WV9KQ+tzStfHur3Qed+ yW2tN0Ig6kRObfnuHsbUU6oHen8rYu7+FKCPneQuomx9XugKY1Jzu2LOxVUi+TupWX+z MIKZFc9U6nQIH+p0hDJ+v8GeWcFYgfr4eM2FCi1Loloh4liZ0bxGo7kKE1bkyL7CHWQ+ kJcQ== 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=Sl4GNsmArDLipzZLi4IQVk0TOodt16D37OUgWF5KbPo=; b=TEBFgPh40R6e5h8Nfh/OgrKq6IThSc08wQD6NFO3mkwgTa7rknP7tU8ErG/FrFgmws vXpp5qvbJ92cNM5j3jCwrks43A/6A6ab9Yry5LAsKvvjOhYxYlMkqY8gZM3ofuPRZaH3 mH/WZ0e9tJ9yl8JlcykB6VbfgabTYH3HFFAqqiZAUCYHiEbMtPaM3/Cf8s2SJgdvCZC6 U02R535WLFhAzQHyKEKIg/dsTzXLWZ2RxCt2VJbNDyuPucFk9yDBhggoYYM2Xc1HkXqD +YgOsCEDOky5dSRa0mhLVuxYvuPIeLCjy7t2R9Sdz4CzbrhM8ROZvX7hIZpVstHFJcQj tR6w== X-Gm-Message-State: AOAM530RKEKqWrQ/vHUR82UT22hHbITqFnz/AjOodp/HIcND/bYYxJ3k 0kC/QypQU1YuDxeNzz1cif/anQ== X-Google-Smtp-Source: ABdhPJyyEAViHTA6jZ1fWkKlx3Fq/q+F6yP4gOxKkTTTvDCGA+QkPdiuE8amuhBa7Q2HIfcbSX2LeA== X-Received: by 2002:a65:6089:: with SMTP id t9mr6633639pgu.236.1594944981548; Thu, 16 Jul 2020 17:16:21 -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 r7sm6211950pgu.51.2020.07.16.17.16.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Jul 2020 17:16:20 -0700 (PDT) From: Bjorn Andersson To: Will Deacon , Robin Murphy , Joerg Roedel , Thierry Reding , Laurentiu Tudor Subject: [PATCH v2 0/5] iommu/arm-smmu: Support maintaining bootloader mappings Date: Thu, 16 Jul 2020 17:16:14 -0700 Message-Id: <20200717001619.325317-1-bjorn.andersson@linaro.org> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200716_201625_856222_02684F5C X-CRM114-Status: GOOD ( 10.55 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:443 listed in] [list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arm-msm@vger.kernel.org, iommu@lists.linux-foundation.org, Jonathan Marek , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.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: Consistently initialize stream mappings iommu/arm-smmu: Setup identity domain for boot mappings drivers/iommu/arm-smmu-qcom.c | 48 +++++++++++++ drivers/iommu/arm-smmu.c | 123 +++++++++++++++++++++++++++++----- drivers/iommu/arm-smmu.h | 21 ++++++ 3 files changed, 174 insertions(+), 18 deletions(-)