From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by spool.mail.gandi.net (Postfix) with ESMTPS id 831467803CD for ; Tue, 20 Feb 2024 09:06:49 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=YBrvcIpFHUPS+DoVAKiOHfeSwtXg5kDKGdGGPSdskEI=; c=relaxed/simple; d=groups.io; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Type:Content-Transfer-Encoding; s=20140610; t=1708420008; v=1; b=lmnN6WMzYOeWHA9he7r/hSfAxOlbmc4gVQXdw+bN7KOAMA3MgS+zqc3WTvq2T96PZm0kbWBU 9ffvwYNxDxuc+hLUU77wRG/aK2gUklW4GR5zLq2tUpqi98a5UEARkUOntv5fkT6594zTKANIdvs 4cYZePWIsTE8IA5K9FqUPW+4= X-Received: by 127.0.0.2 with SMTP id IpMCYY7687511x0agQnjcb1x; Tue, 20 Feb 2024 01:06:48 -0800 X-Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.groups.io with SMTP id smtpd.web10.9426.1708420007425843711 for ; Tue, 20 Feb 2024 01:06:47 -0800 X-Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-325-D5yubqe1Ob-kWZJ01TgJiQ-1; Tue, 20 Feb 2024 04:06:42 -0500 X-MC-Unique: D5yubqe1Ob-kWZJ01TgJiQ-1 X-Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id B91C03869146; Tue, 20 Feb 2024 09:06:41 +0000 (UTC) X-Received: from sirius.home.kraxel.org (unknown [10.39.193.175]) by smtp.corp.redhat.com (Postfix) with ESMTPS id F161E8077; Tue, 20 Feb 2024 09:06:40 +0000 (UTC) X-Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id F26B91800DCF; Tue, 20 Feb 2024 10:06:39 +0100 (CET) From: "Gerd Hoffmann" To: devel@edk2.groups.io Cc: Liming Gao , Michael Roth , Oliver Steffen , Erdem Aktas , Tom Lendacky , Laszlo Ersek , Min Xu , Ard Biesheuvel , Jiewen Yao , Gerd Hoffmann Subject: [edk2-devel] [PATCH v3 0/6] OvmfPkg: Add support for 5-level paging Date: Tue, 20 Feb 2024 10:06:33 +0100 Message-ID: <20240220090639.472222-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.5 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,kraxel@redhat.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: 44nxD2m0vuFb1YmAhxebhg73x7686176AA= Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=lmnN6WMz; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=redhat.com (policy=none); spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io Patch #1 + #2 fix MdeModulePkg/DxeIplPeim to not assert in case a 5-level enabled build runs in 4-level paging mode. Patch #2 - #4 update OvmfPkg ResetVector, adding support for 5-level paging (setup 5-level page tables in case both la57 and gigabyte pages are supported by the vCPU). Patch #5 updates PlatformInitLib for 5-level paging support (update PhysBits calculation). Known issues / limitations: - BaseMemEncryptSevLib must be updated to also support 5-level paging for full 5-level paging support in SEV mode. The patch series does *not* enable 5-level paging by default. Building with 5-level paging support can be done by compiling OVMF with '--pcd PcdUse5LevelPageTable=TRUE'. v3: - add resetvector fixes for sev and tdx v2 changes: - fix sev/tdx handling with 5-level paging. - more comments for 5-level page table setup. - improve PAGE_* naming (new patch #3). - rename Page5LevelSupported to Page5LevelEnabled (new patch #2). - pick up some review tags. Gerd Hoffmann (6): MdeModulePkg/DxeIplPeim: fix PcdUse5LevelPageTable assert MdeModulePkg/DxeIplPeim: rename variable OvmfPkg/ResetVector: improve page table flag names OvmfPkg/ResetVector: SEV: keep #vc handler installed longer OvmfPkg/ResetVector: add 5-level paging support OvmfPkg/PlatformInitLib: add 5-level paging support OvmfPkg/ResetVector/ResetVector.inf | 1 + .../Core/DxeIplPeim/X64/VirtualMemory.c | 24 +-- OvmfPkg/Library/PlatformInitLib/MemDetect.c | 57 ++++-- OvmfPkg/ResetVector/Ia32/AmdSev.asm | 7 +- OvmfPkg/ResetVector/Ia32/IntelTdx.asm | 17 +- OvmfPkg/ResetVector/Ia32/PageTables64.asm | 170 +++++++++++++++--- OvmfPkg/ResetVector/ResetVector.nasmb | 1 + 7 files changed, 224 insertions(+), 53 deletions(-) -- 2.43.2 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#115643): https://edk2.groups.io/g/devel/message/115643 Mute This Topic: https://groups.io/mt/104464306/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=-