From nobody Tue Dec 2 02:30:07 2025 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) (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 993BF3730F5 for ; Wed, 19 Nov 2025 14:34:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.177.32 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763562851; cv=none; b=fi5pxWovy8x4vKlz+sgrBdUfwlEnupSQtiT5OMIC1vA2EBGYPrOiQK84s/cOxvDShDmW6i7m8jl0WswhcrSP21Kbuvh/tqR7CcsjGTX24UbvklYwWET1mRV+I1CY/AVsm2UF2hINm/zTN/bSuo5WVh4BcGJ0lWnQuoGojYx+QOQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763562851; c=relaxed/simple; bh=pdxEiZdMkwdFgBnIeb+S5BsPE/KqcplJ6rjPO1rjHSs=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=W2HW0gNQFQgi4fdN9rZ2lAzuBjo5ZBM76l0QUA/OYbKV0/tbWtsHxs73n/C5JxrwoELmqWVf3MVy1zTLjrB+ToucYf4yS/DpiVt+tgt9FXBpQk6ZCpr83swQkHWVg1IvJJDhq9DJWZZKgxFGjwEqHG4v0hIEn4dIGosrlEWx9aE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oracle.com; spf=pass smtp.mailfrom=oracle.com; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b=Ogu5RnL7; arc=none smtp.client-ip=205.220.177.32 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oracle.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oracle.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="Ogu5RnL7" Received: from pps.filterd (m0333520.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 5AJER15T032459; Wed, 19 Nov 2025 14:33:38 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=cc :content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=corp-2025-04-25; bh=bOZ6s Y/iY5ZyfDO1paHU4rBJMOX/jxuO8yWY61yRy3I=; b=Ogu5RnL7CsMrLc2K3Fa2R ouEFh5lyUx58SmLHstBGedsBuw6Oh8OXKTtTmAVpmj0yi7Sr35EyKkCvVWHW7BrI a7vVDWlNUgEaXenUr0PECmzl6WymtJPK/v+1ZSRp4KVBQV/QxZwI9hiUj3ueRrqc NFAOo9gl/SDA9Qi9X4HFDmvZZ8IwBX4Xb9SflKXXCt0iVoA7hbSpmC3431mGQyF7 v8Zq+e70c4ymLUlGJo8XPN8f7bWUHjKOGjHEyNF7iRVXS/WIU0js4aBSLdk26jYG aAWxQUmsihpjiVWCDIZ8ZwdhLagWfkFjdi/2daCTB+oWXpQgNN8U7kJFvvLc2cFf A== Received: from phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta03.appoci.oracle.com [138.1.37.129]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 4aejbbfa09-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 19 Nov 2025 14:33:38 +0000 (GMT) Received: from pps.filterd (phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (8.18.1.2/8.18.1.2) with ESMTP id 5AJDhdWl002453; Wed, 19 Nov 2025 14:33:37 GMT Received: from pps.reinject (localhost [127.0.0.1]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 4aefyans1q-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 19 Nov 2025 14:33:37 +0000 Received: from phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 5AJEWnns022495; Wed, 19 Nov 2025 14:33:36 GMT Received: from laptop-dell-latitude7430.nl.oracle.com (dhcp-10-154-160-110.vpn.oracle.com [10.154.160.110]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTP id 4aefyanr5p-26; Wed, 19 Nov 2025 14:33:36 +0000 From: Alexandre Chartre To: linux-kernel@vger.kernel.org, mingo@kernel.org, jpoimboe@kernel.org, peterz@infradead.org, david.laight.linux@gmail.com Cc: alexandre.chartre@oracle.com Subject: [PATCH v5 25/30] objtool: Provide access to feature and flags of group alternatives Date: Wed, 19 Nov 2025 15:32:42 +0100 Message-ID: <20251119143247.3944213-26-alexandre.chartre@oracle.com> X-Mailer: git-send-email 2.43.5 In-Reply-To: <20251119143247.3944213-1-alexandre.chartre@oracle.com> References: <20251119143247.3944213-1-alexandre.chartre@oracle.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1121,Hydra:6.1.9,FMLib:17.12.100.49 definitions=2025-11-19_04,2025-11-18_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 phishscore=0 malwarescore=0 suspectscore=0 bulkscore=0 spamscore=0 mlxlogscore=999 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2510240000 definitions=main-2511190116 X-Authority-Analysis: v=2.4 cv=BoqQAIX5 c=1 sm=1 tr=0 ts=691dd542 b=1 cx=c_pps a=WeWmnZmh0fydH62SvGsd2A==:117 a=WeWmnZmh0fydH62SvGsd2A==:17 a=6UeiqGixMTsA:10 a=VkNPw1HP01LnGYTKEx00:22 a=yPCof4ZbAAAA:8 a=OMdgKRDbd2JaGKt5H5wA:9 X-Proofpoint-ORIG-GUID: YylIFXGw-o5x4IT960DH2IFX4tYWoCqS X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUxMTE1MDAzMiBTYWx0ZWRfX38e27K/0rYXv B8RfmoIVYjAZVikluvn6ePCzIYH78vq0Vpq32QAU3yDF6RPv91+xXJ/vwDmhzWM1ifd5YOJi8SZ 3hIppv8tFHShq9hNBbW6V7uKG2YM/YZkPg2ndF5KknLchwTV1ra6BpuzYWeIElOzcsPaOhuMmZE p1S3jImvcAvFmzcwvfouVi9NNsLLNsPR4Hva2XOoCgqVLrsP0DBncB1JgD5TOk++30EtzVmxK4r R79H7TQEdFKqtNPj4quEL0aj0PSiXIetWCyrNqFcSlsJXlZKR6hV0TN8R4UsSLxvL1jy1MeyEC2 gECtWe3k09ddmod4EFzEzmno3ogwoRB03XRASD12gPZb7DP28E3Ei3aW8Z6wlCnwJ/uIuWweTlM RnpXN+3c99MMj2hZ99AVxwwhhyHu4Q== X-Proofpoint-GUID: YylIFXGw-o5x4IT960DH2IFX4tYWoCqS Content-Type: text/plain; charset="utf-8" Each alternative of a group alternative depends on a specific feature and flags. Provide access to the feature/flags for each alternative as an attribute (feature) in struct alt_group. Signed-off-by: Alexandre Chartre --- tools/objtool/check.c | 2 ++ tools/objtool/include/objtool/check.h | 1 + tools/objtool/include/objtool/special.h | 2 +- tools/objtool/special.c | 2 ++ 4 files changed, 6 insertions(+), 1 deletion(-) diff --git a/tools/objtool/check.c b/tools/objtool/check.c index 25839c3950a3c..ddc5ec74d9c99 100644 --- a/tools/objtool/check.c +++ b/tools/objtool/check.c @@ -1772,6 +1772,7 @@ static int handle_group_alt(struct objtool_file *file, orig_alt_group->last_insn =3D last_orig_insn; orig_alt_group->nop =3D NULL; orig_alt_group->ignore =3D orig_insn->ignore_alts; + orig_alt_group->feature =3D 0; } else { if (orig_alt_group->last_insn->offset + orig_alt_group->last_insn->len - orig_alt_group->first_insn->offset !=3D special_alt->orig_len) { @@ -1876,6 +1877,7 @@ static int handle_group_alt(struct objtool_file *file, new_alt_group->nop =3D nop; new_alt_group->ignore =3D (*new_insn)->ignore_alts; new_alt_group->cfi =3D orig_alt_group->cfi; + new_alt_group->feature =3D special_alt->feature; return 0; } =20 diff --git a/tools/objtool/include/objtool/check.h b/tools/objtool/include/= objtool/check.h index cbf4af58e29b2..2e1346ad5e926 100644 --- a/tools/objtool/include/objtool/check.h +++ b/tools/objtool/include/objtool/check.h @@ -36,6 +36,7 @@ struct alt_group { struct cfi_state **cfi; =20 bool ignore; + unsigned int feature; }; =20 enum alternative_type { diff --git a/tools/objtool/include/objtool/special.h b/tools/objtool/includ= e/objtool/special.h index 72d09c0adf1a1..b22410745e4a1 100644 --- a/tools/objtool/include/objtool/special.h +++ b/tools/objtool/include/objtool/special.h @@ -25,7 +25,7 @@ struct special_alt { struct section *new_sec; unsigned long new_off; =20 - unsigned int orig_len, new_len; /* group only */ + unsigned int orig_len, new_len, feature; /* group only */ }; =20 int special_get_alts(struct elf *elf, struct list_head *alts); diff --git a/tools/objtool/special.c b/tools/objtool/special.c index e262af9171436..2a533afbc69aa 100644 --- a/tools/objtool/special.c +++ b/tools/objtool/special.c @@ -81,6 +81,8 @@ static int get_alt_entry(struct elf *elf, const struct sp= ecial_entry *entry, entry->orig_len); alt->new_len =3D *(unsigned char *)(sec->data->d_buf + offset + entry->new_len); + alt->feature =3D *(unsigned int *)(sec->data->d_buf + offset + + entry->feature); } =20 orig_reloc =3D find_reloc_by_dest(elf, sec, offset + entry->orig); --=20 2.43.5