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 7BF7D740051 for ; Tue, 27 Feb 2024 11:08:07 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=ZzZgCoTzuvBOsTKfUe5NqHE0wUQ7LYJGVgiuQ/2cS3E=; c=relaxed/simple; d=groups.io; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version:In-Reply-To:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Type:Content-Disposition; s=20140610; t=1709032086; v=1; b=wvhNEsEG13oEVfsQlcQKLUOivYeJAnN7shCaVD1Z89QF3tRLM6XJt483dN1WkXYhV4qvWmUK ljl0OiHC6alAZGIlGv2oqBQVbjcVPZJTjaenz6USwnWmAY+jHp8aJ+YmSgj/nlTzFUqRCY3Xjl8 Qti1JieSCmoUJClaAlDI4n0M= X-Received: by 127.0.0.2 with SMTP id r1xxYY7687511xkKesKqlsMR; Tue, 27 Feb 2024 03:08:06 -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.web11.9710.1709032085306337891 for ; Tue, 27 Feb 2024 03:08:05 -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-474-DqwST2OyNBi_mPJIHu1laQ-1; Tue, 27 Feb 2024 06:08:00 -0500 X-MC-Unique: DqwST2OyNBi_mPJIHu1laQ-1 X-Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (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 498D985A58A; Tue, 27 Feb 2024 11:07:59 +0000 (UTC) X-Received: from sirius.home.kraxel.org (unknown [10.39.192.249]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 91CB1111D640; Tue, 27 Feb 2024 11:07:58 +0000 (UTC) X-Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 636DC18009BA; Tue, 27 Feb 2024 12:07:57 +0100 (CET) Date: Tue, 27 Feb 2024 12:07:57 +0100 From: "Gerd Hoffmann" To: Tom Lendacky Cc: devel@edk2.groups.io, Ard Biesheuvel , Erdem Aktas , Jiewen Yao , Laszlo Ersek , Liming Gao , Michael D Kinney , Min Xu , Zhiguang Liu , Rahul Kumar , Ray Ni , Michael Roth Subject: Re: [edk2-devel] [PATCH v2 08/23] OvmfPkg/BaseMemEncryptSevLib: Re-organize page state change support Message-ID: <4g4v523e6hogit2ssmyp75ivq7slauddodmp2ahxauauskozp5@4jeg7j3iuagb> References: MIME-Version: 1.0 In-Reply-To: X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.3 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: KBfz89oI28VJyAY63ZpZB9Yfx7686176AA= Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=wvhNEsEG; 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 > --- a/OvmfPkg/Library/BaseMemEncryptSevLib/X64/PeiDxeVirtualMemory.c > +++ b/OvmfPkg/Library/BaseMemEncryptSevLib/X64/PeiDxeVirtualMemory.c > @@ -23,6 +23,8 @@ STATIC BOOLEAN mAddressEncMaskChecked = FALSE; > STATIC UINT64 mAddressEncMask; > STATIC PAGE_TABLE_POOL *mPageTablePool = NULL; > > +STATIC VOID *mPscBuffer = NULL; > + > typedef enum { > SetCBit, > ClearCBit Oh. Global variable in PEI code (both pre-existing and newly added). This is problematic because in OVMF PEI is executed in-place and the firmware volumes is measured by TPM PEIM. Global variables modify the PEI firmware volume and break the measurement. A while back OVMF added EFI_HOB_PLATFORM_INFO (see OvmfPkg/Include/Library/PlatformInitLib.h) to fix that. Most fields in that struct used to be global variables. > --- a/OvmfPkg/Library/BaseMemEncryptSevLib/X64/PeiSnpSystemRamValidate.c > +++ b/OvmfPkg/Library/BaseMemEncryptSevLib/X64/PeiSnpSystemRamValidate.c > @@ -17,6 +17,8 @@ > #include "SnpPageStateChange.h" > #include "VirtualMemory.h" > > +STATIC UINT8 mPscBufferPage[EFI_PAGE_SIZE]; > + Same problem. Given this is a pre-exising problem, affects SEV only and the rest of the patch looks fine: Acked-by: Gerd Hoffmann But it should be cleaned up at some point. BaseMemEncryptSevLib needs an update anyway (use CpuPageTableLib, support 5-level paging). take care, Gerd -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#116026): https://edk2.groups.io/g/devel/message/116026 Mute This Topic: https://groups.io/mt/104512949/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=-