From patchwork Thu Jan 5 10:18:37 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Houghton X-Patchwork-Id: 13089672 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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7E1E8C3DA7A for ; Thu, 5 Jan 2023 10:19:54 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 1C871940010; Thu, 5 Jan 2023 05:19:54 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 17A42940008; Thu, 5 Jan 2023 05:19:54 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id F34B3940010; Thu, 5 Jan 2023 05:19:53 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id CE63B940008 for ; Thu, 5 Jan 2023 05:19:53 -0500 (EST) Received: from smtpin24.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id B309240B38 for ; Thu, 5 Jan 2023 10:19:53 +0000 (UTC) X-FDA: 80320349466.24.5F82CC2 Received: from mail-yw1-f202.google.com (mail-yw1-f202.google.com [209.85.128.202]) by imf14.hostedemail.com (Postfix) with ESMTP id 1EB7810000C for ; Thu, 5 Jan 2023 10:19:51 +0000 (UTC) Authentication-Results: imf14.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=I6ayK2fj; spf=pass (imf14.hostedemail.com: domain of 3R6S2YwoKCI41Bz6CyzB65y66y3w.u64305CF-442Dsu2.69y@flex--jthoughton.bounces.google.com designates 209.85.128.202 as permitted sender) smtp.mailfrom=3R6S2YwoKCI41Bz6CyzB65y66y3w.u64305CF-442Dsu2.69y@flex--jthoughton.bounces.google.com; dmarc=pass (policy=reject) header.from=google.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1672913992; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=ebd8Vu/XVboNQYDKBTu4hK6f3y9obuZPyqPY5k+Gudc=; b=40oK/RXhoqpQpKIp7SKG/vlxU0bucvIkpOLlyreK4iJJEMWsto3c3lAkHmL7c2AmGkJym6 PIbdwyjnPmPTWJGv/0tbpiB69OuVyaNIlSEOMX6OZgwlwfcHyvMhzx7v/ZGILSJbYTEs+0 OsqpJBbcIh81Q0hf3veMRLVoBi2kT4Y= ARC-Authentication-Results: i=1; imf14.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=I6ayK2fj; spf=pass (imf14.hostedemail.com: domain of 3R6S2YwoKCI41Bz6CyzB65y66y3w.u64305CF-442Dsu2.69y@flex--jthoughton.bounces.google.com designates 209.85.128.202 as permitted sender) smtp.mailfrom=3R6S2YwoKCI41Bz6CyzB65y66y3w.u64305CF-442Dsu2.69y@flex--jthoughton.bounces.google.com; dmarc=pass (policy=reject) header.from=google.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1672913992; a=rsa-sha256; cv=none; b=q/ONQjxG10QofFrDWFu3fi+J5G3qOv4WzebdCcPsxIJ98y76R56Jevz1WTL8YQlgt3NYsM /88e00FeZcCTLdP8hjtDQb+T+S6uFNGYnzAe3C/Cx/+sEOqqFyMLZ9Oei71unlRlSmKx3x ay4Mydn4MOZIi7yyFCzW2XkNcIE2tqc= Received: by mail-yw1-f202.google.com with SMTP id 00721157ae682-470d4c948efso306816807b3.11 for ; Thu, 05 Jan 2023 02:19:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=ebd8Vu/XVboNQYDKBTu4hK6f3y9obuZPyqPY5k+Gudc=; b=I6ayK2fjeeV6XAYAV3ZhwaEnnQoYUdQNqveqXyF5ggg1QXVgf5LPqhurqUyX4Sg8HO s6F9jORt3w8TrKLgQbE9o/ipsILjWJVWxOlolxXAYaC7l1LUJTPuzmnYXb8M/6TAOgE6 iV4jd4Plk12mL7A8sfE6TF+7lw9HKJSmcmSdh24PWpxCGN5c8WUgHm+WCIlfPdcQb8Va oaa3biXUtYUW2lT6cUJ+TJCPkPPPYnk+RY3IQZ7J1RSQZAg/BMdpqELg44GmDZbqhD/+ kIK71fstpMvWu1m6mR114A35MUphScUHv/CK8JATL1Z7Dr//wEo/gsARlq+dXyJGqPZ3 FyGA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=ebd8Vu/XVboNQYDKBTu4hK6f3y9obuZPyqPY5k+Gudc=; b=a0M4OM41dDLHVX05AjjsicAhKPC2oaFMGndQ04kqGXRq7gS7xXE77Y61iBC8eyJRax 69h1GQV7pT7qTY3t+gjgqzq4HaZCyZxrcGXWnRjpv+F8p7P23kQNUQavDRWnJ0gwBqrD 8U30vFT4Pn9/+2l+odKZkC6yCVi19whkEiryt3rI6SniBmclMjSQ/97cP5KXre86epVS +zUbjFOS8RjYqVzpVC8ulVuYIKdhzM+/Nft2hrOkS3QOZGbpz6IMsfFsjd9Xai0XSTE1 uD+pL+FjN5/4m2ixdllljxrj+kfUl/IPTVPeUljHSx31f52E5R90us8Psny4sQ2I2AIT C7Hg== X-Gm-Message-State: AFqh2kqRsndj0LrVWRLYH+7csONyVETX7iP6YGqD265yrd9PjJsjJn/w NpIVm53HZ60eOpHYvezhggyEfWNKWUuRr8qR X-Google-Smtp-Source: AMrXdXtV4+6oO1J8uKzAHBFEmMr5riCkeBCaO8d3MxL5klPMuG1OvNmF2A8uHxD11fFnV9fuWT3AXj8ucCtp8clM X-Received: from jthoughton.c.googlers.com ([fda3:e722:ac3:cc00:14:4d90:c0a8:2a4f]) (user=jthoughton job=sendgmr) by 2002:a05:690c:c81:b0:48c:9ce1:9ac8 with SMTP id cm1-20020a05690c0c8100b0048c9ce19ac8mr2452166ywb.305.1672913991340; Thu, 05 Jan 2023 02:19:51 -0800 (PST) Date: Thu, 5 Jan 2023 10:18:37 +0000 In-Reply-To: <20230105101844.1893104-1-jthoughton@google.com> Mime-Version: 1.0 References: <20230105101844.1893104-1-jthoughton@google.com> X-Mailer: git-send-email 2.39.0.314.g84b9a713c41-goog Message-ID: <20230105101844.1893104-40-jthoughton@google.com> Subject: [PATCH 39/46] hugetlb: x86: enable high-granularity mapping From: James Houghton To: Mike Kravetz , Muchun Song , Peter Xu Cc: David Hildenbrand , David Rientjes , Axel Rasmussen , Mina Almasry , "Zach O'Keefe" , Manish Mishra , Naoya Horiguchi , "Dr . David Alan Gilbert" , "Matthew Wilcox (Oracle)" , Vlastimil Babka , Baolin Wang , Miaohe Lin , Yang Shi , Andrew Morton , linux-mm@kvack.org, linux-kernel@vger.kernel.org, James Houghton X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: 1EB7810000C X-Stat-Signature: thhg737be5gf37g7p744s3rzjk9twp5u X-Rspam-User: X-HE-Tag: 1672913991-560021 X-HE-Meta: U2FsdGVkX1/y9Szy5Ezd06v8Q5wjw0QdlcElizyOZt2zYVp080Uq+GcIStP/XCWF8t9pao8pzleIB1O5JTkf6/woNJV+yDiwGX2Apu9FSzF5YKiLAVOUN3hW/rVzN7Yu9AXQNFaTz5xnNaf/K0CaXuX+W0HSbOyGEcZMzBaUPcBQAD3ezapS3G9m70weXAfj0iU7jYZr6+gHkhfHuNtVxu5wN2hS1D58LVoL00dC4LkV2rI0QicsgVQPoT2JZeJlsWGtiG5vqMG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zd1fFArNwXV8YROPBCQ97K/h+76+gpmlgGU8x1w= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Now that HGM is fully supported for GENERAL_HUGETLB, x86 can enable it. The x86 KVM MMU already properly handles HugeTLB HGM pages (it does a page table walk to determine which size to use in the second-stage page table instead of, for example, checking vma_mmu_pagesize, like arm64 does). We could also enable HugeTLB HGM for arm (32-bit) at this point, as it also uses GENERAL_HUGETLB and I don't see anything else that is needed for it. However, I haven't tested on arm at all, so I won't enable it. Signed-off-by: James Houghton --- arch/x86/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig index 3604074a878b..3d08cd45549c 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig @@ -126,6 +126,7 @@ config X86 select ARCH_WANT_GENERAL_HUGETLB select ARCH_WANT_HUGE_PMD_SHARE select ARCH_WANT_HUGETLB_PAGE_OPTIMIZE_VMEMMAP if X86_64 + select ARCH_WANT_HUGETLB_HIGH_GRANULARITY_MAPPING select ARCH_WANT_LD_ORPHAN_WARN select ARCH_WANTS_THP_SWAP if X86_64 select ARCH_HAS_PARANOID_L1D_FLUSH