Message ID | 20240826204353.2228736-6-peterx@redhat.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show
Return-Path: <linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org> 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 3AEA5C5472C for <linux-arm-kernel@archiver.kernel.org>; Mon, 26 Aug 2024 20:49:07 +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: Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date :Subject:Cc:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=SFHgAMnpeJHqDMa0ADr1pyvSduy44GuxF04BOe5aqcw=; b=N9JDqXq548pGbLvy63j22ZJu02 2ePjiETF/ah6PpEIgycwCfBqz6pyRzsvsffFdL746oBq78RLWGpXmS0EAW2JndmFkf39FUGB3UPqw Kbkw0xgOBe+ZEOXA8N/Sy5r0Pu5siUpgv0rsrTzGy1ZT9jP+AAv3tdvgoghIwt7eCdSwgzFy8obNh C9dKbo2ao3d1W/u+DVxO5F3//RCFJ2Q991nL2pLbf/LHdVQaGn/kPwt4KJY9x7ghFYvxRrz3Jx0TL FxBaPGlKyFAr4Cry6i4cnUooTxuuOlhHY3zfYNeMBZ1gsBU7d+pvFExAlVIPLg65PgePZqWVBSTNN iV5XTRMw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sige2-00000008g8P-09Dx; Mon, 26 Aug 2024 20:48:58 +0000 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sigZO-00000008eOJ-1Z9i for linux-arm-kernel@lists.infradead.org; Mon, 26 Aug 2024 20:44:12 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1724705049; h=from:from: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:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=SFHgAMnpeJHqDMa0ADr1pyvSduy44GuxF04BOe5aqcw=; b=dtTbA9uKpTvjGFS0JZf60dx1PumcxPN8MyfLw0XI+pduVKl79+5dyti6KkGbZSULdVyekz yvp3eebj5MU83nyajfD1/edzpeMbp+gJW9i4lH1F6KJ79QbC1ClcYhecnPtcG1+TOmF+85 q0TkT4kTpEb9Z9Cz+HtK46IrxJ/xyu4= Received: from mail-qk1-f197.google.com (mail-qk1-f197.google.com [209.85.222.197]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-194-9IFjm5D8Oq6-84A60BXPnA-1; Mon, 26 Aug 2024 16:44:07 -0400 X-MC-Unique: 9IFjm5D8Oq6-84A60BXPnA-1 Received: by mail-qk1-f197.google.com with SMTP id af79cd13be357-7a1dbbe6d6fso633435085a.3 for <linux-arm-kernel@lists.infradead.org>; Mon, 26 Aug 2024 13:44:07 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724705047; x=1725309847; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=SFHgAMnpeJHqDMa0ADr1pyvSduy44GuxF04BOe5aqcw=; b=Rv8W523hnEYFlnSXEY6NBwAD3ZorhUqDjPjx4hZV/xpsc3RVCHypGoraCDmE4Cv7h5 Aa1MSZOayhfoDxT9x6Qf2GJfjQANHCPx1w70RikKHN/yoWvDCg0g7WEBvbV8Ufjlnxdb m5TfHcc04s/Xd7eshUVN6hLm7O+O59VokCWogpsVIeMmceW9Cnk7Z6on8yEPUs1FJjkq IKF4i3wyQYncbIqQd0G3LPzz7ZBEntoflPKGxcbj+UiHV15fH7xs74BvDMidX5eC3xsX 5ZI0ZIV9EYX48Qsd1k92UEC6CqPFdByUNTdZXms5/aENI2ZgSlXt42GEFynxv0TU2pKM LsGQ== X-Forwarded-Encrypted: i=1; AJvYcCWfIe0kb6f3hdCAfwU+J4GNmtfGWwPGpfhMyZFJ2HM6hbQRkI7dnEkYKUiCvNiFdM1AcieQUXvQuFx0+YpTrRMH@lists.infradead.org X-Gm-Message-State: AOJu0YwFDDJshI3fslyS0cocTkK5Mld7AmRlXKq5DWRooz75YUhZlzFL YXhD760bH600jeyPliw7EhOD0lkHrMVIyNRM1kAs966cS8RNKs+8FNMwGIL+M1zhoMBuNF9E9dX WbPSebptQ1dKjQ8NJTiCAbfFRV01ilhV/pzq6ILhm/OjOtV2JHl6EDJ3UiHqe7aXIdQACyugn X-Received: by 2002:a05:620a:2a14:b0:7a2:ccd:9672 with SMTP id af79cd13be357-7a7e4e6144fmr67568485a.67.1724705046879; Mon, 26 Aug 2024 13:44:06 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG++rZwRsHPi3LEX2hBpbUb+Bhnwx97nv6F7Fy5QJm5RgQYxXJ7nF8aD8ykhSm+rXvWrvbUzQ== X-Received: by 2002:a05:620a:2a14:b0:7a2:ccd:9672 with SMTP id af79cd13be357-7a7e4e6144fmr67565885a.67.1724705046455; Mon, 26 Aug 2024 13:44:06 -0700 (PDT) Received: from x1n.redhat.com (pool-99-254-121-117.cpe.net.cable.rogers.com. [99.254.121.117]) by smtp.gmail.com with ESMTPSA id af79cd13be357-7a67f3fd6c1sm491055185a.121.2024.08.26.13.44.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Aug 2024 13:44:05 -0700 (PDT) From: Peter Xu <peterx@redhat.com> To: linux-kernel@vger.kernel.org, linux-mm@kvack.org Cc: Gavin Shan <gshan@redhat.com>, Catalin Marinas <catalin.marinas@arm.com>, x86@kernel.org, Ingo Molnar <mingo@redhat.com>, Andrew Morton <akpm@linux-foundation.org>, Paolo Bonzini <pbonzini@redhat.com>, Dave Hansen <dave.hansen@linux.intel.com>, Thomas Gleixner <tglx@linutronix.de>, Alistair Popple <apopple@nvidia.com>, kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Sean Christopherson <seanjc@google.com>, peterx@redhat.com, Oscar Salvador <osalvador@suse.de>, Jason Gunthorpe <jgg@nvidia.com>, Borislav Petkov <bp@alien8.de>, Zi Yan <ziy@nvidia.com>, Axel Rasmussen <axelrasmussen@google.com>, David Hildenbrand <david@redhat.com>, Yan Zhao <yan.y.zhao@intel.com>, Will Deacon <will@kernel.org>, Kefeng Wang <wangkefeng.wang@huawei.com>, Alex Williamson <alex.williamson@redhat.com> Subject: [PATCH v2 05/19] mm/gup: Detect huge pfnmap entries in gup-fast Date: Mon, 26 Aug 2024 16:43:39 -0400 Message-ID: <20240826204353.2228736-6-peterx@redhat.com> X-Mailer: git-send-email 2.45.0 In-Reply-To: <20240826204353.2228736-1-peterx@redhat.com> References: <20240826204353.2228736-1-peterx@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII"; x-default=true X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240826_134410_665193_A25BD6FE X-CRM114-Status: GOOD ( 12.56 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: <linux-arm-kernel.lists.infradead.org> List-Unsubscribe: <http://lists.infradead.org/mailman/options/linux-arm-kernel>, <mailto:linux-arm-kernel-request@lists.infradead.org?subject=unsubscribe> List-Archive: <http://lists.infradead.org/pipermail/linux-arm-kernel/> List-Post: <mailto:linux-arm-kernel@lists.infradead.org> List-Help: <mailto:linux-arm-kernel-request@lists.infradead.org?subject=help> List-Subscribe: <http://lists.infradead.org/mailman/listinfo/linux-arm-kernel>, <mailto:linux-arm-kernel-request@lists.infradead.org?subject=subscribe> Sender: "linux-arm-kernel" <linux-arm-kernel-bounces@lists.infradead.org> Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org |
Series |
mm: Support huge pfnmaps
|
expand
|
diff --git a/mm/gup.c b/mm/gup.c index d19884e097fd..a49f67a512ee 100644 --- a/mm/gup.c +++ b/mm/gup.c @@ -3038,6 +3038,9 @@ static int gup_fast_pmd_leaf(pmd_t orig, pmd_t *pmdp, unsigned long addr, if (!pmd_access_permitted(orig, flags & FOLL_WRITE)) return 0; + if (pmd_special(orig)) + return 0; + if (pmd_devmap(orig)) { if (unlikely(flags & FOLL_LONGTERM)) return 0; @@ -3082,6 +3085,9 @@ static int gup_fast_pud_leaf(pud_t orig, pud_t *pudp, unsigned long addr, if (!pud_access_permitted(orig, flags & FOLL_WRITE)) return 0; + if (pud_special(orig)) + return 0; + if (pud_devmap(orig)) { if (unlikely(flags & FOLL_LONGTERM)) return 0;