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 783AEAC1A25 for ; Tue, 13 Feb 2024 21:09:32 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=f2DOKhwsfpyKvSim36l47199iRmzo91zofCD2tBO+dI=; c=relaxed/simple; d=groups.io; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Transfer-Encoding:Content-Type; s=20140610; t=1707858571; v=1; b=VS7Tuy7G6IyU/KsYFRWUosZQWVgW26f7B3XtAIG1CEzGRudQtJVdmciZh93e3Jziy3oUu9AY q9VuTlZOh6nMzSIDR6ETvQxAiNeyTOgUhEF2NZNPH97KPv423PfncHKEjJxfUsyV6hWkGSp0rKr hXVplWemKOusJfZV7M1DihUY= X-Received: by 127.0.0.2 with SMTP id hK2zYY7687511xgDP3N8H7rQ; Tue, 13 Feb 2024 13:09:31 -0800 X-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.web10.25292.1707858570547576579 for ; Tue, 13 Feb 2024 13:09:30 -0800 X-Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-613-URV7AhZEN4OVmr88pJFnNw-1; Tue, 13 Feb 2024 16:09:23 -0500 X-MC-Unique: URV7AhZEN4OVmr88pJFnNw-1 X-Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (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 173F728116A0; Tue, 13 Feb 2024 21:09:23 +0000 (UTC) X-Received: from lacos-laptop-9.usersys.redhat.com (unknown [10.39.192.46]) by smtp.corp.redhat.com (Postfix) with ESMTP id D8791492C2D; Tue, 13 Feb 2024 21:09:21 +0000 (UTC) From: "Laszlo Ersek" To: devel@edk2.groups.io Cc: Dun Tan , Gerd Hoffmann , Rahul Kumar , Ray Ni Subject: [edk2-devel] [edk2-stable202402 PATCH 1/2] UefiCpuPkg/PiSmmCpuDxeSmm: distinguish GetSmBase() failure modes Date: Tue, 13 Feb 2024 22:09:17 +0100 Message-Id: <20240213210918.16372-2-lersek@redhat.com> In-Reply-To: <20240213210918.16372-1-lersek@redhat.com> References: <20240213210918.16372-1-lersek@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.10 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: 69OFd2M8ADzWzLh3Dp8MezIBx7686176AA= Content-Transfer-Encoding: base64 Content-Type: text/plain; charset="US-ASCII"; x-default=true X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=VS7Tuy7G; 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 Q29tbWl0IDcyNWFjZDBiOWNjMCAoIlVlZmlDcHVQa2c6IEF2b2lkIGFzc3VtaW5nIG9ubHkgb25l IHNtbWJhc2Vob2IiLAoyMDIzLTEyLTEyKSBpbnRyb2R1Y2V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