Received: by 2002:ab2:3141:0:b0:1ed:23cc:44d1 with SMTP id i1csp1467321lqg; Sun, 3 Mar 2024 11:27:40 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWv/fR36gPHZsCufL0Mb/8Lhu+aAz0BOb0kxGLr5/ydC0DsjIzq2aZp/QkbfMcjQZxMJoBEH4LT50ORZNXk4UKhwSEig2Ktwko6FPtHGw== X-Google-Smtp-Source: AGHT+IHv3tMPBPJx/uH/4J6VzlWhFG2zv/dkSMt8zi+332xQ4yC4vcxyk2z3mXjn8c0enLofFN6M X-Received: by 2002:a0c:de01:0:b0:68c:7ca9:8e52 with SMTP id t1-20020a0cde01000000b0068c7ca98e52mr8184569qvk.56.1709494059734; Sun, 03 Mar 2024 11:27:39 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709494059; cv=pass; d=google.com; s=arc-20160816; b=wbpejDvol7lhgyRgsbZu0SoBrlTt6tAi9Fe8W9/8u3VsO2XxUY3SnzVWuI45rQjUHo 2/qkfDDuRUXpSOW968SK0rVqPOf+xJp1qVzWkl7aOpRLrd5NQZcdK+anLsxYq5LNmN45 TKh3lpnbbkZX+NIFRf1/OzFDVgJlXVpnzynf0wvGQ5N7izey5ozXYAjCoPXFm5uVMKsA 0uo2br4qq5T/yqJmmieA8Yze2EdGnt2Qw1wZXA/KByd7Uez2XGgC74wu1HISjhR4iUP+ invMYV+Hv4/iWDnwTkMjTQnZKQ/NcgGLTyEdEevgXemJxxzjBTf0LK5T0jrQcvL4UILH TDjw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=8Ho+q4kIRBEDDcBYfwDDw2iENT8f/OLBpqH2DKALBHA=; fh=cDHoXATbYNu4l85KZVSK4PkyqnGOGDn/kBaoOEMG9tU=; b=Li0n9gvEYi5EfjVNXdbgfaE4xoaVnQT0kUAvokxB5v25MXt1h/RbjpeZEzxBRXc3NR iVqho6ZwDaR+GvUTB1pwUxww60G4vq8ROH4c7hz/4oUsItyN7Y5DhREMXuSBDH25O4VB E4Vl4cbyM0UNLsQ6wqNtdGgKDxRZGZAfN07UVBo5jm0I3Oy0breOYCAKJm5JWLfesVwp xUNtXx6jhhJFnZ7z2MljpQoXFZNNt69LqVBklFqXBmrm9TuVLLfs0jy4CaWSpeKUlm/q GNehBLK5tppXUd8yxtSasvM8PsJk6g3VQyG2zFdM4WeJ1cUfmzEfiDSgVHapW6Q94dPh Ne1g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@alien8.de header.s=alien8 header.b=IrvUukiR; arc=pass (i=1 spf=pass spfdomain=alien8.de dkim=pass dkdomain=alien8.de dmarc=pass fromdomain=alien8.de); spf=pass (google.com: domain of linux-kernel+bounces-89880-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-89880-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id jo28-20020a056214501c00b0069036088d64si8080826qvb.146.2024.03.03.11.27.39 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 03 Mar 2024 11:27:39 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-89880-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@alien8.de header.s=alien8 header.b=IrvUukiR; arc=pass (i=1 spf=pass spfdomain=alien8.de dkim=pass dkdomain=alien8.de dmarc=pass fromdomain=alien8.de); spf=pass (google.com: domain of linux-kernel+bounces-89880-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-89880-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de 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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 690271C210B2 for ; Sun, 3 Mar 2024 19:27:39 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id BCE7979DA5; Sun, 3 Mar 2024 19:27:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (4096-bit key) header.d=alien8.de header.i=@alien8.de header.b="IrvUukiR" Received: from mail.alien8.de (mail.alien8.de [65.109.113.108]) (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 C55FC43AB3 for ; Sun, 3 Mar 2024 19:27:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=65.109.113.108 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709494055; cv=none; b=oh3XjXkTc/MRORmFBYfPJb2K40+YdD2fk6liS/HVx5BY2oyWuLALd6gXrl7PvfyY6lkRHqvZIgrjOXY43qDqNBlYCKy/eYo2N2UMQmzE5yNpGuFYr6ysJHekK7vLwo/Y7YnLv/zDhaNE8FFFzemGEzh1Gd6X5OX0K7ZaPFCKmlw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709494055; c=relaxed/simple; bh=XwxzVyKmED83ZL+4yFCYapZmwY2na4dJIvwKR0llUv0=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=QvoK6dNgA37ltHLsWoar3M8ONgPuCI1q+bw5+fLFhACc4wKUCUDz1aMrKGOD5r1sy6mdsloByd9J8kCyyl6rWqYVqv1af0m/DT884y+br0p2r/hzOUwR32cH4v968trCKGOHVslPEEY1a45Y1ovmYZqLnBLSYgQWUbmm1cQIAlg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=alien8.de; spf=pass smtp.mailfrom=alien8.de; dkim=pass (4096-bit key) header.d=alien8.de header.i=@alien8.de header.b=IrvUukiR; arc=none smtp.client-ip=65.109.113.108 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=alien8.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=alien8.de Received: from localhost (localhost.localdomain [127.0.0.1]) by mail.alien8.de (SuperMail on ZX Spectrum 128k) with ESMTP id 2B10A40E019B; Sun, 3 Mar 2024 19:27:22 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at mail.alien8.de Authentication-Results: mail.alien8.de (amavisd-new); dkim=pass (4096-bit key) header.d=alien8.de Received: from mail.alien8.de ([127.0.0.1]) by localhost (mail.alien8.de [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id vE_d3cBpokka; Sun, 3 Mar 2024 19:27:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=alien8; t=1709494039; bh=8Ho+q4kIRBEDDcBYfwDDw2iENT8f/OLBpqH2DKALBHA=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=IrvUukiRaRTZ6TBIx4lec5bVxzGI3gmZNsndJIsEfgQOYHB9hOqmdxuId6bdgv+fW KnzJSqCDSezTcxRghIR/GAvRRuzqel5JlpQWqcIni41rynv0nkcr3gq9bMnLySwo0+ 6ZcJJujQL78rGA7+CNoD17LqmcQJGOuyhAwXpMFQXJsaC1pzqgVEg0NhgGXqsr6hLa 83yFF5W/BKYSGJ+LlecgvyIyS3V3/bJKqdKar4GYBUxl3kh679sBgX8rZTyh9dsrqf VBCmvhmHxLTtuzMT3Nwjxo9LPPOkVJG+0b4mwxdjEYxM3MKmdgq25EbiVt0v9BJQCt k0py0SMVydjbydsWF92w5KFuKZArPoyTYs/oswwzBEatrme7S8NYpZ2EjMJUPCzqE6 3urAvN1WgB5X2SMRCKo34/3KunDwKq7HKN77x/LlSy/DEZELrqEJKfeI/NPOy4f+cm MUZW66MgiUf/fmHQOtRV0qOtCH4h+Q9XOetbC4msJ5moel6X7ndcdPbb2x8+HYPi3s u6Ws9FL5R4FL+kRXexLQl2ML+IAW8Z2TU4vM2uPJlO8zdvyKh1FPquobVmsEnLxRwy ysNwND2qt6IVW74fCpyrTXM0ABtWDcImLtWfaHI45O7VFKvMu+ea8My8Kn3xXETQmW 2zzq9rMNLkvKRsA6sQB4zBOY= Received: from zn.tnic (pd953021b.dip0.t-ipconnect.de [217.83.2.27]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature ECDSA (P-256) server-digest SHA256) (No client certificate requested) by mail.alien8.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id D4A2440E016C; Sun, 3 Mar 2024 19:27:07 +0000 (UTC) Date: Sun, 3 Mar 2024 20:26:54 +0100 From: Borislav Petkov To: Ard Biesheuvel Cc: Ard Biesheuvel , linux-kernel@vger.kernel.org, Kevin Loughlin , Tom Lendacky , Dionna Glaze , Thomas Gleixner , Ingo Molnar , Dave Hansen , Andy Lutomirski , Brian Gerst Subject: Re: [PATCH v7 2/9] x86/startup_64: Defer assignment of 5-level paging global variables Message-ID: <20240303192654.GAZeTO_nxJ4bE2A2zD@fat_crate.local> References: <20240227151907.387873-11-ardb+git@google.com> <20240227151907.387873-13-ardb+git@google.com> <20240228205540.GIZd-dzFYIBbtfIAo3@fat_crate.local> <20240301160921.GBZeH9sZhp73xX40ze@fat_crate.local> <20240301173323.GDZeIRY_BVBqpudkEo@fat_crate.local> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20240301173323.GDZeIRY_BVBqpudkEo@fat_crate.local> On Fri, Mar 01, 2024 at 06:33:23PM +0100, Borislav Petkov wrote: > > I've built a debug OVMF image using the latest version of the series, > > and put it at [0] > > > > Run like this > > > > qemu-system-x86_64 -M q35 \ > > -cpu qemu64,+la57 -smp 4 \ > > -bios OVMF-5level.fd \ > > -kernel arch/x86/boot/bzImage \ > > -append console=ttyS0\ earlyprintk=ttyS0 \ > > -vga none -nographic -m 1g \ > > -initrd > > > > and you will get loads of DEBUG output from the firmware first, and > > then boot into Linux. (initrd can be omitted) > > > > Right before entering, it will print > > > > CpuDxe: 5-Level Paging = 1 > > > > which confirms that the firmware is running with 5 levels of paging. > > > > I've confirmed that this boots happily with this series applied, > > including when using 'no5lvl' on the command line, or when disabling > > CONFIG_X86_5LEVEL [confirmed by inspecting > > /sys/kernel/debug/page_tables/kernel]. > > > > > > [0] http://files.workofard.com/OVMF-5level.fd.gz > > Nice, that might come in handy for other testing too. Btw, on a semi-related note, do you have an idea whether a normal guest kernel using OVMF istead of seabios would be even able to boot a kernel supplied with -kernel like above but without an -initrd? I have everything builtin and the same kernel boots fine in a guest with a [ 0.000000] SMBIOS 3.0.0 present. [ 0.000000] DMI: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.16.3-debian-1.16.3-2 04/01/2014 but if I try to boot the respective guest installed with the OVMF BIOS from the debian package: [ 0.000000] efi: EFI v2.7 by Debian distribution of EDK II [ 0.000000] efi: SMBIOS=0x7f788000 SMBIOS 3.0=0x7f786000 ACPI=0x7f97e000 ACPI 2.0=0x7f97e014 MEMATTR=0x7ddfe018 it fails looking up the /dev/root device major/minor deep in the bowels of the vfs: [ 2.565651] do_new_mount: [ 2.566380] vfs_get_tree: fc->root: 0000000000000000 [ 2.567298] kern_path: filename: ffff88800d666000 of name: /dev/root [ 2.568418] kern_path: ret: 0 [ 2.569009] lookup_bdev: kern_path(/dev/root, , path: ffff88800e537380), error: 0 [ 2.571645] lookup_bdev: inode->i_rdev: 0x0 [ 2.572417] get_tree_bdev: lookup_bdev(/dev/root, dev: 0x0), error: 0 ^^^^^^^^^ That dev_t should be 0x800002 - the major and minor of /dev/sda2 but it looks like something else is missing in this case... Thx. -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette