Received: by 10.223.164.202 with SMTP id h10csp754141wrb; Thu, 9 Nov 2017 13:54:56 -0800 (PST) X-Google-Smtp-Source: ABhQp+RttnliwNRsbwFvD+siDle4egGEC3VQvFl4g0EnIuCga+IwldgcM02/mZH88LgQW/iPzRFp X-Received: by 10.98.93.136 with SMTP id n8mr1905459pfj.215.1510264496699; Thu, 09 Nov 2017 13:54:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510264496; cv=none; d=google.com; s=arc-20160816; b=KySxutx/ddvAc6ikM7eVJxDUHYIH0EY7aQJQ7acKcJOFdaoOUeeUGdpW2iGidMbd3T KmiSshw6xnotLfvhB7F7Rq+VINEVvCvm0nCO8ba8DtSngTBGaCJFibFRsbHZTVHAd7b0 rAhriP2WwjtMyexKP/peVCokc8I+xgpN0YGS0k06qObwZluUrJKPCri8ULydgzJEw4Dk AX50WR4pa1RLyHJkZS4paPmu2Mpd8eP3yHEKvVC51ZaIQZm+2d+4G0qsEb2Gfb9iAXzY ss2fxGPYlRGYyXpaZuY+Pd9txChnS1eXDHuoKkYO8WyIDFBhMIvvfjxCqD2jVhPOGp0M qydQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:spamdiagnosticmetadata :spamdiagnosticoutput:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature:dkim-signature :arc-authentication-results; bh=3KBdqHfq/V8v2t3vcBt4xwFtd4/mMZDqsXou9ENA6C4=; b=o5bPR638bl81g1zYbNckk3qxZdkq/BhpzjpubeB0kNxyIUCpa4dBBhSyUXkHZiqu8x AKThAmVTHt5e/1Su1zZg4Xvy/DS98MnCku2tMlMpn5+VOB4OgKx4Ghz2f1DTknjGOIkH 0iqGbESeudIZNtd8+Xa+gV5RqMPDJL8qiOtasC4zp+rPa/dV5io76t0Ttx0hueuvm6di w0G21zXc+jbUa+YeNrdbbxdFKBhGhYtDONJa4QOO05KYqUlN9Eppg8X7NrVn+Kuysv1Q rl0QnODS5vw5vCVBfT/maMy+FmK72Kb7bdLqOhl2ledoxsXy02Ky2kYXUzK3vvFb+Wht TLmg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@fb.com header.s=facebook header.b=Biq24RO/; dkim=fail header.i=@fb.onmicrosoft.com header.s=selector1-fb-com header.b=eU6sPXJq; 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=pass (p=NONE sp=NONE dis=NONE) header.from=fb.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s126si7079864pgc.618.2017.11.09.13.54.45; Thu, 09 Nov 2017 13:54:56 -0800 (PST) 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; dkim=pass header.i=@fb.com header.s=facebook header.b=Biq24RO/; dkim=fail header.i=@fb.onmicrosoft.com header.s=selector1-fb-com header.b=eU6sPXJq; 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=pass (p=NONE sp=NONE dis=NONE) header.from=fb.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754888AbdKIVyL (ORCPT + 83 others); Thu, 9 Nov 2017 16:54:11 -0500 Received: from mx0b-00082601.pphosted.com ([67.231.153.30]:32788 "EHLO mx0a-00082601.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751017AbdKIVyI (ORCPT ); Thu, 9 Nov 2017 16:54:08 -0500 Received: from pps.filterd (m0089730.ppops.net [127.0.0.1]) by m0089730.ppops.net (8.16.0.21/8.16.0.21) with SMTP id vA9Ln266031923; Thu, 9 Nov 2017 13:53:32 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fb.com; h=subject : to : cc : references : from : message-id : date : mime-version : in-reply-to : content-type : content-transfer-encoding; s=facebook; bh=3KBdqHfq/V8v2t3vcBt4xwFtd4/mMZDqsXou9ENA6C4=; b=Biq24RO/19vhJfeS/kkkI2+EtplszEQWYPDnW/e6TBa/qduzQrR8ZtMChIwx2cjILcJS X977IEXDfp8algKkrafSKx5qmdb3jC9Eqg0qtJ/GZhHemIih9aWTgCGhOkU5dr3NIFlL pyerVX13v0PwBExK+b/+a49KfDHtcM5Cb9w= Received: from mail.thefacebook.com ([199.201.64.23]) by m0089730.ppops.net with ESMTP id 2e4wxggaxu-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Thu, 09 Nov 2017 13:53:32 -0800 Received: from NAM02-SN1-obe.outbound.protection.outlook.com (192.168.54.28) by o365-in.thefacebook.com (192.168.16.24) with Microsoft SMTP Server (TLS) id 14.3.361.1; Thu, 9 Nov 2017 13:53:30 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fb.onmicrosoft.com; s=selector1-fb-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=3KBdqHfq/V8v2t3vcBt4xwFtd4/mMZDqsXou9ENA6C4=; b=eU6sPXJq2Ocva6Z4FR4otBu2s8hcP4qjqCj8zHjWWrcSHxscLc0iM2Et+NmCcDzhgH5PMbn3CPUTztjqNzsTzRD8DiH9JaPm9hzGZRxxBJXcg5WGc7TZLs3Al4g9xrlrMCjggjGyzwmGaOd2eCM2oM09itH/aIPVr+HSYg/8o78= Received: from MacBook-Pro-52.dhcp.thefacebook.com (2620:10d:c090:200::6:146f) by MWHPR15MB1837.namprd15.prod.outlook.com (10.174.255.141) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.218.12; Thu, 9 Nov 2017 21:53:28 +0000 Subject: Re: [PATCH] uprobes/x86: emulate push insns for uprobe on x86 To: Oleg Nesterov CC: , , , , , , , References: <20171109080155.359718-1-yhs@fb.com> <20171109134423.GA8746@redhat.com> From: Yonghong Song Message-ID: <2179faef-262c-21b5-e835-5dff52355656@fb.com> Date: Thu, 9 Nov 2017 13:53:23 -0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: <20171109134423.GA8746@redhat.com> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [2620:10d:c090:200::6:146f] X-ClientProxiedBy: MWHPR14CA0045.namprd14.prod.outlook.com (10.171.142.159) To MWHPR15MB1837.namprd15.prod.outlook.com (10.174.255.141) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 0c68bf29-e407-4b46-1a52-08d527bc4f89 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001)(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(2017052603252);SRVR:MWHPR15MB1837; X-Microsoft-Exchange-Diagnostics: 1;MWHPR15MB1837;3:fWwnerrM5ESmCAFtvjD1WP10B94wVXQ1oLoCusXVcGBoprbsIKhQHMvUZH84wHIcm6+TfSGtxznqVy/7MMYmvjH546pD1eJ92bN+UpOUwxP0M3OKmRVhHQSvsMyR18AMb/MuX397dJVB5CY+9PhJY8/W4mFskTbF72Rvm5pHCyJFyex+UJi0H7UPwrzmm9ntTkluoookFKPntgvWZfPC/Yecz+CB2WQX5Deaf7m2nnLemyXbj+JHIjFl+LwOqEtP;25:Gam1mYtReNW2s/uWMeGHJhvReJTn835Xus7hwYpaXSGUMbcRg+mW9ukIv76et3wvjP6aa7/JQf8tz3T9xZqtzzUFXe1nLSnO8i9i+Xpmsj/Kfkh41PiK1TGDohqFKiqb4uSb2VmznF65upukKU6LzGvMCnoUuhiN8UonU1wn3bXu70RPMhrjCV/K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4o3K/56KGIthXZk+nyQhDIQSW96l7QgusRn4sV+4tELQZa1ZAar9fJ8tEh8cPqRiOPW7qPs9PY9zERzOz84tzR8aqYOcixYtkGmmyNA0HVmR+NqKt3wkqkoBdacnw7dfCRxhg1Z9PJNWCSnPy6ywrbJjCjqFswQv4nYRQkEkHNW8xBq5LtAd99fVotQtRm9ldmBo7Uc+RM9wRGXbYXYu/jC7P39gIVf/p X-Exchange-Antispam-Report-Test: UriScan:(166708455590820); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(11241501159)(6040450)(2401047)(5005006)(8121501046)(3002001)(10201501046)(3231021)(93006095)(93001095)(100000703101)(100105400095)(6041248)(20161123558100)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123562025)(20161123555025)(20161123564025)(20161123560025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095);SRVR:MWHPR15MB1837;BCL:0;PCL:0;RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);SRVR:MWHPR15MB1837; X-Forefront-PRVS: 0486A0CB86 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(6009001)(346002)(376002)(199003)(24454002)(189002)(53546010)(106356001)(50986999)(31686004)(4326008)(105586002)(58126008)(25786009)(64126003)(65956001)(478600001)(68736007)(23676003)(966005)(7736002)(50466002)(230700001)(2906002)(316002)(67846002)(33646002)(6116002)(8936002)(36756003)(6246003)(83506002)(189998001)(53936002)(86362001)(6512007)(6486002)(6306002)(31696002)(97736004)(81166006)(65806001)(6916009)(305945005)(54356999)(76176999)(5660300001)(81156014)(6666003)(101416001)(2950100002)(47776003)(229853002)(8676002)(6506006)(65826007)(42262002);DIR:OUT;SFP:1102;SCL:1;SRVR:MWHPR15MB1837;H:MacBook-Pro-52.dhcp.thefacebook.com;FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX:1;LANG:en; Received-SPF: None (protection.outlook.com: fb.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtNV0hQUjE1TUIxODM3OzIzOlFSZlRWcXVLQnFBTXlnK1QyL3kzRlAydlpI?= =?utf-8?B?RzRmMDV5YjNmWjlZMjVISHZKVHRzRk5GNDR5UjdQOUUyNkhNampMdHlTamgz?= =?utf-8?B?Vm9ob1kwY1V6cWNLTlJwbGZ5R0NIaUh5RlBOS21HSHE5cWpyRnVzN3NIL2ZK?= =?utf-8?B?b3ZMZUpJNi9IbEVBUDNCdzY5NjFPai9MTmpQeWZ6NTNCZ0VKZGxxZVZRY3Zp?= =?utf-8?B?am1MOU5YSjRDNkJubzJhaUtVTXFoc05SaDVrOW5nbFBxeFNuenJZY0FINWxu?= =?utf-8?B?T003bHUyQWE0QVBIbzJOZ2FiR0NnV05lc2J6WTBLZW9mbHRTWldjTjdHSi90?= =?utf-8?B?S2huTFFaVTJGK2FuRndrOXdVWUJjNmJ3MkU5Z3FuV1RDVlQ4c01QNHNzV3RE?= =?utf-8?B?R3R6WTNETlFTdUZDck5oc3BLdk9oZWxwbmoybGwxcFlFaG5TeVdKWGp4Y1VZ?= =?utf-8?B?SHQ5STJIc0FucUpMSGZldVRlbWhCTTlJVWZGUWlOOU50dE1TVW50VkQ0YnJY?= =?utf-8?B?NjBpWWRjVmwvVkYyWnhsM1ZZQUtMKzhOSlArd0sxTk0rQzJiRW9GQXJkblZM?= =?utf-8?B?UGExK2Zobld6c1M5QXVwSFh1R21pai9Ub3Nxbk40M2J1eTBTRU8yV3ozeTM0?= =?utf-8?B?NXZJTE0zWG9jdk5RS0YwekZxQUM3RDdPZm5Qb0x6dUJna3F6aWtzVjRObitK?= =?utf-8?B?cy9Oa1RJT0JnL2ZaclYyVExNdVBrOGRCdi9XcFU3MW0vZHVHeDlNOHVxaFNl?= =?utf-8?B?SzgwTC9MKzZRME1qREd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SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;MWHPR15MB1837;20:Odb2lLy0bCK1lCeMTyz57Ipvc1CRcc1NxsUYIthjeu5rApzXvsgcuG8i+We/ADd6SzH5TN/Lj7Nqad7Hf2IUkBXJ2gXTGaMKrQw5s0xxbJd4zG57UQKR3s7RWDK4fUNAnR1AYbxKx9JIuPr3yVrmwyhDQu0FcmZHLlCMMqZv0oE= X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Nov 2017 21:53:28.0294 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 0c68bf29-e407-4b46-1a52-08d527bc4f89 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 8ae927fe-1255-47a7-a2af-5f3a069daaa2 X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR15MB1837 X-OriginatorOrg: fb.com X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-11-09_09:,, signatures=0 X-Proofpoint-Spam-Reason: safe X-FB-Internal: Safe Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11/9/17 5:44 AM, Oleg Nesterov wrote: > On 11/09, Yonghong Song wrote: >> >> This patch extends the emulation to "push " >> insns. These insns are typical in the beginning >> of the function. For example, bcc >> in https://github.com/iovisor/bcc repo provides >> tools to measure funclantency, detect memleak, etc. >> The tools will place uprobes in the beginning of >> function and possibly uretprobes at the end of function. >> This patch is able to reduce the trap overhead for >> uprobe from 2 to 1. > > OK. but to be honest I do not like the implementation, please see below. > >> +enum uprobe_insn_t { >> + UPROBE_BRANCH_INSN = 0, >> + UPROBE_PUSH_INSN = 1, >> +}; >> + >> struct uprobe_xol_ops; >> >> struct arch_uprobe { >> @@ -42,6 +47,7 @@ struct arch_uprobe { >> }; >> >> const struct uprobe_xol_ops *ops; >> + enum uprobe_insn_t insn_class; > > Why? > > I'd suggest to leave branch_xol_ops alone and add the new push_xol_ops{}, > the code will look much simpler. > > The only thing they can share is branch_post_xol_op() which is just > > regs->sp += sizeof_long(); > return -ERESTART; > > I think a bit of code duplication would be fine in this case. Just prototyped. Agreed, having seperate uprobe_xol_ops for "push" emulation is clean and better. > > And. Do you really need ->post_xol() method to emulate "push"? Why we can't > simply execute it out-of-line if copy_to_user() fails? Thanks for pointing it out. Agreed, we do not really need post_xol for "push". xol execution is just fine. Will address your other comments as well in the next revision. > > branch_post_xol_op() is needed because we can't execute "call" out-of-line, > we need to restart and try again if copy_to_user() fails, but I don not > understand why it is needed to emulate "push". > > Oleg. > From 1583600390168465683@xxx Thu Nov 09 14:50:19 +0000 2017 X-GM-THRID: 1583574831236519975 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread