Received: by 10.223.164.202 with SMTP id h10csp491851wrb; Thu, 9 Nov 2017 09:25:45 -0800 (PST) X-Google-Smtp-Source: ABhQp+QEH1pcSt0VJVO1eh2e11IeyviswXhUBaWmTo8eVGwehsBQbuLn7xGWn6Ar+exiqaNJJPp/ X-Received: by 10.99.157.7 with SMTP id i7mr1120480pgd.165.1510248345049; Thu, 09 Nov 2017 09:25:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510248345; cv=none; d=google.com; s=arc-20160816; b=RqxiZtsbmY3faokDb3UQMfPcP62/zPuBl1BQ71Bg8jTNllDRSPWH5ZzdKJTdAj3xBf bkADVYunQt7YrpPBEa8kzaPP5lbhCsGj3Oi0b+GdPz20nRoGOVUrYCgegIo4SKW6xBB/ p1ylMJHhixIGOWeNnCiUtJRhfaM9tDcLkX5dmYVZfqfXFLhWt9KKH+sp1FaqNkIVpsUw SEXO1XmVC0wxPXDUqq1Ullfk9AGISryCmfPipMe4kIQzorCtCaNBWbdRLIazmDt56tjc Wj6OOmquIkx3sszvpau7PqYDcZjZkUvCUbzvlDYzsiBOPIX9+4uwYAiTfarLGjxhvn+t dLkA== 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=S2Cr+5fAwY3/GmfsaVtzpI79lSNSgNJ4se2JuOER6hM=; b=Xq8vHRD+pOP83BuhLilZn1VzNP4k7hZvdbFDZPI7LiywWBockmRcQjomv1Dx45OD/7 EF6jaij7BUHElXEJ31RCPy4a601HaLUJlDKG/1x7DLym7pVWVeFW6rWx0syvWVhMg2pO oUxXfr1t4B/qFdjePt4wTPPBNtMfNypSaFiyp1WxqAdqjngo3xwXlHuEBQYO7GjEjE3C TvWsvjaF6L3x4jPKBhDYLKOWOXEGJRIwbRESj0MVpOVLecF4HbUiZAJR6LD0GJaWz/hz GDux9YKNmP9qBhRBCDOgRBAXhW5wQN/McCBUxwJdhnILiv5t1J8E4oX930ZiaIA0IaAK TrEw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@fb.com header.s=facebook header.b=obeCWvWt; dkim=fail header.i=@fb.onmicrosoft.com header.s=selector1-fb-com header.b=bRr6LYyF; 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 n9si7070520plk.85.2017.11.09.09.25.33; Thu, 09 Nov 2017 09:25:44 -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=obeCWvWt; dkim=fail header.i=@fb.onmicrosoft.com header.s=selector1-fb-com header.b=bRr6LYyF; 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 S1753469AbdKIRXU (ORCPT + 81 others); Thu, 9 Nov 2017 12:23:20 -0500 Received: from mx0b-00082601.pphosted.com ([67.231.153.30]:60592 "EHLO mx0b-00082601.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752622AbdKIRXS (ORCPT ); Thu, 9 Nov 2017 12:23:18 -0500 Received: from pps.filterd (m0109331.ppops.net [127.0.0.1]) by mx0a-00082601.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id vA9HHmNB003697; Thu, 9 Nov 2017 09:22:22 -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=S2Cr+5fAwY3/GmfsaVtzpI79lSNSgNJ4se2JuOER6hM=; b=obeCWvWtpNh9qSAgC6DlQYpzI1YU3TuDCio+7GVX0FPu0SJnf9gIEZPlhtFwnn6OtOWL wAphdP27Z/ClAexTyeh4oJPtfve2rF3ymYxRZwaaVo+nxEu11YKE5t7AnTBtkP7P2BjH vD2evpxNXruAtjkOktlDmzNQ8DMff0MHawc= Received: from maileast.thefacebook.com ([199.201.65.23]) by mx0a-00082601.pphosted.com with ESMTP id 2e4nsusv0s-2 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Thu, 09 Nov 2017 09:22:21 -0800 Received: from NAM02-BL2-obe.outbound.protection.outlook.com (192.168.183.28) by o365-in.thefacebook.com (192.168.177.34) with Microsoft SMTP Server (TLS) id 14.3.361.1; Thu, 9 Nov 2017 12:22:19 -0500 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=S2Cr+5fAwY3/GmfsaVtzpI79lSNSgNJ4se2JuOER6hM=; b=bRr6LYyF0zfpscc9Nbozf/pLCEjJzhdXPQmgbI0djlnqAY+yIeWWaQCAalD+GFjtMBgOnJzXXG2nEh2oUUM33bYaznq63mx0fhkIiO07tj2tZHwOj2CqAODSMN45R2wnEnFveBOyoBeMjq14ho8v1ArFjHl6cRJZoNy9imFtdXU= 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 17:22:15 +0000 Subject: Re: [PATCH x86 v2] uprobe: emulate push insns for uprobe on x86 To: David Laight , "mingo@kernel.org" , "tglx@linutronix.de" , "oleg@redhat.com" , "peterz@infradead.org" , "linux-kernel@vger.kernel.org" , "x86@kernel.org" , "netdev@vger.kernel.org" , "ast@fb.com" CC: "kernel-team@fb.com" References: <20171109005433.2289587-1-yhs@fb.com> <063D6719AE5E284EB5DD2968C1650D6DD00B73C7@AcuExch.aculab.com> From: Yonghong Song Message-ID: <4d290497-4b4a-2eb5-1b92-496b990c80b2@fb.com> Date: Thu, 9 Nov 2017 09:22:10 -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: <063D6719AE5E284EB5DD2968C1650D6DD00B73C7@AcuExch.aculab.com> Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [2620:10d:c090:200::6:146f] X-ClientProxiedBy: DM5PR21CA0009.namprd21.prod.outlook.com (10.173.176.147) To MWHPR15MB1837.namprd15.prod.outlook.com (10.174.255.141) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: a3992543-3c89-443d-794f-08d527966d1c X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001)(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(2017052603249);SRVR:MWHPR15MB1837; X-Microsoft-Exchange-Diagnostics: 1;MWHPR15MB1837;3:OM9HD2aUmu4B23FR/CnYIYtXbRJX5B18E/Ccl5UvY9Jme1uBviyRxPHxOmXxvVl8ja9KfUWXDIc6+4z4HrlIRdfGouSApyE2/aPIvlAoIbJIVM/pTBZXMtl8EQhaZnoK3ORJyJay/5A+jKbpWHdZ1WesD3/J4gJTwY823ulk8Vxen2LgPeG55XgsW66XN91c514aN6EcF0Z7QxndtwuSQjGgDAa5pjeaaHsYnTw0hVMOy7YPsMHgef/18tFq///k;25:QJaSZ5hWjJ+SrCcHtFrLT1l4UMOGCiwRFAyT7p/3VMVHzvTWhiE8rCPHbGV1pEOCzAWtcSP0DhQNRIGHuZ/iJXbsfXPlUa4yeR7139JxcDoCA01N3eIthivjGFoKwRMQ/W2S3BsIZIgPnZHT2AVfgG29IJh0I34AcIDgjJYM67v+XNblXuCkH7e0nPVmpsXF84yMwpEw6vV5zAplKdTUxTkyo3Kl8GRHRWUxj4tHTbIlfa4i/jEiiNU+XdkAOqdOL3Sfy1L020wwOJWi9xTVPWKD5BeaO6tT9QT8Ax+MY1LISQRMo2OJUtAJ8RGIoYTGUDggplZeOyK6z+uAtIckaA==;31:Q7oCoMgXBsAQ81pGesTkJwthmrDZnRGpoOqgTKDg/rLlCpYLynDVa2l3YUaOwP1c6kgs5WCu1EQl27Bxwr1sc9Z98zMyiJy5XE+Qe0xpWJiCGEwJVnZJ7d2job/Fweq6m7BnMGm6guCd1bcoHa+vmfm4jDifdB9J7miJ4HfqGYeUhadCyunwP3FrGG2DJNM7j6s9fi7uz1uvVBTjghrWDkQstrZAHRFWjA1krPRdCuk= X-MS-TrafficTypeDiagnostic: MWHPR15MB1837: X-Microsoft-Exchange-Diagnostics: 1;MWHPR15MB1837;20:gucLxAzexoaFMMWdq2i7ozuuIp3TF1Vt0hByBWa51NMM3db/1CWDl51I0oF9vUVwnnA/GksltLaUthwuW2UOZBehwoNhNnrDSRdSuCmfQV09JWbLVAhI4N7PJyPXegD5ndmbEIFkHcIZ11bWYGndEDAzrKh3kbApVqOAKalchXUokZAnMP17uTw4yXCEKkB1wQzSvravRt9qWEwLArnuC/a33FdXPkNVgjwLHiicz5qVDjW5Qq9YGDSkltyezirx41sW9RbB5RUQixva6C2bcLzAYKA3mZ2IkoAiTuOMRt7ZS3R7qlbXN11Zm2RSx23cKvM/NhUG4viF5cxzzgJRi8vn+hCYcN92TANhg62DyfNJ+3gZpxlyZmOMBLLYIR8yuxlIEM7TEVHee2wQVcaFJktO3XqsC1p/JzBpsp/QJeKDSiuFDxtDyvNsN8HZevvsHGCVsiHDj2kVBihGRw9+9/EPqkdWuciL653NxYsT8z05pgz/uGJcZ113Y2gTGOPD;4:xp+qDcsH56SMrF+u294bgWZcuxmGFNpco+JUeXCnwfL85/R54Oi7gYjIQGr0ib9TMT6VQ9XR4GOhDobK2AgZI7ULtsoUBmiCRskfImuRkh6m+yNYrG1D+yrwfKOH3b7Z9b3EY+3e439ZZSGx4oVOP1wTVoAEu/ppQrCMtdR8HhtyISW5WRJwA2qJQJivxPyUu/YonDnxAFZemwXlvedLTcAfqMzRcUb3kWsHLRwY0I9IBIxpV+YWAzS27Nqz0aeBJWD3dVNm6swcpmBeeMmUkg== X-Exchange-Antispam-Report-Test: UriScan:; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(11241501159)(6040450)(2401047)(8121501046)(5005006)(100000703101)(100105400095)(93006095)(93001095)(10201501046)(3231021)(3002001)(6041248)(20161123560025)(20161123564025)(20161123555025)(20161123562025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123558100)(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)(376002)(346002)(199003)(24454002)(189002)(53546010)(2201001)(106356001)(50986999)(4326008)(31686004)(105586002)(58126008)(25786009)(64126003)(65956001)(68736007)(478600001)(110136005)(7736002)(50466002)(2906002)(230700001)(33646002)(316002)(67846002)(2501003)(6116002)(36756003)(8936002)(6246003)(83506002)(53936002)(189998001)(86362001)(6512007)(6486002)(31696002)(97736004)(81166006)(65806001)(305945005)(54356999)(76176999)(81156014)(6666003)(5660300001)(2950100002)(101416001)(6636002)(23746002)(229853002)(47776003)(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: =?Windows-1252?Q?1;MWHPR15MB1837;23:X9Bgy/1/NI40AiR+dvXGDx9Zkqe4Pp0A9++xk?= =?Windows-1252?Q?VLN03CeO3XTEhR4b6G/PAH+3ExrKfq9EwyPASXTBmBd0cbaGe2q2xlvO?= =?Windows-1252?Q?sET+GyX5MaDynCuDWVr23y2Rhn6rx1qWYRgmT954/BxMIJI6sS+n3YBK?= =?Windows-1252?Q?E03HP/4uRRNFOywFYinGqw5jCJITDFnKsUQ/BlfIFexqNucn6ugci3jU?= =?Windows-1252?Q?PAy+j8FDeBbtoK5cFOsZ7As4N9AvVKwqoRutz7m9LCT/Q77fxvq4WAH4?= =?Windows-1252?Q?SoWMog7FYo8bA7fhXe0gs94L5yh+rS9Cqu9NUAZW55C0QRclcnzPJNU6?= =?Windows-1252?Q?g931yXbgMEBxODIErhZc3HPI4Pz1n97CmrQaQWmV2BZdi1ZaLwvDOcK1?= =?Windows-1252?Q?VdGkSjnYrfZJrimaNyVbgRSJ48rzmATHbybdMmrAbEoanjYRjfUlQMuO?= =?Windows-1252?Q?eaUmFPavRREaVPm4XTmGI5fdFudUSm/N0qn2eF8GV74s+C9C/s44QyOC?= =?Windows-1252?Q?ahnPpZjAqrOYzEdEbBFQomnlOM2265ES+03xULQlgbiDXT3IV14W6c+g?= =?Windows-1252?Q?uuWBlVF8QtVvY7HcLTtYI7MPUs3AFjGKJeBpMiK5CKX7OsiV7mTd9vqB?= =?Windows-1252?Q?WmQDTVr5iCpJ7TXkmLM3SF5o6T7gQ7JUzRUrzhmAXEbx0E9o4WjroxYi?= =?Windows-1252?Q?L3aZ1ThbohN4XDrZZ+Du7ReD9ttenNZJStbQlxZPODbzuU5IlC5Iytgc?= =?Windows-1252?Q?u5iOrpnP1AtOmBzSw7NUmAbHPS0TI8f8jYIPzRuGffSpQ0DHBqB77nHl?= =?Windows-1252?Q?FTBdCnKe7MdsZoWcv4l9zF0cb6BUPDHZejJSV/i5RBCK04QrL+bl0oqL?= =?Windows-1252?Q?257iNfXUvXVFFtCOdf2Ky6C+ZoeqPPlhuRtCaGhNVo5HpGkbGnUv5ppr?= =?Windows-1252?Q?iSp+NnQ/5M5de+E5TUfOlie7BOoLoc0tG2XxT8/g+7/5jkdS/JWFsjnQ?= =?Windows-1252?Q?qSAKGKgDzzUuAmMnMAkRsr2qnfuIwrH+TqaV1zkFshPyJdHw9setp0io?= =?Windows-1252?Q?4OReRCrdZsA/Li2hMBW+pWbVsSNtzEvWkfGcJ6xbdQ08nYQWqkuXcy33?= =?Windows-1252?Q?QyHjp3SyaWpY9h9IqphfKUrdZwiTCgulsnKAgMNYedoFuNia5szngRwO?= =?Windows-1252?Q?hSyLRNfdI2GX5oI5K15Tw6Kp+Ca9D+3hHbIYbAfnTL7QJpcN+BxSfoW4?= =?Windows-1252?Q?giMdBgTNwQME92fOKhAH4WvneZMZvVc0+xnFU5ZycVWvQVWOuYOjPxPt?= =?Windows-1252?Q?Mp4c+nduIe5eCRIQhsQl3gIPM+gWjR5ljPy345m/3JKN02WsF/z1hPay?= =?Windows-1252?Q?7Sf+lHQ2JaD5ejEWsNvdZHLwNCLTzWTwQGdrzgz1IKu5HfI89sCNZ7Md?= =?Windows-1252?Q?A/VnCW0SH8e8lmEwzxz?= X-Microsoft-Exchange-Diagnostics: 1;MWHPR15MB1837;6:6uEWJHr2DFcNCfDaKu63FfwQ3rZqYHEpAlrd44Senx/xCie6h/MwuLiJHYqmwULSA6NN/hdSSfoGlKUINJ6R5BnIJANgdIhwE23bIhF92MREWBQbLMAa7uDD5kAXG6vx9FhXfWKO6bf70HhF5rwSWd6Mvn2zA8Y9F1OGkO5mMdFSz1T8oldY/3sPJsCB2lq6NqK1HP8txqlDREG6+6XLW424Xu6IMqkF0XSHa44yoMEu2vzIlnaBF8CDVdDuWxG6X8DYSjP929O63FV1viW37eQiqsweagyBamHeUyvinFWwPcEFoo88IJB5NkgXrcApqY/9y5z7FHpYS9vvwQmbfRBtvKWG7STqBquw8A9Tp0U=;5:z1weisvotBdMkvPM/2ywn0uw8zhv5+ZNYaMTd8CGbeKUQhf67Y4J5Yq6qSiD1eLiUTAzvPMkpF0r5TxQ02tXIR9Tn3B10Wsl3VQc5Ss8nQ2qMBtqe3E5V5jqpCD3U88E1WyIckNpaDdv33PVPPmEfLIuu9qggGNLwmX06rDYEwI=;24:XRTymXM9w2L2Maf5DmxJGYMlb07LANcNGWQVzpj7TooFC9EcPlLFQm0q3qa9iLURcgWR44kcB2hb+E0BnU2QxA2vgUP9QDFnw1UgIFDM+3s=;7:fhxsDcxPXy4UYEJaA5txsMTuB/MCB93Z2vM8NFt1JugemF6Je5msnpe1m2fxorYg/nO4H30slTTVb4omt2r46Ao9wDHzAzPePGci7EEFgielhzSCZPGUO3Pb9c2gFKagukeSIg0lZnSt/qD1EdML0iR1rnImom5kg+sFpWwpMEcpNwYqiAT8jQa3RkxKAfLvX8eTr4IPMAiGBA4IvCxJ0eFGt5tBXzE8J1VLVHRkbeEEn/3aQEgF5+vU4t2YfJxa SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;MWHPR15MB1837;20:I6w5y9p3FoLjskzsA0R0lLbpuqDCeyVhRKyaY0Kqd5YAk3J6rbf4x5V6Hy/EKmrvKXcUoRaswWQIDuWN5WErS3Lok3zG4aeZri0VzCKpdbcPV038uZgI5+xDlJOY/s6Ob49DOW9v9KbN6XAYCk2ju539Cx7Z3n9gyayBWFXFi8M= X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Nov 2017 17:22:15.0703 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a3992543-3c89-443d-794f-08d527966d1c 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_06:,, 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 3:26 AM, David Laight wrote: > From: Yonghong Song >> Sent: 09 November 2017 00:55 >> >> Uprobe is a tracing mechanism for userspace programs. >> Typical uprobe will incur overhead of two traps. >> First trap is caused by replaced trap insn, and >> the second trap is to execute the original displaced >> insn in user space. >> >> To reduce the overhead, kernel provides hooks >> for architectures to emulate the original insn >> and skip the second trap. In x86, emulation >> is done for certain branch insns. >> >> This patch extends the emulation to "push " >> insns. These insns are typical in the beginning >> of the function. For example, bcc > ... >> diff --git a/arch/x86/include/asm/uprobes.h b/arch/x86/include/asm/uprobes.h >> index 74f4c2f..f9d2b43 100644 >> --- a/arch/x86/include/asm/uprobes.h >> +++ b/arch/x86/include/asm/uprobes.h >> @@ -33,6 +33,11 @@ typedef u8 uprobe_opcode_t; > ... >> @@ -53,6 +59,10 @@ struct arch_uprobe { >> u8 fixups; >> u8 ilen; >> } defparam; >> + struct { >> + u8 rex_prefix; > > Just call this 'reg_high' and set to 0 or 1. Will do. > >> + u8 opc1; >> + } push; >> }; >> }; >> >> diff --git a/arch/x86/kernel/uprobes.c b/arch/x86/kernel/uprobes.c >> index a3755d2..5ace65c 100644 >> --- a/arch/x86/kernel/uprobes.c >> +++ b/arch/x86/kernel/uprobes.c >> @@ -640,11 +640,71 @@ static bool check_jmp_cond(struct arch_uprobe *auprobe, struct pt_regs *regs) >> #undef COND >> #undef CASE_COND >> >> -static bool branch_emulate_op(struct arch_uprobe *auprobe, struct pt_regs *regs) >> +static unsigned long *get_push_reg_ptr(struct arch_uprobe *auprobe, >> + struct pt_regs *regs) >> { >> - unsigned long new_ip = regs->ip += auprobe->branch.ilen; >> - unsigned long offs = (long)auprobe->branch.offs; >> +#if defined(CONFIG_X86_64) >> + switch (auprobe->push.opc1) { >> + case 0x50: >> + return auprobe->push.rex_prefix ? ®s->r8 : ®s->ax; >> + case 0x51: >> + return auprobe->push.rex_prefix ? ®s->r9 : ®s->cx; >> + case 0x52: >> + return auprobe->push.rex_prefix ? ®s->r10 : ®s->dx; >> + case 0x53: >> + return auprobe->push.rex_prefix ? ®s->r11 : ®s->bx; >> + case 0x54: >> + return auprobe->push.rex_prefix ? ®s->r12 : ®s->sp; >> + case 0x55: >> + return auprobe->push.rex_prefix ? ®s->r13 : ®s->bp; >> + case 0x56: >> + return auprobe->push.rex_prefix ? ®s->r14 : ®s->si; >> + } >> + >> + /* opc1 0x57 */ >> + return auprobe->push.rex_prefix ? ®s->r15 : ®s->di; > > The bottom of that switch statement is horrid.... > Actually why can't you sort out this address in the code that > sets up 'reg_prefix' (etc); Good suggestion. Will do. > > David > From 1583587584516368142@xxx Thu Nov 09 11:26:47 +0000 2017 X-GM-THRID: 1583547898123441695 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread