Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp249331ybl; Tue, 20 Aug 2019 19:20:31 -0700 (PDT) X-Google-Smtp-Source: APXvYqwMAhTbxVu9Us2QCy9ZmMDIPvt96zyHg2vD08SI1PZidzpEjwYacC/Y0cD3Mi4TyIGT0f6n X-Received: by 2002:a63:2b8e:: with SMTP id r136mr27256203pgr.216.1566354031668; Tue, 20 Aug 2019 19:20:31 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1566354031; cv=pass; d=google.com; s=arc-20160816; b=AjoWO8o/6PBZqpr5wn09W64aBKo45sK5PLCPm6+/UAH2dkr39YIZh8C8z84S+1h8ew koW8BKSVpf1V7M/Rv/FUw5HjQrO5kbqNIbz7WsbK1x49PwKyjQlYfoVOyOI7xy5PYYpT HeD0uZUwp67n8kc73py2m9/5Xn5t8DR0s7eufV7n4wCwGfLqCH64vZKgXO6FGrH74wXe TV1TN8loNgsfXtk0Gxuab4AWCU4JjcFcB3JrCI1Ub0711+ykHxKDlyvP9oleRRe3EZZS mSw66M8Fpp6rW3iZdzBYhNZ/Y4RDGV6o26248TqnFtYG6LLIa8jBRIBCdGElmU7DhMzD 5Rmw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :content-id:content-language:accept-language:in-reply-to:references :message-id:date:thread-index:thread-topic:subject:cc:to:from :dkim-signature; bh=hUuMHjoe75rqWTnQaVQatauchNyXq7Z+RK96qIFK5Io=; b=FhD4FhwyHs9Y8lhE6v7oIkUldV62e2dlhmQHVpujUuVKOnr5Yema7OvxOhrftRfWNw MtAfB78Vp8RTY9rONd8/LQ64Tgzxt5kaz7qdcH8b1zPwDECFYfg1TKGzPK2sc4dnzUwn Ka9AFemHcc/2fDHHDcg/GJ/IKSV53PcIgsXtEZAAGUxaAefQ6ypFApM9OcKqzuapbccA 5mtIr/0Ia8yJ+rTSozDcvd0IypJXMh2fQ0EGBZPZUn2LdEFAqJiiZLp8zpCGmNU+RxXu M15jP6woTKzyng6kvxznxe4zIuYYkPBKQ2ven/6F3I4X74js7cYzlZcD5trzzh8NeaQJ XGKQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@Synaptics.onmicrosoft.com header.s=selector2-Synaptics-onmicrosoft-com header.b="Y++f/hyp"; arc=pass (i=1 spf=pass spfdomain=synaptics.com dkim=pass dkdomain=synaptics.com dmarc=pass fromdomain=synaptics.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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d25si13171363pge.301.2019.08.20.19.20.16; Tue, 20 Aug 2019 19:20:31 -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; dkim=pass header.i=@Synaptics.onmicrosoft.com header.s=selector2-Synaptics-onmicrosoft-com header.b="Y++f/hyp"; arc=pass (i=1 spf=pass spfdomain=synaptics.com dkim=pass dkdomain=synaptics.com dmarc=pass fromdomain=synaptics.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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727127AbfHUCC1 (ORCPT + 99 others); Tue, 20 Aug 2019 22:02:27 -0400 Received: from mail-eopbgr740070.outbound.protection.outlook.com ([40.107.74.70]:39982 "EHLO NAM01-BN3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726372AbfHUCC1 (ORCPT ); Tue, 20 Aug 2019 22:02:27 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=BQ9936GfR4Vxh4KuakPfq/JPKrr7o/AbUxo+SdG63eYjDG6o0WNFG7cGdzsZNhfmy4i3d1gVED66neOtZnClolb0igePKHVh/UXJp7knSfoAjM3omNt/6uRq2Wywmbck7uSEB5uHmyLlqGCDs4bZWsDbn3rvQdh/s2qzfMtVL+gbmhqF+v0yFLq6+VYIPe43zNB36q6D9IYYizg+13y5yaQ2H8SOcBo0+UUJx3YOKEf9IYd7C3SO0GHwhq15Sf/pY4U8jJP6cqLRgr2UrCMY+kBpp/++QNCGakNn0o+6xF2YrdkC5UZzbhgX/mluhSWAuGaJTLJbdXbpeRSYxle4mQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=hUuMHjoe75rqWTnQaVQatauchNyXq7Z+RK96qIFK5Io=; b=FDu+wwZBrjMHH2lISFucuqHo/Iup3IrNrza3Hl3DZwQgpDuxOH9FYMkcpMTKU4xucAUoVAv+NnQu0OjqvZnz82xdbvIjaXjpMgC+Yw4hhf1aT1kqhZ0fjCaV2wxZXJMpAo/mGpC/dwooESDNzgm8iBAFyGFBT0GtdYHpt9CQZnsTnGzIh/QlJqqU084oKCpCNdjBy9/KocrFV8p6yvOhSB046LpPMw4U7f4gx25YyW1pwASNFUZrpbCL/KUeEbw4Dx4cXA1n5/Pr7vaMrS2ii6D1jCSx2jEdi41D+cUbF1cx2ZyjrSvRzJz4D37vL8CrolFJ7QmDPEHEl9WntLLBMg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=synaptics.com; dmarc=pass action=none header.from=synaptics.com; dkim=pass header.d=synaptics.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Synaptics.onmicrosoft.com; s=selector2-Synaptics-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=hUuMHjoe75rqWTnQaVQatauchNyXq7Z+RK96qIFK5Io=; b=Y++f/hypMiLNY8Mc3nRnA95quJq6oAOkwhKJ3YCWoatn3RNtUraDJMPKWfQcX7I69g/onfQlqsz+tbZ7qVwuBe8fM05yqiSIKTek6xDUOIrgDrkWNViQmNjPCwXeFtstOlvHOuSEsA84cf9n2tTU/rlqegVwL8CYWt+BVUPqFs4= Received: from BYAPR03MB4773.namprd03.prod.outlook.com (20.179.92.152) by BYAPR03MB4885.namprd03.prod.outlook.com (20.179.94.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2178.18; Wed, 21 Aug 2019 02:02:24 +0000 Received: from BYAPR03MB4773.namprd03.prod.outlook.com ([fe80::a517:3578:67bf:6c88]) by BYAPR03MB4773.namprd03.prod.outlook.com ([fe80::a517:3578:67bf:6c88%7]) with mapi id 15.20.2157.022; Wed, 21 Aug 2019 02:02:23 +0000 From: Jisheng Zhang To: Peter Zijlstra CC: Thomas Gleixner , Catalin Marinas , Jonathan Corbet , Will Deacon , Ingo Molnar , Borislav Petkov , "H. Peter Anvin" , "x86@kernel.org" , "Naveen N. Rao" , Anil S Keshavamurthy , "David S. Miller" , Masami Hiramatsu , "linux-doc@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" Subject: Re: [PATCH v2 1/3] kprobes/x86: use instruction_pointer and instruction_pointer_set Thread-Topic: [PATCH v2 1/3] kprobes/x86: use instruction_pointer and instruction_pointer_set Thread-Index: AQHVVwqiEXrXfYjUc0SG3b0/wT6us6cDu4YAgACFhgD//8UhAIAA0YuA Date: Wed, 21 Aug 2019 02:02:23 +0000 Message-ID: <20190821095109.34c8a47f@xhacker.debian> References: <20190820113928.1971900c@xhacker.debian> <20190820114109.4624d56b@xhacker.debian> <20190820165152.20275268@xhacker.debian> <20190820132110.GP2332@hirez.programming.kicks-ass.net> In-Reply-To: <20190820132110.GP2332@hirez.programming.kicks-ass.net> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [124.74.246.114] x-clientproxiedby: TYAPR03CA0007.apcprd03.prod.outlook.com (2603:1096:404:14::19) To BYAPR03MB4773.namprd03.prod.outlook.com (2603:10b6:a03:134::24) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Jisheng.Zhang@synaptics.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: Claws Mail 3.17.3 (GTK+ 2.24.32; x86_64-pc-linux-gnu) x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 3a617a94-17ba-449a-3b57-08d725db9b5a x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(5600148)(711020)(4605104)(1401327)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7193020);SRVR:BYAPR03MB4885; x-ms-traffictypediagnostic: BYAPR03MB4885: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:3968; x-forefront-prvs: 0136C1DDA4 x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(136003)(396003)(366004)(346002)(376002)(39860400002)(189003)(199004)(316002)(76176011)(6916009)(6246003)(8936002)(2906002)(86362001)(26005)(50226002)(81156014)(81166006)(52116002)(99286004)(8676002)(6116002)(9686003)(53936002)(66476007)(229853002)(6512007)(66556008)(64756008)(6486002)(3846002)(66446008)(66946007)(6436002)(14454004)(25786009)(4326008)(54906003)(478600001)(386003)(7416002)(71190400001)(71200400001)(256004)(305945005)(7736002)(66066001)(11346002)(186003)(102836004)(6506007)(446003)(476003)(486006)(4744005)(1076003)(5660300002)(39210200001);DIR:OUT;SFP:1101;SCL:1;SRVR:BYAPR03MB4885;H:BYAPR03MB4773.namprd03.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:0; received-spf: None (protection.outlook.com: synaptics.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: shHB0z3Lt1+J1Ki7s8ZOpHzcAyXBvr8/NFz/HzIhP5L/GEypbQo8nQvq655e/o4DqQtVdzKqxn/l8VsKQZLSM/cAPcHmr4ORSE7XAvL43Wvp9kA2Ho0zSF7CmTkns8lw6cZppXUpcM/6b5gFSYHjjjw7zOQ5rNA3pNpbgKwlRygKQwUdtHswgzD9G6IKchJab/MtxvVS6/CAIfaaH8cdoAjG5nEpZY90U0NJwj1xdvF4VXXeTB0bCCHAg/ErwBtWGLCG8FDrn8CEUbBmX9MFkKGTfSGSlVb83pBuJa7ql/xiIwztBXLUOrhtJVvThaggThldQitDDGclonePbeHnk7gzkYUkTEy8tUIyvVJQui6a+Ytc0GIXLtj4SQ9ox2bleBKHQ3aTFGmumd5MHyqDinnuYBSA9bbHb10Vw0RZOYY= x-ms-exchange-transport-forked: True Content-Type: text/plain; charset="us-ascii" Content-ID: <4C07A4FB8806CE458AFD476C7948DA7B@namprd03.prod.outlook.com> Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: synaptics.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3a617a94-17ba-449a-3b57-08d725db9b5a X-MS-Exchange-CrossTenant-originalarrivaltime: 21 Aug 2019 02:02:23.2990 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 335d1fbc-2124-4173-9863-17e7051a2a0e X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: DB9R5wdkeldXDg4VeETorIOfE5CXxsTkOiMIMFEBsF+Xrh9e7kQQUNpcehD0zQgNjJPGvShpX3Xm0PF5zf3uaw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR03MB4885 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Peter, On Tue, 20 Aug 2019 15:21:10 +0200 Peter Zijlstra wrote: >=20 >=20 > On Tue, Aug 20, 2019 at 09:02:59AM +0000, Jisheng Zhang wrote: > > In v2, actually, the arm64 version's kprobe_ftrace_handler() is the sam= e > > as x86's, the only difference is comment, e.g > > > > /* Kprobe handler expects regs->ip =3D ip + 1 as breakpoint hit */ > > > > while in arm64 > > > > /* Kprobe handler expects regs->pc =3D ip + 1 as breakpoint hit */ =20 >=20 > What's weird; I thought ARM has fixed sized instructions and they are > all 4 bytes? So how does a single byte offset make sense for ARM? I believe the "+1" here means + one kprobe_opcode_t. Thanks