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 D6ED3740047 for ; Tue, 31 Oct 2023 15:40:21 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=AwpEEcfwfvcNvK4lzsmjjAGJg9e23Fn4yBEH/j92BC8=; c=relaxed/simple; d=groups.io; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From:In-Reply-To:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Language:Content-Type:Content-Transfer-Encoding; s=20140610; t=1698766820; v=1; b=Qzm5RdRDuCRL3U969g70eYLqMLjbXpxEvn5k/6fq4mMuY/ik5bKjo6jxP9eOzueBz4upJuH3 jmo2uG8NZrc/gAR4Q0ZkiX7PVuckIfJ8+0nReE4uT0uDRqdN/pVgSVZi3IMeCLqyPfG1xBpvEs2 BKTEvNVChoixDCPhQuNs0bC4= X-Received: by 127.0.0.2 with SMTP id 0vIoYY7687511x62i77lyWDz; Tue, 31 Oct 2023 08:40:20 -0700 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.2067.1698766819812281779 for ; Tue, 31 Oct 2023 08:40:19 -0700 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-488-9RcyUxQiOTK5bkQ0m1HNCg-1; Tue, 31 Oct 2023 11:40:17 -0400 X-MC-Unique: 9RcyUxQiOTK5bkQ0m1HNCg-1 X-Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (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 F2F1A8B5AE0; Tue, 31 Oct 2023 15:40:16 +0000 (UTC) X-Received: from [10.39.195.34] (unknown [10.39.195.34]) by smtp.corp.redhat.com (Postfix) with ESMTPS id BC8302166B26; Tue, 31 Oct 2023 15:40:15 +0000 (UTC) Message-ID: Date: Tue, 31 Oct 2023 16:40:14 +0100 MIME-Version: 1.0 Subject: Re: [edk2-devel] [PATCH] UefiCpuPkg/MmSaveStateLib: Remove checking Smm Rev ID in AMD MmSaveStateLib To: devel@edk2.groups.io, AbdulLateef.Attar@amd.com, "Lin, Jacque" Cc: "Chang, Abner" , Gerd Hoffmann , Paolo Bonzini References: <20231030061203.1166-1-hsienchieh.lin@amd.com> From: "Laszlo Ersek" In-Reply-To: X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.6 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,lersek@redhat.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: ga6zbfVFBooLsC7cXfIuA0W3x7686176AA= Content-Language: en-US Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=Qzm5RdRD; 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 On 10/31/23 11:43, Attar, AbdulLateef (Abdul Lateef) via groups.io wrote: > [Public] >=20 > Hi Laszlo and @Lin, Jacque > Please find my response inline. > Thanks > AbduL > -----Original Message----- > From: Laszlo Ersek > Sent: Monday, October 30, 2023 7:34 PM > To: devel@edk2.groups.io; Lin, Jacque > Cc: Attar, AbdulLateef (Abdul Lateef) ; Chang,= Abner ; Gerd Hoffmann ; Paolo Bonz= ini > Subject: Re: [edk2-devel] [PATCH] UefiCpuPkg/MmSaveStateLib: Remove check= ing Smm Rev ID in AMD MmSaveStateLib > Are you saying that the >=20 > SmmRevId < AMD_SMM_MIN_REV_ID_X64 >=20 > check will always evaluate to FALSE, and so the "return EFI_NOT_FOUND" > branch is dead code? > [Attar, AbdulLateef (Abdul Lateef)] that's right it always evaluate to FA= LSE > If that's the case, then the patch seems right, but *why* is SmmRevId alw= ays greater than or equal to AMD_SMM_MIN_REV_ID_X64? > [Attar, AbdulLateef (Abdul Lateef)] as per AMD64 Programmer's manual 10.2= .4 SMM-Revision Identifier. > First 16bit contains the version, which 0x64 for 64bit architecture. > Bit 16 and bit 17 always set 1. > Hence SmmRevId is always equal to AMD_SMM_MIN_REV_ID_X64. That may apply to physical hardware platforms, but does not apply to QEMU/KVM, and this library instance is also used in OVMF (on QEMU/KVM), since commit commit f2188fe5d155 ("OvmfPkg: Uses MmSaveStateLib library", 2023-07-03). Therefore, whatever you do in this library instance, must consider the impact on OVMF on QEMU/KVM. Thanks Laszlo -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#110432): https://edk2.groups.io/g/devel/message/110432 Mute This Topic: https://groups.io/mt/102269908/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/leave/12367111/7686176/19134562= 12/xyzzy [rebecca@openfw.io] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-