Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp1478848ybb; Thu, 2 Apr 2020 01:20:49 -0700 (PDT) X-Google-Smtp-Source: APiQypJAUrA9/nKfXQuEkgvEKwlldBNUZc4EBFf6btVbRVRJdtwlEMWI1Bwy6MzhnomrPLbx4+7B X-Received: by 2002:aca:4cd8:: with SMTP id z207mr1309091oia.155.1585815649522; Thu, 02 Apr 2020 01:20:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585815649; cv=none; d=google.com; s=arc-20160816; b=bxq7KlPgUiT7mKkxnt6GGqjlKVDqq+mVLMHnzrRak1a1wa8sIY4ln1qjRyE+uXlxQB bDAHqNaPD0Mh0ZU1HKlz7wDM27DOPWQ9sRuqSu7G5CNlq/ORrKhYi8T0F/R3T2Pe13DV wuhorqxukX2nH6CqSbf5EP18tvhXvWeuWzqDJjfihFGrD2vzYE4dHiyxec0DK+nqy6xC uGTY42sQi2vkPw2NWkvzOTsxsVcHUfxtDZEpk+67qRbzyLkZo5cyQS/2NfK5DqW5jG+a 2CqORqSS1duXglyhq5pPM7FvEQfubQlM8pRdRVlnjt5GAycMR787ISxCsJANoCyokEof txiQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=p17e2nyu9f8khVOWGKbMQnX5vaZpXcrK5ZQI2Ho/lm4=; b=wPisB4WUOZZG9BbhuB+4g0xnNexhwF+N9uv/ApHW1QBttLuV1JglV+GCfTb7CgCVAf lQIZwd/MGzE94rz6h3GOqw3FvELVKwe2XnAa4LpaLwmtld/bmg//6JDG42uK1SeXsOs4 1F0/qv84Yp5cSmUXxqNJ0nVnQyJYoyzZKZATErsXd9QDBN2qcK6Wmn4qFTb0ul52+dMa oFiso/Xh92lNJxhp9p0yha0grS1tVjOa+VZFVUYOXSrQBa6JVKpMDMZs2ZB/J5oP4OLJ U//MNzl2rQye8zTeBXjM7JgKSUNrdmVeBngs1PCkSlO1YOZszsUjzA6BLlGToEOtI080 /yUQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2020-01-29 header.b=eej2Hpgw; 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=oracle.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b8si2162682oob.73.2020.04.02.01.20.37; Thu, 02 Apr 2020 01:20:49 -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=@oracle.com header.s=corp-2020-01-29 header.b=eej2Hpgw; 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=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387832AbgDBIS4 (ORCPT + 99 others); Thu, 2 Apr 2020 04:18:56 -0400 Received: from aserp2120.oracle.com ([141.146.126.78]:39230 "EHLO aserp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387737AbgDBISm (ORCPT ); Thu, 2 Apr 2020 04:18:42 -0400 Received: from pps.filterd (aserp2120.oracle.com [127.0.0.1]) by aserp2120.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 0328Hfuo196604; Thu, 2 Apr 2020 08:18:12 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id; s=corp-2020-01-29; bh=p17e2nyu9f8khVOWGKbMQnX5vaZpXcrK5ZQI2Ho/lm4=; b=eej2HpgwaI6tdb9RzaIbds5q10LJdi4Gg8qBlMRaU5df33iXwU/ReF1o76nS4+ga1kp3 VcUwC5g+2GgkyR6G5KeLVCxLitTENpJOZIWM35xGHTLEhiWGyOdXmStVuLg1J2clXj1E oVIxSVHrCvlYa0dPPwRnWcqFNfdroCMR9mIsoMaZLpbRPGClbN9RmLMy30izaaahq3N7 7Kl7IkBbObRA7qHtDpZf2f6FYaqcDqMGCMAbj8ILnUFnh6q+rblXD4IA5fMzVf+8z9+8 VBAjkDIGXwuqsfCOj82mjwBSimpb9X3WPqbru/rBOynYCymnHMzQ2exPthletdpBboy6 jg== Received: from userp3030.oracle.com (userp3030.oracle.com [156.151.31.80]) by aserp2120.oracle.com with ESMTP id 303yunce44-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 02 Apr 2020 08:18:12 +0000 Received: from pps.filterd (userp3030.oracle.com [127.0.0.1]) by userp3030.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 0328Gw4b022002; Thu, 2 Apr 2020 08:18:12 GMT Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by userp3030.oracle.com with ESMTP id 302g2j3pnm-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 02 Apr 2020 08:18:11 +0000 Received: from abhmp0011.oracle.com (abhmp0011.oracle.com [141.146.116.17]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id 0328I90O022173; Thu, 2 Apr 2020 08:18:09 GMT Received: from linux-1.home (/92.157.90.160) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 02 Apr 2020 01:18:09 -0700 From: Alexandre Chartre To: x86@kernel.org Cc: linux-kernel@vger.kernel.org, jpoimboe@redhat.com, peterz@infradead.org, jthierry@redhat.com, tglx@linutronix.de, alexandre.chartre@oracle.com Subject: [PATCH 0/7] objtool changes to remove most ANNOTATE_NOSPEC_ALTERNATIVE Date: Thu, 2 Apr 2020 10:22:13 +0200 Message-Id: <20200402082220.808-1-alexandre.chartre@oracle.com> X-Mailer: git-send-email 2.18.2 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9578 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=774 spamscore=0 mlxscore=0 adultscore=0 phishscore=0 bulkscore=0 suspectscore=1 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2003020000 definitions=main-2004020075 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9578 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 phishscore=0 lowpriorityscore=0 malwarescore=0 adultscore=0 priorityscore=1501 mlxlogscore=830 bulkscore=0 suspectscore=1 mlxscore=0 spamscore=0 impostorscore=0 clxscore=1015 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2003020000 definitions=main-2004020075 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, Code like retpoline or RSB stuffing, which is used to mitigate some of the speculative execution issues, is currently ignored by objtool with the ANNOTATE_NOSPEC_ALTERNATIVE directive. This series adds support for intra-function calls and trampoline return instructions to objtool so that it can handle such a code. With these changes, we can remove most ANNOTATE_NOSPEC_ALTERNATIVE directives. Thanks, alex. -- Alexandre Chartre (7): objtool: is_fentry_call() crashes if call has no destination objtool: Allow branches within the same alternative. objtool: Add support for intra-function calls objtool: Add support for return trampoline call x86/speculation: Annotate intra-function calls x86/speculation: Annotate retpoline return instructions x86/speculation: Remove most ANNOTATE_NOSPEC_ALTERNATIVE arch/x86/include/asm/nospec-branch.h | 38 ++++-- tools/objtool/check.c | 172 +++++++++++++++++++++++++-- tools/objtool/check.h | 5 +- 3 files changed, 196 insertions(+), 19 deletions(-) -- 2.18.2