From nobody Thu Apr 25 23:27:14 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org ARC-Seal: i=1; a=rsa-sha256; t=1558093229; cv=none; d=zoho.com; s=zohoarc; b=YwacLTcg2fH1SMXTuDtLNeXR/HYXG+oXIQGWAR9Q8moIOmuxVnRayV4aAjKXQBqmaYbhNa5mI5hL1RRF37edpekxDzH97J+y0SDm+YR3EKizgHt0HpcuUKheY2tlCKj287a/XlmmLyeWjJ6ilQ8GwhRvGd1BxbegKuKjSYVRjss= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1558093229; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=oyUliqgZwqOED/AUPzHQ58ktXddLNh1Sp8nhb9olMBw=; b=iafS1aoqAtgK3yIEu+J++yd473mMlXqYSziafrzoU2l5FbOjkx9JgLIs8UKELGPynuu4/hZJkf462isv9kGJNiw7QDbsqsXawzqQGvZ9OQAiEbLfnRgFDCgzNi4xztyN/J0ID4pc3FG6OHPo1fBVcNkrZz7vi9g08vRad2Yk4ao= ARC-Authentication-Results: i=1; mx.zoho.com; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1558093229251225.2817521611605; Fri, 17 May 2019 04:40:29 -0700 (PDT) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hRbCX-0002Nl-47; Fri, 17 May 2019 11:39:01 +0000 Received: from us1-rack-dfw2.inumbo.com ([104.130.134.6]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hRbCV-0002Ng-Qr for xen-devel@lists.xenproject.org; Fri, 17 May 2019 11:38:59 +0000 Received: from esa2.hc3370-68.iphmx.com (unknown [216.71.145.153]) by us1-rack-dfw2.inumbo.com (Halon) with ESMTPS id 5b9ff5d3-7898-11e9-8980-bc764e045a96; Fri, 17 May 2019 11:38:58 +0000 (UTC) X-Inumbo-ID: 5b9ff5d3-7898-11e9-8980-bc764e045a96 Authentication-Results: esa2.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@MIAPEX02MSOL01.citrite.net Received-SPF: none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Received-SPF: None (esa2.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=esa2.hc3370-68.iphmx.com; envelope-from="anthony.perard@citrix.com"; x-sender="anthony.perard@citrix.com"; x-conformance=sidf_compatible Received-SPF: SoftFail (esa2.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=esa2.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 include:spf.citrix.com include:spf2.citrix.com include:ironport.citrix.com exists:%{i}._spf.mta.salesforce.com ~all" Received-SPF: None (esa2.hc3370-68.iphmx.com: no sender authenticity information available from domain of postmaster@MIAPEX02MSOL01.citrite.net) identity=helo; client-ip=23.29.105.83; receiver=esa2.hc3370-68.iphmx.com; envelope-from="anthony.perard@citrix.com"; x-sender="postmaster@MIAPEX02MSOL01.citrite.net"; x-conformance=sidf_compatible IronPort-SDR: ResV7xIXD7RfrHupvbEollEBSgW2cg+x92eMGAhEVi76594RxfJLejpoDhjNfNMi1JUuy75CBt +3navPC4Av/O+85ef/QT1yjCtqw6WmxcECsxnrK6i0k2v7XKF/pzW8uyiJX8ewMbrpG4844AKv +z8GI+trDY1pqdai3XU5iTQ3vG1tRbR+xF7NVHWjA1zXXEWtIpNWSZFQVSh1LBqITYM75CoKz5 Bg/oYDWuK3HuCPV9b2L4h94g7ZbBjqKxBjfjW016ot6Gd/a2ZegFci/r8DL47Zaqdmj7dhXRk7 6Ms= X-SBRS: 2.7 X-MesageID: 565170 X-Ironport-Server: esa2.hc3370-68.iphmx.com X-Remote-IP: 23.29.105.83 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.60,479,1549947600"; d="scan'208";a="565170" From: Anthony PERARD To: Date: Fri, 17 May 2019 12:38:43 +0100 Message-ID: <20190517113843.4598-1-anthony.perard@citrix.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190515114015.25492-1-anthony.perard@citrix.com> References: <20190515114015.25492-1-anthony.perard@citrix.com> MIME-Version: 1.0 Subject: [Xen-devel] [PATCH v2] 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 , Andrew Cooper , Ian Jackson , Wei Liu Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" This was probably useful as a sanity check when the "__xen_guest" section were not legacy. But now ELF notes are prefered and "should live in a PT_NOTE segment" (elfnote.h). This check is unnecessary as elf_xen_parse() from xen/common/libelf will do the right thing and look for ELFNOTEs in the different places in order of preference. elf_xen_parse() will still be able to also look for the legacy "__xen_guest" section without the check in libxc. 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 --- Notes: v2: Rework commit message, explain why the check is unnecessary. 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; } =20 - /* 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 =3D -EINVAL; - goto out; - } - /* parse binary and get xen meta info */ elf_parse_binary(elf); if ( elf_xen_parse(elf, &dom->parms) !=3D 0 ) --=20 Anthony PERARD _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel