Message ID | 20240111120929.2694440-3-mawupeng1@huawei.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel+bounces-23562-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:2411:b0:101:2151:f287 with SMTP id m17csp1399800dyi; Thu, 11 Jan 2024 04:10:30 -0800 (PST) X-Google-Smtp-Source: AGHT+IEXOojPq+zx7/JADpHyCUvtLRdoLi81UhyUOVsTUVU9tcdzPM+sof3bTJhlPQUlPgDDwywH X-Received: by 2002:a05:620a:3913:b0:783:18c4:7d8a with SMTP id qr19-20020a05620a391300b0078318c47d8amr1190145qkn.134.1704975030206; Thu, 11 Jan 2024 04:10:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704975030; cv=none; d=google.com; s=arc-20160816; b=z4E2ayaBQnR2zU50J5TwWNUhBcggA9QSu/R4eui3sM2S3jihZVGL2M4u0GuqYvAwev a8+X22xQwlncsKSYQwi1T9rnckSsBU8ZuLb2kSiSPkiHuKM4GSelOX4fEgxN7YKRwNEr C+8qARFr87pIBYufPTd0e3ZBG8+yIAm8KtOKRLUQ+xPr6MYb1BiAPciu5C2l7zNCnVMB UOD21ORBdNz/6h5fIgeOWfuEAMXPYhcUsqXDuK7jdlkw+gLS/0aXMgLA9mhzdA/UBtJH sPYvZAftlzAjdlOZUJhGMC+dGVFz0VBm5LiY5dxCK98W5JaNszA3/4flXy8nBaedq3tp aNJQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from; bh=zWg57uO6w1vlBSJSLwpXFeuEl1yeG3R2L+mCmYVmCC8=; fh=VDFt/Ez8CwS+3hxzG1nckgKJ9OcfII+UembkYqexFFw=; b=amOzcdneVcOWV2AjIL/dgTwSl20ff68E8tGnoikDL/Po8RVmJ3/zfmX1DHsnmQjGSj DyckyEMTqW791ofKbbhEmqRbuEiBKUB3Yfkyskr0uukuq9obMhYNIRWkeLiIvDiArljA MAqdrn5XbP1UkPf+k0XQyAAXl3pKFm/14bW+++nhaXF/9kum1PYZDvFPjmWtwZby8WF9 0jIso3Y6WnzQdolGtMEVMboT/ZMCYb6wAM+He6HhCkayQ9EkBbtjvvZrFPL7wZLCrUpP BVzwrImxIr8ZbHoj4BMyCFxchiKpTk6fyCotDrBzKxqK7lYqb2nDda12kHvb5aopCaRt +BpA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-23562-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-23562-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id bn42-20020a05620a2aea00b007832a1c1451si792406qkb.25.2024.01.11.04.10.30 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Jan 2024 04:10:30 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-23562-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-23562-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-23562-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 033961C20A1D for <ouuuleilei@gmail.com>; Thu, 11 Jan 2024 12:10:30 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D233815EB7; Thu, 11 Jan 2024 12:09:40 +0000 (UTC) Received: from szxga05-in.huawei.com (szxga05-in.huawei.com [45.249.212.191]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 427AE15AD2 for <linux-kernel@vger.kernel.org>; Thu, 11 Jan 2024 12:09:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Received: from mail.maildlp.com (unknown [172.19.88.214]) by szxga05-in.huawei.com (SkyGuard) with ESMTP id 4T9jzV3fqvz1FJ0j; Thu, 11 Jan 2024 20:05:26 +0800 (CST) Received: from dggpemd200001.china.huawei.com (unknown [7.185.36.224]) by mail.maildlp.com (Postfix) with ESMTPS id 183751A0190; Thu, 11 Jan 2024 20:09:34 +0800 (CST) Received: from localhost.localdomain (10.175.112.125) by dggpemd200001.china.huawei.com (7.185.36.224) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.2.1258.28; Thu, 11 Jan 2024 20:09:33 +0800 From: Wupeng Ma <mawupeng1@huawei.com> To: <akpm@linux-foundation.org>, <dave.hansen@linux.intel.com>, <luto@kernel.org>, <tglx@linutronix.de>, <peterz@infradead.org> CC: <linux-kernel@vger.kernel.org>, <x86@kernel.org>, <mawupeng1@huawei.com>, <bp@suse.de>, <mingo@redhat.com> Subject: [PATCH v3 2/3] x86/mm/pat: Cleanup unused parameter in follow_phys Date: Thu, 11 Jan 2024 20:09:28 +0800 Message-ID: <20240111120929.2694440-3-mawupeng1@huawei.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240111120929.2694440-1-mawupeng1@huawei.com> References: <20240111120929.2694440-1-mawupeng1@huawei.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: <linux-kernel.vger.kernel.org> List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) To dggpemd200001.china.huawei.com (7.185.36.224) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1787795896819053446 X-GMAIL-MSGID: 1787795896819053446 |
Series |
[v3,1/3] x86/mm/pat: Move follow_phys to pat-related file
|
|
Commit Message
mawupeng
Jan. 11, 2024, 12:09 p.m. UTC
From: Ma Wupeng <mawupeng1@huawei.com> Parameter flags is always zero in caller untrack_pfn() and track_pfn_copy(). let's drop it. Signed-off-by: Ma Wupeng <mawupeng1@huawei.com> --- arch/x86/mm/pat/memtype.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-)
Comments
Hi Wupeng,
kernel test robot noticed the following build warnings:
[auto build test WARNING on akpm-mm/mm-everything]
[also build test WARNING on tip/x86/mm tip/master linus/master v6.7 next-20240111]
[cannot apply to tip/auto-latest]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Wupeng-Ma/x86-mm-pat-Move-follow_phys-to-pat-related-file/20240111-201305
base: https://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm.git mm-everything
patch link: https://lore.kernel.org/r/20240111120929.2694440-3-mawupeng1%40huawei.com
patch subject: [PATCH v3 2/3] x86/mm/pat: Cleanup unused parameter in follow_phys
config: i386-alldefconfig (https://download.01.org/0day-ci/archive/20240112/202401121454.wuRFNxQE-lkp@intel.com/config)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240112/202401121454.wuRFNxQE-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202401121454.wuRFNxQE-lkp@intel.com/
All warnings (new ones prefixed by >>):
arch/x86/mm/pat/memtype.c: In function 'follow_phys':
>> arch/x86/mm/pat/memtype.c:972:1: warning: label 'unlock' defined but not used [-Wunused-label]
972 | unlock:
| ^~~~~~
vim +/unlock +972 arch/x86/mm/pat/memtype.c
5899329b19100c arch/x86/mm/pat.c venkatesh.pallipadi@intel.com 2008-12-18 952
b4e07d9667b7ae arch/x86/mm/pat/memtype.c Ma Wupeng 2024-01-11 953 static int follow_phys(struct vm_area_struct *vma,
76b476f1ffb4bf arch/x86/mm/pat/memtype.c Ma Wupeng 2024-01-11 954 unsigned long address, unsigned long *prot,
76b476f1ffb4bf arch/x86/mm/pat/memtype.c Ma Wupeng 2024-01-11 955 resource_size_t *phys)
b4e07d9667b7ae arch/x86/mm/pat/memtype.c Ma Wupeng 2024-01-11 956 {
b4e07d9667b7ae arch/x86/mm/pat/memtype.c Ma Wupeng 2024-01-11 957 int ret = -EINVAL;
b4e07d9667b7ae arch/x86/mm/pat/memtype.c Ma Wupeng 2024-01-11 958 pte_t *ptep, pte;
b4e07d9667b7ae arch/x86/mm/pat/memtype.c Ma Wupeng 2024-01-11 959 spinlock_t *ptl;
b4e07d9667b7ae arch/x86/mm/pat/memtype.c Ma Wupeng 2024-01-11 960
b4e07d9667b7ae arch/x86/mm/pat/memtype.c Ma Wupeng 2024-01-11 961 if (!(vma->vm_flags & (VM_IO | VM_PFNMAP)))
b4e07d9667b7ae arch/x86/mm/pat/memtype.c Ma Wupeng 2024-01-11 962 goto out;
b4e07d9667b7ae arch/x86/mm/pat/memtype.c Ma Wupeng 2024-01-11 963
b4e07d9667b7ae arch/x86/mm/pat/memtype.c Ma Wupeng 2024-01-11 964 if (follow_pte(vma->vm_mm, address, &ptep, &ptl))
b4e07d9667b7ae arch/x86/mm/pat/memtype.c Ma Wupeng 2024-01-11 965 goto out;
b4e07d9667b7ae arch/x86/mm/pat/memtype.c Ma Wupeng 2024-01-11 966 pte = ptep_get(ptep);
b4e07d9667b7ae arch/x86/mm/pat/memtype.c Ma Wupeng 2024-01-11 967
b4e07d9667b7ae arch/x86/mm/pat/memtype.c Ma Wupeng 2024-01-11 968 *prot = pgprot_val(pte_pgprot(pte));
b4e07d9667b7ae arch/x86/mm/pat/memtype.c Ma Wupeng 2024-01-11 969 *phys = (resource_size_t)pte_pfn(pte) << PAGE_SHIFT;
b4e07d9667b7ae arch/x86/mm/pat/memtype.c Ma Wupeng 2024-01-11 970
b4e07d9667b7ae arch/x86/mm/pat/memtype.c Ma Wupeng 2024-01-11 971 ret = 0;
b4e07d9667b7ae arch/x86/mm/pat/memtype.c Ma Wupeng 2024-01-11 @972 unlock:
b4e07d9667b7ae arch/x86/mm/pat/memtype.c Ma Wupeng 2024-01-11 973 pte_unmap_unlock(ptep, ptl);
b4e07d9667b7ae arch/x86/mm/pat/memtype.c Ma Wupeng 2024-01-11 974 out:
b4e07d9667b7ae arch/x86/mm/pat/memtype.c Ma Wupeng 2024-01-11 975 return ret;
b4e07d9667b7ae arch/x86/mm/pat/memtype.c Ma Wupeng 2024-01-11 976 }
b4e07d9667b7ae arch/x86/mm/pat/memtype.c Ma Wupeng 2024-01-11 977
Hi Wupeng,
kernel test robot noticed the following build warnings:
[auto build test WARNING on akpm-mm/mm-everything]
[also build test WARNING on tip/x86/mm tip/master linus/master v6.7 next-20240112]
[cannot apply to tip/auto-latest]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Wupeng-Ma/x86-mm-pat-Move-follow_phys-to-pat-related-file/20240111-201305
base: https://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm.git mm-everything
patch link: https://lore.kernel.org/r/20240111120929.2694440-3-mawupeng1%40huawei.com
patch subject: [PATCH v3 2/3] x86/mm/pat: Cleanup unused parameter in follow_phys
config: i386-buildonly-randconfig-002-20240112 (https://download.01.org/0day-ci/archive/20240112/202401121839.yeX0qcR8-lkp@intel.com/config)
compiler: ClangBuiltLinux clang version 17.0.6 (https://github.com/llvm/llvm-project 6009708b4367171ccdbf4b5905cb6a803753fe18)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240112/202401121839.yeX0qcR8-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202401121839.yeX0qcR8-lkp@intel.com/
All warnings (new ones prefixed by >>):
arch/x86/mm/pat/memtype.c:973:2: error: call to undeclared function 'kunmap_local'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
973 | pte_unmap_unlock(ptep, ptl);
| ^
include/linux/mm.h:2965:2: note: expanded from macro 'pte_unmap_unlock'
2965 | pte_unmap(pte); \
| ^
include/linux/pgtable.h:103:2: note: expanded from macro 'pte_unmap'
103 | kunmap_local((pte)); \
| ^
>> arch/x86/mm/pat/memtype.c:972:1: warning: unused label 'unlock' [-Wunused-label]
972 | unlock:
| ^~~~~~~
1 warning and 1 error generated.
vim +/unlock +972 arch/x86/mm/pat/memtype.c
5899329b19100c0 arch/x86/mm/pat.c venkatesh.pallipadi@intel.com 2008-12-18 952
b4e07d9667b7ae8 arch/x86/mm/pat/memtype.c Ma Wupeng 2024-01-11 953 static int follow_phys(struct vm_area_struct *vma,
76b476f1ffb4bf1 arch/x86/mm/pat/memtype.c Ma Wupeng 2024-01-11 954 unsigned long address, unsigned long *prot,
76b476f1ffb4bf1 arch/x86/mm/pat/memtype.c Ma Wupeng 2024-01-11 955 resource_size_t *phys)
b4e07d9667b7ae8 arch/x86/mm/pat/memtype.c Ma Wupeng 2024-01-11 956 {
b4e07d9667b7ae8 arch/x86/mm/pat/memtype.c Ma Wupeng 2024-01-11 957 int ret = -EINVAL;
b4e07d9667b7ae8 arch/x86/mm/pat/memtype.c Ma Wupeng 2024-01-11 958 pte_t *ptep, pte;
b4e07d9667b7ae8 arch/x86/mm/pat/memtype.c Ma Wupeng 2024-01-11 959 spinlock_t *ptl;
b4e07d9667b7ae8 arch/x86/mm/pat/memtype.c Ma Wupeng 2024-01-11 960
b4e07d9667b7ae8 arch/x86/mm/pat/memtype.c Ma Wupeng 2024-01-11 961 if (!(vma->vm_flags & (VM_IO | VM_PFNMAP)))
b4e07d9667b7ae8 arch/x86/mm/pat/memtype.c Ma Wupeng 2024-01-11 962 goto out;
b4e07d9667b7ae8 arch/x86/mm/pat/memtype.c Ma Wupeng 2024-01-11 963
b4e07d9667b7ae8 arch/x86/mm/pat/memtype.c Ma Wupeng 2024-01-11 964 if (follow_pte(vma->vm_mm, address, &ptep, &ptl))
b4e07d9667b7ae8 arch/x86/mm/pat/memtype.c Ma Wupeng 2024-01-11 965 goto out;
b4e07d9667b7ae8 arch/x86/mm/pat/memtype.c Ma Wupeng 2024-01-11 966 pte = ptep_get(ptep);
b4e07d9667b7ae8 arch/x86/mm/pat/memtype.c Ma Wupeng 2024-01-11 967
b4e07d9667b7ae8 arch/x86/mm/pat/memtype.c Ma Wupeng 2024-01-11 968 *prot = pgprot_val(pte_pgprot(pte));
b4e07d9667b7ae8 arch/x86/mm/pat/memtype.c Ma Wupeng 2024-01-11 969 *phys = (resource_size_t)pte_pfn(pte) << PAGE_SHIFT;
b4e07d9667b7ae8 arch/x86/mm/pat/memtype.c Ma Wupeng 2024-01-11 970
b4e07d9667b7ae8 arch/x86/mm/pat/memtype.c Ma Wupeng 2024-01-11 971 ret = 0;
b4e07d9667b7ae8 arch/x86/mm/pat/memtype.c Ma Wupeng 2024-01-11 @972 unlock:
b4e07d9667b7ae8 arch/x86/mm/pat/memtype.c Ma Wupeng 2024-01-11 @973 pte_unmap_unlock(ptep, ptl);
b4e07d9667b7ae8 arch/x86/mm/pat/memtype.c Ma Wupeng 2024-01-11 974 out:
b4e07d9667b7ae8 arch/x86/mm/pat/memtype.c Ma Wupeng 2024-01-11 975 return ret;
b4e07d9667b7ae8 arch/x86/mm/pat/memtype.c Ma Wupeng 2024-01-11 976 }
b4e07d9667b7ae8 arch/x86/mm/pat/memtype.c Ma Wupeng 2024-01-11 977
diff --git a/arch/x86/mm/pat/memtype.c b/arch/x86/mm/pat/memtype.c index a6a88679c92e..94bcba399701 100644 --- a/arch/x86/mm/pat/memtype.c +++ b/arch/x86/mm/pat/memtype.c @@ -951,8 +951,8 @@ static void free_pfn_range(u64 paddr, unsigned long size) } static int follow_phys(struct vm_area_struct *vma, - unsigned long address, unsigned int flags, - unsigned long *prot, resource_size_t *phys) + unsigned long address, unsigned long *prot, + resource_size_t *phys) { int ret = -EINVAL; pte_t *ptep, pte; @@ -965,9 +965,6 @@ static int follow_phys(struct vm_area_struct *vma, goto out; pte = ptep_get(ptep); - if ((flags & FOLL_WRITE) && !pte_write(pte)) - goto unlock; - *prot = pgprot_val(pte_pgprot(pte)); *phys = (resource_size_t)pte_pfn(pte) << PAGE_SHIFT; @@ -997,7 +994,7 @@ int track_pfn_copy(struct vm_area_struct *vma) * reserve the whole chunk covered by vma. We need the * starting address and protection from pte. */ - if (follow_phys(vma, vma->vm_start, 0, &prot, &paddr)) { + if (follow_phys(vma, vma->vm_start, &prot, &paddr)) { WARN_ON_ONCE(1); return -EINVAL; } @@ -1084,7 +1081,7 @@ void untrack_pfn(struct vm_area_struct *vma, unsigned long pfn, /* free the chunk starting from pfn or the whole chunk */ paddr = (resource_size_t)pfn << PAGE_SHIFT; if (!paddr && !size) { - if (follow_phys(vma, vma->vm_start, 0, &prot, &paddr)) { + if (follow_phys(vma, vma->vm_start, &prot, &paddr)) { WARN_ON_ONCE(1); return; }