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 15B4BE71D2B for ; Fri, 29 Sep 2023 13:08:11 +0000 (UTC) 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:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=fQirwlzU/zlfmuqxHacw751rXYaqvYkfrTKhtM97KMA=; b=yT5UnvAE5E2ynm 1KbET2w3bDNuQrdJ8hVUadMHg+VfJs/SREWXDtBF01u0gJkCVW8Z8cRPFZKVMjmz2J3FYJEDj6A1s i9jCTmO4yELg0OLK1YgGC/w67Y5/ze1R1C+vH6D1YCYGWLtox8m2PHe7mf3TjbII4uSmiUMf+9g+m ao1n1yGE0zJiN9zmZsMpDp8v35BA/QwY9N3F42N1WuagNWyla9/9IMnUcsuGD8i7u/8zoxhK0uEA3 8lC/95Bp3UqPyo55F3EQo7rsp/QAiT1psHRo99xz0gQ/n8ssAXyEToeBXbfaiwJTYsq28Lpx/LDGE fjH1hZcNw7U3k++bC/jA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qmDDY-007vwm-1Q; Fri, 29 Sep 2023 13:07:40 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qmDDW-007vwd-10 for linux-arm-kernel@bombadil.infradead.org; Fri, 29 Sep 2023 13:07:38 +0000 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=dt3+Gee4n493ylM7Lgh9enoYPiATPdmVGjPO0i2DNIE=; b=C6o0SgZNP6MRBvncMimIbIodtV 5Rnzbls/ZT/6AuiSZIpKQgmOw4PF3HnVYJ17nLBrIJgDXgJNNvSwh3FDPKtz2TBHyClWyvhD5JHXs Zv7CfOjfy94rZ37sSAfXzFAmIHqzxFZyR5gw7iR3T44Ue5Hvi12JZffFlafj+dNBJmnfspIpT3aI+ 5Vvcg1ZJQqpxVtNUDGwnv0paIkRUNPwCfKCJqZPqPA1Mxau1Ox8HR39pbhbRac89vI0FMXiDpWBgR VJ/JLyxDyYHsBZ3GMR9iUos4Byrm0akBJeIJxBba20q0zH7IDwiyMvm05keNEnfxBVHnTKQ3ggdBq VjEzOZXw==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1qmDDT-008uCI-EX; Fri, 29 Sep 2023 13:07:35 +0000 Date: Fri, 29 Sep 2023 14:07:35 +0100 From: Matthew Wilcox To: Gavin Shan Cc: Vincent Donnefort , maz@kernel.org, oliver.upton@linux.dev, kvmarm@lists.linux.dev, linux-arm-kernel@lists.infradead.org, kernel-team@android.com, will@kernel.org Subject: Re: [PATCH v2 2/2] KVM: arm64: Use folio for THP adjustment Message-ID: References: <20230928173205.2826598-1-vdonnefort@google.com> <20230928173205.2826598-3-vdonnefort@google.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: 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 Fri, Sep 29, 2023 at 05:24:00PM +1000, Gavin Shan wrote: > > + size_t sz = folio_size(pfn_folio(pfn)); > > Is it possible that a tail page is returned from __gfn_to_pfn_memslot()? folio_size() > doesn't work for a tail page because order 0 is returned for tail pages. It seems it's pfn_folio() can't return a tail page. That's the point of folios; they aren't tail pages. They're either a head page or an order-0 page. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel