From patchwork Wed Oct 19 03:49:41 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kefeng Wang X-Patchwork-Id: 4430 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp108549wrs; Tue, 18 Oct 2022 20:34:57 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6yFh9xB+7541kXii18qt+d9mlzcXRpQ4T0V4pGzEZbWkEXQWHGqeznTuH0YExAVENieRcy X-Received: by 2002:a17:907:a425:b0:78d:b3ce:1e43 with SMTP id sg37-20020a170907a42500b0078db3ce1e43mr4905322ejc.95.1666150496908; Tue, 18 Oct 2022 20:34:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666150496; cv=none; d=google.com; s=arc-20160816; b=lxz9kawEOFQmzO9yWxilCtKf9y4G6ETkjZOxaVh3KYHyYOZFaRztdKfBmaH778VPZw JINNye9BWvlXETfLgJComXsqNIeMjOowcnN9DooXExlPivY44QsawQopgyzQzjx696/f rInE3AFi/g46Jhjkp8ZC/ZoVnTfOQR+lch6qWLGltAEsYghCydcQN2Ysr3fkn3Tockge q6WrnTSVeeUN9cXJcWq1RRHFxnxYPTWZHrBWJ5p0jCKc46FcesMiBCCh6B6PiAkv9Ts4 kkoCWg+r7tPgk4KSnXmcWD5PP96aXKp4ldEvdtM3USF/n3nnf6JEOpgy8VCVPsEJSrx3 +SaQ== 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=P89rUoDA+nksodvLWZ2Z9yurxKG+A6kPWXcToRSwRqs=; b=lIL0G2D7ufqNL22VvdEbj38gIcSUlW9B+xXK1ADn79pemdKLgSYPLY0IrokknzTJ/2 a4fwrYUM+X8wekmZmX/W/B56FxBMeTEhyFVl8aQBqDeUoZ23JYcmMInMUrlwV7TDtVTe qosJ6Dnf6pUZvsGoXU+ekV0uEdc+ielqAfYFSU2pXfZ3BZLtUY21LYPSVs1D7HHRdm8n KKoI+Ag/iUWR4hoJi/3rktC1CAj5ivScMF/WjG/E9pchYrFol3wevjHdScao4JmB6hb5 AfX9l/5neFGWV6xehZjAiFcJVCfDkETtreo2csbK0yzv1hOM5qVWA0+VKJrSPruqgeO/ vw6g== 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=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id lg22-20020a170906f89600b0078c959aea8bsi10932174ejb.324.2022.10.18.20.34.31; Tue, 18 Oct 2022 20:34:56 -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=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229925AbiJSDaG (ORCPT + 99 others); Tue, 18 Oct 2022 23:30:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44348 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229779AbiJSDaC (ORCPT ); Tue, 18 Oct 2022 23:30:02 -0400 Received: from szxga03-in.huawei.com (szxga03-in.huawei.com [45.249.212.189]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 77D9F33E2B; Tue, 18 Oct 2022 20:29:58 -0700 (PDT) Received: from dggpemm500023.china.huawei.com (unknown [172.30.72.54]) by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4Msbks5XpWzJn4F; Wed, 19 Oct 2022 11:27:17 +0800 (CST) Received: from dggpemm500001.china.huawei.com (7.185.36.107) by dggpemm500023.china.huawei.com (7.185.36.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Wed, 19 Oct 2022 11:29:56 +0800 Received: from localhost.localdomain.localdomain (10.175.113.25) by dggpemm500001.china.huawei.com (7.185.36.107) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Wed, 19 Oct 2022 11:29:56 +0800 From: Kefeng Wang To: , Andrew Morton CC: Dinh Nguyen , Jarkko Sakkinen , Dave Hansen , , , , Kefeng Wang Subject: [PATCH 1/5] nios2: remove unused INIT_MMAP Date: Wed, 19 Oct 2022 11:49:41 +0800 Message-ID: <20221019034945.93081-2-wangkefeng.wang@huawei.com> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20221019034945.93081-1-wangkefeng.wang@huawei.com> References: <20221019034945.93081-1-wangkefeng.wang@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.175.113.25] X-ClientProxiedBy: dggems703-chm.china.huawei.com (10.3.19.180) To dggpemm500001.china.huawei.com (7.185.36.107) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS autolearn=ham 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747085423516218246?= X-GMAIL-MSGID: =?utf-8?q?1747085423516218246?= It seems that INIT_MMAP is gone in 2.4.10, not sure, anyways, it is useless now, kill it. Cc: Dinh Nguyen Signed-off-by: Kefeng Wang --- arch/nios2/include/asm/processor.h | 3 --- 1 file changed, 3 deletions(-) diff --git a/arch/nios2/include/asm/processor.h b/arch/nios2/include/asm/processor.h index 8916d93d5c2d..eb44130364a9 100644 --- a/arch/nios2/include/asm/processor.h +++ b/arch/nios2/include/asm/processor.h @@ -50,9 +50,6 @@ struct thread_struct { unsigned long kpsr; }; -#define INIT_MMAP \ - { &init_mm, (0), (0), __pgprot(0x0), VM_READ | VM_WRITE | VM_EXEC } - # define INIT_THREAD { \ .kregs = NULL, \ .ksp = 0, \ From patchwork Wed Oct 19 03:49:42 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kefeng Wang X-Patchwork-Id: 4432 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp108780wrs; Tue, 18 Oct 2022 20:35:35 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6/CzEzMPvrgEel7H1UBOzKNreYHSJVp8kIWQ45UP0HqZVf9o/rVbSXFkLiIabakOkEaN4d X-Received: by 2002:a62:4c6:0:b0:55f:c739:51e0 with SMTP id 189-20020a6204c6000000b0055fc73951e0mr6386623pfe.49.1666150534979; Tue, 18 Oct 2022 20:35:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666150534; cv=none; d=google.com; s=arc-20160816; b=YngJlapPc8mVK9XWDplEBKO8RF0oZTe2HS0jl4NF68AmF7FP4vcCurhYt/XD/4fD0C 8ElGiREvtatwwnGtl5uWnUaTkifoVq4IBN/wxn6mY1425X1/nARCGhyea+5F6na0HEnu vx3XBoBoEmBe/t+tUINZVJ3y1waFo2WozxWH5Iqd6ACiJkKEx+kKl8tRvIg2xnnPPG5I UjAp5OcDGXJjvYjisTHNFv6Dh8khBdeMTlqjCC40loVgL1LHIBWdCiSuJOJp7XLAdtbU x3eYpP/Bq2yrEl4ntCBn3qVYNju0Nb8qD6RbjoaCRReYQapa6UtgzqrJZzzeJ7pg+abj zvyg== 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=kHHJyDT2hgQmZR5mRQG4tLDHVs0Z/pdo4jfpgZD/puE=; b=kevS8+heqPVlFdIOe/Dy1d1h5CCNuurGovrm5PsIvlP49teJkeKnvSWy5Cg7beHkbt iK6R8zOjAh5h5n8c+AuAnz0mwTRG6hYmZE4kn67rfEiolX8wPHkcVhL8rKLiEIrWyrdf xfCXGBrHDnc1TULcq4dR/CR+Wfy2hNY0BYzFGa7eQyh1Pm6YcaDvEqyyK/iDooU+4RCE //U6oQU63FX8V+SyBcNVbA4tciht7SFyFS9cG7gSGIv+DY/NSbStTlVpexIV5ES/cBRK litj3U2K2IRz6VVUK/b2S4qoycCBFNwLSp5rDnjIErPOKnbwip3xTYQcL4Ky4ErjcVle 1r0g== 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=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w1-20020a63a741000000b00461c7200fafsi16921287pgo.320.2022.10.18.20.35.22; Tue, 18 Oct 2022 20:35:34 -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=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229928AbiJSDaQ (ORCPT + 99 others); Tue, 18 Oct 2022 23:30:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44744 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229926AbiJSDaH (ORCPT ); Tue, 18 Oct 2022 23:30:07 -0400 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7174D50F94; Tue, 18 Oct 2022 20:30:06 -0700 (PDT) Received: from dggpemm500024.china.huawei.com (unknown [172.30.72.54]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4Msbny0JjPzHv4h; Wed, 19 Oct 2022 11:29:58 +0800 (CST) Received: from dggpemm500001.china.huawei.com (7.185.36.107) by dggpemm500024.china.huawei.com (7.185.36.203) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Wed, 19 Oct 2022 11:29:57 +0800 Received: from localhost.localdomain.localdomain (10.175.113.25) by dggpemm500001.china.huawei.com (7.185.36.107) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Wed, 19 Oct 2022 11:29:56 +0800 From: Kefeng Wang To: , Andrew Morton CC: Dinh Nguyen , Jarkko Sakkinen , Dave Hansen , , , , Kefeng Wang Subject: [PATCH 2/5] x86/sgx: use VM_ACCESS_FLAGS Date: Wed, 19 Oct 2022 11:49:42 +0800 Message-ID: <20221019034945.93081-3-wangkefeng.wang@huawei.com> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20221019034945.93081-1-wangkefeng.wang@huawei.com> References: <20221019034945.93081-1-wangkefeng.wang@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.175.113.25] X-ClientProxiedBy: dggems703-chm.china.huawei.com (10.3.19.180) To dggpemm500001.china.huawei.com (7.185.36.107) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS autolearn=ham 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747085463182250150?= X-GMAIL-MSGID: =?utf-8?q?1747085463182250150?= Simplify VM_READ|VM_WRITE|VM_EXEC with VM_ACCESS_FLAGS. Cc: Jarkko Sakkinen Cc: Dave Hansen Signed-off-by: Kefeng Wang --- arch/x86/kernel/cpu/sgx/encl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/x86/kernel/cpu/sgx/encl.c b/arch/x86/kernel/cpu/sgx/encl.c index 1ec20807de1e..6225c525372d 100644 --- a/arch/x86/kernel/cpu/sgx/encl.c +++ b/arch/x86/kernel/cpu/sgx/encl.c @@ -268,7 +268,7 @@ static struct sgx_encl_page *sgx_encl_load_page_in_vma(struct sgx_encl *encl, unsigned long addr, unsigned long vm_flags) { - unsigned long vm_prot_bits = vm_flags & (VM_READ | VM_WRITE | VM_EXEC); + unsigned long vm_prot_bits = vm_flags & VM_ACCESS_FLAGS; struct sgx_encl_page *entry; entry = xa_load(&encl->page_array, PFN_DOWN(addr)); @@ -502,7 +502,7 @@ static void sgx_vma_open(struct vm_area_struct *vma) int sgx_encl_may_map(struct sgx_encl *encl, unsigned long start, unsigned long end, unsigned long vm_flags) { - unsigned long vm_prot_bits = vm_flags & (VM_READ | VM_WRITE | VM_EXEC); + unsigned long vm_prot_bits = vm_flags & VM_ACCESS_FLAGS; struct sgx_encl_page *page; unsigned long count = 0; int ret = 0; From patchwork Wed Oct 19 03:49:43 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kefeng Wang X-Patchwork-Id: 4433 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp109426wrs; Tue, 18 Oct 2022 20:38:18 -0700 (PDT) X-Google-Smtp-Source: AMsMyM41i3xm8sopOLgvVYyDEgA8eDqEhLNqsIQlfnmsndvrYLRraCfQbRdy1bACZlB9iD6XuLwW X-Received: by 2002:a05:6402:5485:b0:459:147a:d902 with SMTP id fg5-20020a056402548500b00459147ad902mr5599429edb.263.1666150697980; Tue, 18 Oct 2022 20:38:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666150697; cv=none; d=google.com; s=arc-20160816; b=J+Mb/pp2X3lbejW9TohNWPlDetNRpdLQiWXYnXmtx2/LMnAMaLxgGXGu4bOjdncFQr SheV6wPO3px77ITdoKgm1EJTPJlbmOHpojZ/YopP7gotvqvVE03uRnF9II5b2+FlM0B+ CGTh6aQEV0mV5ruBCLhHLrfc59G4kqUOlQd2kkHqoLIKv60xdTkJULXf1P+/wjvQRgb+ MJWwqA3dgOyMVDVh9AT9/Z00RX227v/NgjtRdqxEfugWtMmgVLwsJqqtCOkA4HYNoYhr +EOwmuWaamNz0guHIn8ZD64Mx+4ABVcJ5u9m7reVa7Q7oNshOmaST3kQXSjvqVZgxlKI w6fw== 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=Ppy1RF3pOcFIZ3ILq218Whi5/N8wKsABR515Lv+nZj4=; b=pXoaV6uXv5ogc2VrfgodFA2zAmSSaOd3yP4sIlFWbeoWjfAJlEcxPVVuwjIoJeyXc7 YqlY17V39SpzBZgkg/3MsBwU/hou7VC0j0JJA25gxtAeJExsYya7TXmufyavGZi9Y1bF rWpmi3YifhwQcUODuGqg6XmmqLkEZZO20Ula5xRn+s9xB237zUJVKE3M6DOwgaNpupoq CtHLqNwBZQOSv9RVwm+GnLWRApTT04FJfEmZRaSlt3n8RVLJIL2ABHatUmCobfXLrSz0 /FkiWv+IImf3HcPtg51hj+sMqmN8ozoHQb1vRBmBN2OQKKi5Kl6Dfck4MuMmdSq2s/RB Hc7g== 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=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hq6-20020a1709073f0600b00787c0e9818csi15656430ejc.568.2022.10.18.20.37.53; Tue, 18 Oct 2022 20:38:17 -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=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229508AbiJSDar (ORCPT + 99 others); Tue, 18 Oct 2022 23:30:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45800 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229935AbiJSDa3 (ORCPT ); Tue, 18 Oct 2022 23:30:29 -0400 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C534A659E1; Tue, 18 Oct 2022 20:30:23 -0700 (PDT) Received: from dggpemm500021.china.huawei.com (unknown [172.30.72.56]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4Msbkb21cWznV2c; Wed, 19 Oct 2022 11:27:03 +0800 (CST) Received: from dggpemm500001.china.huawei.com (7.185.36.107) by dggpemm500021.china.huawei.com (7.185.36.109) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Wed, 19 Oct 2022 11:29:57 +0800 Received: from localhost.localdomain.localdomain (10.175.113.25) by dggpemm500001.china.huawei.com (7.185.36.107) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Wed, 19 Oct 2022 11:29:57 +0800 From: Kefeng Wang To: , Andrew Morton CC: Dinh Nguyen , Jarkko Sakkinen , Dave Hansen , , , , Kefeng Wang Subject: [PATCH 3/5] mm: mprotect: use VM_ACCESS_FLAGS Date: Wed, 19 Oct 2022 11:49:43 +0800 Message-ID: <20221019034945.93081-4-wangkefeng.wang@huawei.com> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20221019034945.93081-1-wangkefeng.wang@huawei.com> References: <20221019034945.93081-1-wangkefeng.wang@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.175.113.25] X-ClientProxiedBy: dggems703-chm.china.huawei.com (10.3.19.180) To dggpemm500001.china.huawei.com (7.185.36.107) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS autolearn=ham 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747085634177044071?= X-GMAIL-MSGID: =?utf-8?q?1747085634177044071?= Simplify VM_READ|VM_WRITE|VM_EXEC with VM_ACCESS_FLAGS. Signed-off-by: Kefeng Wang --- mm/mprotect.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/mm/mprotect.c b/mm/mprotect.c index 668bfaa6ed2a..99762403cc8f 100644 --- a/mm/mprotect.c +++ b/mm/mprotect.c @@ -756,8 +756,7 @@ static int do_mprotect_pkey(unsigned long start, size_t len, * If a permission is not passed to mprotect(), it must be * cleared from the VMA. */ - mask_off_old_flags = VM_READ | VM_WRITE | VM_EXEC | - VM_FLAGS_CLEAR; + mask_off_old_flags = VM_ACCESS_FLAGS | VM_FLAGS_CLEAR; new_vma_pkey = arch_override_mprotect_pkey(vma, prot, pkey); newflags = calc_vm_prot_bits(prot, new_vma_pkey); From patchwork Wed Oct 19 03:49:44 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kefeng Wang X-Patchwork-Id: 4431 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp108672wrs; Tue, 18 Oct 2022 20:35:14 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4/afV9lDICCoW2NmQZV/BN3+0/gRNGAtuVBKAOWAxT/J/EVjkoi4en/1jVZtErmI0b9o1X X-Received: by 2002:a17:906:fe49:b0:73d:70c5:1a52 with SMTP id wz9-20020a170906fe4900b0073d70c51a52mr4986522ejb.469.1666150513922; Tue, 18 Oct 2022 20:35:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666150513; cv=none; d=google.com; s=arc-20160816; b=yiJj7H0oLNA/VCqJx++vOy858xfnAafb1ZtXf0txgCP+JpEEJzNwvgnsbldrw2Ma8o j7lA8nnSvDZ7dLuNjLwSvMuIEvyEUKph52arvpp9VIq3l4slb5IUEXrB6DV6envmjy+5 wfY8PKKyQqGJnV+Z+HaHEx0qkO3hWgo5NvtwEawdDpcPnz2NPYBNMjjdQpEViBWBbdS4 E9b3NGdqMwlHMnzx+5jQAzys+H/TQUW9l5oc3faBtiqXJWmZ19dIGVVG2rSzCesf44II xPkMOOK7FwXMAyp0Wqx07ANfhVXbMSc2p/m1Xfu57qcWecDgjEs6zCBZppR+AhHZqq7w f05w== 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=ZOHu4WLNeTFWtwTh3s0cuZmAqBO2WfUNWuJ1+8gPM88=; b=NiysDifelm6/Z4evpmvd9FuYg9SQEuFK9BmG3NIwaEZaXlH61OizDmK1A0QDnmV5LI 5OiaWXZKfRA10HirDWGOwnmXfAcOwkisfa6R3p6lX4rkrzxQoDIIFZDXt3VKRyPALo0w /lCiuR9/k9pw9c1J643lJJ0kFiIH4XH0pC7HWK+HhYqjM3ruC2dIlm8COZ2nvNeM8Lfv 0v6qXhQ8ma+nBSZbEXlNh7GZ8eqqC23gAPA/ADc9HHpFubobKz1ObYzoHzuzuPa6/1rh lpVJO2ndJzwOvQdHZ1ufKmIcQPbERJOd3NLHOH6LrYmysYonGjX93fALaHUvanegG1Ut 7T8Q== 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=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t20-20020a1709066bd400b00783698dd8b4si11574616ejs.722.2022.10.18.20.34.48; Tue, 18 Oct 2022 20:35:13 -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=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229779AbiJSDaN (ORCPT + 99 others); Tue, 18 Oct 2022 23:30:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44352 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229799AbiJSDaC (ORCPT ); Tue, 18 Oct 2022 23:30:02 -0400 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3C2293B9B5; Tue, 18 Oct 2022 20:30:00 -0700 (PDT) Received: from dggpemm500020.china.huawei.com (unknown [172.30.72.54]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4Msbk81L6QznTV5; Wed, 19 Oct 2022 11:26:40 +0800 (CST) Received: from dggpemm500001.china.huawei.com (7.185.36.107) by dggpemm500020.china.huawei.com (7.185.36.49) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Wed, 19 Oct 2022 11:29:58 +0800 Received: from localhost.localdomain.localdomain (10.175.113.25) by dggpemm500001.china.huawei.com (7.185.36.107) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Wed, 19 Oct 2022 11:29:57 +0800 From: Kefeng Wang To: , Andrew Morton CC: Dinh Nguyen , Jarkko Sakkinen , Dave Hansen , , , , Kefeng Wang Subject: [PATCH 4/5] mm: debug_vm_pgtable: use VM_ACCESS_FLAGS Date: Wed, 19 Oct 2022 11:49:44 +0800 Message-ID: <20221019034945.93081-5-wangkefeng.wang@huawei.com> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20221019034945.93081-1-wangkefeng.wang@huawei.com> References: <20221019034945.93081-1-wangkefeng.wang@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.175.113.25] X-ClientProxiedBy: dggems703-chm.china.huawei.com (10.3.19.180) To dggpemm500001.china.huawei.com (7.185.36.107) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS autolearn=ham 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747085441297861716?= X-GMAIL-MSGID: =?utf-8?q?1747085441297861716?= Directly use VM_ACCESS_FLAGS instead VMFLAGS. Signed-off-by: Kefeng Wang --- mm/debug_vm_pgtable.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/mm/debug_vm_pgtable.c b/mm/debug_vm_pgtable.c index dc7df1254f0a..2b61fde8c38c 100644 --- a/mm/debug_vm_pgtable.c +++ b/mm/debug_vm_pgtable.c @@ -38,11 +38,7 @@ * Please refer Documentation/mm/arch_pgtable_helpers.rst for the semantics * expectations that are being validated here. All future changes in here * or the documentation need to be in sync. - */ - -#define VMFLAGS (VM_READ|VM_WRITE|VM_EXEC) - -/* + * * On s390 platform, the lower 4 bits are used to identify given page table * entry type. But these bits might affect the ability to clear entries with * pxx_clear() because of how dynamic page table folding works on s390. So @@ -1125,7 +1121,7 @@ static int __init init_args(struct pgtable_debug_args *args) */ memset(args, 0, sizeof(*args)); args->vaddr = get_random_vaddr(); - args->page_prot = vm_get_page_prot(VMFLAGS); + args->page_prot = vm_get_page_prot(VM_ACCESS_FLAGS); args->page_prot_none = vm_get_page_prot(VM_NONE); args->is_contiguous_page = false; args->pud_pfn = ULONG_MAX;