From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by mx.groups.io with SMTP id smtpd.web10.13017.1611071691495311016 for ; Tue, 19 Jan 2021 07:54:52 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=BMaIgFu0; spf=pass (domain: redhat.com, ip: 63.128.21.124, mailfrom: lersek@redhat.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1611071690; 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=iyksUBMRstX76OHReXinySc30pK+431W4tSF2kM4EWQ=; b=BMaIgFu0mfbgUJhbECCdU1Wq2ol2jHQdaUYm4wRvEdHSV+hlZm5dMPCTZPWxwBjoSWuF1x g1+DFJNkpemi9wujU/UqE+Z40WyKDwu94oPCNlql9vDQizgj8IdxbPlsJGfaXdig2kHo3O fB3WwHktWKHyPmPX/7hbla0PQ+ZXKrA= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-186-xQgoqoD9ObaE84fIUMedEg-1; Tue, 19 Jan 2021 10:54:47 -0500 X-MC-Unique: xQgoqoD9ObaE84fIUMedEg-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id DB3CD87950E; Tue, 19 Jan 2021 15:54:45 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-114-176.ams2.redhat.com [10.36.114.176]) by smtp.corp.redhat.com (Postfix) with ESMTP id 64CF960C5A; Tue, 19 Jan 2021 15:54:44 +0000 (UTC) From: "Laszlo Ersek" To: edk2-devel-groups-io Cc: Eric Dong , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Rahul Kumar , Ray Ni , Star Zeng Subject: [PATCH v2 1/4] UefiCpuPkg/CpuFeature: Don't assume CpuS3DataDxe alloc RegisterTable Date: Tue, 19 Jan 2021 16:54:37 +0100 Message-Id: <20210119155440.2262-2-lersek@redhat.com> In-Reply-To: <20210119155440.2262-1-lersek@redhat.com> References: <20210119155440.2262-1-lersek@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=lersek@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: base64 RnJvbTogUmF5IE5pIDxyYXkubmlAaW50ZWwuY29tPgoKVGhlcmUgYXJlIGxvdHMgb2YgZmllbGRz IGluIEFDUElfQ1BVX0RBVEEgc3RydWN0dXJlIHdoaWxlIG9ubHkKZm9sbG93aW5ncyBhcmUgYWNj ZXNzZWQgYnkgQ3B1RmVhdHVyZSBpbmZyYToKKiBOdW1iZXJPZkNwdXMKKiBQcmVTbW1Jbml0UmVn aXN0ZXJUYWJsZSAvLyBwb2ludGVyCiogUmVnaXN0ZXJUYWJsZSAgLy8gcG9pbnRlcgoqIENwdVN0 YXR1cwoqIEFwTG9jYXRpb24gIC8vIHBvaW50ZXIKClNvIGl0J3MgcG9zc2libGUgdGhhdCBhbiBp bXBsZW1lbnRhdGlvbiBvZiBDcHVTM0RhdGFEeGUgZG9lc24ndAphbGxvY2F0ZSBtZW1vcnkgZm9y IFByZVNtbUluaXRSZWdpc3RlclRhYmxlL1JlZ2lzdGVyVGFibGUvQXBMb2NhdGlvbi4KClRoaXMg cGF0Y2ggaGFuZGxlcyB0aGUgY2FzZSB3aGVuIENwdVMzRGF0YUR4ZSBkb2Vzbid0IGFsb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