Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp5271861pxb; Wed, 26 Jan 2022 08:20:27 -0800 (PST) X-Google-Smtp-Source: ABdhPJz2t8lZU5XcR71p743+vSG9pnP5EJb/684AVC27zHOu1wQ3LCh7aZ8JByhH3RgJxbvN6c2F X-Received: by 2002:aa7:d0c5:: with SMTP id u5mr6220495edo.124.1643214027712; Wed, 26 Jan 2022 08:20:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643214027; cv=none; d=google.com; s=arc-20160816; b=jfS7p2z6lLhvPUZK0Xale9ut6PS+MfoipL65/97ffKioHSS0LlqcgMNiVlQ3tLRBNQ wtEpkQqg+su/yFSJNI+yTHLrvQIPqryJqJlgkBvAzN1o9c+e1jfmm88wXsncSoZpKBQN e3DdGJQu5ZD2F1UnSshxSLWpxFAg6j8HrlSIYfJol6CnwErtrCCRLroV1Q04FhtGxgK5 sjDqJ2H0v4MO6UEZ5tyyb3Su/XJEdmFbAH1qpGSOW3PhLAtECKJHT7hF7wUlB1x/CF02 o2OUb51V28aoV7Sv1SH434wOe8GA7fTu8Ss4yuzL8DAcaGhmM2NIHbdv4Sgw/bki9MqS OIMw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=86XwsEqiHWcpAKS+1w66D4BvB/zNvs89vkaCBpH8v1A=; b=LG0iQAw4WN5ucE72fk/aHmGIuo9TMhW8wrewJy5+od7KyeHRFtOzpbX1V1ZZyn4dXX hv8wb+PrL76Grw+n+oH610iv8BuW96cJKprQ9gGXD/A2Z/m9sxh2LtQA5NUlqHM39okA Od9bunATOdch4GM70RT5BCWva3/p5afWBzof0dpHESt9dwhiASGv6DvNgrLiIVk9tRty qQzHyLf10tQdbL7MM5SIl+xJkwxq5ZuUsYc3uWGshla5bXWabuCeF0Us5UtvXPdU9A9u NvHuZjnEzbZ9SqySA0KxYu7RYTGGRgVxMDfv8W5xXI/i47iJoT8FUqeY92JCJ1AuqjMy jOnA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=WVIaPz8P; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id sb10si5314367ejc.658.2022.01.26.08.19.52; Wed, 26 Jan 2022 08:20:27 -0800 (PST) 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=@infradead.org header.s=casper.20170209 header.b=WVIaPz8P; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236654AbiAZCvJ (ORCPT + 99 others); Tue, 25 Jan 2022 21:51:09 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38610 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236514AbiAZCvI (ORCPT ); Tue, 25 Jan 2022 21:51:08 -0500 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 64015C06161C for ; Tue, 25 Jan 2022 18:51:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=86XwsEqiHWcpAKS+1w66D4BvB/zNvs89vkaCBpH8v1A=; b=WVIaPz8PNke5qT2GHlggxTERIt 1gByfyYpDfCQf3V4cJwM8jJX1yZjxR7A5zbsBQgSgJA5GOtlRgQpLiqkAG87yRkPSdMt/Hb7X+biu 1CNLDxWXRd/rkXeiZrkTquDHB6Z7vn7QwjiQ8TVckrWw8oSvmtZ+P7f2pT+9il3b010BOL9pXMyGN cfsxfsq2hvoFGT2KOkRv4FYjhfEUHyyg5YX2WbTtVHY197jxgs77IvBxmpZds6dst8x7n+OEa6sG4 Leb1KP/pny3DOZid1GUF9FEp+yFHOcXK9hyuGMVBjp7dDDtC2QvNL3403LwMcbxSdBqhtIpvrukkd ocKpgIkA==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1nCYOZ-003di7-Ho; Wed, 26 Jan 2022 02:50:51 +0000 Date: Wed, 26 Jan 2022 02:50:51 +0000 From: Matthew Wilcox To: Robin Murphy Cc: Yury Norov , Catalin Marinas , Will Deacon , Andrew Morton , Nicholas Piggin , Ding Tianhong , Anshuman Khandual , Alexey Klimov , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: Re: [PATCH] vmap(): don't allow invalid pages Message-ID: References: <20220118235244.540103-1-yury.norov@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jan 19, 2022 at 01:28:14PM +0000, Robin Murphy wrote: > Is it page_to_pfn() guaranteed to work without blowing up if page is invalid > in the first place? Looking at the CONFIG_SPARSEMEM case I'm not sure that's > true... Something that all the ARM people weighing in on this don't understand is that basically nobody uses SPARSEMEM without SPARSEMEM_VMEMMAP. So all this complicated code to do page_to_pfn() is never tested. Real users all do a simple subtraction and so the simple pfn_valid() works fine.