From patchwork Fri Sep 29 13:09:13 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulrich Hecht X-Patchwork-Id: 9978063 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 82F316034B for ; Fri, 29 Sep 2017 13:22:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 70ACF283DA for ; Fri, 29 Sep 2017 13:22:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 65080297EE; Fri, 29 Sep 2017 13:22:46 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, DKIM_VALID, FREEMAIL_FROM, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 1A4DA283DA for ; Fri, 29 Sep 2017 13:22:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To: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:List-Owner; bh=AWe+wJu+pl8hVez02nOrkzP7oqD+EdoixkfFWp5rKkk=; b=amf/dQxGrVycNVfsDotYKhoL3j Lpe3EE6mJR1MSDEz7lE7aAS4bqEL2vvvC3jJd9ZmEc4YxmHRtHKkD2vHfdH5hXu1194xmM+c3xQdB Lz5gzI+fPT1zacQTy/13/M1d+tmsixN7DRCA6l6vvZKXBS/QuLAYXbRHHsYU63HYsjNrqt49+3EF2 hoWnG6fHd76fnmMEik7PAQ7JPug5l3gHgwInnrp+3uzcAieB/7bL/JNlJa5SX/eU+Clea5swU9rOc 5cUHmxxaPWUZev5SmhJt2gMi0GoCAy6B/FV9NNy3NRdCedAEPqVOLx2sGqH26Fex7ta76Unengagp hR+22WBA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1dxvFX-0006ye-TM; Fri, 29 Sep 2017 13:22:39 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1dxvFV-0006el-9j; Fri, 29 Sep 2017 13:22:37 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=References:In-Reply-To:Message-Id:Date: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=sz4LamPgKMWrOg13GG4pXpHmy1wiiaxP5wdQXnmVpaw=; b=t3k/JdNpN1+auTl/mfbkRkaWF lmJV0PDCnnNEoMh62VM22O5Eb+hYQHVbw/4ubIVYI9hWBmHVgbHg0CcU7c2iMkFxaVCovjGM8SBR5 QVzuSxwtHbTWDWeR+LXPesj7qjMhv0ITxx4GenK27EEcWO2m8dEDrSq7v+ZGYjKMlqtNuKlgGUfjD 0kEFf2qSn5O2kc3+2fETlHCnQQMA4VbPLhu7FJSS0cs9ap0QhoANT99xcIL9cVox66UKa/ucQ6C7S iP3GJ2N0WaXx5w/YmsHmLo7dH/SACPiHpkyvgulSnkLs015XmYdZTFasSq5Ka3seFYKCdGn5UFsmP QnIPRGibg==; Received: from mail-wr0-x243.google.com ([2a00:1450:400c:c0c::243]) by casper.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1dxv3a-0002EP-BZ; Fri, 29 Sep 2017 13:10:21 +0000 Received: by mail-wr0-x243.google.com with SMTP id k10so1245212wrk.3; Fri, 29 Sep 2017 06:09:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=sz4LamPgKMWrOg13GG4pXpHmy1wiiaxP5wdQXnmVpaw=; b=PZM12ARCZ8XpRSDrGEL5HKuU+h6v8XSyZtKc4V5WA2jVn1wwl0ss/Gb5jcc3z/typa 22IgFqspeVjud5VI9lxBG0KRDpxqodbf1mUHWWfZ4rrzyxkVnEM8tFcFPLRMD3XWuWRV edYZoFEp77+zm9J6A5oTOy0OinqoYeLK9jEX7NMZDaNQQXpcn0SPETmjNrLUBwtEdoC5 xf5fSxnYMdfc+sLCUsLxqQD+WkS69+mpRKPa6eHHwU5ohSp52njBjY1MkAPse0MpAbQr w07GI+021V/JakAmyMVJJYZub/fuYaWh+HKfp5i9qZKooL+0dvbUyhXTFJ4MGKxZeSDU 51Fg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=sz4LamPgKMWrOg13GG4pXpHmy1wiiaxP5wdQXnmVpaw=; b=m6jFcMcgux7ClU1m9sw+lc+I0JBzhxCGBcxp3zobj9N1Guv6Md7wx7ay+gSBDPZ2K4 Wa3YOemNel5B0BGVIqvmYd5MmuZUORvw3fi57EgbcPOEn6e8DhqmexCGbWjeXFtIxa7Y +ZtKke/OyORCVVNgWUJC4Mai7q9cqih4f9+uU6Up0Qo+IdeMlYMmaEYn75LEJeFpnyCP MvDe4YeRc9NW0zHCEqG82n27fqL+3UmEPG4kFhi65/5o4vpGL52Sq6q6ebBsm531Ig/q eUGAPx9a4y/cRqHXiz8/o3EjtgiMDsWFBizvzVB3uS8e9lpZmCODVrk1lx8IdNwogg4F JbRA== X-Gm-Message-State: AHPjjUj3797vO2qbqncH+Y9xWaAR48IVbYorLzbShDjnw7cfKbh03W/1 c/7YcWwSaIfZMNlz+H3NdQ== X-Google-Smtp-Source: AOwi7QCh0DMmlUDKP7Q9ht39Wpx7t1ND7jx3BG08yXpAg34aZCHOL/25HYMbe8JOpEyPiUNwTc0aDA== X-Received: by 10.223.198.130 with SMTP id j2mr8224323wrg.52.1506690596615; Fri, 29 Sep 2017 06:09:56 -0700 (PDT) Received: from groucho.site (ipbcc0ce42.dynamic.kabel-deutschland.de. [188.192.206.66]) by smtp.gmail.com with ESMTPSA id i8sm3423834wra.56.2017.09.29.06.09.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 29 Sep 2017 06:09:56 -0700 (PDT) From: Ulrich Hecht To: magnus.damm@gmail.com, laurent.pinchart@ideasonboard.com, jacopo@jmondi.org Subject: [RFC 11/11] hack: Revert "iommu/io-pgtable: Sanitise map/unmap addresses" Date: Fri, 29 Sep 2017 15:09:13 +0200 Message-Id: <1506690553-27357-12-git-send-email-ulrich.hecht+renesas@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1506690553-27357-1-git-send-email-ulrich.hecht+renesas@gmail.com> References: <1506690553-27357-1-git-send-email-ulrich.hecht+renesas@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170929_141018_450107_09A7DC86 X-CRM114-Status: UNSURE ( 9.02 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Ulrich Hecht , linux-mediatek@lists.infradead.org, dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP This check breaks DRM initialization on Acer Chromebook R13, paddr is above 4GB. Haven't looked into this yet. This reverts commit 76557391433c77d330cede1a531b358d2f90df66. Signed-off-by: Ulrich Hecht --- drivers/iommu/io-pgtable-arm-v7s.c | 6 ------ drivers/iommu/io-pgtable-arm.c | 7 ------- 2 files changed, 13 deletions(-) diff --git a/drivers/iommu/io-pgtable-arm-v7s.c b/drivers/iommu/io-pgtable-arm-v7s.c index d665d0d..af330f5 100644 --- a/drivers/iommu/io-pgtable-arm-v7s.c +++ b/drivers/iommu/io-pgtable-arm-v7s.c @@ -479,9 +479,6 @@ static int arm_v7s_map(struct io_pgtable_ops *ops, unsigned long iova, if (!(prot & (IOMMU_READ | IOMMU_WRITE))) return 0; - if (WARN_ON(upper_32_bits(iova) || upper_32_bits(paddr))) - return -ERANGE; - ret = __arm_v7s_map(data, iova, paddr, size, prot, 1, data->pgd); /* * Synchronise all PTE updates for the new mapping before there's @@ -662,9 +659,6 @@ static int arm_v7s_unmap(struct io_pgtable_ops *ops, unsigned long iova, struct arm_v7s_io_pgtable *data = io_pgtable_ops_to_data(ops); size_t unmapped; - if (WARN_ON(upper_32_bits(iova))) - return 0; - unmapped = __arm_v7s_unmap(data, iova, size, 1, data->pgd); if (unmapped) io_pgtable_tlb_sync(&data->iop); diff --git a/drivers/iommu/io-pgtable-arm.c b/drivers/iommu/io-pgtable-arm.c index e8018a3..b182039 100644 --- a/drivers/iommu/io-pgtable-arm.c +++ b/drivers/iommu/io-pgtable-arm.c @@ -452,10 +452,6 @@ static int arm_lpae_map(struct io_pgtable_ops *ops, unsigned long iova, if (!(iommu_prot & (IOMMU_READ | IOMMU_WRITE))) return 0; - if (WARN_ON(iova >= (1ULL << data->iop.cfg.ias) || - paddr >= (1ULL << data->iop.cfg.oas))) - return -ERANGE; - prot = arm_lpae_prot_to_pte(data, iommu_prot); ret = __arm_lpae_map(data, iova, paddr, size, prot, lvl, ptep); /* @@ -614,9 +610,6 @@ static int arm_lpae_unmap(struct io_pgtable_ops *ops, unsigned long iova, arm_lpae_iopte *ptep = data->pgd; int lvl = ARM_LPAE_START_LVL(data); - if (WARN_ON(iova >= (1ULL << data->iop.cfg.ias))) - return 0; - unmapped = __arm_lpae_unmap(data, iova, size, lvl, ptep); if (unmapped) io_pgtable_tlb_sync(&data->iop);