Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3919335pxj; Tue, 11 May 2021 15:08:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw0K4YDgftjgpXozuBuLYsTCf2OU2tZQOESaH+Pf4VNyCjrnz40S9kqmw6NnZzjyaxuKIYy X-Received: by 2002:a05:6512:324e:: with SMTP id c14mr22755218lfr.218.1620770920545; Tue, 11 May 2021 15:08:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620770920; cv=none; d=google.com; s=arc-20160816; b=HR9pAf/I031MYZbAbW96JmfZ43EhpF6U1xuEMdm6wXrZ+Yy4jUuQezxh2pOhkUuDEJ 0NhYGOrx9FQOg2VFWxyYbe4PjJQvoREwynjHnCU+0Bnc5zgpqqdCHEWKRFJgVtu9mup/ V6io/iM/Y8Rkc9HPqufpqEQuttt+fdqWOU7lS0ixkbvOqwwERocB1ky//bSUT3uekOap SlORebTbW6cghmdyeQ91wn1ehkjSOcDmxpEq8VXKCJ23v7jIkCTHgUvmIJJS8aUfbP+0 /wJLTiLIJ5QKAxhoHyjz4KdfdBWokO+xw1VIasm2x0CNoEW7L6lKZIMy+KnbmzDWkR4s PsWQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=kViGQP5O4vIiDx6PPU4NLLIcleSx+m7CXWAs81ZnckE=; b=Auc79d/XGC9iPJVljUPvgTENl06Au/OCcxs4bFrScPgY5wZYjDYEKW+pYGZPBYpNgI 5dJdDgBbrmIzb1gMjoVG7/cAbjXo4HW0bgpKvEXZBQNr+9Gwe+Ot0vajTLWkuS4LiKnf UZ9S5f8p+b9rtHEEh6ISA51nFEl+ygU4pmFiRr/21qkZmgDT0MkrPcxUe2n4AUgDrGsp Tu2ebmocZMfHiinE/few+jM5GBq35wxiwS7ZQafcpJh07YYp9/tg0oaEy5CW9mx+Abcs 8JRtigxtWsHdiCf1qDigt3EkkPb5FV8es19VjqEWhzauAsvy/GyC2quc9jbVdo/9ucfY N1Vg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="PF/0Oclr"; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f26si21911852ljn.360.2021.05.11.15.08.10; Tue, 11 May 2021 15:08:40 -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; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="PF/0Oclr"; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230011AbhEKWII (ORCPT + 99 others); Tue, 11 May 2021 18:08:08 -0400 Received: from mail.kernel.org ([198.145.29.99]:37232 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229948AbhEKWIH (ORCPT ); Tue, 11 May 2021 18:08:07 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id AC9D0616EA; Tue, 11 May 2021 22:07:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1620770820; bh=VqXQJ3bvlOwIHMtxFA0B6zkp90401MM2U+HgMCcnldw=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=PF/0OclrsY78SxKAdd/IFRhyMLoT+9uHWOWCTYK0/ZRvTPoumVcfsbxVLtyAFFqYb MsI+q4ugqK8yHypA9r0TgVahyE6QulWg5Gm9wqDW2W4o+YR3D9qVU+JjirABnBIeyG obUG63V3qbIZIFJQqbC3j61c7+YeBYw1ivNsRMduUeze/RcBwE13VzNpH/xY5pPStx HXhHjeaoLDldisHwgggn/lqCvX5UYAnPo/D0QsDdy2zhyV5Ovnc+z0W/gFjp19GIyH NaE7Gjg3mX+7Dl27eP5dUyU2Pwptos+ppJ+SPhbBNA3Z1meUBs53rXvd2lq+dCk0wI uWwjxaqTUkE9g== Received: by mail-ot1-f53.google.com with SMTP id 69-20020a9d0a4b0000b02902ed42f141e1so8680965otg.2; Tue, 11 May 2021 15:07:00 -0700 (PDT) X-Gm-Message-State: AOAM532ehy/x6wwsYEJJBw4sCEJ92hqt3Bq6lT0pXTl/AeXk0n1bBRCj Z7cPBXYv4k0orER71cs13RefN26pxB9NkR3wut4= X-Received: by 2002:a05:6830:4da:: with SMTP id s26mr27807293otd.77.1620770819934; Tue, 11 May 2021 15:06:59 -0700 (PDT) MIME-Version: 1.0 References: <706be699-7f79-391c-bbac-a4b3820511d8@molgen.mpg.de> In-Reply-To: <706be699-7f79-391c-bbac-a4b3820511d8@molgen.mpg.de> From: Ard Biesheuvel Date: Wed, 12 May 2021 00:06:48 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: efivarfs fails with `No such device` when EFI runtime is missing To: Paul Menzel Cc: Matthew Garrett , Jeremy Kerr , linux-efi , LKML Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 11 May 2021 at 22:58, Paul Menzel wrote: > > [Use Ard=E2=80=99s current email, and add other maintainers] > > Am 11.05.21 um 22:55 schrieb Paul Menzel: > > Dear Linux folks, > > > > > > I migrated a 32-bit GNU/Linux installation from BIOS to EFI. Trying to > > edit the entries in UEFI=E2=80=99s Boot Manager with `efibootmgr`, I go= t the error: > > > > EFI variables are not supported on this system > > > > `sudo modprobe efivarfs` fails with > > > > No such device > > > > After several tries, I found > > > > [ 0.000000] efi: No EFI runtime due to 32/64-bit mismatch with > > kernel > > > > logged by Linux, and then I found the Stack Overflow thread *How could > > 32bit kernel read efivars from 64bit UEFI?* [1]. > > > > I would have thought, setting EFI variables is just directly writing to > > some storage. But probably not. > > > > Could the error message for the efivarfs load failure be improved, that > > *device* means the runtime service (if I am not mistaken)? > > Not sure what you are asking for here. The efivarfs module fails with -ENODEV if EFI runtime services are not supported by the kernel (for whatever reason), and it is actually modprobe in user space that prints glibc's default error string for ENODEV. What we could do is print something to the kernel log when this situation occurs, in addition to the current behavior of modprobe, which is difficult to change. Patches welcome.