From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CD10EC433EF for ; Fri, 5 Nov 2021 01:04:49 +0000 (UTC) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D298561220 for ; Fri, 5 Nov 2021 01:04:48 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org D298561220 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 5A5B783686; Fri, 5 Nov 2021 02:04:46 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="oORmhq57"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id ED4BA836D0; Fri, 5 Nov 2021 02:04:43 +0100 (CET) Received: from mail-pl1-x636.google.com (mail-pl1-x636.google.com [IPv6:2607:f8b0:4864:20::636]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 010EC8355C for ; Fri, 5 Nov 2021 02:04:39 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=takahiro.akashi@linaro.org Received: by mail-pl1-x636.google.com with SMTP id k4so10068569plx.8 for ; Thu, 04 Nov 2021 18:04:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:mail-followup-to:references :mime-version:content-disposition:in-reply-to; bh=hm/sd3hluNq++xFGBhL4Qrw0s5Zot7vhmCtYxdWVHv4=; b=oORmhq57N52/LDZF9DMCPl3MGauX9GuODSThmfnnn9fSNsUzmYQepvqlMZfRAEwmbc xgasxSZvfmmgbGamFmWLCoqYYLqhPZfsNIgrTQyCksVwfZJhqqynpPqyZQ9bMOD7IorG LhHMk2/8Wnjz7/THyfwtXb6Q59h8CtOc8jGc2aU+ck/XAkybugroCEIzRvUQTb0dtxmF bgqik1boh0pYQMYTfs/QFepBHbosSCszp5RmZhsijqp/yS+vyfwHrZMwrpuzb26UefbB f1nPWEt89O5PCzyzwdpCKxY6olJjeOmLBSGp5tcOtXZXD12Q94UnFrIP1WpWVwU+NAXz omIQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id :mail-followup-to:references:mime-version:content-disposition :in-reply-to; bh=hm/sd3hluNq++xFGBhL4Qrw0s5Zot7vhmCtYxdWVHv4=; b=RdoosHxR7XKeKUFIOs+mRCV1Pzcm/Z0DmwGOJXVHIVm4JqJRwrlMOeZQfSyKtHktZF DpMOL0yCW70ADuDvEhrjNVPp9Mx0r7/p/Drt4wqGoJhDuFAztGe00yHgB4YhrhckFQU8 a0rEAYYDthKm/n/dyJfCxLGE+yLov8hnqDNSGvnd6ENl/SW07l3PPl3dRc2olV8GDJvy Y/xkg60TPLfk5yF20REh5JErdaXmZWARrBmxAYwRFbyaN7+sCR24n7rc9kxvo66c3gf9 D9CnLJEPv38C/kppAZG/2msfhByM/os7SRVUnyvrK+0scIPaTzs2OK3rUiauE3Fy3z5m 6fmQ== X-Gm-Message-State: AOAM533KYHaX5vCQkZESqTe0sk+bT2ime0Gs3DNITU4Wc7fvypT/fy0C YDf68yIV/UJSfU3ZXJ50CbhHDw== X-Google-Smtp-Source: ABdhPJygN6lR/KGR96ts2wnBT4QpTsAIaLWbyqoFnjML5kzccxv2wjlKPkHlfCm6UfO8RAoV5jkYRQ== X-Received: by 2002:a17:902:aa02:b0:13a:6c8f:407f with SMTP id be2-20020a170902aa0200b0013a6c8f407fmr47244554plb.59.1636074278099; Thu, 04 Nov 2021 18:04:38 -0700 (PDT) Received: from laputa ([2400:4050:c3e1:100:844c:5534:2811:8a4d]) by smtp.gmail.com with ESMTPSA id l17sm6504782pfc.94.2021.11.04.18.04.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Nov 2021 18:04:37 -0700 (PDT) Date: Fri, 5 Nov 2021 10:04:33 +0900 From: AKASHI Takahiro To: Simon Glass Cc: Mark Kettenis , xypron.glpk@gmx.de, agraf@csgraf.de, ilias.apalodimas@linaro.org, sughosh.ganu@linaro.org, masami.hiramatsu@linaro.org, u-boot@lists.denx.de Subject: Re: [PATCH v5 02/11] tools: mkeficapsule: add firmwware image signing Message-ID: <20211105010433.GA27316@laputa> Mail-Followup-To: AKASHI Takahiro , Simon Glass , Mark Kettenis , xypron.glpk@gmx.de, agraf@csgraf.de, ilias.apalodimas@linaro.org, sughosh.ganu@linaro.org, masami.hiramatsu@linaro.org, u-boot@lists.denx.de References: <20211028062356.98224-1-takahiro.akashi@linaro.org> <20211028062356.98224-3-takahiro.akashi@linaro.org> <20211029045628.GA33977@laputa> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.2 at phobos.denx.de X-Virus-Status: Clean Hi, Simon, On Thu, Nov 04, 2021 at 09:11:59AM -0600, Simon Glass wrote: > Hi Mark, > > On Thu, 4 Nov 2021 at 08:31, Mark Kettenis wrote: > > > > > From: Simon Glass > > > Date: Wed, 3 Nov 2021 20:51:25 -0600 > > > > > > Hi Mark, > > > > > > On Tue, 2 Nov 2021 at 09:13, Mark Kettenis wrote: > > > > > > > > > From: Simon Glass > > > > > Date: Tue, 2 Nov 2021 08:56:50 -0600 > > > > > > > > > > Hi Takahiro, > > > > > > > > > > > > - can we just build the tool always? > > > > > > > > > > > > This is one of my questions. > > > > > > Why do you want to do so while there are bunch of tools that are > > > > > > not always built. > > > > > > > > > > Because I think all tools should be built always. It is fine if that > > > > > happens due to CONFIG options but we should try to avoid making it > > > > > complicated. > > > > > > > > Well, unless this patchset fixes things, we can't, because > > > > mkeficapsule doesn't build on OpenBSD. I tried looking into it, but I > > > > can't figure out how this is even supposed to compile as a host tool: > > > > > > > > > > > > In file included from tools/mkeficapsule.c:8: > > > > In file included from include/malloc.h:369: > > > > include/linux/string.h:15:24: error: conflicting types for 'strspn' > > > > extern __kernel_size_t strspn(const char *,const char *); > > > > ^ > > > > /usr/include/string.h:88:9: note: previous declaration is here > > > > size_t strspn(const char *, const char *); > > > > > > My guess is that linux/string.h should not be included, or perhaps > > > __kernel_size_t should be defined to size_t. > > > > > > I doubt it would take an age to figure out, with a bit of fiddling. > > > > Well, I think the problem is quite fundamental. Indeed I agree that > > linux/string.h shouldn't be included. It gets pulled in because the > > tools include . Modern software really shouldn't include > > that header anymore, and we removed it in OpenBSD some time ago. But > > even with that fixed, things break since the same header gets pulled > > in from . > > > > Redefining __kernel_size_t doesn't provide a way out: > > > > tools/mkeficapsule.c:23:16: error: typedef redefinition with different types ('size_t' (aka 'unsigned long') vs 'unsigned int') > > typedef size_t __kernel_size_t; > > ^ > > ./arch/arm/include/asm/posix_types.h:37:23: note: previous definition is here > > typedef unsigned int __kernel_size_t; > > ^ > > > > This is on an amd64 host, so "unsigned int" clearly is the wrong type > > for size_t. > > > > The fundamental problem seems to be that isn't safe to include > > in a "host" tool because it includes "target" headers that > > accidentally resolve to "system" headers on Linux systems. > > > > Maybe Takahiro or Heinrich have an idea how to fix that? But in the > > meantime it would be good if building this tool would remain optional. > > Yes let's ask them to fix that as I agree this sounds wrong. We have > several efi headers so perhaps just need to have the right stuff in > each. As far as I know, you initially introduced efi.h and efi_api.h. What is your intent to have the two? I think that efi_api.h contains definitions and interfaces defined in UEFI specification for building EFI application/modules, hence I believe that it should be target-independent. Right? But it *includes* efi.h which also contains some definitions defined in UEFI specification, while efi.h is only for U-Boot as UEFI application. I suspect that is the root cause. Or should we thoroughly use linux headers like "efi/efi.h" in this tool? -Takahiro Akashi > It is OK to have it optional with a CONFIG, but it should be enabled > by default, otherwise no one will know it is there. > > Can we get the OpenBSD environment into CI or is that just too hard? > > Regards, > Simon