From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.81]) by mx.groups.io with SMTP id smtpd.web10.9283.1582478782976034212 for ; Sun, 23 Feb 2020 09:26:23 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=OwQrSq9L; spf=pass (domain: redhat.com, ip: 207.211.31.81, mailfrom: lersek@redhat.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1582478782; 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=NealU0zex6nfZRPf3tJ+IvwJBKvA7M9QQMkVEs1LubM=; b=OwQrSq9LZ/cxMZh6wStaIH32ZFA+zRVBpReZQRndnemKcCsNlp4wB/WA0coAw0Z3vteEOG AFoLGKYNhw60dOevlkGjsDAmKyzvAkE/Wo6NNCMa0/LLIM6b723CiAEL+WHguaMfOL24Mq KrLXu/0Syp0GuLZisQZ7LVKxAKvv+GI= 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-419-QK1WDTTGPEu0navMJcw1ew-1; Sun, 23 Feb 2020 12:26:20 -0500 X-MC-Unique: QK1WDTTGPEu0navMJcw1ew-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 1D4BE100726A; Sun, 23 Feb 2020 17:26:19 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-116-53.ams2.redhat.com [10.36.116.53]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6322F5C105; Sun, 23 Feb 2020 17:26:17 +0000 (UTC) From: "Laszlo Ersek" To: edk2-devel-groups-io Cc: Ard Biesheuvel , Igor Mammedov , Jiewen Yao , Jordan Justen , Michael Kinney , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH 16/16] OvmfPkg/CpuS3DataDxe: enable S3 resume after CPU hotplug Date: Sun, 23 Feb 2020 18:25:37 +0100 Message-Id: <20200223172537.28464-17-lersek@redhat.com> In-Reply-To: <20200223172537.28464-1-lersek@redhat.com> References: <20200223172537.28464-1-lersek@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: base64 RHVyaW5nIG5vcm1hbCBib290LCBDcHVTM0RhdGFEeGUgYWxsb2NhdGVzCgotIGFuIGVtcHR5IENQ VV9SRUdJU1RFUl9UQUJMRSBlbnRyeSBpbiB0aGUKICAiQUNQSV9DUFVfREFUQS5QcmVTbW1Jbml0 UmVnaXN0ZXJUYWJsZSIgYXJyYXksIGFuZAoKLSBhbiBlbXB0eSBDUFVfUkVHSVNURVJfVEFCTEUg ZW50cnkgaW4gdGhlICJBQ1BJX0NQVV9EQVRBLlJlZ2lzdGVyVGFibGUiCiAgYXJyYXksCgpmb3Ig ZXZlcnkgQ1BVIHdob3NlIEFQSUMgSUQgQ3B1UzNEYXRhRHhlIGNhbiBsZWFybi4KCkN1cnJlbnRs eSBFRklfTVBfU0VSVklDRVNfUFJPVE9DT0wgaXMgdXNlZCBmb3IgYm90aCBkZXRlcm1pbmluZyB0 aGUgbnVtYmVyCm9mIENQVXMgLS0gdGhlIHByb3RvY29sIHJlcG9ydHMgdGhlIHByZXNlbnQtYXQt Ym9vdCBDUFUgY291bnQgLS0sIGFuZCBmb3IKcmV0cmlldmluZyB0aGUgQVBJQyBJRHMgb2YgdGhv c2UgQ1BVcy4KCkNvbnNlcXVlbnRseSwgaWYgYSBDUF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ogICBJTiBFRklfU1lTVEVNX1RB QkxFICAqU3lzdGVtVGFibGUNCiAgICkNCiB7DQogICBFRklfU1RBVFVTICAgICAgICAgICAgICAg ICBTdGF0dXM7DQogICBBQ1BJX0NQVV9EQVRBX0VYICAgICAgICAgICAqQWNwaUNwdURhdGFFeDsN CiAgIEFDUElfQ1BVX0RBVEEgICAgICAgICAgICAgICpBY3BpQ3B1RGF0YTsNCiAgIEVGSV9NUF9T RVJWSUNFU19QUk9UT0NPTCAgICpNcFNlcnZpY2VzOw0KICAgVUlOVE4gICAgICAgICAgICAgICAg ICAgICAgTnVtYmVyT2ZDcHVzOw0KLSAgVUlOVE4gICAgICAgICAgICAgICAgICAgICAgTnVtYmVy T2ZFbmFibGVkUHJvY2Vzc29yczsNCiAgIFZPSUQgICAgICAgICAgICAgICAgICAgICAgICpTdGFj azsNCiAgIFVJTlROICAgICAgICAgICAgICAgICAgICAgIFRhYmxlU2l6ZTsNCiAgIENQVV9SRUdJ U1RFUl9UQUJMRSAgICAgICAgICpSZWdpc3RlclRhYmxlOw0KICAgVUlOVE4gICAgICAgICAgICAg ICAgICAgICAgSW5kZXg7DQogICBFRklfUFJPQ0VTU09SX0lORk9STUFUSU9OICBQcm9jZXNzb3JJ bmZvQnVmZmVyOw0KICAgVUlOVE4gICAgICAgICAgICAgICAgICAgICAgR2R0U2l6ZTsNCiAgIFVJ TlROICAgICAgICAgICAgICAgICAgICAgIElkdFNpemU7DQogICBWT0lEICAgICAgICAgICAgICAg ICAgICAgICAqR2R0Ow0KICAgVk9JRCAgICAgICAgICAgICAgICAgICAgICAgKklkdDsNCiAgIEVG SV9FVkVOVCAgICAgICAgICAgICAgICAgIEV2ZW50Ow0KICAgQUNQSV9DUFVfREFUQSAgICAgICAg ICAgICAgKk9sZEFjcGlDcHVEYXRhOw0KKyAgQk9PTEVBTiAgICAgICAgICAgICAgICAgICAgRmV0 Y2hQb3NzaWJsZUFwaWNJZHM7DQogDQogICBpZiAoIVBjZEdldEJvb2wg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ZWZhdWx0 U21iYXNlKTsNCiANCi0gIC8vDQotICAvLyBHZXQgdGhlIG51bWJlciBvZiBDUFVzDQotICAvLw0K LSAgU3RhdHVzID0gTXBTZXJ2aWNlcy0+R2V0TnVtYmVyT2ZQcm9jZXNzb3JzICgNCi0gICAgICAg ICAgICAgICAgICAgICAgICAgTXBTZXJ2aWNlcywNCi0gICAgICAgICAgICAgICAgICAgICAgICAg Jk51bWJlck9mQ3B1cywNCi0gICAgICAgICAgICAgICAgICAgICAgICAgJk51bWJlck9mRW5hYmxl ZFByb2Nlc3NvcnMNCi0gICAgICAgICAgICAgICAgICAgICAgICAgKTsNCi0gIEFTU0VSVF9FRklf RVJST1IgKFN0YXR1cyk7DQorICBpZiAoRmV0Y2hQb3NzaWJsZUFwaWNJZHMpIHsNCisgICAgTnVt YmVyT2ZDcHVzID0gUGNkR2V0MzIgKFBjZENwdU1heExvZ2ljYWxQcm9jZXNzb3JOdW1iZXIpOw0K KyAgfSBlbHNlIHsNCisgICAgVUlOVE4gTnVtYmVyT2ZFbmFibGVkUHJvY2Vzc29yczsNCisNCisg ICAgLy8NCisgICAgLy8gR2V0IE1QIFNlcnZpY2VzIFByb3RvY29sDQorICAgIC8vDQorICAgIFN0 YXR1cyA9IGdCUy0+TG9jYXRlUHJvdG9jb2wgKA0KKyAgICAgICAgICAgICAgICAgICAgJmdFZmlN cFNlcnZpY2VQcm90b2NvbEd1aWQsDQorICAgICAgICAgICAgICAgICAgICBOVUxMLA0KKyAgICAg ICAgICAgICAgICAgICAgKFZPSUQgKiopJk1wU2VydmljZXMNCisgICAgICAgICAgICAgICAgICAg ICk7DQorICAgIEFTU0VSVF9FRklfRVJST1IgKFN0YXR1cyk7DQorDQorICAgIC8vDQorICAgIC8v IEdldCB0aGUgbnVtYmVyIG9mIENQVXMNCisgICAgLy8NCisgICAgU3RhdHVzID0gTXBTZXJ2aWNl cy0+R2V0TnVtYmVyT2ZQcm9jZXNzb3JzICgNCisgICAgICAgICAgICAgICAgICA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ljSWRzKSB7DQorICAgICAgLy8NCisgICAgICAvLyBXcml0ZSBhIHZhbGlkIHNlbGVj dG9yIHNvIHRoYXQgb3RoZXIgaG90cGx1ZyByZWdpc3RlcnMgY2FuIGJlDQorICAgICAgLy8gYWNj ZXNzZWQuDQorICAgICAgLy8NCisgICAgICBJb1dyaXRlMzIgKElDSDlfQ1BVX0hPVFBMVUdfQkFT RSArIFFFTVVfQ1BVSFBfV19DUFVfU0VMLCAwKTsNCisgICAgICAvLw0KKyAgICAgIC8vIFdlJ2xs IGJlIGZldGNoaW5nIHRoZSBBUElDIElEcy4NCisgICAgICAvLw0KKyAgICAgIElvV3JpdGU4IChJ Q0g5X0NQVV9IT1RQTFVHX0JBU0UgKyBRRU1VX0NQVUhQX1dfQ01ELA0KKyAgICAgICAgUUVNVV9D UFVIUF9DTURfR0VUX0FSQ0hfSUQpOw0KKyAgICB9DQogICAgIGZvciAoSW5kZXggPSAwOyBJbmRl eCA8IE51bWJlck9mQ3B1czsgSW5kZXgrKykgew0KLSAgICAgIFN0YXR1cyA9IE1wU2VydmljZXMt PkdldFByb2Nlc3NvckluZm8gKA0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgIE1wU2Vydmlj ZXMsDQotICAgICAgICAgICAgICAgICAgICAgICAgICAgSW5kZXgsDQotICAgICAgICAgICAgICAg ICAgICAgICAgICAgJlByb2Nlc3NvckluZm9CdWZmZXINCi0gICAgICAgICAgICAgICAgICAgICAg ICAgICApOw0KLSAgICAgIEFTU0VSVF9FRklfRVJST1IgKFN0YXR1cyk7DQorICAgICAgVUlOVDMy IEluaXRpYWxBcGljSWQ7DQogDQotICAgICAgUmVnaXN0ZXJUYWJsZVtJbmRleF0uSW5pdGlhbEFw aWNJZCAgICAgID0gKFVJTlQzMilQcm9jZXNzb3JJbmZvQnVmZmVyLlByb2Nlc3NvcklkOw0KKyAg ICAgIGlmIChGZXRjaFBvc3NpYmxlQXBpY0lkcykgew0KKyAgICAgICAgSW9Xcml0ZTMyIChJQ0g5 X0NQVV9IT1RQTFVHX0JBU0UgKyBRRU1VX0NQVUhQX1dfQ1BVX1NFTCwNCisgICAgICAgICAgKFVJ TlQzMilJbmRleCk7DQorICAgICAgICBJbml0aWFsQXBpY0lkID0gSW9SZWFkMzIgKA0KKyAgICAg ICAgICAgICAgICAgICAgICAgICAgSUNIOV9DUFVfSE9UUExVR19CQVNFICsgUUVNVV9DUFVIUF9S V19DTURfREFUQSk7DQorICAgICAgfSBlbHNlIHsNCisgICAgICAgIFN0YXR1cyA9IE1wU2Vydmlj ZXMtPkdldFByb2Nlc3NvckluZm8gKA0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTXBT ZXJ2aWNlcywNCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEluZGV4LA0KKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgJlByb2Nlc3NvckluZm9CdWZmZXINCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICk7DQorICAgICAgICBBU1NFUlRfRUZJX0VSUk9SIChTdGF0dXMpOw0K KyAgICAgICAgSW5pdGlhbEFwaWNJZCA9IChVSU5UMzIpUHJvY2Vzc29ySW5mb0J1ZmZlci5Qcm9j ZXNzb3JJZDsNCisgICAgICB9DQorDQorICAgICAgREVCVUcgKChERUJVR19WRVJCT1NFLCAiJWE6 IEluZGV4PSUwNUx1IEFwaWNJZD0weCUwOHhcbiIsIF9fRlVOQ1RJT05fXywNCisgICAgICAgIChV SU5UNjQpSW5kZXgsIEluaXRpYWxBcGljSWQpKTsNCisNCisgICAgICBSZWdpc3RlclRhYmxlW0lu ZGV4XS5Jbml0aWFsQXBpY0lkICAgICAgPSBJbml0aWFsQXBpY0lkOw0KICAgICAgIFJlZ2lzdGVy VGFibGVbSW5kZXhdLlRhYmxlTGVuZ3RoICAgICAgICA9IDA7DQogICAgICAgUmVnaXN0ZXJUYWJs ZVtJbmRleF0uQWxsb2NhdGVkU2l6ZSAgICAgID0gMDsNCiAgICAgICBSZWdpc3RlclR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