From mboxrd@z Thu Jan 1 00:00:00 1970 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.web11.74531.1669986632701566533 for ; Fri, 02 Dec 2022 05:10:32 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Xk1h+bEF; spf=pass (domain: redhat.com, ip: 170.10.129.124, mailfrom: kraxel@redhat.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1669986631; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=L5BgCQssD9SYQMpmHbgxwCNlkAIRWqiI/N6L95roY+o=; b=Xk1h+bEFptMs7HXCWvfj7oxbtTbDpu7I8AH+ZXD+QoVZxKVQhgTp4mNHtcXPg7sek1uF7x ZjT/6qVorZvLVzlKpJl+XW89KQWYM8InEO05CNtnSEbuLpez2IsugjplDYo5Kmf+2oLEjQ yp+CbFblmePeyNZTCG4cluyO70K7JZg= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-3-NIJEJcXbNEunhn38t5mHRQ-1; Fri, 02 Dec 2022 08:10:28 -0500 X-MC-Unique: NIJEJcXbNEunhn38t5mHRQ-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 0AE8238012CC; Fri, 2 Dec 2022 13:10:28 +0000 (UTC) Received: from sirius.home.kraxel.org (unknown [10.39.192.79]) by smtp.corp.redhat.com (Postfix) with ESMTPS id CC0F31410DDA; Fri, 2 Dec 2022 13:10:27 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id E965B1801548; Fri, 2 Dec 2022 14:10:09 +0100 (CET) From: "Gerd Hoffmann" To: devel@edk2.groups.io Cc: Bob Feng , Yuwei Chen , Erdem Aktas , Jordan Justen , Peter Grehan , Rebecca Cran , Liming Gao , Ard Biesheuvel , Gerd Hoffmann , Jiewen Yao , Min Xu , Brijesh Singh , Oliver Steffen , Pawel Polawski , Tom Lendacky , James Bottomley Subject: [PATCH 08/14] OvmfPkg/PlatformPei: NoExec: stop using mPlatformInfoHob Date: Fri, 2 Dec 2022 14:10:03 +0100 Message-Id: <20221202131009.3190040-9-kraxel@redhat.com> In-Reply-To: <20221202131009.3190040-1-kraxel@redhat.com> References: <20221202131009.3190040-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.7 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII"; x-default=true Stop using the mPlatformInfoHob global variable in NoexecDxeInitialization() function. Pass a pointer to the PlatformInfoHob instead. Signed-off-by: Gerd Hoffmann --- OvmfPkg/PlatformPei/Platform.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/OvmfPkg/PlatformPei/Platform.c b/OvmfPkg/PlatformPei/Platform.c index 85b47e7ed8df..7f3a26092626 100644 --- a/OvmfPkg/PlatformPei/Platform.c +++ b/OvmfPkg/PlatformPei/Platform.c @@ -75,16 +75,17 @@ MemMapInitialization ( ASSERT_RETURN_ERROR (PcdStatus); } +STATIC VOID NoexecDxeInitialization ( - VOID + IN OUT EFI_HOB_PLATFORM_INFO *PlatformInfoHob ) { RETURN_STATUS Status; - Status = PlatformNoexecDxeInitialization (&mPlatformInfoHob); + Status = PlatformNoexecDxeInitialization (PlatformInfoHob); if (!RETURN_ERROR (Status)) { - Status = PcdSetBoolS (PcdSetNxForStack, mPlatformInfoHob.PcdSetNxForStack); + Status = PcdSetBoolS (PcdSetNxForStack, PlatformInfoHob->PcdSetNxForStack); ASSERT_RETURN_ERROR (Status); } } @@ -375,7 +376,7 @@ InitializePlatform ( PeiFvInitialization (&mPlatformInfoHob); MemTypeInfoInitialization (&mPlatformInfoHob); MemMapInitialization (&mPlatformInfoHob); - NoexecDxeInitialization (); + NoexecDxeInitialization (&mPlatformInfoHob); } InstallClearCacheCallback (); -- 2.38.1