Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp826918iog; Fri, 24 Jun 2022 15:19:42 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tJm2S9axZGvebEZahGZ+PeXXbVZq56kIUsBTv0s53+evwkvgR6P2Axl6RWDFPkAUTUJwFt X-Received: by 2002:a17:902:9307:b0:166:41a8:abc0 with SMTP id bc7-20020a170902930700b0016641a8abc0mr1224673plb.135.1656109182426; Fri, 24 Jun 2022 15:19:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656109182; cv=none; d=google.com; s=arc-20160816; b=bRLDRO2jWJTtbVk3EWKEKCKCR8Lps4fF1Y/IMZuh3/baoEIaxBm7mazAhkbNRsFbgF kiZOUY0wLH0hSkgbk2a7thQj5YoqeotCKIMcBCOel7AGJTVbRTtc5QMZecAq9b5Aissd pHApdzCEbWa3R7+goFT3IMjxL/aFGEwv4Vxx6r7u9oY0sVK5yKl7nV9zyLpA45lmFh/g WzoFmAMJHzT+LDLNVN3sZXKROHg6EopeNMiiX6j6UdSMgkQTsUXh9NnRYUHn4/HxKLr2 egkB5NQfqj2+HUVba7LJuGChLE4Qnjb2JN094b5aA3AYDs6EoDAbuWpxOGcpNYIdqu0g wHug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=m9vHXuFnSqVbxIwE4RZmI5muNo5bjUjNHkEAxxR/IvI=; b=u6dGIH54kGSfJHSJin5FXZ5AWoghK4K+pFAHlmNfw9MEJk2lYp8iMBKfsuvQHu358j Aojefozgzm8UuOkuSvPSM1n5jnW+qxHOYsqCIpvJ/6N41+0Y9a2f3VnQJjz/0JNXj/SB 9mNQtxrAcIkOqg6k+xEgRXVQZDoMosJjolnUgSKuIOL/fcpNMxOLGSArfPpu+K+uhaRJ lS3rNxuNO4IAPCQQxre1XhWJvYka8/E0qpBluxe/DDgBm8iPn6EGtRLdLL9J7Q4TqdEl PS/VS0+A4tL8JiSmOqEElfW7Gh/3+xSHJ7GwjmWmITZGfQ3LHZrWU8Mz5Jr1Nd4tHbby 0yvw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q6-20020a635046000000b003fc8c5109adsi4328751pgl.315.2022.06.24.15.19.29; Fri, 24 Jun 2022 15:19:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231959AbiFXV5q convert rfc822-to-8bit (ORCPT + 99 others); Fri, 24 Jun 2022 17:57:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49696 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231530AbiFXV5k (ORCPT ); Fri, 24 Jun 2022 17:57:40 -0400 Received: from mx0a-00082601.pphosted.com (mx0a-00082601.pphosted.com [67.231.145.42]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A3BEB87B7C for ; Fri, 24 Jun 2022 14:57:39 -0700 (PDT) Received: from pps.filterd (m0148461.ppops.net [127.0.0.1]) by mx0a-00082601.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 25OLaBjh012457 for ; Fri, 24 Jun 2022 14:57:39 -0700 Received: from maileast.thefacebook.com ([163.114.130.16]) by mx0a-00082601.pphosted.com (PPS) with ESMTPS id 3gwcu743y9-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Fri, 24 Jun 2022 14:57:39 -0700 Received: from twshared1457.37.frc1.facebook.com (2620:10d:c0a8:1b::d) by mail.thefacebook.com (2620:10d:c0a8:82::d) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.28; Fri, 24 Jun 2022 14:57:38 -0700 Received: by devbig932.frc1.facebook.com (Postfix, from userid 4523) id 078AA94C3A27; Fri, 24 Jun 2022 14:57:25 -0700 (PDT) From: Song Liu To: , , CC: , , , , , Song Liu Subject: [PATCH v5 bpf-next 3/5] vmalloc: WARN for set_vm_flush_reset_perms() on huge pages Date: Fri, 24 Jun 2022 14:57:10 -0700 Message-ID: <20220624215712.3050672-4-song@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220624215712.3050672-1-song@kernel.org> References: <20220624215712.3050672-1-song@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8BIT X-FB-Internal: Safe Content-Type: text/plain X-Proofpoint-ORIG-GUID: 7L76DiWj7vF4wWCvjOAGvT6rjW8nKpYx X-Proofpoint-GUID: 7L76DiWj7vF4wWCvjOAGvT6rjW8nKpYx X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.883,Hydra:6.0.517,FMLib:17.11.122.1 definitions=2022-06-24_09,2022-06-24_01,2022-06-22_01 X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org VM_FLUSH_RESET_PERMS is not yet ready for huge pages, add a WARN to catch misuse soon. Suggested-by: Rick Edgecombe Signed-off-by: Song Liu --- include/linux/vmalloc.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/linux/vmalloc.h b/include/linux/vmalloc.h index 096d48aa3437..59d3e1f3e108 100644 --- a/include/linux/vmalloc.h +++ b/include/linux/vmalloc.h @@ -239,6 +239,7 @@ static inline void set_vm_flush_reset_perms(void *addr) { struct vm_struct *vm = find_vm_area(addr); + WARN_ON_ONCE(is_vm_area_hugepages(addr)); if (vm) vm->flags |= VM_FLUSH_RESET_PERMS; } -- 2.30.2