From patchwork Wed Aug 24 02:22:06 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Rzeszutek Wilk X-Patchwork-Id: 9296717 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 605D5608A7 for ; Wed, 24 Aug 2016 02:24:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 51F1C28D10 for ; Wed, 24 Aug 2016 02:24:59 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 460AF28DD4; Wed, 24 Aug 2016 02:24:59 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 94FD328DCB for ; Wed, 24 Aug 2016 02:24:58 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bcNq6-00031e-Mq; Wed, 24 Aug 2016 02:22:50 +0000 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bcNq5-00030P-8G for xen-devel@lists.xenproject.org; Wed, 24 Aug 2016 02:22:49 +0000 Received: from [85.158.139.211] by server-12.bemta-5.messagelabs.com id 6D/54-01026-8F40DB75; Wed, 24 Aug 2016 02:22:48 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrFLMWRWlGSWpSXmKPExsUyZ7p8oO4Plr3 hBvdXclh83zKZyYHR4/CHKywBjFGsmXlJ+RUJrBmfb81lLbgnUDF74xzmBsYlfF2MXBxCAm1M En+W7mGDcL4xSux7uZkVwtnIKLFh8x1GCGcCo8SUncuAHA4ONgETiTerHLsYOTlEBCIkel+eY gGxmQX6gLpPM4PYwgL+Eq8+P2YHsVkEVCVmHzvOAtLKK+AmcfCbI4gpISAv8ex2PUgFp4C7xJ nDs8CmCAFVLDr8BqxTQsBQ4vTDbYwTGPkWMDKsYtQoTi0qSy3SNbLQSyrKTM8oyU3MzNE1NDD Vy00tLk5MT81JTCrWS87P3cQIDJN6BgbGHYx9q/wOMUpyMCmJ8pq93RMuxJeUn1KZkVicEV9U mpNafIhRhoNDSYI3nXlvuJBgUWp6akVaZg4wYGHSEhw8SiK8GiBp3uKCxNzizHSI1ClGRSlx3 rUgCQGQREZpHlwbLEouMcpKCfMyMjAwCPEUpBblZpagyr9iFOdgVBLmXQUyhSczrwRu+iugxU xAi1vu7wZZXJKIkJJqYNRcFyi/Sk7U/SbXwZfv62YG/z42U6aq48NcEdfO6/LCgcxTmqdfedJ 0aEKqfL+L79LQzjUeukybvRuWT4v5mXRfmkfWcO1Nr+suy9SOvzOMW8pqdyfh1AMub9n0TZ66 jQstP69a4cRdlaIYEiIWdHnXn9va7gcXb878t/Doziu/XSdWXipfVaLEUpyRaKjFXFScCABQT SMOjQIAAA== X-Env-Sender: konrad.wilk@oracle.com X-Msg-Ref: server-6.tower-206.messagelabs.com!1472005366!55685300!1 X-Originating-IP: [156.151.31.81] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiAyODgzMzk=\n X-StarScan-Received: X-StarScan-Version: 8.84; banners=-,-,- X-VirusChecked: Checked Received: (qmail 9978 invoked from network); 24 Aug 2016 02:22:47 -0000 Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81) by server-6.tower-206.messagelabs.com with DHE-RSA-AES256-GCM-SHA384 encrypted SMTP; 24 Aug 2016 02:22:47 -0000 Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id u7O2Me1F021843 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 24 Aug 2016 02:22:41 GMT Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by userv0021.oracle.com (8.13.8/8.13.8) with ESMTP id u7O2MeDK028191 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 24 Aug 2016 02:22:40 GMT Received: from abhmp0014.oracle.com (abhmp0014.oracle.com [141.146.116.20]) by aserv0121.oracle.com (8.13.8/8.13.8) with ESMTP id u7O2MdNf000719; Wed, 24 Aug 2016 02:22:39 GMT Received: from localhost.localdomain.com (/209.6.196.81) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 23 Aug 2016 19:22:39 -0700 From: Konrad Rzeszutek Wilk To: xen-devel@lists.xenproject.org, konrad@kernel.org, ross.lagerwall@citrix.com Date: Tue, 23 Aug 2016 22:22:06 -0400 Message-Id: <1472005332-32207-4-git-send-email-konrad.wilk@oracle.com> X-Mailer: git-send-email 2.4.11 In-Reply-To: <1472005332-32207-1-git-send-email-konrad.wilk@oracle.com> References: <1472005332-32207-1-git-send-email-konrad.wilk@oracle.com> X-Source-IP: userv0021.oracle.com [156.151.31.71] Cc: Andrew Cooper , Jan Beulich , Konrad Rzeszutek Wilk Subject: [Xen-devel] [PATCH v4 3/9] version/livepatch: Move xen_build_id_check to version.h X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP It makes more sense for it to be there. However that means the version.h has now a dependency on as the Elf_Note is a macro. The elfstructs.h has a dependency on types.h as well so we need that. We cannot put that #include in elfstructs.h as that file is used by tools and they do not have such file. Reviewed-by: Jan Beulich Reviewed-by: Ross Lagerwall Signed-off-by: Konrad Rzeszutek Wilk --- Cc: Ross Lagerwall Cc: Jan Beulich Cc: Andrew Cooper v3: First submission v4: Added Ross's and Jan's Reviewed-by. --- xen/include/xen/livepatch.h | 2 -- xen/include/xen/version.h | 8 ++++++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/xen/include/xen/livepatch.h b/xen/include/xen/livepatch.h index ed49843..02f4572 100644 --- a/xen/include/xen/livepatch.h +++ b/xen/include/xen/livepatch.h @@ -42,8 +42,6 @@ int livepatch_op(struct xen_sysctl_livepatch_op *); void check_for_livepatch_work(void); unsigned long livepatch_symbols_lookup_by_name(const char *symname); bool_t is_patch(const void *addr); -int xen_build_id_check(const Elf_Note *n, unsigned int n_sz, - const void **p, unsigned int *len); /* Arch hooks. */ int arch_livepatch_verify_elf(const struct livepatch_elf *elf); diff --git a/xen/include/xen/version.h b/xen/include/xen/version.h index 400160f..97c247a 100644 --- a/xen/include/xen/version.h +++ b/xen/include/xen/version.h @@ -1,6 +1,9 @@ #ifndef __XEN_VERSION_H__ #define __XEN_VERSION_H__ +#include +#include + const char *xen_compile_date(void); const char *xen_compile_time(void); const char *xen_compile_by(void); @@ -15,4 +18,9 @@ const char *xen_banner(void); const char *xen_deny(void); int xen_build_id(const void **p, unsigned int *len); +#ifdef BUILD_ID +int xen_build_id_check(const Elf_Note *n, unsigned int n_sz, + const void **p, unsigned int *len); +#endif + #endif /* __XEN_VERSION_H__ */