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 925A194115D for ; Fri, 1 Mar 2024 07:44:11 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=W8QqFR1BOOfnxRJv73sjMWXNqZvs5pAapwdHBCbnbZc=; 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=1709279050; v=1; b=SCHPZnr+9Kb52SDcy9sB2uCodjAlE4HBWqE23OcuNu42c04ww7YasgVtI37h+0ip+BH3N8zO nagaB69QPDhVbE87QORXjDR8qQA9tSJHKagRpuZFJhAqdbHA1ceqv+lmIcNtAtXvukzmRxVtphZ 7QaS0/2LElnrF7Z63y1VbPhA= X-Received: by 127.0.0.2 with SMTP id ySklYY7687511x3QeA0Kslfa; Thu, 29 Feb 2024 23:44:10 -0800 X-Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.groups.io with SMTP id smtpd.web10.17678.1709279049687774010 for ; Thu, 29 Feb 2024 23:44:09 -0800 X-Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-496-o6PIsFYpNY6gFw4tgPsZ7A-1; Fri, 01 Mar 2024 02:44:05 -0500 X-MC-Unique: o6PIsFYpNY6gFw4tgPsZ7A-1 X-Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (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 86B4C868904; Fri, 1 Mar 2024 07:44:04 +0000 (UTC) X-Received: from sirius.home.kraxel.org (unknown [10.39.192.121]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 046202026D0A; Fri, 1 Mar 2024 07:44:04 +0000 (UTC) X-Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id A8CA21800DFF; Fri, 1 Mar 2024 08:44:02 +0100 (CET) From: "Gerd Hoffmann" To: devel@edk2.groups.io Cc: Jiewen Yao , Oliver Steffen , Laszlo Ersek , Michael Roth , Erdem Aktas , Gerd Hoffmann , Min Xu , Ard Biesheuvel , Tom Lendacky Subject: [edk2-devel] [PATCH v2 00/10] OvmfPkg/ResetVector: cleanup and add 5-level paging support. Date: Fri, 1 Mar 2024 08:43:52 +0100 Message-ID: <20240301074402.98625-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.4 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: A4sRHWT9MoLM1a1bRt4nn4p0x7686176AA= 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=SCHPZnr+; 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 So I ran with the suggestion by Laszlo to move the page table setup into macros and untangle the non-CoCo / TDX / SEV code paths. The first five patches of the series are doing that (without functional changes). Support for 5-level paging is added by the following five patches. This way it is indeed easier to understand. Additional bonus is that the patches can be splitted into smaller pieces and 5-level paging for the three cases (non-CoCo / TDX / SEC) can be enabled independently. The SEV patches (#9 + #10) are included here for completeness, but it is probably a good idea to merge them only after 5-level paging support was added to BaseMemEncryptSevLib. This way we can turn on 5-level paging support without breaking SEV. v2 changes: - remove SetCr3La57 label, use Enable5LevelPaging macro instead. - turn GetSevCBitMaskAbove31 into a macro. - comment fixes. Gerd Hoffmann (10): OvmfPkg/ResetVector: improve page table flag names OvmfPkg/ResetVector: add ClearOvmfPageTables macro OvmfPkg/ResetVector: add CreatePageTables4Level macro OvmfPkg/ResetVector: split TDX BSP workflow OvmfPkg/ResetVector: split SEV and non-CoCo workflows OvmfPkg/ResetVector: add 5-level paging support OvmfPkg/ResetVector: print post codes for 4/5 level paging OvmfPkg/ResetVector: wire up 5-level paging for TDX OvmfPkg/ResetVector: leave SEV VC handler installed longer OvmfPkg/ResetVector: wire up 5-level paging for SEV OvmfPkg/ResetVector/ResetVector.inf | 1 + OvmfPkg/ResetVector/Ia32/AmdSev.asm | 40 ++- OvmfPkg/ResetVector/Ia32/IntelTdx.asm | 17 +- OvmfPkg/ResetVector/Ia32/PageTables64.asm | 299 +++++++++++++++++----- OvmfPkg/ResetVector/Main.asm | 4 + OvmfPkg/ResetVector/ResetVector.nasmb | 5 +- 6 files changed, 272 insertions(+), 94 deletions(-) -- 2.44.0 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#116215): https://edk2.groups.io/g/devel/message/116215 Mute This Topic: https://groups.io/mt/104660109/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=-