Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp475282pxj; Thu, 10 Jun 2021 05:31:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwAJII7ViwYh9QwlgRwullhqtTjpOfSmI8ZYTHJeJDYIT4+cdltsCrK/IcVFbLgEd0tQWTK X-Received: by 2002:a17:906:82c3:: with SMTP id a3mr4122161ejy.230.1623328290265; Thu, 10 Jun 2021 05:31:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623328290; cv=none; d=google.com; s=arc-20160816; b=ttOFQPd6jqwfotkgdQ6CRKx+c0X5aelhk/0Hj1OY7CUt1PoBAxV+n5e6PSdLQXJ/Qe tFxdXVCH6K+qkhkV4ybG0dVM0K2arxBXcBMhG0oKbT4jVowE87qYsUwxuGoZ1Luevgg5 sEUvwIIWqqdL1wdx4JIYQsDYZNLguODIJCIJAq2xozom5RqiKZzNa1zC9SwxD64zQWlp lstapyKbky3ktiz5VA7OKJtvECQf3L6dBoy64C8qs17a/yakiw3qqxlHb7JJM8+69XHV u7k/gyDty5O28NPYBY9QbO5DU4UxDHmwWqP1cNueYMFG2vFGpaRvZhmYDOYuwJX+jAfI dADQ== 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=ZHSvNg6yik/PVHq0m9BDlTakMFa2k8LbpL8e8y+bwUU=; b=wPhVARknecD0J6j5iWS+o4Qj16W2aP1EJxKj0bfFmAbscbFNJhi3Fbd55WSexCXS03 IfW0OU/4vPbhYscTtny8Cx3EY44oxT4C8Ebdi3+wygqIrXWrwStAbI7I6cVomBtC9Gww oYT93LOOJePFLmTKBVBAnmVTjiwy7TAHSTQNQ16GqxFGCDPCoh7KVBIKJZQJhneIsM0i 8lRM8QbtZsi5/vu3VbUAgXxxXOWMEnirwpOCFbwroxoQt0Ru3fFvXnTy0VaELo7DeTfG RB+8qGUz5U4aUJcFfItlIqUxoCGFi2+ZX/7G/NXe4fWjSSwpE7ge9K4RDpoMNwXwrTyD gRBg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q19si2208943edv.125.2021.06.10.05.31.06; Thu, 10 Jun 2021 05:31:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230396AbhFJM31 (ORCPT + 99 others); Thu, 10 Jun 2021 08:29:27 -0400 Received: from szxga08-in.huawei.com ([45.249.212.255]:5323 "EHLO szxga08-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230431AbhFJM3O (ORCPT ); Thu, 10 Jun 2021 08:29:14 -0400 Received: from dggemv711-chm.china.huawei.com (unknown [172.30.72.57]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4G135B6CXcz1BL4Z; Thu, 10 Jun 2021 20:22:22 +0800 (CST) Received: from dggpemm500001.china.huawei.com (7.185.36.107) by dggemv711-chm.china.huawei.com (10.1.198.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Thu, 10 Jun 2021 20:27:16 +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.2176.2; Thu, 10 Jun 2021 20:27:09 +0800 From: Kefeng Wang To: Russell King , CC: Catalin Marinas , , Andrew Morton , Jungseung Lee , Will Deacon , Kefeng Wang Subject: [PATCH v3 2/6] ARM: mm: Kill task_struct argument for __do_page_fault() Date: Thu, 10 Jun 2021 20:35:52 +0800 Message-ID: <20210610123556.171328-3-wangkefeng.wang@huawei.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210610123556.171328-1-wangkefeng.wang@huawei.com> References: <20210610123556.171328-1-wangkefeng.wang@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.175.113.25] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To dggpemm500001.china.huawei.com (7.185.36.107) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The __do_page_fault() won't use task_struct argument, kill it and also use current->mm directly in do_page_fault(). No functional change. Signed-off-by: Kefeng Wang --- arch/arm/mm/fault.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/arch/arm/mm/fault.c b/arch/arm/mm/fault.c index 662ac3ca3c8a..249db395bdf0 100644 --- a/arch/arm/mm/fault.c +++ b/arch/arm/mm/fault.c @@ -202,8 +202,7 @@ static inline bool access_error(unsigned int fsr, struct vm_area_struct *vma) static vm_fault_t __kprobes __do_page_fault(struct mm_struct *mm, unsigned long addr, unsigned int fsr, - unsigned int flags, struct task_struct *tsk, - struct pt_regs *regs) + unsigned int flags, struct pt_regs *regs) { struct vm_area_struct *vma = find_vma(mm, addr); if (unlikely(!vma)) @@ -231,8 +230,7 @@ __do_page_fault(struct mm_struct *mm, unsigned long addr, unsigned int fsr, static int __kprobes do_page_fault(unsigned long addr, unsigned int fsr, struct pt_regs *regs) { - struct task_struct *tsk; - struct mm_struct *mm; + struct mm_struct *mm = current->mm; int sig, code; vm_fault_t fault; unsigned int flags = FAULT_FLAG_DEFAULT; @@ -240,8 +238,6 @@ do_page_fault(unsigned long addr, unsigned int fsr, struct pt_regs *regs) if (kprobe_page_fault(regs, fsr)) return 0; - tsk = current; - mm = tsk->mm; /* Enable interrupts if they were enabled in the parent context. */ if (interrupts_enabled(regs)) @@ -285,7 +281,7 @@ do_page_fault(unsigned long addr, unsigned int fsr, struct pt_regs *regs) #endif } - fault = __do_page_fault(mm, addr, fsr, flags, tsk, regs); + fault = __do_page_fault(mm, addr, fsr, flags, regs); /* If we need to retry but a fatal signal is pending, handle the * signal first. We do not need to release the mmap_lock because -- 2.26.2