Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp4254708imw; Thu, 7 Jul 2022 15:40:35 -0700 (PDT) X-Google-Smtp-Source: AGRyM1uanidzxOi6dwlrt3tJ7mCYOoj1IRlhlkN0DTD5MPV3DMv/SFoAc6LBdYC6fTqoC9pBf2Tf X-Received: by 2002:a05:6402:444a:b0:43a:63fd:eec6 with SMTP id o10-20020a056402444a00b0043a63fdeec6mr610031edb.18.1657233635586; Thu, 07 Jul 2022 15:40:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657233635; cv=none; d=google.com; s=arc-20160816; b=fso6tUQDDy7y2xTFao/g6GuB/LFJ7awT7f+mWD2CWM32XEEIaWSuBDgFeL6fAh2kDx DIRlLMemE4ahcT4HNP6xDOEaGHzn0Eb0NPXznITImdFe59EB4OzCtT8AShnz/Tq+hvQE iEVFy8A9jQc4pJPK9ILe24Rw9HCbqi9OYv9i9wgC/ln67QmYFxTSSPpf8DGlQIF75hMH m2YLBP86KgGWdTDX+Z10TIKWW7bi6ENubS+hg/mN+udF2MHOKhr3pMBxFDWsAjy2WPKw tekLn4y9WNasgPxYlVAXd0D2hVB2U3TC2ih6VaHyJKMBssDOBvCqTH0XYI/vyvRZT8dd i8sA== 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=WoEIxaVZvYww4RLuoOa7sp+0SYIEdTZ2EIIYJowOGQC+24VseBrbjFYTzdBx8W1sNo xzvPDoM5vYB0Pv0G8KEBOGF6ijR3eejsAo9vD7J0pbj/90FgEY4WAXx1Cvd3+vJFB3RQ 2CdHtJkp2+euXOz8mNEhneBwpC86CMxfXfkaWVgU2xBY+CVPJvSLH1AFzeC56LTRnPaI fwEYATqJENj0U5xlqpcEDqxnLtjeojffUAt5jQ5oI3Ali/oa+ceG6LVdX6UCotDc0SfN CeC6vifU71M/uyaK/mqIonUjqg3zya7JvB1qJzzjWT0JceK2BCNT0dKcp0EoVF8+jq7r 0LKw== 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 di12-20020a170906730c00b0072a89f7b510si2641317ejc.1002.2022.07.07.15.40.10; Thu, 07 Jul 2022 15:40:35 -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 S236824AbiGGWge convert rfc822-to-8bit (ORCPT + 99 others); Thu, 7 Jul 2022 18:36:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35634 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236911AbiGGWg3 (ORCPT ); Thu, 7 Jul 2022 18:36:29 -0400 Received: from mx0b-00082601.pphosted.com (mx0b-00082601.pphosted.com [67.231.153.30]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 06B37E21 for ; Thu, 7 Jul 2022 15:36:28 -0700 (PDT) Received: from pps.filterd (m0109332.ppops.net [127.0.0.1]) by mx0a-00082601.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 267KPhSD030988 for ; Thu, 7 Jul 2022 15:36:28 -0700 Received: from maileast.thefacebook.com ([163.114.130.16]) by mx0a-00082601.pphosted.com (PPS) with ESMTPS id 3h5nw2f4te-9 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Thu, 07 Jul 2022 15:36:28 -0700 Received: from twshared0725.22.frc3.facebook.com (2620:10d:c0a8:1b::d) by mail.thefacebook.com (2620:10d:c0a8:82::f) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.28; Thu, 7 Jul 2022 15:36:24 -0700 Received: by devbig932.frc1.facebook.com (Postfix, from userid 4523) id 8C1649D349C2; Thu, 7 Jul 2022 15:36:06 -0700 (PDT) From: Song Liu To: , , CC: , , , , , , Song Liu Subject: [PATCH v6 bpf-next 3/5] vmalloc: WARN for set_vm_flush_reset_perms() on huge pages Date: Thu, 7 Jul 2022 15:35:44 -0700 Message-ID: <20220707223546.4124919-4-song@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220707223546.4124919-1-song@kernel.org> References: <20220707223546.4124919-1-song@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8BIT X-FB-Internal: Safe Content-Type: text/plain X-Proofpoint-GUID: TUDqMPcWWbEe-0YIkFt2gNHtJlUlBJyc X-Proofpoint-ORIG-GUID: TUDqMPcWWbEe-0YIkFt2gNHtJlUlBJyc 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-07-07_17,2022-06-28_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