Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp383995ybg; Mon, 1 Jun 2020 04:04:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxpSKmFhFeULZ1fIMXw7KIA6iFXDkwn0rKtxUFZT+2fMV55vRFhJcceJqPLapkxJZ4U+x7a X-Received: by 2002:aa7:c38c:: with SMTP id k12mr15139131edq.261.1591009495648; Mon, 01 Jun 2020 04:04:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591009495; cv=none; d=google.com; s=arc-20160816; b=e/WZREgYefXyU63DlRh5G1WVjRD/edxBNAWBXACsHPJafuRYOdBh41VV5fESOwNrja oOImnabuNFM24XQpAqhu4H8mQvayz6b8w/hol1ucJMEO8T3CaTHSn/y1w6OexAaoctNo v7MgEoIrl1dJ22HETYDKM5YomCnCHnDPbt+4te8pvrcaMt3AYj7IU31lVpjpa0Ypbk3A kQgLBjoaEnxwMAXBDYOPGgtte+XuNsjuCYyz10cKz+SgY8S0ySueoNzhJinJTsgdNOTX aQ7SPUkxMQtxM9R/WNkmRLg23iEtXrqc5EKu2q43wQ7VaR7DBW7yUs7pMYdCe5vS/mhe WFfQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :ironport-sdr; bh=n98N9J58aUXwDNgq5EnQryFTys8V7Q8u8x0tyO4bHCE=; b=XC5u6rAispeP2BjsN9j65Yf8/fMBljfJJMGk613LwwNGx7lrepckgQYP53O3iGjlPp wbb1IRSF0Bud8b+zeZeg7Y5uUsb2PTALvEYiqHrgp8GM5evxxJdVynH2Dw4ZypnFW2eS E6MwfCHAziv2jsB8A/F4M4NDwEPf6Y+IRcXgUcVjCbrKnOliPg8jjFnQtjunfQc3Gr7b ziW/ZWliFdSyAA9VPczXF7kgfrjTxBigXOlkZpnQQFPoZb1jFkHgKqbGHcmsMLhVjRU2 4jlzv6qHi1Ia5f5JNkFtEiQBW0wRKk1o0WaAHvKhVuYkSuBf2u/k2RUmcgaPy9oha3tP hZLQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=citrix.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c26si3799547edj.238.2020.06.01.04.04.31; Mon, 01 Jun 2020 04:04:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=citrix.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726089AbgFALBy (ORCPT + 99 others); Mon, 1 Jun 2020 07:01:54 -0400 Received: from esa6.hc3370-68.iphmx.com ([216.71.155.175]:36067 "EHLO esa6.hc3370-68.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725925AbgFALBy (ORCPT ); Mon, 1 Jun 2020 07:01:54 -0400 X-Greylist: delayed 428 seconds by postgrey-1.27 at vger.kernel.org; Mon, 01 Jun 2020 07:01:53 EDT Authentication-Results: esa6.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none IronPort-SDR: dE4OJlvFGeDUUtAzk3Pi5zV28ZQIW5UOP7UQrOT5lcQFU2YWh+Xc0k4Dbio1M5jzIQRGIdcbgX T0UA6G1hW8qVM0IXQuYrEA++MNqKuY+BQHzK8tdGNAXiBGrCA+PzIKy+tFZB/X5eMboLe8OBRi W/yT9uFgzTE+mD8IurFET4SeUBhqARgj1gOIEfCdjngudjQ7bEGpkuIoJXc0yVJffNpn7AyqoH Ac5ZSqvawoklGR18qCojrS7GFT73+YeKkHaDVpPE0iJZTpsNv82xn7a5GQ7gS4FqVLy6QkZWmH zDk= X-SBRS: 2.7 X-MesageID: 19251855 X-Ironport-Server: esa6.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.73,460,1583211600"; d="scan'208";a="19251855" Date: Mon, 1 Jun 2020 12:54:37 +0200 From: Roger Pau =?utf-8?B?TW9ubsOp?= To: Daniel Kiper CC: , , , , , , , , , , , , , , , , , , , , , , , , Subject: Re: [BOOTLOADER SPECIFICATION RFC] The bootloader log format for TrenchBoot and others Message-ID: <20200601105437.GS1195@Air-de-Roger> References: <20200529112735.qln44ds6z7djheof@tomti.i.net-space.pl> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Disposition: inline In-Reply-To: <20200529112735.qln44ds6z7djheof@tomti.i.net-space.pl> X-ClientProxiedBy: AMSPEX02CAS02.citrite.net (10.69.22.113) To AMSPEX02CL02.citrite.net (10.69.22.126) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, May 29, 2020 at 01:27:35PM +0200, Daniel Kiper wrote: > Hey, > > Below you can find my rough idea of the bootloader log format which is > generic thing but initially will be used for TrenchBoot work. I discussed > this proposal with Ross and Daniel S. So, the idea went through initial > sanitization. Now I would like to take feedback from other folks too. > So, please take a look and complain... > > In general we want to pass the messages produced by the bootloader to the OS > kernel and finally to the userspace for further processing and analysis. Below > is the description of the structures which will be used for this thing. > > struct bootloader_log_msgs > { > grub_uint32_t level; > grub_uint32_t facility; Nit: if this is aimed at cross-OS and cross-bootloader compatibility uint32_t should be used here instead of a grub specific alias. > char type[]; > char msg[]; I think you want char * here instead? Or are the above arrays expected to have a fixed size in the final spec? > } > > struct bootloader_log > { > grub_uint32_t version; > grub_uint32_t producer; > grub_uint32_t size; > grub_uint32_t next_off; > bootloader_log_msgs msgs[]; As I understand it this is not a pointer to an array of bootloader_log_msgs but rather in-place? > } > > The members of struct bootloader_log: > - version: the bootloader log format version number, 1 for now, > - producer: the producer/bootloader type; we can steal some values from > linux/Documentation/x86/boot.rst:type_of_loader, > - size: total size of the log buffer including the bootloader_log struct, > - next_off: offset in bytes, from start of the bootloader_log struct, > of the next byte after the last log message in the msgs[]; > i.e. the offset of the next available log message slot, So this will be a memory area that's shared between the OS and the bootloader and needs to be updated at runtime? If this is something that's created by the bootloader during loading and passed to the OS for consumption (but it's not further updated), I don't see much point in the next_off field. The size field could be updated to reflect the actual size of the produced messages? Roger.