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.web11.14562.1610479190469021496 for ; Tue, 12 Jan 2021 11:19:50 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=EplW/e1S; 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=1610479189; 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=sV8Ty8aLYEjhBaZry2kAgX8YxgzYDoUOkSZQOcIbFm0=; b=EplW/e1SogV/IsnoRg06q+hwbyPVd9ZR0iv4O1oPFWgAdtgqFNvlDE7cix9aMp2KoPUUxX cEWkLpvp6dI+gYAVwxJRy1paibTtcJ0EsbdTEhVpgRp0j/1AdUKzmC48I9enWLKJIisXM3 xiI1JQRhG8b6uroeBnVlh8v6lJ4Z1zw= 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-134-QqO6r1aXNQ-Zs2U7N9OKjw-1; Tue, 12 Jan 2021 14:19:47 -0500 X-MC-Unique: QqO6r1aXNQ-Zs2U7N9OKjw-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 F0D521922029; Tue, 12 Jan 2021 19:19:45 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-112-67.ams2.redhat.com [10.36.112.67]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5EF0060CEB; Tue, 12 Jan 2021 19:19:43 +0000 (UTC) From: "Laszlo Ersek" To: devel@edk2.groups.io Cc: Ard Biesheuvel , Jordan Justen , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH 3/3] OvmfPkg/CpuS3DataDxe: do not allocate useless register tables Date: Tue, 12 Jan 2021 20:19:34 +0100 Message-Id: <20210112191934.12459-4-lersek@redhat.com> In-Reply-To: <20210112191934.12459-1-lersek@redhat.com> References: <20210112191934.12459-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 Q3B1UzNEYXRhRHhlIGFsbG9jYXRlcyB0aGUgIlJlZ2lzdGVyVGFibGUiIGFuZCAiUHJlU21tSW5p dFJlZ2lzdGVyVGFibGUiCmFycmF5cyBpbiBBQ1BJX0NQVV9EQVRBIGp1c3Qgc28gZXZlcnkgcHJv Y2Vzc29yIGluIHRoZSBzeXN0ZW0gY2FuIGhhdmUgaXRzCm93biBlbXB0eSByZWdpc3RlciB0YWJs ZSwgbWF0Y2hlZCBieSBBUElDIElELiBUaGlzIGhhcyBuZXZlciBiZWVuIHVzZWZ1bAppbiBwcmFj dGljZS4KCkdpdmVuIGNvbW1pdCBlOTkyY2MzZjQ4NTkgKCJVZWZpQ3B1UGtnIFBpU21tQ3B1RHhl U21tOiBSZWR1Y2UgU01SQU0KY29uc3VtcHRpb24gaW4gQ3B1UzMuYyIsIDIwMjEtMDEtMTEpLCBz aW1wbHkgbGVhdmUgYm90aAoiQWNwaUNwdURhdGEtPlJlZ2lzdGVyVGFibGUiIGFuZCAiQWNwaUNw dURhdGEtPlByZVNtbUluaXRSZWdpc3RlclRhYmxlIgppbml0aWFsaXplZCB0byB0aGUgemVybyBh ZGRyZXN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Gx1ZyByZWdpc3RlcnMgY2FuIGJlDQotICAgICAgLy8gYWNjZXNzZWQuDQotICAgICAgLy8NCi0g ICAgICBJb1dyaXRlMzIgKElDSDlfQ1BVX0hPVFBMVUdfQkFTRSArIFFFTVVfQ1BVSFBfV19DUFVf U0VMLCAwKTsNCi0gICAgICAvLw0KLSAgICAgIC8vIFdlJ2xsIGJlIGZldGNoaW5nIHRoZSBBUElD IElEcy4NCi0gICAgICAvLw0KLSAgICAgIElvV3JpdGU4IChJQ0g5X0NQVV9IT1RQTFVHX0JBU0Ug KyBRRU1VX0NQVUhQX1dfQ01ELA0KLSAgICAgICAgUUVNVV9DUFVIUF9DTURfR0VUX0FSQ0hfSUQp Ow0KLSAgICB9DQotICAgIGZvciAoSW5kZXggPSAwOyBJbmRleCA8IE51bWJlck9mQ3B1czsgSW5k ZXgrKykgew0KLSAgICAgIFVJTlQzMiBJbml0aWFsQXBpY0lkOw0KLQ0KLSAgICAgIGlmIChGZXRj aFBvc3NpYmxlQXBpY0lkcykgew0KLSAgICAgICAgSW9Xcml0ZTMyIChJQ0g5X0NQVV9IT1RQTFVH X0JBU0UgKyBRRU1VX0NQVUhQX1dfQ1BVX1NFTCwNCi0gICAgICAgICAgKFVJTlQzMilJbmRleCk7 DQotICAgICAgICBJbml0aWFsQXBpY0lkID0gSW9SZWFkMzIgKA0KLSAgICAgICAgICAgICAgICAg ICAgICAgICAgSUNIOV9DUFVfSE9UUExVR19CQVNFICsgUUVNVV9DUFVIUF9SV19DTURfREFUQSk7 DQotICAgICAgfSBlbHNlIHsNCi0gICAgICAgIFN0YXR1cyA9IE1wU2VydmljZXMtPkdldFByb2Nl c3NvckluZm8gKA0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTXBTZXJ2aWNlcywNCi0g ICAgICAgICAgICAgICAgICAgICAgICAgICAgIEluZGV4LA0KLSAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgJlByb2Nlc3NvckluZm9CdWZmZXINCi0gICAgICAgICAg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