Received: by 10.213.65.68 with SMTP id h4csp332057imn; Tue, 13 Mar 2018 05:58:24 -0700 (PDT) X-Google-Smtp-Source: AG47ELuOEq67z1txKbsCIgI49wRHks0/bymftLKQq2Q6PEHyMD4PkrJECXoJwB6xKQBHIQIDoE4P X-Received: by 2002:a17:902:7e4a:: with SMTP id a10-v6mr497277pln.13.1520945904085; Tue, 13 Mar 2018 05:58:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1520945904; cv=none; d=google.com; s=arc-20160816; b=UdHzK9bmF6Se9W5IA32BKSFZBEDv8i+f9zeHQ2uBp/HnLDv3IAIENiA1GO5k5uhooc 3AUB8t6GcpwlLkEqnk9Suh4OX3vFFwL4zx1NUplb9LtzQNqlwZZ1EnLx3VGc1hRV66ia mGWauqXXdJTd5WInQ+tvOvCnB1r0k0607t8kZCdWDGUXdcxvRyHQqo7H7lIcs+3euvAa JPyYn0TKfBbsYcgS/Geb91PxEE2H9H0/0koXcdSk8ti4AnFAD1fMyQtgg3E9OGgckc1y dTJMqqXef90cQazqOXoXyRY8G/VSnY/oXEyqfulN6X7NAvE2p4l6Sk29imfkKFi/6D/X cDew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:references:in-reply-to:date :subject:cc:to:from:arc-authentication-results; bh=66IjrC6hGSUn0trVrP0mrsD+611byHy9lVZOH/S1wTs=; b=vWPFHQYrLLR2f5O/rZfJlXJ8/Jwl8e1ZTIYBIr5DNSo88jBuDid5KYniQUegDFDkPH FGySZOLuCeAuzs26/2ooJaSlRAo99ynKbDMNhizsnf07Qz0GtQ1BagGBwQrJI87IMQAp FHYpxT8FAUoveUsH+33ODVnw3swjei6AjLFgBqbcRsXntZi6U/3Xgn/vLz8a/s//au+b sVgZIPdJkoaTPS88H1xH0NmJkdkwTjQM/B/fmNHPFb3Cn7uft7clQwq8LVX0Q7MClI+8 8lBoibhAtmv8zkjmGK7tyeuhKQMiujGyU9PGLYMrbrlBB35W73pKnKaTs3TVX2zROCN9 6pqw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y86si127445pfi.19.2018.03.13.05.58.10; Tue, 13 Mar 2018 05:58:24 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752594AbeCMMzC (ORCPT + 99 others); Tue, 13 Mar 2018 08:55:02 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:41238 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752278AbeCMMzA (ORCPT ); Tue, 13 Mar 2018 08:55:00 -0400 Received: from pps.filterd (m0098420.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w2DCscm0033542 for ; Tue, 13 Mar 2018 08:55:00 -0400 Received: from e06smtp14.uk.ibm.com (e06smtp14.uk.ibm.com [195.75.94.110]) by mx0b-001b2d01.pphosted.com with ESMTP id 2gpd5n5t5n-1 (version=TLSv1.2 cipher=AES256-SHA256 bits=256 verify=NOT) for ; Tue, 13 Mar 2018 08:54:57 -0400 Received: from localhost by e06smtp14.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 13 Mar 2018 12:54:54 -0000 Received: from b06cxnps3074.portsmouth.uk.ibm.com (9.149.109.194) by e06smtp14.uk.ibm.com (192.168.101.144) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Tue, 13 Mar 2018 12:54:46 -0000 Received: from d06av25.portsmouth.uk.ibm.com (d06av25.portsmouth.uk.ibm.com [9.149.105.61]) by b06cxnps3074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w2DCskbn65929280; Tue, 13 Mar 2018 12:54:46 GMT Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id EDB2811C052; Tue, 13 Mar 2018 12:47:25 +0000 (GMT) Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 7692311C04C; Tue, 13 Mar 2018 12:47:14 +0000 (GMT) Received: from bangoria.in.ibm.com (unknown [9.124.221.140]) by d06av25.portsmouth.uk.ibm.com (Postfix) with ESMTP; Tue, 13 Mar 2018 12:47:14 +0000 (GMT) From: Ravi Bangoria To: mhiramat@kernel.org, oleg@redhat.com, peterz@infradead.org, srikar@linux.vnet.ibm.com Cc: acme@kernel.org, ananth@linux.vnet.ibm.com, akpm@linux-foundation.org, alexander.shishkin@linux.intel.com, alexis.berlemont@gmail.com, corbet@lwn.net, dan.j.williams@intel.com, gregkh@linuxfoundation.org, huawei.libin@huawei.com, hughd@google.com, jack@suse.cz, jglisse@redhat.com, jolsa@redhat.com, kan.liang@intel.com, kirill.shutemov@linux.intel.com, kjlx@templeofstupid.com, kstewart@linuxfoundation.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, mhocko@suse.com, milian.wolff@kdab.com, mingo@redhat.com, namhyung@kernel.org, naveen.n.rao@linux.vnet.ibm.com, pc@us.ibm.com, pombredanne@nexb.com, rostedt@goodmis.org, tglx@linutronix.de, tmricht@linux.vnet.ibm.com, willy@infradead.org, yao.jin@linux.intel.com, fengguang.wu@intel.com, Ravi Bangoria Subject: [PATCH 4/8] Uprobe: Export uprobe_map_info along with uprobe_{build/free}_map_info() Date: Tue, 13 Mar 2018 18:25:59 +0530 X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180313125603.19819-1-ravi.bangoria@linux.vnet.ibm.com> References: <20180313125603.19819-1-ravi.bangoria@linux.vnet.ibm.com> X-TM-AS-GCONF: 00 x-cbid: 18031312-0016-0000-0000-00000530FAD7 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18031312-0017-0000-0000-0000286E2CB6 Message-Id: <20180313125603.19819-5-ravi.bangoria@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2018-03-13_06:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=2 phishscore=0 bulkscore=0 spamscore=0 clxscore=1011 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1709140000 definitions=main-1803130154 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org These exported data structure and functions will be used by other files in later patches. No functionality changes. Signed-off-by: Ravi Bangoria --- include/linux/uprobes.h | 9 +++++++++ kernel/events/uprobes.c | 14 +++----------- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/include/linux/uprobes.h b/include/linux/uprobes.h index 0a294e9..7bd2760 100644 --- a/include/linux/uprobes.h +++ b/include/linux/uprobes.h @@ -109,12 +109,19 @@ enum rp_check { RP_CHECK_RET, }; +struct address_space; struct xol_area; struct uprobes_state { struct xol_area *xol_area; }; +struct uprobe_map_info { + struct uprobe_map_info *next; + struct mm_struct *mm; + unsigned long vaddr; +}; + extern int set_swbp(struct arch_uprobe *aup, struct mm_struct *mm, unsigned long vaddr); extern int set_orig_insn(struct arch_uprobe *aup, struct mm_struct *mm, unsigned long vaddr); extern bool is_swbp_insn(uprobe_opcode_t *insn); @@ -149,6 +156,8 @@ struct uprobes_state { extern bool arch_uprobe_ignore(struct arch_uprobe *aup, struct pt_regs *regs); extern void arch_uprobe_copy_ixol(struct page *page, unsigned long vaddr, void *src, unsigned long len); +extern struct uprobe_map_info *uprobe_free_map_info(struct uprobe_map_info *info); +extern struct uprobe_map_info *uprobe_build_map_info(struct address_space *mapping, loff_t offset, bool is_register); #else /* !CONFIG_UPROBES */ struct uprobes_state { }; diff --git a/kernel/events/uprobes.c b/kernel/events/uprobes.c index 081b88c1..e7830b8 100644 --- a/kernel/events/uprobes.c +++ b/kernel/events/uprobes.c @@ -695,23 +695,15 @@ static void delete_uprobe(struct uprobe *uprobe) put_uprobe(uprobe); } -struct uprobe_map_info { - struct uprobe_map_info *next; - struct mm_struct *mm; - unsigned long vaddr; -}; - -static inline struct uprobe_map_info * -uprobe_free_map_info(struct uprobe_map_info *info) +struct uprobe_map_info *uprobe_free_map_info(struct uprobe_map_info *info) { struct uprobe_map_info *next = info->next; kfree(info); return next; } -static struct uprobe_map_info * -uprobe_build_map_info(struct address_space *mapping, loff_t offset, - bool is_register) +struct uprobe_map_info *uprobe_build_map_info(struct address_space *mapping, + loff_t offset, bool is_register) { unsigned long pgoff = offset >> PAGE_SHIFT; struct vm_area_struct *vma; -- 1.8.3.1