Received: by 2002:a05:7412:bbc7:b0:fc:a2b0:25d7 with SMTP id kh7csp2193824rdb; Sun, 4 Feb 2024 20:42:27 -0800 (PST) X-Google-Smtp-Source: AGHT+IF8W+NY8fps/SGlTkzPcWSYpJKtUHzMwaI0C2sEvvARnnnNQsXZHRnoIoOf2XOtqsQZD51c X-Received: by 2002:ac8:7d10:0:b0:42c:2494:7fd6 with SMTP id g16-20020ac87d10000000b0042c24947fd6mr2216272qtb.37.1707108146771; Sun, 04 Feb 2024 20:42:26 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVveHhvnoF8kp73QCp/7DxQ/v4zbGe0dSvpZLy5aQL3epJgvHPqHLfDyXfMLSvU5ZbRWkxDc6rp9Qv11uAF2rzf7dRED6WrI+ju0nTZhA== Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id b22-20020ac87fd6000000b0042c1c0087dfsi2858881qtk.578.2024.02.04.20.42.26 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 04 Feb 2024 20:42:26 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-52025-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@illinois.edu header.s=campusrelays header.b=EryxEfyG; arc=fail (signature failed); spf=pass (google.com: domain of linux-kernel+bounces-52025-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-52025-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=illinois.edu Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 7992D1C210F5 for ; Mon, 5 Feb 2024 04:42:26 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A42DBB641; Mon, 5 Feb 2024 04:42:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=illinois.edu header.i=@illinois.edu header.b="EryxEfyG" Received: from mx0a-00007101.pphosted.com (mx0a-00007101.pphosted.com [148.163.135.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 98593AD27; Mon, 5 Feb 2024 04:42:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=148.163.135.28 ARC-Seal:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707108136; cv=fail; b=rx7v+Ol7Ly3/fr60wBcZMBlssWKvG4gVtVppsbuqWYmx6z8GQBGnSxkFSf4QeQAyFLsoi4/r4ofDYRsHBouuDeLZVkn5j6OM93ZsHT9aSAXcwLALJC0F35nlFO/oNJAuVILsPuS4Eot+xtb2m9pNYXaUlslcf19j1oGRTiFC/cM= ARC-Message-Signature:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707108136; c=relaxed/simple; bh=p+GGkCy7k2rMDqg4QlPyNJmKoinwhRBjqgwJUJoKT+Q=; h=Message-ID:Date:Subject:To:Cc:References:From:In-Reply-To: Content-Type:MIME-Version; b=h5HI8M+KwlJZ9EDeb742N+3cIDZ+qKkdnsXqRPnl43lE1GRWw9Z3KsR+SbtHq7E8pA1xcJ1hT9l40Ek8SeeXoiyiMpyZrMeSvAQ7EMTV97f3DH/cyoETcGrNc2v8m/wuS0ORbBWniBId9/8S6pAuLmtgocA2A7LQxMXIF5YtHYI= ARC-Authentication-Results:i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=illinois.edu; spf=pass smtp.mailfrom=illinois.edu; dkim=pass (2048-bit key) header.d=illinois.edu header.i=@illinois.edu header.b=EryxEfyG; arc=fail smtp.client-ip=148.163.135.28 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=illinois.edu Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=illinois.edu Received: from pps.filterd (m0166257.ppops.net [127.0.0.1]) by mx0a-00007101.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 4153abBd022206; Mon, 5 Feb 2024 04:41:21 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=illinois.edu; h=message-id : date : subject : to : cc : references : from : in-reply-to : content-type : mime-version; s=campusrelays; bh=PRnX+IL7z1uEAUuAFWy1XheYxtUSO9f1LDXiuVMDNFw=; b=EryxEfyGAJGKlgqk5lww6liebmj4U/W+9XeZhiXFfuOd5xh1anL12q/yMS55Ug7Yb3vp NNZWoP8xEG1mBamZ1WiW7/zv4MLFeUzE0kbhvM2JvcVKENg1Qdyil/PlByz6nsAEn3e9 B+FmIKU0BC8C3dUwPkDHUdvnL7BMPRyAAeWTbl5oML0WXMk+CfjiMsxcWU/YS5f5pgYS vo8g/GXnnph/YpUyEqot2/GVwt3AfuOPSsq4QkpDVpGhGpEkDyRHgekhBQdWG8MpBB67 SHXF7gBnJ8CZUc1ggQTTK8f+FAkD4yxBFK9PhkadtFoOVA1VNeZV9KXomNx/PuiYGP4I xg== Received: from nam12-dm6-obe.outbound.protection.outlook.com (mail-dm6nam12lp2168.outbound.protection.outlook.com [104.47.59.168]) by mx0a-00007101.pphosted.com (PPS) with ESMTPS id 3w1e8n9ueg-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 05 Feb 2024 04:40:50 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=CXYBa8b7pizJVwopKW7s5gVyNOAms0jlri/gTBZEtUintIUQfsA+czJeQRK1EiJaUSLWrvMYCTGIoMV+YLKpx25TCfFS02UQ0Ps+3EW0ShDDxFNrGoZwDtgO0YB1ckBoK7eSXy/igzyS/W589RTvYG5yzTWjOzNUIKJDvgHhW0h8mw/UNixpUpuNVEkrc9VLmQZRDp2I3oOXoFOM8AJ62BguUVIujh0IhuDcUuUBz/fmU+yRDQUyWjSRdwIbL3nfV2ZDcyqfsZaZ3j+luxwJ3I9yR2488U6J5Ak/tLxqtuveTigoujvIa0h/Po+fjlNecCD4W7BW2YwWRGhEAlaJVQ== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=PRnX+IL7z1uEAUuAFWy1XheYxtUSO9f1LDXiuVMDNFw=; b=Afr+faOFJ/CPLMSWu/8n2Mtt/73QmMqP8ZAEFesVnl5iq9Vg5cCDTEJL5qdvCIrf9O4isP8GSWQJlYnigrXQ0pr+cZJvhN916mRqye3B7dFDVqf2mkFLZ440B44ooL/YoQAoNIqwSiqTCdbmmU1S9a0RUvzmwxeEGMcULRQH5+w4btQY148eyZnbRjOqLdYeqTIhaOYCclIMJ+8wzkdtsdE8AKlMgDItPeEGtDE98qRn9JIwSJ9rMlG9m8kWYqFy/GLvQJwb3oaA/uspHzJMrXiYcZ0qKTLHW075JpbrNkpgA5pH8o3yYy503Sd8znB5pamblNQxmlLLD1VamBI4Zg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=illinois.edu; dmarc=pass action=none header.from=illinois.edu; dkim=pass header.d=illinois.edu; arc=none Received: from DS0PR11MB7286.namprd11.prod.outlook.com (2603:10b6:8:13c::15) by DM8PR11MB5607.namprd11.prod.outlook.com (2603:10b6:8:28::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7249.34; Mon, 5 Feb 2024 04:40:48 +0000 Received: from DS0PR11MB7286.namprd11.prod.outlook.com ([fe80::df27:adc7:bb62:4690]) by DS0PR11MB7286.namprd11.prod.outlook.com ([fe80::df27:adc7:bb62:4690%4]) with mapi id 15.20.7249.035; Mon, 5 Feb 2024 04:39:33 +0000 Message-ID: <14799708-1f90-464f-9432-5b11755c3fca@illinois.edu> Date: Sun, 4 Feb 2024 22:39:32 -0600 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 3/3] x86/kprobes: Boost more instructions from grp2/3/4/5 Content-Language: en-US To: "Masami Hiramatsu (Google)" Cc: Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , Peter Zijlstra , Xin Li , linux-trace-kernel@vger.kernel.org, linux-kernel@vger.kernel.org References: <20240204031300.830475-1-jinghao7@illinois.edu> <20240204031300.830475-4-jinghao7@illinois.edu> <20240204210932.bd112a37dd3c276b046f6b16@kernel.org> From: Jinghao Jia Autocrypt: addr=jinghao7@illinois.edu; keydata= xsFNBGJmFCsBEADTCP2WqIboXB/QxPFGOxAhbbstER2dlqRLID5Rh/lYLiRfTiAe23c4vxNy zi+pgSd7aRdmx+OCFZr3YP/SjNDiyI4u1H7RcOe2Zucoh+uWmK2dwrPWSix/ZP91VbHhN12H LnHc9PBCVV+14qMfYgmV/JS2274WjzYYXwG19celZbCZ9RplAQ8RGIc9HtBTFFrphyNoJsNS I0yCCgr8TnmVcXxibsJ+61QA9XrEtIQubAV19XG9by1bK+VNc0Q+e5gn0MZjksbEDHzrJoR9 6Oa3E1xVWVmUaUG6lV1W5FvsX1q3GrULv/meuxgLwpj9sPqgdcybQkNvZbEdeKMoRbfP+RSw M+S4awIIsORlVOrhbdVoBjqJRGUB+FpmVdW6m1Kf1gpCD7d1Kb3+Pj8iF4oF4m/j2AyZLYt2 drYWtqvbc6adYkR2sBoBG6/opZzjMtrKycb7KHwR2y6KG9KXu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WO7oFhsbKEOQSUFI1vp7H8quRCwDHn GYFDxX+gx7nm7eURvgYYr+rN9xkQUKvRa/R7i8TKkdsYUMAnXHsyyNUW8lgh14EKmDd99U+E n9Dscfu/R/Ne/n/NpEpPcWmYfFE5vAUa3Mx+5WBzA+qLb4fUa5VtLomLso+/jf4Vf3epUT8d mLgXMG27L9/eYEDR5/RSkdi8FBzkbOpuFsoeGEFmAFBgBxbNe9KuUQRH1dicnsuRpBmElHeo o7jc2Rfr9CJl5B7wrSs5jC2UbRcmOR8kIWNOebxP2b5tcRLJcU4b//E5hbwkaJTsAwLBNrfy kjbbUMJwLp0QlMt2z2YYHIcx6WkKlaouaPfg06CnTz8cz2dpcbvhi0xfBp8= In-Reply-To: <20240204210932.bd112a37dd3c276b046f6b16@kernel.org> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="------------ZZ2yMAKQPMMRAYDpK65oEstS" X-ClientProxiedBy: CH0PR03CA0426.namprd03.prod.outlook.com (2603:10b6:610:10e::10) To DS0PR11MB7286.namprd11.prod.outlook.com (2603:10b6:8:13c::15) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS0PR11MB7286:EE_|DM8PR11MB5607:EE_ X-MS-Office365-Filtering-Correlation-Id: b741f1b2-e4d2-43d0-d921-08dc26047335 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: RbRwP6d9UFhnkxsJ7fhHyO0rAf8IkcWGZuVxqSCrj1t1d7gTqek+TRI6ngHhf8P/Lqh3prQvyTAJ+s04DFZQNIjtdWNuNZi3y8KWHh+c2eGvPgTyhoTFzkHp5ruAr/QTjRMj4yhHycHfQuzok9EAi5t5chR/1sSurj2I25+k0PeAg4p3cqeSDQYOk/mxRZGQObGhPmp+7ZJAO3p68DA56yvrbFQ11FzBl0r8nB7aBOaEh2RBFq04BfHoSJi1HenY9d0qy8hTC9qZN0XRvN+wr4veEGCTeygBR8SQwRfKSnIKE6poIoZRrKlCvc0zNh2a8Baclm9gJPAS2jYDM8ZzTRG0b0L1InOPLO2DGFEvlhPwN4LzyCTnkz5cRm97V03SEGKv3dzrutL22ngjjyfteEAf2cMYGhasNqX0aH4KGN2FfOS5GqG9QlC+1JfH+UMrgPZOmM1GZDhht+PCRzrjCKxvNpVUyIzbNRpo2dLscGlV9OwuH9ErIV4uhlqbE/Ggzu2Rakdkohu1Fp2/a5yF9r2KGwmOoOsLYo8uAvlpyiPULUqbZqbt4ETUvQuaCbN5577kTHETdxTeDhepOrrSVQONTPHOqlEDWrjX97l7CuU6lOLRdQBsNbP3nqS6JXv87mK48stZ18vro0WFKqIzdw== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DS0PR11MB7286.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(346002)(376002)(39860400002)(396003)(366004)(136003)(230922051799003)(1800799012)(186009)(451199024)(64100799003)(235185007)(5660300002)(53546011)(6506007)(33964004)(41300700001)(31686004)(7416002)(38100700002)(36756003)(4326008)(8676002)(8936002)(2906002)(21480400003)(786003)(316002)(83380400001)(6916009)(6512007)(54906003)(2616005)(66476007)(66556008)(66946007)(31696002)(478600001)(86362001)(75432002)(6486002)(45980500001)(43740500002);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?TitHcGRuLzNvbVAwVW05Y1VwdnRDSVQ1UGd2VGlPRUY3WFlyMzVJWGVxMVda?= =?utf-8?B?bmRtaVROUUQySzh0V1NOd2liOTI0QUZRRithbGg3dGVtOUJHNllpSVVZM0xV?= =?utf-8?B?Mzl1L3hWWFpCZU9vV3dBRGIyWEVqcS94ZXl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B?d3Fwbkw5QUJqMTY3UkRwV1o1REZndmZvZWtFSW9BdTBkV0ppR3hNV2lpdmNw?= =?utf-8?B?RFpJMXpXUmtoR0Z5bzRoVE52R0REcmNnM0Z3SmFqWHhZb3I5UWR6Nnd1ZTYr?= =?utf-8?B?T0ZMdlMvZnlsVlBCd3Zpbk9uWWFad3dKai95dGxvTWpRS09TWlRLNVJKMkJo?= =?utf-8?B?S0o5bmpSbVRxTi9SV043VXNKdTVKMVo5bHZEWjFmZmlFU0lyOEs5YkwrUjVk?= =?utf-8?Q?87DhvxwZE+Wf4z55PIqfxV41kAzQEa2FdYUQkhI5OZVz?= X-OriginatorOrg: illinois.edu X-MS-Exchange-CrossTenant-Network-Message-Id: b741f1b2-e4d2-43d0-d921-08dc26047335 X-MS-Exchange-CrossTenant-AuthSource: DS0PR11MB7286.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Feb 2024 04:39:33.6747 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 44467e6f-462c-4ea2-823f-7800de5434e3 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: iRY8HWvepYqBCDjj2m1tjYFFk542u56N5x3QVXKuXjzlCzwgLDWwV6Ac1p9SbYHROZtj/V3Pcryi8Wn+JGaAoQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM8PR11MB5607 X-Proofpoint-GUID: zY3fW_Mg6vq75BlTU8G-mDOFIOUt0rRt X-Proofpoint-ORIG-GUID: zY3fW_Mg6vq75BlTU8G-mDOFIOUt0rRt X-Spam-Details: rule=cautious_plus_nq_notspam policy=cautious_plus_nq score=0 lowpriorityscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 impostorscore=0 mlxscore=0 suspectscore=0 mlxlogscore=999 priorityscore=1501 adultscore=0 clxscore=1015 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311290000 definitions=main-2402050034 X-Spam-Score: 0 X-Spam-OrigSender: jinghao7@illinois.edu X-Spam-Bar: --------------ZZ2yMAKQPMMRAYDpK65oEstS Content-Type: multipart/mixed; boundary="------------M0CLXM6euGmP4zr93iem0nhr"; protected-headers="v1" From: Jinghao Jia To: "Masami Hiramatsu (Google)" Cc: Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , Peter Zijlstra , Xin Li , linux-trace-kernel@vger.kernel.org, linux-kernel@vger.kernel.org Message-ID: <14799708-1f90-464f-9432-5b11755c3fca@illinois.edu> Subject: Re: [PATCH v2 3/3] x86/kprobes: Boost more instructions from grp2/3/4/5 References: <20240204031300.830475-1-jinghao7@illinois.edu> <20240204031300.830475-4-jinghao7@illinois.edu> <20240204210932.bd112a37dd3c276b046f6b16@kernel.org> In-Reply-To: <20240204210932.bd112a37dd3c276b046f6b16@kernel.org> --------------M0CLXM6euGmP4zr93iem0nhr Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 2/4/24 06:09, Masami Hiramatsu (Google) wrote: > On Sat, 3 Feb 2024 21:13:00 -0600 > Jinghao Jia wrote: >=20 >> With the instruction decoder, we are now able to decode and recognize >> instructions with opcode extensions. There are more instructions in >> these groups that can be boosted: >> >> Group 2: ROL, ROR, RCL, RCR, SHL/SAL, SHR, SAR >> Group 3: TEST, NOT, NEG, MUL, IMUL, DIV, IDIV >> Group 4: INC, DEC (byte operation) >> Group 5: INC, DEC (word/doubleword/quadword operation) >> >> These instructions are not boosted previously because there are reserv= ed >> opcodes within the groups, e.g., group 2 with ModR/M.nnn =3D=3D 110 is= >> unmapped. As a result, kprobes attached to them requires two int3 trap= s >> as being non-boostable also prevents jump-optimization. >> >> Some simple tests on QEMU show that after boosting and jump-optimizati= on >> a single kprobe on these instructions with an empty pre-handler runs 1= 0x >> faster (~1000 cycles vs. ~100 cycles). >> >> Since these instructions are mostly ALU operations and do not touch >> special registers like RIP, let's boost them so that we get the >> performance benefit. >> >=20 > This looks good to me. And can you check how many instructions in the > vmlinux will be covered by this change typically? >=20 I collected the stats from the LLVM CodeGen backend on kernel version 6.7= =2E3 using Gentoo's dist-kernel config (with a mod2yesconfig to make modules builtin) and here are the number of Grp 2/3/4/5 instructions that are new= ly covered by this patch: Kernel total # of insns: 28552017 (from objdump) Grp2 insns: 286249 (from LLVM) Grp3 insns: 286556 (from LLVM) Grp4 insns: 5832 (from LLVM) Grp5 insns: 146314 (from LLVM) Note that using LLVM means we miss the stats from inline assembly and assembly source files. --Jinghao > Thank you, >=20 >> Signed-off-by: Jinghao Jia >> --- >> arch/x86/kernel/kprobes/core.c | 23 +++++++++++++++++------ >> 1 file changed, 17 insertions(+), 6 deletions(-) >> >> diff --git a/arch/x86/kernel/kprobes/core.c b/arch/x86/kernel/kprobes/= core.c >> index 7a08d6a486c8..530f6d4b34f4 100644 >> --- a/arch/x86/kernel/kprobes/core.c >> +++ b/arch/x86/kernel/kprobes/core.c >> @@ -169,22 +169,33 @@ bool can_boost(struct insn *insn, void *addr) >> case 0x62: /* bound */ >> case 0x70 ... 0x7f: /* Conditional jumps */ >> case 0x9a: /* Call far */ >> - case 0xc0 ... 0xc1: /* Grp2 */ >> case 0xcc ... 0xce: /* software exceptions */ >> - case 0xd0 ... 0xd3: /* Grp2 */ >> case 0xd6: /* (UD) */ >> case 0xd8 ... 0xdf: /* ESC */ >> case 0xe0 ... 0xe3: /* LOOP*, JCXZ */ >> case 0xe8 ... 0xe9: /* near Call, JMP */ >> case 0xeb: /* Short JMP */ >> case 0xf0 ... 0xf4: /* LOCK/REP, HLT */ >> - case 0xf6 ... 0xf7: /* Grp3 */ >> - case 0xfe: /* Grp4 */ >> /* ... are not boostable */ >> return false; >> + case 0xc0 ... 0xc1: /* Grp2 */ >> + case 0xd0 ... 0xd3: /* Grp2 */ >> + /* >> + * AMD uses nnn =3D=3D 110 as SHL/SAL, but Intel makes it reserved.= >> + */ >> + return X86_MODRM_REG(insn->modrm.bytes[0]) !=3D 0b110; >> + case 0xf6 ... 0xf7: /* Grp3 */ >> + /* AMD uses nnn =3D=3D 001 as TEST, but Intel makes it reserved. */= >> + return X86_MODRM_REG(insn->modrm.bytes[0]) !=3D 0b001; >> + case 0xfe: /* Grp4 */ >> + /* Only INC and DEC are boostable */ >> + return X86_MODRM_REG(insn->modrm.bytes[0]) =3D=3D 0b000 || >> + X86_MODRM_REG(insn->modrm.bytes[0]) =3D=3D 0b001; >> case 0xff: /* Grp5 */ >> - /* Only indirect jmp is boostable */ >> - return X86_MODRM_REG(insn->modrm.bytes[0]) =3D=3D 4; >> + /* Only INC, DEC, and indirect JMP are boostable */ >> + return X86_MODRM_REG(insn->modrm.bytes[0]) =3D=3D 0b000 || >> + X86_MODRM_REG(insn->modrm.bytes[0]) =3D=3D 0b001 || >> + X86_MODRM_REG(insn->modrm.bytes[0]) =3D=3D 0b100; >> default: >> return true; >> } >> --=20 >> 2.43.0 >> >=20 >=20 --------------M0CLXM6euGmP4zr93iem0nhr-- --------------ZZ2yMAKQPMMRAYDpK65oEstS Content-Type: application/pgp-signature; name="OpenPGP_signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="OpenPGP_signature.asc" -----BEGIN PGP SIGNATURE----- wsF5BAABCAAjFiEE2/ZzTtJDFIshN/BBL9huahcPNUYFAmXAZoQFAwAAAAAACgkQL9huahcPNUZR DRAAtivU3wLiveyrE472EpivOJUPsFg3goSTPtxEzu1kyK7qPBVa144buNh8P+WQpBsxinnUUcxz zBAQtAvenxIx+wQdjlmyF5oc6uuV4nEMybZg5WohFr40b7/uTjECGb8ONmsu0ZAxXzXssuo6VoQk 4Bhlv5sHA87ZfncUBA4ca3ZHKov+LjCCTRXj5QSbqntjZV7bLituJnoT2rkxmHpeHweotnkN36aE gGaYcYkQMaXnEdafuqG/+RIKq18S/1E4vwbAMa6rIk8/lDkwf27JRfwPSYHYq404aegACgocbCqA 3TX+iLBIAoM/lCcilPKW7wC3WcG/1devDrHCpAhLROaFt1eS+l9a9/LQrs7kEUX/P/KyAwPyPa5A Fxei83YQzqMZciJH/Spmw/4HXnzhwRcn9/fKH9WCWG1PnoxZpPC80wwAZEDW8BbQGFYOaWu9J7Qa 9zbUtPVpPWTOyL0yt95NRiY5BhaWRA3PKwcNA5c3A9B5dwAi1lS4caHx2KrjAJF7wjJtKIlCnArT IOTCTLtzVzpgCLmtLKkbcRUyrR3xKoXccJ9lFgyUEVQQdivlm+7FST2rGvOLBePPLqyFjXkyD2T4 BgXYc7Wmq/4X2H/7Xa0j+Sa62dCe5agun6L0alw91yq0WmYWoTeq9Sq3pGVhF0d7WpZtFfYaV06f gb0= =rP4m -----END PGP SIGNATURE----- --------------ZZ2yMAKQPMMRAYDpK65oEstS--