From patchwork Sun Aug 14 21:52:20 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: 9280175 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 D6960600CB for ; Sun, 14 Aug 2016 21:55:30 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C8DC3289FA for ; Sun, 14 Aug 2016 21:55:30 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BDAA128A58; Sun, 14 Aug 2016 21:55:30 +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 639A7289FA for ; Sun, 14 Aug 2016 21:55:30 +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 1bZ3L5-0004Qz-AB; Sun, 14 Aug 2016 21:53:03 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bZ3L4-0004Qr-HI for xen-devel@lists.xenproject.org; Sun, 14 Aug 2016 21:53:02 +0000 Received: from [85.158.137.68] by server-6.bemta-3.messagelabs.com id A8/66-28813-D38E0B75; Sun, 14 Aug 2016 21:53:01 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrJLMWRWlGSWpSXmKPExsXSO6nOVdf2xYZ wg/9rRSy+b5nM5MDocfjDFZYAxijWzLyk/IoE1owVHzMKLvJXdG9uYW9gXMrbxcjFISQwmUli 8v53zF2MnEDOX0aJ/S0CEImNjBIT/v9nhHAmMEpsnn+QrYuRg4NNwETizSpHkAYRgQiJ3penW EBsZoE+Rol9p8EGCQv4S7T8nskGYrMIqEpcfX+DFcTmFXCV6Fm5iglkjISAvMSz2/UgYU4BN4 kJe7qhbnCV2H6hlwnElhAwlmh/e5FtAiPfAkaGVYwaxalFZalFukYmeklFmekZJbmJmTm6hgb GermpxcWJ6ak5iUnFesn5uZsYgUFSz8DAuIPx1XG/Q4ySHExKorw65uvChfiS8lMqMxKLM+KL SnNSiw8xynBwKEnw8j/fEC4kWJSanlqRlpkDDFeYtAQHj5IIrwJImre4IDG3ODMdInWKUVFKn JcXJCEAksgozYNrg8XIJUZZKWFeRgYGBiGegtSi3MwSVPlXjOIcjErCvOogU3gy80rgpr8CWs wEtFhfGmxxSSJCSqqBccvvxwyrp/09G+VhWLfiyev2gOKLsbEOUpufT/vxW3KL3xzzh5vmTeU 5vf9VKJNL0pVzv5fefW6tlD6xIsd1x9S567YWlE331rr+YnPKiZMnA+ov7p/0lIn9YOsJ8/6i a4+3PJotd/v8paXNu9uEZ36Y4XVt0ZGK35nVuh1XJ3486rGr1nu+o8lmJZbijERDLeai4kQAH VZg8owCAAA= X-Env-Sender: konrad.wilk@oracle.com X-Msg-Ref: server-7.tower-31.messagelabs.com!1471211579!48002459!1 X-Originating-IP: [141.146.126.69] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogMTQxLjE0Ni4xMjYuNjkgPT4gMjc3MjE4\n X-StarScan-Received: X-StarScan-Version: 8.84; banners=-,-,- X-VirusChecked: Checked Received: (qmail 58594 invoked from network); 14 Aug 2016 21:53:01 -0000 Received: from aserp1040.oracle.com (HELO aserp1040.oracle.com) (141.146.126.69) by server-7.tower-31.messagelabs.com with DHE-RSA-AES256-GCM-SHA384 encrypted SMTP; 14 Aug 2016 21:53:01 -0000 Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id u7ELqtDc029601 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 14 Aug 2016 21:52:55 GMT Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by aserv0022.oracle.com (8.14.4/8.14.4) with ESMTP id u7ELqs94024679 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 14 Aug 2016 21:52:55 GMT Received: from abhmp0007.oracle.com (abhmp0007.oracle.com [141.146.116.13]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id u7ELqsPc007343; Sun, 14 Aug 2016 21:52:54 GMT Received: from localhost.localdomain.com (/209.6.196.81) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Sun, 14 Aug 2016 14:52:54 -0700 From: Konrad Rzeszutek Wilk To: xen-devel@lists.xenproject.org, konrad@kernel.org, ross.lagerwall@citrix.com Date: Sun, 14 Aug 2016 17:52:20 -0400 Message-Id: <1471211546-2235-4-git-send-email-konrad.wilk@oracle.com> X-Mailer: git-send-email 2.4.11 In-Reply-To: <1471211546-2235-1-git-send-email-konrad.wilk@oracle.com> References: <1471211546-2235-1-git-send-email-konrad.wilk@oracle.com> X-Source-IP: aserv0022.oracle.com [141.146.126.234] Cc: Andrew Cooper , Jan Beulich , Konrad Rzeszutek Wilk Subject: [Xen-devel] [PATCH v3 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. Signed-off-by: Konrad Rzeszutek Wilk Reviewed-by: Jan Beulich Reviewed-by: Ross Lagerwall --- Cc: Ross Lagerwall Cc: Jan Beulich Cc: Andrew Cooper v3: First submission --- 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__ */