From patchwork Sat Sep 26 12:59:56 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AngeloGioacchino Del Regno X-Patchwork-Id: 11801381 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 7573D16BC for ; Sat, 26 Sep 2020 13:00:43 +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 382D822204 for ; Sat, 26 Sep 2020 13:00:43 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="xnzEV/vM"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="YEFZLk3c" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 382D822204 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com 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=1ehAASM2LhO9sgnMvn4SiEQjTD1AsBfJKyB9l2LPELM=; b=xnzEV/vMlOfKfreBo/QIr6JLnR mHQkfmXTxQ8VujtedS0/t6FlS4rqY0sjq/aI3IiABkjWgmWomZQ/IAGpJJYfHIjiOJ2yuRo5BbFtJ s5qYucJ4LxBveA6/r8YcYBoun6M2iHlllulBaFi/4SthgcdQxBBW1uk2807Ck76yG7kCj//7Dkui2 Teg1zyBmkOn1p4+HerVFNShXYwiqj2+iPTpmFdfO/AFj4QQrXfnOmv4e3tNVNol/2vqagYyoqnGdY WoVPABNW+m8Si6xviOsEKcF/yCfnwNcUIcDpnAK2aQ89IOZSlP6OYr1I+kXbg0/tgJZBSkNKzNn3V M84406Ew==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kM9oM-0008Pz-At; Sat, 26 Sep 2020 13:00:22 +0000 Received: from mail-wr1-x441.google.com ([2a00:1450:4864:20::441]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kM9oD-0008L0-4H for linux-arm-kernel@lists.infradead.org; Sat, 26 Sep 2020 13:00:15 +0000 Received: by mail-wr1-x441.google.com with SMTP id t10so6907911wrv.1 for ; Sat, 26 Sep 2020 06:00:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=PAcoT4e7//N0L9a2DDThzgnZpyqBXzsg7G0B+Oty6tc=; b=YEFZLk3cJa28x/a0LzCSWhYC+2UQHeOq5V07AWVziptgbTzNHTFXbNJujyKUitFRQw tMUnEn6ro0Z5D7Vl1PBzFlrs34BSqmhXVpdh1AgXNV4WYlXjXtHE3lDeovrqhMF9J9sx sUn83NtWSG56E4dG41BaWRujxLWSG2vYCpnVzi/axvbCaA8SqGMiZDgL2FZCEQFaRq6t guKkcbrJC0Fryy3ifKpb5TZjW/TaP4Irb3HAhiZXqVXxX8KYdM3ZSVR2qTRBygRW1UcS qMxGwADOtTHsIDZCIB9vkk16glPQmPJSa1iMbQEaXr7faabgHDwHrBqu/gBN61GVFJ1P O9jQ== 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=PAcoT4e7//N0L9a2DDThzgnZpyqBXzsg7G0B+Oty6tc=; b=J0CWb0yHjPn6SMZp858VqfbD9XMklUyp0uU4DN2qFIEU2EsW3fSvZU0qbbp2+IckzL 67fANEruE8ftzicGFmt0RCfzUchjYbQZXLInlAhw5wXYj89PZDjje5Y6kksozVj1jhmk 0UGQh9kas/jV+E/2FAV0r8rGX76T5FOmpd0+NowbfbN68VuUglrqN6R6e/LQQJCDTqOf 15fm/pkbLk14PlurHOio8exCn9MNbV19vWP0bD21kAQcapMcYneSdBCOy8bDs6Zz1Pcv yFO5HbGTHZHSYD6udQM/YaQmkDIU6RJXX8UwQtJOJDnIjBHGf0gvs77riQrjBBX0Hzj5 PqRQ== X-Gm-Message-State: AOAM531vcVYMndzx68syxZRf7qMmlznbkJd3kfC1kGGLcRuR+dYYO7MT TRJX7pT0aEwCaSxLb8ZD7TY= X-Google-Smtp-Source: ABdhPJxOT7l7/Elc5zO2CHh/l9y3x4rzuvfL4itTCERHNUCo2rwzkXL7LybRxm2uIWBRmBxy51M64A== X-Received: by 2002:a5d:4388:: with SMTP id i8mr9349083wrq.365.1601125208258; Sat, 26 Sep 2020 06:00:08 -0700 (PDT) Received: from IcarusMOD.eternityproject.eu ([2.237.20.237]) by smtp.gmail.com with ESMTPSA id b11sm6462896wrt.38.2020.09.26.06.00.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 26 Sep 2020 06:00:07 -0700 (PDT) From: kholk11@gmail.com To: will@kernel.org Subject: [PATCH 0/8] Implement firmware quirks for Qualcomm ARM-SMMUv2 Date: Sat, 26 Sep 2020 14:59:56 +0200 Message-Id: <20200926130004.13528-1-kholk11@gmail.com> X-Mailer: git-send-email 2.28.0 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200926_090013_263442_D85A02AC X-CRM114-Status: GOOD ( 13.18 ) X-Spam-Score: 0.1 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (0.1 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:441 listed in] [list.dnswl.org] 0.2 FREEMAIL_ENVFROM_END_DIGIT Envelope-from freemail username ends in digit [kholk11[at]gmail.com] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [kholk11[at]gmail.com] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 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 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: devicetree@vger.kernel.org, marijns95@gmail.com, phone-devel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, joro@8bytes.org, konradybcio@gmail.com, bjorn.andersson@linaro.org, martin.botka1@gmail.com, kholk11@gmail.com, robin.murphy@arm.com, 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 From: AngeloGioacchino Del Regno In this patch series, I'm implementing some quirks for firmware issues happening on various Qualcomm SoCs, including SDM630, SDM636, SDM660, their SDA variants and, most probably, other MSM/APQs. In the specific case of the 630/660 family of SoCs, failing to apply all of these quirks means complete havoc when enabling the IOMMUs, as the firmware that is running on (almost?) all of the commercial boards (smartphones) is set to give us a "nice" hypervisor fault, resulting in either a system hang or a reboot. The actual implementation of these quirks in downstream kernels is done through reading some DT property and varying code paths, while here it's done through the implementation details for ARM-SMMU instead. In short, the quirks that are proposed in this patch series are the ones relative to the following downstream properties: - qcom,use-3-lvl-tables (39-bit VA size) - qcom,skip-init (avoid stream mapping reset for secure CBs) - qcom,no-smr-check (manually set correct streamid/smr masks) This patch series has been tested on the following devices: - Sony Xperia XA2 Ultra (SDM630 Nile Discovery) - Sony Xperia 10 (SDM630 Ganges Kirin) - Sony Xperia 10 Plus (SDM636 Ganges Mermaid) AngeloGioacchino Del Regno (8): iommu/arm-smmu-qcom: Rename qcom_smmu_impl to qcom_smmu500_impl iommu/arm-smmu-qcom: Add QC SMMUv2 VA Size quirk for SDM660 dt-bindings: arm-smmu: add binding for SMMUv2 on Qualcomm SDM660 iommu/arm-smmu: Support test_smr_masks implementation detail deviation iommu/arm-smmu-qcom: Add test_smr_masks detail to QCOM SMMUv2 iommu/arm-smmu: Move stream mapping reset to separate function iommu/arm-smmu: Support stream_mapping_reset implementation detail iommu/arm-smmu-qcom: Add stream_mapping_reset detail to QCOM SMMUv2 .../devicetree/bindings/iommu/arm,smmu.yaml | 1 + drivers/iommu/arm/arm-smmu/arm-smmu-impl.c | 3 +- drivers/iommu/arm/arm-smmu/arm-smmu-qcom.c | 59 ++++++++++++++++++- drivers/iommu/arm/arm-smmu/arm-smmu.c | 28 +++++++-- drivers/iommu/arm/arm-smmu/arm-smmu.h | 2 + 5 files changed, 85 insertions(+), 8 deletions(-)