From patchwork Wed Jun 22 17:15:37 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anthony PERARD X-Patchwork-Id: 9193389 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 48C7C60890 for ; Wed, 22 Jun 2016 17:19:00 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3368A2840A for ; Wed, 22 Jun 2016 17:19:00 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2840428415; Wed, 22 Jun 2016 17:19:00 +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 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 331D02840B for ; Wed, 22 Jun 2016 17:18: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 1bFlld-0004og-GH; Wed, 22 Jun 2016 17:16:45 +0000 Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bFllc-0004mw-4M for xen-devel@lists.xen.org; Wed, 22 Jun 2016 17:16:44 +0000 Received: from [193.109.254.147] by server-13.bemta-14.messagelabs.com id 69/46-09524-BF7CA675; Wed, 22 Jun 2016 17:16:43 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprNIsWRWlGSWpSXmKPExsXitHSDve6v41n hBhf/GFgs+biYxYHR4+ju30wBjFGsmXlJ+RUJrBkf7pxnK7ivWPF+x3yWBsbL4l2MnBwSAv4S v96fYgSx2QQMJFZMvwpmiwjISqzumsPexcjBwSxQLnH0mC5IWFggSeL2xlfMIDaLgKrE+ZeHW EFsXgFbiSmfe1kgRspJNJy/D1bDKWAnsexVDxuILQRUc3vBAkYIW03ixsJlLBC9ghInZz4Bs5 kFJCQOvnjBDLJWQoBb4m+3/QRGvllIqmYhqVrAyLSKUaM4tagstUjX0EIvqSgzPaMkNzEzR9f Q0EQvN7W4ODE9NScxqVgvOT93EyMwoOoZGBh3MB7Z7nmIUZKDSUmUl3FbVrgQX1J+SmVGYnFG fFFpTmrxIUYZDg4lCV7Oo0A5waLU9NSKtMwcYGjDpCU4eJREePVB0rzFBYm5xZnpEKlTjLocW xbcWMskxJKXn5cqJc7LAFIkAFKUUZoHNwIWZ5cYZaWEeRkZGBiEeApSi3IzS1DlXzGKczAqCf MagEzhycwrgdv0CugIJqAjlvWngxxRkoiQkmpg1HPf/Ol1wuGwORukPpi77F/Od8ZjK9eOSZc WTVo9fZ2ASXzuBOndS5aJPbNXYJzszN1eskbdaOrGJxGedSrsu/KLynkTd7LcyhXgk4+L9n/p 7rYmTWHHLWXe1d9DZmlVdrGorwtZ8ZVl6vJlzV8/KIl6syzVkOF592Y978EvxupOpantW4NTl ViKMxINtZiLihMBjXqtqa4CAAA= X-Env-Sender: prvs=9742ee4c2=anthony.perard@citrix.com X-Msg-Ref: server-14.tower-27.messagelabs.com!1466615801!37129849!1 X-Originating-IP: [66.165.176.63] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAzMDYwNDg=\n, received_headers: No Received headers X-StarScan-Received: X-StarScan-Version: 8.46; banners=-,-,- X-VirusChecked: Checked Received: (qmail 37364 invoked from network); 22 Jun 2016 17:16:42 -0000 Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63) by server-14.tower-27.messagelabs.com with RC4-SHA encrypted SMTP; 22 Jun 2016 17:16:42 -0000 X-IronPort-AV: E=Sophos;i="5.26,509,1459814400"; d="scan'208";a="369016602" From: Anthony PERARD To: Date: Wed, 22 Jun 2016 18:15:37 +0100 Message-ID: <20160622171545.5304-7-anthony.perard@citrix.com> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20160622171545.5304-1-anthony.perard@citrix.com> References: <20160622171545.5304-1-anthony.perard@citrix.com> MIME-Version: 1.0 X-DLP: MIA1 Cc: Anthony PERARD , Wei Liu , Ian Jackson Subject: [Xen-devel] [PATCH v5 06/14] xen: Move the hvm_start_info C representation from libxc to public/xen.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: , Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP Instead of having several representation of hvm_start_info in C, define it in public/xen.h so both libxc and hvmloader can use it. Signed-off-by: Anthony PERARD --- Change in V5: - remove packed attribute. New in V4. --- tools/libxc/include/xc_dom.h | 31 ------------------------------- xen/include/public/xen.h | 27 +++++++++++++++++++++++++++ 2 files changed, 27 insertions(+), 31 deletions(-) diff --git a/tools/libxc/include/xc_dom.h b/tools/libxc/include/xc_dom.h index 0629971..de7dca9 100644 --- a/tools/libxc/include/xc_dom.h +++ b/tools/libxc/include/xc_dom.h @@ -219,37 +219,6 @@ struct xc_dom_image { struct xc_hvm_firmware_module smbios_module; }; -#if defined(__i386__) || defined(__x86_64__) -/* C representation of the x86/HVM start info layout. - * - * The canonical definition of this layout resides in public/xen.h, this - * is just a way to represent the layout described there using C types. - * - * NB: the packed attribute is not really needed, but it helps us enforce - * the fact this this is just a representation, and it might indeed - * be required in the future if there are alignment changes. - */ -struct hvm_start_info { - uint32_t magic; /* Contains the magic value 0x336ec578 */ - /* ("xEn3" with the 0x80 bit of the "E" set).*/ - uint32_t version; /* Version of this structure. */ - uint32_t flags; /* SIF_xxx flags. */ - uint32_t nr_modules; /* Number of modules passed to the kernel. */ - uint64_t modlist_paddr; /* Physical address of an array of */ - /* hvm_modlist_entry. */ - uint64_t cmdline_paddr; /* Physical address of the command line. */ - uint64_t rsdp_paddr; /* Physical address of the RSDP ACPI data */ - /* structure. */ -} __attribute__((packed)); - -struct hvm_modlist_entry { - uint64_t paddr; /* Physical address of the module. */ - uint64_t size; /* Size of the module in bytes. */ - uint64_t cmdline_paddr; /* Physical address of the command line. */ - uint64_t reserved; -} __attribute__((packed)); -#endif /* x86 */ - /* --- pluggable kernel loader ------------------------------------- */ struct xc_dom_loader { diff --git a/xen/include/public/xen.h b/xen/include/public/xen.h index d9ddee7..defde97 100644 --- a/xen/include/public/xen.h +++ b/xen/include/public/xen.h @@ -859,6 +859,33 @@ typedef struct start_info start_info_t; */ #define XEN_HVM_START_MAGIC_VALUE 0x336ec578 +#if defined(__i386__) || defined(__x86_64__) +/* C representation of the x86/HVM start info layout. + * + * The canonical definition of this layout is abrove, this is just a way to + * represent the layout described there using C types. + */ +struct hvm_start_info { + uint32_t magic; /* Contains the magic value 0x336ec578 */ + /* ("xEn3" with the 0x80 bit of the "E" set).*/ + uint32_t version; /* Version of this structure. */ + uint32_t flags; /* SIF_xxx flags. */ + uint32_t nr_modules; /* Number of modules passed to the kernel. */ + uint64_t modlist_paddr; /* Physical address of an array of */ + /* hvm_modlist_entry. */ + uint64_t cmdline_paddr; /* Physical address of the command line. */ + uint64_t rsdp_paddr; /* Physical address of the RSDP ACPI data */ + /* structure. */ +}; + +struct hvm_modlist_entry { + uint64_t paddr; /* Physical address of the module. */ + uint64_t size; /* Size of the module in bytes. */ + uint64_t cmdline_paddr; /* Physical address of the command line. */ + uint64_t reserved; +}; +#endif /* x86 */ + /* New console union for dom0 introduced in 0x00030203. */ #if __XEN_INTERFACE_VERSION__ < 0x00030203 #define console_mfn console.domU.mfn