Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp4467708ybg; Mon, 8 Jun 2020 08:32:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzJokFMe4q5ojk6qequoqILN9PLpLYJURnsKrgzTRcADQmNtV4o4L1SIO06jXg4piKntRp5 X-Received: by 2002:aa7:ce10:: with SMTP id d16mr22823408edv.116.1591630360340; Mon, 08 Jun 2020 08:32:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591630360; cv=none; d=google.com; s=arc-20160816; b=kAa7H5yJuiyZEKuHnvBtUsY/3Nkc4CbkPNOPcvgBIEfeQ0qfLQWRS6iLsrRazCNAVV dHp1FXFWQFaDhITG5TY8Ml1m4nlPrw8IGff+r3Q9AYG+vJgKHXZWiZwn50hSHBGU9rt9 B3mXgb9FZxZKDIrPs/m9G5l8UC9OuLQdHYZgE43ZhGVKN89bnXGxxijDVkemqpcHYG1x v1poL5FF6ZQmh1mbHxvTRYoUf/mcilzHpJorg9gXPwWBZKy0G+NNkl1CNuxxamX+zhmL s3q76EB/Y4/+auwcm8kT5jijgv3YfzLaWbCB6oIJkMUJM0T0wPFNk/CHjEnznzKr2Vzl y0hw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=e6ldx0MlwgMZ7eYGwNs6t50sH9muEKSQEPCznWlog1s=; b=XzrHzlhCuEn7EdznA5dRUvbTtCF4Z8wLUegbvvZHEmfekGlzg3LVpmFFl+h5cLjy7Z 7kEZgwp6EJ3j7tNqNcTx4KMk9gqDOQjOl3QcgS/XvC59Poe7lkMeshJflNAHOv8LREGx Eqzbc+j8p6mYpjiDiuK75w9LZt8H9JT5KhSUSZ5t4fSDdhd4jDKxWs5yE5Kr7ev8lsZr bYZwGtJSBb8maIUQPO58elvqt0qDuNz8K33p5AUFkXMyuS7VdVcGSgQiIjO+XzS8hkAW 7cKX/70d60dPeFUu7IsCKhvsF4E+UXmL/1qu6Hd0rxDjTD6InzD1IgxqzlzKJYlwYiAX mX2w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=KYYXVR0J; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p7si5477323ejb.303.2020.06.08.08.32.16; Mon, 08 Jun 2020 08:32:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=KYYXVR0J; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730320AbgFHP2l (ORCPT + 99 others); Mon, 8 Jun 2020 11:28:41 -0400 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:56928 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729961AbgFHP2E (ORCPT ); Mon, 8 Jun 2020 11:28:04 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1591630083; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=e6ldx0MlwgMZ7eYGwNs6t50sH9muEKSQEPCznWlog1s=; b=KYYXVR0JtUSaCCl5dgqidIDjaZ7i1oG1tZapHD+bjCalApsYDx9o47ka5cUR7GA3IP9TDG mcSC+AmyihgWT1fQuXYHvVUEMc1koye9sfQMiljDD967TkxVtxWWfcI79JHaHLh5xe21UL 3kiUslCfRdd+J0opqsmVb/rm5ltv/vM= Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-401-bYofDwdmN6epDt2XMB9yNQ-1; Mon, 08 Jun 2020 11:28:02 -0400 X-MC-Unique: bYofDwdmN6epDt2XMB9yNQ-1 Received: by mail-wr1-f72.google.com with SMTP id p10so7319635wrn.19 for ; Mon, 08 Jun 2020 08:28:02 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=e6ldx0MlwgMZ7eYGwNs6t50sH9muEKSQEPCznWlog1s=; b=h8F5O2+sUaw+w3Ay6VLMkd97x/VH6ZDb6XLIKExem97K92gNE+dCJkab8l+fHT+yAb ekwyuy7/iwS+xUhF5wtlNDFYnKy7EZWax0hIpIloGbB4koj2d8HEBpGNawn5GsbPzcl9 xLiGzlO4M7DvLLqVsw07b8uZUhBL1S03gTwmI85aUNur42kPFDMqECu4qVbuEyze4YVU C8n7b5i8Z0yfqivAAELvyIub3TGtas0MyhHJIDHSNmVLejMnJU27Td8o4yVCRHJUyM0m lX38a2Cpux0YrOsw84f9VZR/sDArGxhBAblFLDjZB2r8DDtRzO4o4bvXiWejoxsHLYOc aDEg== X-Gm-Message-State: AOAM533mLDmeGd1J1sMp3HlbRwunTuvnc184UYy1bltp1pdMFZYV0UOk yDCsfveOMqwcZTOfO42x2cWS5jYi3otqt+Flu6Khvv0rSBjQNOZXtcJnqCZgZH7iPupsJhj1nle zZCVTao/M8+tOBmKLtZp4gM4i X-Received: by 2002:a7b:c951:: with SMTP id i17mr16396580wml.44.1591630080541; Mon, 08 Jun 2020 08:28:00 -0700 (PDT) X-Received: by 2002:a7b:c951:: with SMTP id i17mr16396567wml.44.1591630080316; Mon, 08 Jun 2020 08:28:00 -0700 (PDT) Received: from redfedo.redhat.com ([2a01:cb14:499:3d00:cd47:f651:9d80:157a]) by smtp.gmail.com with ESMTPSA id u130sm23981707wmg.32.2020.06.08.08.27.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Jun 2020 08:27:59 -0700 (PDT) From: Julien Thierry To: linux-kernel@vger.kernel.org Cc: jpoimboe@redhat.com, peterz@infradead.org, mbenes@suse.cz, raphael.gault@arm.com, Julien Thierry Subject: [PATCH 3/7] objtool: Move macros describing structures to arch-dependent code Date: Mon, 8 Jun 2020 16:27:50 +0100 Message-Id: <20200608152754.2483-4-jthierry@redhat.com> X-Mailer: git-send-email 2.21.1 In-Reply-To: <20200608152754.2483-1-jthierry@redhat.com> References: <20200608152754.2483-1-jthierry@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Some macros are defined to describe the size and layout of structures exception_table_entry, jump_entry and alt_instr. These values can vary from one architecture to another. Have the values be defined by arch specific code. Suggested-by: Raphael Gault Signed-off-by: Julien Thierry --- tools/objtool/arch/x86/include/arch_special.h | 20 +++++++++++++++++++ tools/objtool/special.c | 16 +-------------- 2 files changed, 21 insertions(+), 15 deletions(-) create mode 100644 tools/objtool/arch/x86/include/arch_special.h diff --git a/tools/objtool/arch/x86/include/arch_special.h b/tools/objtool/arch/x86/include/arch_special.h new file mode 100644 index 000000000000..d818b2bffa02 --- /dev/null +++ b/tools/objtool/arch/x86/include/arch_special.h @@ -0,0 +1,20 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ +#ifndef _X86_ARCH_SPECIAL_H +#define _X86_ARCH_SPECIAL_H + +#define EX_ENTRY_SIZE 12 +#define EX_ORIG_OFFSET 0 +#define EX_NEW_OFFSET 4 + +#define JUMP_ENTRY_SIZE 16 +#define JUMP_ORIG_OFFSET 0 +#define JUMP_NEW_OFFSET 4 + +#define ALT_ENTRY_SIZE 13 +#define ALT_ORIG_OFFSET 0 +#define ALT_NEW_OFFSET 4 +#define ALT_FEATURE_OFFSET 8 +#define ALT_ORIG_LEN_OFFSET 10 +#define ALT_NEW_LEN_OFFSET 11 + +#endif /* _X86_ARCH_SPECIAL_H */ diff --git a/tools/objtool/special.c b/tools/objtool/special.c index e74e0189de22..2bd57db0881f 100644 --- a/tools/objtool/special.c +++ b/tools/objtool/special.c @@ -14,21 +14,7 @@ #include "builtin.h" #include "special.h" #include "warn.h" - -#define EX_ENTRY_SIZE 12 -#define EX_ORIG_OFFSET 0 -#define EX_NEW_OFFSET 4 - -#define JUMP_ENTRY_SIZE 16 -#define JUMP_ORIG_OFFSET 0 -#define JUMP_NEW_OFFSET 4 - -#define ALT_ENTRY_SIZE 13 -#define ALT_ORIG_OFFSET 0 -#define ALT_NEW_OFFSET 4 -#define ALT_FEATURE_OFFSET 8 -#define ALT_ORIG_LEN_OFFSET 10 -#define ALT_NEW_LEN_OFFSET 11 +#include "arch_special.h" #define X86_FEATURE_POPCNT (4*32+23) #define X86_FEATURE_SMAP (9*32+20) -- 2.21.1