Received: by 2002:a05:7412:31a9:b0:e2:908c:2ebd with SMTP id et41csp3794602rdb; Thu, 14 Sep 2023 02:55:20 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGcxycFj7K9xNd7H3cL1K8LZ8cNYTf0GC8HFhany8G5mp63EedthvXVwAfbN0B7kkb2gxnc X-Received: by 2002:a25:b097:0:b0:d7b:9187:b92e with SMTP id f23-20020a25b097000000b00d7b9187b92emr5087782ybj.58.1694685320383; Thu, 14 Sep 2023 02:55:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694685320; cv=none; d=google.com; s=arc-20160816; b=I3w3uc3/OH60RR1zoGmpVepn3Rbf4u8XdUpR5E/uuIfCVvfAZrZGQzfbVJNuzWG6YK z3qjSEicmB7/eF67qwmSoQPJQCl48cwu0Tqrgg2TiQ7UuTT3xy27GOmTXDd2Q2XTjdOu azADc9fLvNikIDMnV1mTiOq28Z063EUOMdtHeiPr+ZC40EP0kJvOnHtBMHc3xfJymX4O 2NQnXpfmrW6bb6re8Jud2OpgaZkMuBEfAvHoIw+2Wr87KAjVxrxB/eUW0tB76HPQUMkR JD9/Cj7nW6bX44dGV0MMm0azHdeYIQH2w8RVK+yOFHxszNo09WjBGBCZvAjPnFgrmiaO 9QHA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=n+wMY5PW5cmd0WeVSO1xGTUhfmCCtHosQIztHZF/GPw=; fh=OYHMRIciRShKem2MB/FNt+zW7L6HYzLjcMDOR8YV4LU=; b=1Fz4OvBHcGFUALXsTX4ZMVsjIWm7Zp2JKpa+1ZYAHtkJRjiUtm1O1M7b0BvkmfZkcZ y3Fp1E473QC9dDluVOLvCsvu9q5+8CrJxQXkJanysLxpVbuoWh1Rqb1l/QZExLU2zjp2 uTUDmOs9HNhmXJdywquM6hS8nbJrXbWVG2we5shnEm2OdiNJdIwFR5Of8ElqVBP31SG1 XKY87lgiQ11NB3w4Ycvx777IyF2q7qYQkt25jBZ7EyQZzYtr1ZIjolzLcn1U9LMfggRl hP0BrR3AL0cqloUiTutL2DjdzweVb1IOLl5dHUDWbnC0ALHR6QTAqwsYcjluo7JjeJfS 07QQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id i3-20020a63e903000000b00565eb0cf702si1226042pgh.310.2023.09.14.02.55.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Sep 2023 02:55:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 3A072807667C; Thu, 14 Sep 2023 02:32:38 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231925AbjINJca (ORCPT + 99 others); Thu, 14 Sep 2023 05:32:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40778 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235935AbjINJc2 (ORCPT ); Thu, 14 Sep 2023 05:32:28 -0400 X-Greylist: delayed 2603 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Thu, 14 Sep 2023 02:32:23 PDT Received: from gardel.0pointer.net (gardel.0pointer.net [IPv6:2a01:238:43ed:c300:10c3:bcf3:3266:da74]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6AA281BF2; Thu, 14 Sep 2023 02:32:23 -0700 (PDT) Received: from gardel-login.0pointer.net (gardel-mail [85.214.157.71]) by gardel.0pointer.net (Postfix) with ESMTP id 1A4E2E801F5; Thu, 14 Sep 2023 11:32:21 +0200 (CEST) Received: by gardel-login.0pointer.net (Postfix, from userid 1000) id A2B45160258; Thu, 14 Sep 2023 11:32:20 +0200 (CEST) Date: Thu, 14 Sep 2023 11:32:20 +0200 From: Lennart Poettering To: Philipp Rudo Cc: Jan Hendrik Farr , linux-kernel@vger.kernel.org, kexec@lists.infradead.org, x86@kernel.org, tglx@linutronix.de, dhowells@redhat.com, vgoyal@redhat.com, keyrings@vger.kernel.org, akpm@linux-foundation.org, bhe@redhat.com, bhelgaas@google.com, bluca@debian.org Subject: Re: [PATCH v2 0/2] x86/kexec: UKI Support Message-ID: References: <20230911052535.335770-1-kernel@jfarr.cc> <20230913160045.40d377f9@rotkaeppchen> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230913160045.40d377f9@rotkaeppchen> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Thu, 14 Sep 2023 02:32:38 -0700 (PDT) X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email On Mi, 13.09.23 16:00, Philipp Rudo (prudo@redhat.com) wrote: > For example there are two definitions for the UKI which contradict each other. > The dedicated one [1] you have cited earlier and the one in the BLS for type #2 > entries [2]. In [1] the .linux and .initrd sections are mandatory and the > .osrel and .cmdline sections are optional while in [2] it is the other way > round. Which definition should the kernel follow? > > Furthermore, I absolutely don't understand how the spec should be read. All > the spec does is defining some file formats. There is no word about which > component in the boot chain is supposed to handle them and what exactly this > component is supposed to do with it. But that is crucial if we want to add UKI > support for kexec as the kexec systemcall will replace the stub. So we need to > know what tasks the stub is supposed to perform. Currently this is only some > implementation detail of the systemd-stub [3] that can change any moment and I > strongly oppose to base any uapi on it. > > In the end the only benefit this series brings is to extend the signature > checking on the whole UKI except of just the kernel image. Everything else can > also be done in user space. Compared to the problems described above this is a > very small gain for me. > > Until the spec got fixed I don't see a chance to add UKI support for kexec. So that spec is initially just a generalization of what systemd-stub/systemd-boot/ukify does. The descrepancies between the cited specs mostly come from the that generalization. If you want to enumerate kernels and order them the ".osrel" stuff for example is necessary, hence the boot loader spec really wants it. If you don't care about the boot loader spec though and just want to register the kernel UKI PE directly in BootXXX efi vars for example, then there's no need to include .osrel. That all said we should certainly make the two specs align better, and clarify the situation. Suggestions/patches more than welcome. Ultimately, I think a spec written as description with a single implementation in mind (i.e. systemd) is a generally a bad spec. Hence if kexec in the Linux kernel wants to add support for it, that'd be great but I'd see that as an opportunity to adjust the spec to the needs of the Linux kernel in this area, so that it reflects well more than just one backend implementation. Hence, seeing the spec as set in stone and as inherently low quality is the wrong way to see it I am sure. Instead, the goal here is to adjust the spec to make it work really nicely for *both* systemd and the kernel. Lennart -- Lennart Poettering, Berlin