From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5FE79C432BE for ; Thu, 26 Aug 2021 18:44:36 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 2610260F44 for ; Thu, 26 Aug 2021 18:44:36 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 2610260F44 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linux-foundation.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:Subject:Message-ID:Date:From: In-Reply-To:References:MIME-Version:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=/6TDgLwzU4DWyhfDkb4rTM1tTdOFn9xwItXR1ETu2mk=; b=iOv6Q20msGFYS6 CYJyMb+60XUHs+nzExJkyMIqj9QdcVRkCjLKxLOYjhrwDh59c2iPrhdIb9+npExqgI/B3MervxBRw 4biyUdKL0t7Ms+um5j5tN1mqTgQ5jja8TvVq+dT+DEl4iYxu4uUbZEIDU87uaYUgAXJgG3GArryfL dc1NHcuqyZjZqSt9/kvJK+Zq3c0THr+/QUlJYGiRNaQCxBBMWQONMb8uN0EWxhbYews42WpeQVQ4X gxnhr6Jal11dF4PQpRiZKS/myHguNvRA8Ptm+g1ZaRiFfvhNn/DoOE/6P/cvFpe3htrTDPdRnZPZl sgJVSaYcwBg3qzh/jNqQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mJKK9-00AkfT-3h; Thu, 26 Aug 2021 18:42:01 +0000 Received: from mail-lj1-x229.google.com ([2a00:1450:4864:20::229]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mJKK3-00Akes-83 for linux-arm-kernel@lists.infradead.org; Thu, 26 Aug 2021 18:41:59 +0000 Received: by mail-lj1-x229.google.com with SMTP id s12so6973265ljg.0 for ; Thu, 26 Aug 2021 11:41:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=WSi2CT3/EAuJ8jcPqCdGVYqPPf28RMrJEFE8J6fYp1k=; b=QnVjVhg8NS9rsFJf38THsE2c+locc1ye7QZAehoJy4p1/TL67fZfBLPuBZsjP8d73w 4RxIO/ZauUUZRulREfT1TdnBshTxlViODZwLcPA9JX/rZnznm88zub8yU7JtNy+5jSDg nW9ECnoBI1ZiLfFXBT24mKJt3jAuHiJK10gBI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=WSi2CT3/EAuJ8jcPqCdGVYqPPf28RMrJEFE8J6fYp1k=; b=o76yAcXkMumINxuKbeGlZ3khy4NSu1lwqQMHuCPrJrAZ8PmJZHo03r6muDzZBhDk23 88AD/nFLoXwEWHx5dhfTiJJCpP8btwIXkTvxfgfBJDp+Pwicq5hyQyOCmxhHunnn9xXH RsSkgjKSu9yyivLx1MUICuvlLBDTIS3+HO6lSduOjkdrzSTMtNmEASJGcBua4CuB9O0/ ypWdq4uspb+gmLHZBaUznGE3CJDdWHjKiAkqHvJ7i67ckWCp+5f7VL1iHfUBtc/N41FW JmwlSvlzXQBXj6HTpR9xCpsy7jFVy6q6N0BQn5x3rqapRAydlSD4OSTGK4/hcrrtPaWB KJQA== X-Gm-Message-State: AOAM5326xVa2piLSquI1c3eLPziVkSTwq9DzOCZrf80L62y5P30Mx0g9 0uBfoUrXviQOMRUUMsDzjfO4fVcZ0jRJqzEl X-Google-Smtp-Source: ABdhPJwki3sANwz49cZ0dq3UxDFJFyA0CMRRrlDUk0PvH7AahK7OtoZK/LdaDiwt80WxiIX3hT8I/w== X-Received: by 2002:a2e:22c1:: with SMTP id i184mr4308921lji.89.1630003312089; Thu, 26 Aug 2021 11:41:52 -0700 (PDT) Received: from mail-lf1-f49.google.com (mail-lf1-f49.google.com. [209.85.167.49]) by smtp.gmail.com with ESMTPSA id p3sm379441lfa.228.2021.08.26.11.41.50 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 26 Aug 2021 11:41:50 -0700 (PDT) Received: by mail-lf1-f49.google.com with SMTP id g13so8827976lfj.12 for ; Thu, 26 Aug 2021 11:41:50 -0700 (PDT) X-Received: by 2002:a05:6512:2091:: with SMTP id t17mr3780432lfr.253.1630003309915; Thu, 26 Aug 2021 11:41:49 -0700 (PDT) MIME-Version: 1.0 References: <20210826131747.GE26318@willie-the-truck> In-Reply-To: <20210826131747.GE26318@willie-the-truck> From: Linus Torvalds Date: Thu, 26 Aug 2021 11:41:34 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [GIT PULL] arm64 fix for 5.14 To: Will Deacon , Christoph Hellwig Cc: Catalin Marinas , Linux ARM , Linux Kernel Mailing List , Android Kernel Team X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210826_114155_337321_D2B719DF X-CRM114-Status: GOOD ( 19.39 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Thu, Aug 26, 2021 at 6:17 AM Will Deacon wrote: > > Please pull this single arm64 fix for 5.14. Pulled. But adding Christoph to the cc, since I do think the eventual fix needs to be in the DMA mapping code: > We received a report this week > that the generic version of pfn_valid(), which we switched to this merge > window in 16c9afc77660 ("arm64/mm: drop HAVE_ARCH_PFN_VALID"), interacts > badly with dma_map_resource() due to the following check: > > /* Don't allow RAM to be mapped */ > if (WARN_ON_ONCE(pfn_valid(PHYS_PFN(phys_addr)))) > return DMA_MAPPING_ERROR; > > Since the ongoing saga to determine the semantics of pfn_valid() is > unlikely to be resolved this week (does it indicate valid memory, or > just the presence of a struct page, or whether that struct page has been > initialised?), just revert back to our old version of pfn_valid() for > 5.14. I think that's the right thing for now, but yeah, that condition for WARN_ON_ONCE() seems very questionable. "pfn_valid()" is more about whether you can do a "pfn_to_page()" lookup on it. II get the feeling that the dma-mapping code should allow pages that are PageReserved() to be mapped - they aren't "ram" in the kernel sense. Perhaps also make sure it's not the zero page (which is PageReserved(), but most definitely RAM). In a PC world that would be (for example) the legacy PCI space at 0xa0000-0xfffff, but I could easily imagine other platforms having other situations. Linus _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel