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.133.124]) by mx.groups.io with SMTP id smtpd.web11.30670.1679909475887964796 for ; Mon, 27 Mar 2023 02:31:16 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=gQ+egOtv; spf=pass (domain: redhat.com, ip: 170.10.133.124, mailfrom: lersek@redhat.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1679909474; 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=6DnrW776xdVsKr+lKnekCW04l/AxzP3F1Why3A4fTkU=; b=gQ+egOtvjUCZXVC4aT2x+ns54+W5FbFoJI4bDJBGoSKhY5oYFrXJArgRMw0lPgR7I/CwsY fDlfo1JURKC50dIChyRPF9xebVopnAy9YDAoP8+MOmOjJmhYENd51FMhyMKDrGNvQidrJn HN5OYs5Fs5UnBJONIc7CII0f24VOMdI= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-178-Z_sN_Uq3P1yrspRrOSqYWA-1; Mon, 27 Mar 2023 05:31:11 -0400 X-MC-Unique: Z_sN_Uq3P1yrspRrOSqYWA-1 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id AB79F85A588; Mon, 27 Mar 2023 09:31:10 +0000 (UTC) Received: from [10.39.193.10] (unknown [10.39.193.10]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8E58D492C3E; Mon, 27 Mar 2023 09:31:09 +0000 (UTC) Message-ID: <36223265-e4a7-30ab-f958-de908f86748d@redhat.com> Date: Mon, 27 Mar 2023 11:31:07 +0200 MIME-Version: 1.0 Subject: Re: [PATCH v2 1/1] UefiCpuPkg/PiSmmCpuDxeSmm: fix format string To: Gerd Hoffmann , devel@edk2.groups.io Cc: Eric Dong , Rahul Kumar , Oliver Steffen , Pawel Polawski , Ray Ni References: <20230327080207.33524-1-kraxel@redhat.com> From: "Laszlo Ersek" In-Reply-To: <20230327080207.33524-1-kraxel@redhat.com> X-Scanned-By: MIMEDefang 3.1 on 10.11.54.9 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 3/27/23 10:02, Gerd Hoffmann wrote: > BufferPages is UINTN, so we need "%Lu" when printing it to avoid > it being truncated. Also cast to UINT64 to make sure it works > for 32bit builds too. > > Fixes: 4f441d024bee ("UefiCpuPkg/PiSmmCpuDxeSmm: fix error handling") > Reported-by: Laszlo Ersek > Signed-off-by: Gerd Hoffmann > --- > UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.c b/UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.c > index cf69161caa4b..c0e368ea9475 100644 > --- a/UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.c > +++ b/UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.c > @@ -880,7 +880,7 @@ PiCpuSmmEntry ( > BufferPages = EFI_SIZE_TO_PAGES (SIZE_32KB + TileSize * (mMaxNumberOfCpus - 1)); > Buffer = AllocateAlignedCodePages (BufferPages, SIZE_4KB); > if (Buffer == NULL) { > - DEBUG ((DEBUG_ERROR, "Failed to allocate %d pages.\n", BufferPages)); > + DEBUG ((DEBUG_ERROR, "Failed to allocate %Lu pages.\n", (UINT64)BufferPages)); > CpuDeadLoop (); > return EFI_OUT_OF_RESOURCES; > } Reviewed-by: Laszlo Ersek