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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 74689C3DA4A for ; Mon, 19 Aug 2024 14:20:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Type:Cc:To:From: Subject:Message-ID:References:Mime-Version:In-Reply-To:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=9hLxUPog6ZfK1tAJoowXx9bJNhMgN4jUhRQI7FjOx9Y=; b=itcW6+bpywdORU9+Ql9sg9weTr YIvewM9fW9oF6uiV1MkvBHToE2YGkm3cyDg9kVmw39cEpcrnHw8m/6NrYPzWEb6GgMbhoE0fUVkOR BGS37nHIeUCWzVnev21V0APQ8ISKIp3kf63egcQi/ko1Gkjm2or5YrXxf/V0aF8YTFZvoKBAo14zd HfKAUuqTcbsz73mHJwhXw5mqL4RVd6Q+Uikt25PiO6Sq1jotcms0JsDb/ytKSibpDsylXDZVkvHgA ctQyD1S4HDXgZjzchZ6hFqrk8qQpVDcTfqT4NWXiFlhuWdJAtGVUappeq9k+GQKAsx9nG9Gyt6K7P +HBZfSsA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sg3Ee-00000001iyI-1kPN; Mon, 19 Aug 2024 14:19:52 +0000 Received: from mail-pj1-x1049.google.com ([2607:f8b0:4864:20::1049]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sg3Dx-00000001ioi-2OmZ for linux-arm-kernel@lists.infradead.org; Mon, 19 Aug 2024 14:19:11 +0000 Received: by mail-pj1-x1049.google.com with SMTP id 98e67ed59e1d1-2d1da888717so4475242a91.2 for ; Mon, 19 Aug 2024 07:19:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1724077148; x=1724681948; darn=lists.infradead.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=9hLxUPog6ZfK1tAJoowXx9bJNhMgN4jUhRQI7FjOx9Y=; b=GqGVifAKaq/1C7enClo9LGmo+fy+MuBZ1mzoqUjGhyana1ULqMfBaDrfZZhnuDphAX QvXcK2rW56vYLSwsSnbBr2yx4LNQXMMNV93kw85hYvoa+/GNOw08aD7MktgTN3JvoauX C8lTPYObrzsBAJcxSq/H8Z7uvVB83jUYZGg4gCAEGSYdFwUP7jc+3I6EYYPhwbGlGTkF oqTZU9SagjM6DhlAWZjMyFwJ0l7L1O+pW78yF8DuJrTB90mQusggo+XKqJ4WjKJioFkW kAU/JjFjHxF8Q5qLe8h7Ztmvoj/rRshMJYph2QS5SwdswaeQ6z3ZXUWcMLEx33AhbBoB gvIQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724077148; x=1724681948; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=9hLxUPog6ZfK1tAJoowXx9bJNhMgN4jUhRQI7FjOx9Y=; b=lTTy4EuaXGCrTRmIGGXsh5f98TNJbxSRkObttfuwELwSOhj2go/06dnLK+xmzzM/y6 qjevTlSiwtehhQXurnmtr3suQZustc+thwlkSnbXBZK72OYen9S3uxbZ5nbFQ5blkAg7 nxbQXcE4AfXKP5eipcYYfWWHDg2CsAC7AK5KKBGb4R6tmrFu+yoFYCyRujaNTrXJJUZG h8mVQUHXbPbt/EnovShD17Fmx0sSYkFYIR/50Gk9IbDz5udH/dO8x6VOuE7k99iGbC30 jabtiCEZ0pBTSX0rMqcsNwEWRahyJUSmHi4fCZOFtzT7EpSAxFJQ+tJt6WW2t9mNQ3+U AZVA== X-Forwarded-Encrypted: i=1; AJvYcCUQjoTAXSuPNmsyWtz78fWFyWtJ2yny3Bl8BXs1rD6O9hKvDpDJURaFf9pnyFrU+wi7E4KFuvHg8S9Jtc5bDsD8OWiUEbu1lv2qfq2Zl+W9TFX/T8c= X-Gm-Message-State: AOJu0Yxysn8lV8ZWbpd4Hc7JqEsiXOIiquCn/IZ9CiPDLRazDpI7TTyX VafqxIuCNzb7S+rmu0k4LzleJOeDH9GU8s6tNssRm1HSlGwLof6naNhIWwv5XAOXK3rUkbWNTYy pHg== X-Google-Smtp-Source: AGHT+IEiVhcjMIh5HUWd1g2HbFSvaK6Ja8HiHcoC9dIXWYuIbXgLvSwXqZaaLQxebIQg4YAxeY37LXgLQ40= X-Received: from zagreus.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:5c37]) (user=seanjc job=sendgmr) by 2002:a17:90a:d817:b0:2d3:cfe1:3205 with SMTP id 98e67ed59e1d1-2d3e041dd44mr104680a91.7.1724077147516; Mon, 19 Aug 2024 07:19:07 -0700 (PDT) Date: Mon, 19 Aug 2024 07:19:07 -0700 In-Reply-To: <20240819121926.GG2032816@nvidia.com> Mime-Version: 1.0 References: <20240809160909.1023470-1-peterx@redhat.com> <20240809160909.1023470-7-peterx@redhat.com> <20240814130525.GH2032816@nvidia.com> <81080764-7c94-463f-80d3-e3b2968ddf5f@redhat.com> <20240819121926.GG2032816@nvidia.com> Message-ID: Subject: Re: [PATCH 06/19] mm/pagewalk: Check pfnmap early for folio_walk_start() From: Sean Christopherson To: Jason Gunthorpe Cc: David Hildenbrand , Peter Xu , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Oscar Salvador , Axel Rasmussen , linux-arm-kernel@lists.infradead.org, x86@kernel.org, Will Deacon , Gavin Shan , Paolo Bonzini , Zi Yan , Andrew Morton , Catalin Marinas , Ingo Molnar , Alistair Popple , Borislav Petkov , Thomas Gleixner , kvm@vger.kernel.org, Dave Hansen , Alex Williamson , Yan Zhao Content-Type: text/plain; charset="us-ascii" X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240819_071909_651272_7E6CEEBE X-CRM114-Status: GOOD ( 18.29 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Mon, Aug 19, 2024, Jason Gunthorpe wrote: > On Fri, Aug 16, 2024 at 07:56:30PM +0200, David Hildenbrand wrote: > > > I think KVM does something nasty: if it something with a "struct page", and > > it's not PageReserved, it would take a reference (if I get > > kvm_pfn_to_refcounted_page()) independent if it's a "normal" or "not normal" > > page -- it essentially ignores the vm_normal_page() information in the page > > tables ... > > Oh that's nasty. Nothing should be upgrading the output of the follow > functions to refcounted. That's what GUP is for. > > And PFNMAP pages, even if they have struct pages for some reason, > should *NEVER* be refcounted because they are in a PFNMAP VMA. That is > completely against the whole point :\ If they could be safely > refcounted then it would be a MIXEDMAP. Yeah yeah, I'm working on it. https://lore.kernel.org/all/20240726235234.228822-1-seanjc@google.com