From patchwork Mon Sep 9 14:19:05 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Maxiwell S. Garcia" X-Patchwork-Id: 1159786 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46Rrwv26wBz9s00 for ; Tue, 10 Sep 2019 01:02:07 +1000 (AEST) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=linux.ibm.com Received: from bilbo.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 46Rrwt20c2zDqMx for ; Tue, 10 Sep 2019 01:02:06 +1000 (AEST) X-Original-To: petitboot@lists.ozlabs.org Delivered-To: petitboot@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=linux.ibm.com (client-ip=148.163.156.1; helo=mx0a-001b2d01.pphosted.com; envelope-from=maxiwell@linux.ibm.com; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=linux.ibm.com Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 46RrwT0ckHzDqMn for ; Tue, 10 Sep 2019 01:01:44 +1000 (AEST) Received: from pps.filterd (m0098394.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x89EHNbA079903 for ; Mon, 9 Sep 2019 10:19:22 -0400 Received: from ppma02dal.us.ibm.com (a.bd.3ea9.ip4.static.sl-reverse.com [169.62.189.10]) by mx0a-001b2d01.pphosted.com with ESMTP id 2uwpeh606g-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 09 Sep 2019 10:19:22 -0400 Received: from pps.filterd (ppma02dal.us.ibm.com [127.0.0.1]) by ppma02dal.us.ibm.com (8.16.0.27/8.16.0.27) with SMTP id x89EFIr1026501 for ; Mon, 9 Sep 2019 14:19:17 GMT Received: from b03cxnp08026.gho.boulder.ibm.com (b03cxnp08026.gho.boulder.ibm.com [9.17.130.18]) by ppma02dal.us.ibm.com with ESMTP id 2uv466ymk3-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 09 Sep 2019 14:19:16 +0000 Received: from b03ledav006.gho.boulder.ibm.com (b03ledav006.gho.boulder.ibm.com [9.17.130.237]) by b03cxnp08026.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x89EJEsX37028218 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 9 Sep 2019 14:19:14 GMT Received: from b03ledav006.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id A76FEC605F; Mon, 9 Sep 2019 14:19:14 +0000 (GMT) Received: from b03ledav006.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id B82D0C6063; Mon, 9 Sep 2019 14:19:13 +0000 (GMT) Received: from maxibm.ibmuc.com (unknown [9.80.194.34]) by b03ledav006.gho.boulder.ibm.com (Postfix) with ESMTP; Mon, 9 Sep 2019 14:19:13 +0000 (GMT) From: "Maxiwell S. Garcia" To: petitboot@lists.ozlabs.org Subject: [PATCH 0/3] discover: Check if the kernel image has Ultravisor support Date: Mon, 9 Sep 2019 11:19:05 -0300 Message-Id: <20190909141908.8903-1-maxiwell@linux.ibm.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2019-09-09_06:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=1 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1906280000 definitions=main-1909090144 X-BeenThere: petitboot@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Petitboot bootloader development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: petitboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Petitboot" Hi, The PPC kernel image has an ELF Note 'namespace' called 'PowerPC' to store capabilities that indicates if the powerpc kernel binary knows how to run in an ultravisor-enabled system. This patchset enables petitboot to read the ELF structures of kernel binary using the libelf as low-level support and get the kernel image ELF Note capabilities. If that image is not compatible with the system, the boot process is aborted. Maxiwell S. Garcia (3): configure: Add libelf as a requirement discovery: Add helper functions to read ELF notes discover: Check if the kernel image has Ultravisor support configure.ac | 6 ++++ discover/Makefile.am | 7 ++-- discover/boot.c | 28 ++++++++++++++- discover/elf.c | 86 ++++++++++++++++++++++++++++++++++++++++++++ discover/elf.h | 29 +++++++++++++++ 5 files changed, 153 insertions(+), 3 deletions(-) create mode 100644 discover/elf.c create mode 100644 discover/elf.h