Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp2272517lqp; Sun, 24 Mar 2024 10:43:45 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWPnyafCurumVbNhNqzsJWr8lEKxNhcGUqGdsCw+D6fz15tB6+6L9K1eCKEF67KyTfw+NAarBaY9g+H2O9SCZqDCHwkpP0TKJBkYn60qg== X-Google-Smtp-Source: AGHT+IEBLQTzlLFtKJQQsj1GrnCoweB1kgqEPoFWlLnfvm/iaR091SIdCTxhF/JvRndi8o8qj6Je X-Received: by 2002:a05:6a00:14cb:b0:6e7:2e76:5358 with SMTP id w11-20020a056a0014cb00b006e72e765358mr5372649pfu.29.1711302225021; Sun, 24 Mar 2024 10:43:45 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711302225; cv=pass; d=google.com; s=arc-20160816; b=wvD7YSbSL47zj7N8otGCA/jz/EwBcWDs+GjgJTisvfsutS6pjAAc2DnjxTl726rbIW fFj8yOpcoZQnSPMbDvyjGd4KDy1W+fU3aARUIGJMLG2vXapdyMzWRngAEGBxsKE94F5G x4hKB/zxpVbfbfQbXWAyXqmuiTrTiwBYlivso8IA5v5+Zb7FkIT612mQ6bKrqdGfheoX Q7tkR3wr1nOeeSGhsOmcejN0eRSsFbZugehDxj2ABgehnOj7BaetH2H6JvuuuQ9LlCCo CTwMRUz+P5X/xfU+OA4gHDadLrOT+M7N3x9Z99gZxtL5CDR0PlMu5MufbMCKjiKu0aN/ nbrA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :dkim-signature; bh=3RrIVUUOWzZHaUEa3eA3h9XEt61zWI4GU6ZvIyLwh5Y=; fh=qiyH8pepC9j1U1wb0WD8HV89rrG5mAJfHGme9tTMZg8=; b=s9Q3JcLk1KkZ+cqMbEfHAZpohv9YU7oWI1cIPuVyAWeCTA2s0Dx2Z7YfNTTv8qbGlE CY/vxhX9Q+xCbzyGu/AZF10jVMIgc+zh97vDcW6fqWQVX6AiBAKvRWSXOXmZGpZQlwUL eO/ca0WO0dmWZxTateII7oo2gmFyBhFY7rjrVsFRXIcSmbvQHY5wJQIY8eMvKzY/Gdop XppHa5Y0QGI1NIXGqY/iDHRJE6NNmEbyrJUm9wDbAZgbVfmVUJmd5xk2GPB3T0lOiPi2 u3xyaZ2UjL4lpzjBQJwfPcN9SmlOIZLme7PoU+zFWZNFmqDPUTn/JYPgLCyeh6LxN41o D9/g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=GngHH2Em; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-112790-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-112790-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id p6-20020aa79e86000000b006e7213b671csi3655012pfq.262.2024.03.24.10.43.44 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 Mar 2024 10:43:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-112790-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=GngHH2Em; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-112790-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-112790-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 996D4281578 for ; Sun, 24 Mar 2024 17:43:44 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6D0431A28C; Sun, 24 Mar 2024 17:43:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="GngHH2Em" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 92D7317555; Sun, 24 Mar 2024 17:43:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711302217; cv=none; b=ODRqAXLa9YNZ3C9AKx8szvYNAsCBce13mC7ABwY5vljTN9ANMgBUEI+KbOP571lV5BL/yF0ifByKtUfBkPXSHjr4+h2KGkB4zndNlMzEKLlWB06l1JRJKnhdk4qQGoENvjpphLMlQbrqBPsFmTVP8a6ukhjdlsexw6pN76uhg8o= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711302217; c=relaxed/simple; bh=iV5eaQhCMjboTPn8RIB6+34ItDagxR0EDqsSNn6cFkI=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=j8zmVUb8Io1mU3shCDwKwP3+pRcbP89b3FhRcAsx4IEJREiYMHPtsViaMECtcdQfZ649+Hxu/kJ9AFTAwG3uPnQXh75bNAihJThyOkGnKJ8ANQuUiGBQ0xqRziKEbUHyHwpvXZHolYUqah8jR4KqH9xnfnuJdhJf3BXOFt19mOA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=GngHH2Em; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3BA13C433F1; Sun, 24 Mar 2024 17:43:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711302217; bh=iV5eaQhCMjboTPn8RIB6+34ItDagxR0EDqsSNn6cFkI=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=GngHH2Emt0UgAODe8rNAAbokRjd/3dZz7d9ws6sN5rYoXRd+5kjoAE5LR7fcihClr 6n/ddHPnr+a2z3iOenF528yUnqOsuLQvmmX/Vt92ZwYNbPVlbHRyjfxIexeMM/xEYL h8bfdJM9eHnP29h77+iEgrVuKVB8S+Dges8W2LkKJmVAoGjQD/cJGQAfwuKVUQPz/q Pu/aHQ55eLaw6zFrZlkca1N0URitlog0p/zxiVM7a3LbDJtgxrOfTr/3Q5JbZEoeta plEAJdzjILd3eT1fOhfi0eV+glR0i3WGGwF6xzH8fEfzim5iiVLAJbK/0VGlSqfvAC NEGYrLaIl5ZkA== Received: by mail-lj1-f179.google.com with SMTP id 38308e7fff4ca-2d228a132acso51171391fa.0; Sun, 24 Mar 2024 10:43:37 -0700 (PDT) X-Forwarded-Encrypted: i=1; AJvYcCUhYCYpxkOi3siIdsvQs7uBRoK+i0tmg2pi7VQgLQWrBR/w/K/hLAA5hrnn9SGsfnc1Y8ygGKmfg/RUFXmh0Kcbsftw3O2YqnDToqXDH+QCT0g3J2hT4+M+7pD004NzO1BTogjp1g++ X-Gm-Message-State: AOJu0Ywndv+2ZzkdqQdd0qszRPpBocd225J4mBy7PU2+YDEkQYJI1qxD UgIqciIsI59vWcxJ2Vpxc6hv09FKyPhX9tQNZLJ1YTFl37rdtyhwO8E1S2EU0XlsJsCRJAhP2Q4 lKL5+9TOKk+8wsFMsKJYsZoex3hY= X-Received: by 2002:a2e:8eda:0:b0:2d2:df0d:9e92 with SMTP id e26-20020a2e8eda000000b002d2df0d9e92mr3139059ljl.49.1711302215418; Sun, 24 Mar 2024 10:43:35 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240321150510.GI8211@craftyguy.net> In-Reply-To: From: Ard Biesheuvel Date: Sun, 24 Mar 2024 19:43:24 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: x86_64 32-bit EFI mixed mode boot broken To: Hans de Goede Cc: Clayton Craft , x86@kernel.org, linux-kernel@vger.kernel.org, linux-efi@vger.kernel.org, Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , regressions@lists.linux.dev Content-Type: text/plain; charset="UTF-8" On Sun, 24 Mar 2024 at 16:49, Hans de Goede wrote: > > Hi, > > On 3/21/24 11:48 PM, Ard Biesheuvel wrote: > > (cc Hans) > > > > On Thu, 21 Mar 2024 at 23:05, Clayton Craft wrote: > >> > >> I've been chasing a problem with 32-bit EFI mixed mode booting on two different > >> (x86_64) Intel Bay Trail platforms, where the system reboots or hangs seemingly > >> very early somewhere before or after loading the kernel. I've not been able to > >> get any output from the kernel or stub over efifb when the issue happens[0], and > >> do not have serial console access on these systems. > >> > >> v6.8 fails for me, and presumably so does everything back to v6.2. v6.1 is able > >> to boot OK on these platforms with mixed mode, and it looks like there are a lot > >> of changes from 6.1..6.2 for EFI/mixed mode booting. > > > > v6.1 just received some EFI related backports, so please check the > > latest v6.1.y as well. > > > >> I did managed to bisect the > >> issue to: > >> > >> commit e2ab9eab324cdf240de89741e4a1aa79919f0196 > >> Author: Ard Biesheuvel > >> Date: Tue Nov 22 17:10:02 2022 +0100 > >> > >> x86/boot/compressed: Move 32-bit entrypoint code into .text section > >> > >> However I'm not sure how to proceed from here, or if my bisect is all that > >> useful since the commit seems to be in the middle of a bunch of changes I do not > >> understand. I've been using systemd-boot to test this (both the full bootloader > >> and UKI w/ the sd-boot stub). Is 32-bit mixed mode on x86_64 working for others? > >> > > > > I usually test on 32-bit OVMF built with LOAD_X64_ON_IA32_ENABLE, > > which allows the use of the compat entry point. This is different from > > the EFI handover protocol, and I am not sure which one you are using. > > > > I have never had any reports, or noticed any issues myself. Last time > > I tried (some weeks ago) it was working for me. > > CC'ing Hans who may have more data points. > > I've been offline for most of the week and I see that in the mean time > you seem to have found a fix, great. > > FWIW I have been booting everything up to 6.8.0 on my own mixed-mode > Bay Trail tablets without issues, so the problem seems to be specific to > certain BIOS-es. > > Please Cc me on the final fix, then I can test that early and double check > that things don't regress on other mixed-mode Bay Trail devices. > Thanks. I pushed another branch https://git.kernel.org/pub/scm/linux/kernel/git/ardb/linux.git/log/?h=efi-clayton-3 which has a proper fix for the issue that you found. As it turns out, the compat mixed mode (with handover protocol) was broken from the beginning, and the change you identified just happened to trigger it on your hardware.