From patchwork Fri Jan 15 14:59:40 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Roger_Pau_Monn=C3=A9?= X-Patchwork-Id: 8042281 Return-Path: X-Original-To: patchwork-xen-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 95381BEEE1 for ; Fri, 15 Jan 2016 15:02:09 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id BFEF420459 for ; Fri, 15 Jan 2016 15:02:08 +0000 (UTC) Received: from lists.xen.org (lists.xenproject.org [50.57.142.19]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C68F820453 for ; Fri, 15 Jan 2016 15:02:06 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xen.org) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1aK5qz-0000nZ-Sf; Fri, 15 Jan 2016 14:59:53 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1aK5qz-0000nN-26 for xen-devel@lists.xenproject.org; Fri, 15 Jan 2016 14:59:53 +0000 Received: from [85.158.137.68] by server-1.bemta-3.messagelabs.com id 3F/78-02745-86909965; Fri, 15 Jan 2016 14:59:52 +0000 X-Env-Sender: prvs=8150a737c=roger.pau@citrix.com X-Msg-Ref: server-5.tower-31.messagelabs.com!1452869990!16144022!1 X-Originating-IP: [66.165.176.89] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAyMDMwMDc=\n, received_headers: No Received headers X-StarScan-Received: X-StarScan-Version: 7.35.1; banners=-,-,- X-VirusChecked: Checked Received: (qmail 17424 invoked from network); 15 Jan 2016 14:59:51 -0000 Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89) by server-5.tower-31.messagelabs.com with RC4-SHA encrypted SMTP; 15 Jan 2016 14:59:51 -0000 X-IronPort-AV: E=Sophos;i="5.22,299,1449532800"; d="scan'208";a="325418768" From: Roger Pau Monne To: Date: Fri, 15 Jan 2016 15:59:40 +0100 Message-ID: <1452869983-75956-2-git-send-email-roger.pau@citrix.com> X-Mailer: git-send-email 1.9.5 (Apple Git-50.3) In-Reply-To: <1452869983-75956-1-git-send-email-roger.pau@citrix.com> References: <1452869983-75956-1-git-send-email-roger.pau@citrix.com> MIME-Version: 1.0 X-DLP: MIA1 Cc: Wei Liu , Ian Jackson , Ian Campbell , Roger Pau Monne Subject: [Xen-devel] [PATCH v2 1/4] xen/elfnotes: check phys_entry against UNSET_ADDR32 X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP And introduce UNSET_ADDR32. Signed-off-by: Roger Pau Monné Acked-by: Jan Beulich Acked-by: Wei Liu --- Cc: Ian Jackson Cc: Ian Campbell Cc: Wei Liu --- Changes since v1: - Fix commit title. --- tools/libxc/xc_dom_elfloader.c | 2 +- xen/common/libelf/libelf-dominfo.c | 1 + xen/include/xen/libelf.h | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/libxc/xc_dom_elfloader.c b/tools/libxc/xc_dom_elfloader.c index 2ae575e..5039f3f 100644 --- a/tools/libxc/xc_dom_elfloader.c +++ b/tools/libxc/xc_dom_elfloader.c @@ -57,7 +57,7 @@ static char *xc_dom_guest_type(struct xc_dom_image *dom, uint64_t machine = elf_uval(elf, elf->ehdr, e_machine); if ( dom->container_type == XC_DOM_HVM_CONTAINER && - dom->parms.phys_entry != UNSET_ADDR ) + dom->parms.phys_entry != UNSET_ADDR32 ) return "hvm-3.0-x86_32"; switch ( machine ) diff --git a/xen/common/libelf/libelf-dominfo.c b/xen/common/libelf/libelf-dominfo.c index 02d6cfb..ec69449 100644 --- a/xen/common/libelf/libelf-dominfo.c +++ b/xen/common/libelf/libelf-dominfo.c @@ -503,6 +503,7 @@ elf_errorstatus elf_xen_parse(struct elf_binary *elf, parms->virt_hv_start_low = UNSET_ADDR; parms->p2m_base = UNSET_ADDR; parms->elf_paddr_offset = UNSET_ADDR; + parms->phys_entry = UNSET_ADDR32; /* Find and parse elf notes. */ count = elf_phdr_count(elf); diff --git a/xen/include/xen/libelf.h b/xen/include/xen/libelf.h index 6da4cc0..95b5370 100644 --- a/xen/include/xen/libelf.h +++ b/xen/include/xen/libelf.h @@ -386,6 +386,7 @@ elf_errorstatus elf_reloc(struct elf_binary *elf); /* xc_libelf_dominfo.c */ #define UNSET_ADDR ((uint64_t)-1) +#define UNSET_ADDR32 ((uint32_t)-1) enum xen_elfnote_type { XEN_ENT_NONE = 0,