From patchwork Wed May 15 11:40:15 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anthony PERARD X-Patchwork-Id: 10944583 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 332B176 for ; Wed, 15 May 2019 11:42:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 23F3A2899E for ; Wed, 15 May 2019 11:42:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 180C2289F0; Wed, 15 May 2019 11:42:06 +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=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, 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 AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id BA6302899E for ; Wed, 15 May 2019 11:42:05 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hQsGz-0004Sk-JP; Wed, 15 May 2019 11:40:37 +0000 Received: from us1-rack-dfw2.inumbo.com ([104.130.134.6]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hQsGy-0004SY-AW for xen-devel@lists.xenproject.org; Wed, 15 May 2019 11:40:36 +0000 X-Inumbo-ID: 40a9aa70-7706-11e9-8980-bc764e045a96 Received: from esa3.hc3370-68.iphmx.com (unknown [216.71.145.155]) by us1-rack-dfw2.inumbo.com (Halon) with ESMTPS id 40a9aa70-7706-11e9-8980-bc764e045a96; Wed, 15 May 2019 11:40:35 +0000 (UTC) Authentication-Results: esa3.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none; spf=None smtp.pra=anthony.perard@citrix.com; spf=SoftFail smtp.mailfrom=anthony.perard@citrix.com; spf=None smtp.helo=postmaster@MIAPEX02MSOL02.citrite.net Received-SPF: None (esa3.hc3370-68.iphmx.com: no sender authenticity information available from domain of anthony.perard@citrix.com) identity=pra; client-ip=23.29.105.83; receiver=esa3.hc3370-68.iphmx.com; envelope-from="anthony.perard@citrix.com"; x-sender="anthony.perard@citrix.com"; x-conformance=sidf_compatible Received-SPF: SoftFail (esa3.hc3370-68.iphmx.com: domain of anthony.perard@citrix.com is inclined to not designate 23.29.105.83 as permitted sender) identity=mailfrom; client-ip=23.29.105.83; receiver=esa3.hc3370-68.iphmx.com; envelope-from="anthony.perard@citrix.com"; x-sender="anthony.perard@citrix.com"; x-conformance=sidf_compatible; x-record-type="v=spf1"; x-record-text="v=spf1 mx include:spf.citrix.com include:spf2.citrix.com include:ironport.citrix.com include:_spf.salesforce.com ~all" Received-SPF: None (esa3.hc3370-68.iphmx.com: no sender authenticity information available from domain of postmaster@MIAPEX02MSOL02.citrite.net) identity=helo; client-ip=23.29.105.83; receiver=esa3.hc3370-68.iphmx.com; envelope-from="anthony.perard@citrix.com"; x-sender="postmaster@MIAPEX02MSOL02.citrite.net"; x-conformance=sidf_compatible IronPort-SDR: ncXw90FgGqkDGu/2VA9OL0JeCSJC5S2AJH2ZdqKqhvUH3x19fOWIAys688HirFlAbUezoaUP5u jNMcu6rOJiwwA3tSi4VJp3t8GkAtcVv1YZOYDXz3RU23odCzfFuZb+VqYRpLGtSdhf/BXjQIGH sQoHtoru6F3HxIQZz/ObgGJ7E9DUGDeOkQmu7MLFUA8UwabLGFwJc/DhA8Iw3NPx5ewE3Bwln+ jkpjNcbrszK8ax5SWFRqyrMpaLtlR8/VzK+6teeoS29iRqc9qsscxaq0H9F2mJ6qxaqw8MiwOT VK4= X-SBRS: 2.7 X-MesageID: 463370 X-Ironport-Server: esa3.hc3370-68.iphmx.com X-Remote-IP: 23.29.105.83 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.60,472,1549947600"; d="scan'208";a="463370" From: Anthony PERARD To: Date: Wed, 15 May 2019 12:40:15 +0100 Message-ID: <20190515114015.25492-1-anthony.perard@citrix.com> X-Mailer: git-send-email 2.21.0 MIME-Version: 1.0 Subject: [Xen-devel] [PATCH] libxc: elf_kernel loader: Remove check for shstrtab X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Anthony PERARD , Wei Liu , Ian Jackson Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP This was probably useful to load ELF Note, but now ELF notes "should live in a PT_NOTE segment" (elfnote.h). With notes living in segment, there are no need for sections, so there is nothing to be stored in the shstrtab. This patch would allow to write a simpler ELF header for an OVMF blob (which isn't an ELF) and allow it to be loaded as a PVH kernel. The header only needs to declare two program segments: - one to tell an ELF loader where to put the blob, - one for a Xen ELFNOTE. The ELFNOTE is to comply to the pvh design which wants the XEN_ELFNOTE_PHYS32_ENTRY to declare a blob as compaptible with the PVH boot ABI. Note that without the ELFNOTE, libxc will load an ELF but with the plain ELF loader, which doesn't check for shstrtab. Signed-off-by: Anthony PERARD Acked-by: Wei Liu --- tools/libxc/xc_dom_elfloader.c | 9 --------- 1 file changed, 9 deletions(-) diff --git a/tools/libxc/xc_dom_elfloader.c b/tools/libxc/xc_dom_elfloader.c index 82b5f2ee79..b327db219d 100644 --- a/tools/libxc/xc_dom_elfloader.c +++ b/tools/libxc/xc_dom_elfloader.c @@ -165,15 +165,6 @@ static elf_negerrnoval xc_dom_parse_elf_kernel(struct xc_dom_image *dom) return rc; } - /* Find the section-header strings table. */ - if ( ELF_PTRVAL_INVALID(elf->sec_strtab) ) - { - xc_dom_panic(dom->xch, XC_INVALID_KERNEL, "%s: ELF image" - " has no shstrtab", __FUNCTION__); - rc = -EINVAL; - goto out; - } - /* parse binary and get xen meta info */ elf_parse_binary(elf); if ( elf_xen_parse(elf, &dom->parms) != 0 )