Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp1403516pxk; Fri, 4 Sep 2020 08:33:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxENQVRJhUjz3tEDVU95H9sqGjkwFeOj1NzmJf1xeTAKocczQEs6HYNoYrCSdxrTpe5IfTl X-Received: by 2002:a17:906:fccb:: with SMTP id qx11mr8211332ejb.429.1599233597276; Fri, 04 Sep 2020 08:33:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599233597; cv=none; d=google.com; s=arc-20160816; b=R5iktJVnEfxMw5skHZGSD7JZZLZZ5W23W+MQMmKBy5vNLVmw55EQ+Jn/3foMN1z8Qa bguZSoGlsfqQ/yzXfwZWKILVB2YgTcaydBF4OVWpLv2Ea8HM5q1z1caipXMSyOCgZscR 3KGGy71WfFNRxKP2jR1MW4WJac41+p3r3llyNnusxw6NFct6SBIeKLxnltQ4pxaat7wa E7LuTNRD1hVoMkSu4m83eLD0oimyx3jv24mXeGRHmOVFj61kAJkTFoP0YII4TWxGKu8D EhKdaVFNyuH5i7e4JL1v+xl7D8sahSrzxWwMiBOe8WKmmc4xVlAU5pxbwHVv1syXqOgV iS1A== 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 :message-id:date:subject:cc:to:from; bh=umTLLbWNIKdgBaY8oamQNBodLX2YoAzBBUrL/6iK/FA=; b=oNV/TuJLZUcUMQekXYqmNgaSPxL9DMA6aflPXtGFED4F2aKaZggEI3GvxeDfypJ7AZ /n39HqKq7tSlGQ65JfjWxieChkyLQVmttQgZkTQbv3jnmfPjaAcS+XJ1CLHZqPW3KE/9 XQ7KWfjUHSwzOyNu4RaW7Ka7JHTOzB2a90PdH0BTM1nR6SDnElkReyDj2Nws9Sti0hlY IJdsCiGSfROCC9OXOd83oE7Mxt/if38PUIilv+YcKJu7FsSn8YaXnsE294dC5GAxSd8f 7wTNQ56PYQShZR1gbB10ty7lllMRETQDiJMbY/loZMPEDzkLfeVP8NxdUfqdNvY3FcUB 9z9g== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (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 a14si4270041edn.42.2020.09.04.08.32.53; Fri, 04 Sep 2020 08:33:17 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726220AbgIDPaj (ORCPT + 99 others); Fri, 4 Sep 2020 11:30:39 -0400 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:27083 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725984AbgIDPah (ORCPT ); Fri, 4 Sep 2020 11:30:37 -0400 Received: from mail-ej1-f69.google.com (mail-ej1-f69.google.com [209.85.218.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-571-xFRSHDPkOGK54w5bnhDK-w-1; Fri, 04 Sep 2020 11:30:35 -0400 X-MC-Unique: xFRSHDPkOGK54w5bnhDK-w-1 Received: by mail-ej1-f69.google.com with SMTP id md9so2353537ejb.8 for ; Fri, 04 Sep 2020 08:30:33 -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:mime-version :content-transfer-encoding; bh=umTLLbWNIKdgBaY8oamQNBodLX2YoAzBBUrL/6iK/FA=; b=fu7wtDL/LYPNAbBT1OOx2EffqXiD5WdfTI0cdxjKy8lSs4j1DoovJd6V/D2nQc+wJj MmsuMZAjCN8pzZs7D0TOEhNuLL3+8xq9cWGtH5A8VKaGC5rbIXoFjUutuwkIJB3nbdHA MKIWc5vuHGvMQz6au9gVvQ/dtB6ERQYUkuZWciPTLc9mVIvpCBTR5Dh3hrwd0VPQNz8J nbD7qXlnlQHWsQAIOJsveEorp51xsPQEGr7q7+k/IKrep3FItJVR0t7gAQ/N0g5UPE/N N39eA4xA2JC8K14NAL7vquSkz1Zc+FwnJRTxsxZwcB+Mxzyl/cu7BJLBIhbpfHA50hvN 8FwA== X-Gm-Message-State: AOAM533OtzRzawCrPsAGiYBhiKIyVSEOX1s29CgKS34z/ZHEnaRDrNoW Nhhs+NqGWh6qQaAGEzC4eIpuz04qPFqWRPiqePMAJwuDhfxEiG+ZOHMDZpvGge+bRcUTtLF10hz Wqfbmijf8pRid/xKspN5tj2io X-Received: by 2002:a17:906:656:: with SMTP id t22mr7736899ejb.392.1599233432632; Fri, 04 Sep 2020 08:30:32 -0700 (PDT) X-Received: by 2002:a17:906:656:: with SMTP id t22mr7736874ejb.392.1599233432418; Fri, 04 Sep 2020 08:30:32 -0700 (PDT) Received: from redfedo.redhat.com ([2a01:cb14:499:3d00:cd47:f651:9d80:157a]) by smtp.gmail.com with ESMTPSA id z10sm6273802eje.122.2020.09.04.08.30.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Sep 2020 08:30:31 -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, benh@kernel.crashing.org, Julien Thierry Subject: [PATCH v3 00/10] Make check implementation arch agnostic Date: Fri, 4 Sep 2020 16:30:18 +0100 Message-Id: <20200904153028.32676-1-jthierry@redhat.com> X-Mailer: git-send-email 2.21.3 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 Hi, The current implementation of the check subcommand has various x86 bits here and there. In order to prepare objtool to provide check for other architectures, add some abstraction over the x86 specific bits, relying on objtool arch specific code to provide some necessary operations. This is part of the effort to implement check for arm64, initiated [1] by Raphael. The series is based on top of the separation of check & orc subcommands series[2]. I've push both series base on top of tip/objtool/core at [3]. - The first two patches make it simpler for new arches to provide their list of kernel headers, without worrying about modifications in the x86 headers. - Patch 3 Moves arch specific macros to more suitable location - Patches 4 and 5 add abstraction to handle alternatives - Patch 6 adds abstraction to handle jump table - Patches 7-10 makes unwind hint definitions shared across architectures Changes since v2 [4]: - Rebased on v5.9-rc1 - Under tools/objtool/arch/x86/, rename arch_special.c to special.c - Rename include/linux/frame.h to inclide/linux/objtool.h - Share unwind hint types across architectures [1] https://lkml.org/lkml/2019/8/16/400 [2] https://lkml.org/lkml/2020/6/4/675 [3] https://github.com/julien-thierry/linux/tree/arch-independent-check [4] https://lkml.org/lkml/2020/7/30/424 Cheers, Julien --> Julien Thierry (9): objtool: Group headers to check in a single list objtool: Make sync-check consider the target architecture objtool: Move macros describing structures to arch-dependent code objtool: Abstract alternative special case handling objtool: Make relocation in alternative handling arch dependent headers: Rename frame.h objtool: Only include valid definitions depending on source file type objtool: Make unwind hints definitions available to other architectures objtool: Decode unwind hint register depending on architecture Raphael Gault (1): objtool: Refactor switch-tables code to support other architectures arch/x86/include/asm/nospec-branch.h | 2 +- arch/x86/include/asm/orc_types.h | 34 ---- arch/x86/include/asm/unwind_hints.h | 50 +----- arch/x86/kernel/kprobes/core.c | 2 +- arch/x86/kernel/kprobes/opt.c | 2 +- arch/x86/kernel/reboot.c | 2 +- arch/x86/kernel/unwind_orc.c | 11 +- arch/x86/kvm/svm/svm.c | 2 +- arch/x86/kvm/vmx/nested.c | 2 +- arch/x86/kvm/vmx/vmx.c | 2 +- arch/x86/xen/enlighten_pv.c | 2 +- drivers/gpu/drm/vmwgfx/vmwgfx_msg.c | 3 +- include/linux/frame.h | 35 ----- include/linux/objtool.h | 134 ++++++++++++++++ kernel/bpf/core.c | 2 +- kernel/kexec_core.c | 2 +- tools/arch/x86/include/asm/orc_types.h | 34 ---- tools/include/linux/objtool.h | 134 ++++++++++++++++ tools/objtool/Makefile | 2 +- tools/objtool/arch.h | 2 + tools/objtool/arch/x86/Build | 1 + tools/objtool/arch/x86/decode.c | 37 +++++ tools/objtool/arch/x86/include/arch_special.h | 20 +++ tools/objtool/arch/x86/special.c | 145 ++++++++++++++++++ tools/objtool/check.c | 137 ++--------------- tools/objtool/check.h | 7 +- tools/objtool/objtool.h | 2 + tools/objtool/orc_dump.c | 7 +- tools/objtool/orc_gen.c | 5 +- tools/objtool/special.c | 48 +----- tools/objtool/special.h | 10 ++ tools/objtool/sync-check.sh | 27 ++-- tools/objtool/weak.c | 2 - 33 files changed, 561 insertions(+), 346 deletions(-) delete mode 100644 include/linux/frame.h create mode 100644 include/linux/objtool.h create mode 100644 tools/include/linux/objtool.h create mode 100644 tools/objtool/arch/x86/include/arch_special.h create mode 100644 tools/objtool/arch/x86/special.c -- 2.21.3