From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.61]) by mx.groups.io with SMTP id smtpd.web11.9235.1582478772396705734 for ; Sun, 23 Feb 2020 09:26:12 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=VNKK3BNj; spf=pass (domain: redhat.com, ip: 205.139.110.61, mailfrom: lersek@redhat.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1582478771; 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=DgNIyl829Qae/gQ9bsPi2t/MnYRNk+5FkjJwjtwrTiw=; b=VNKK3BNjlkf56MfvlDJNGaOdtsnKCikTpPB72hQwLcWnjQlKw0k5SHLfx9f4DekkJEeo0j BmhV7s7pDjqqnoJYbJK0hbDNCWblD9cBS8lbaXOo9xVqxkMrnsBs+YU9XF7Z/aNGuGP0g/ ROnaqDS/2Tn2d0pcqc+hQXcAYCEf2TQ= 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-326-dNkwxtCHMx-2epwA7f-u9w-1; Sun, 23 Feb 2020 12:26:07 -0500 X-MC-Unique: dNkwxtCHMx-2epwA7f-u9w-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 A5A021851FC2; Sun, 23 Feb 2020 17:26:06 +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 E857D5C105; Sun, 23 Feb 2020 17:26:04 +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 10/16] OvmfPkg/CpuHotplugSmm: collect CPUs with events Date: Sun, 23 Feb 2020 18:25:31 +0100 Message-Id: <20200223172537.28464-11-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 Q2FsbCBRZW11Q3B1aHBDb2xsZWN0QXBpY0lkcygpIGluIHRoZSByb290IE1NSSBoYW5kbGVyLiBU aGUgQVBJQyBJRHMgb2YKdGhlIGhvdHBsdWdnZWQgQ1BVcyB3aWxsIGJlIHVzZWQgZm9yIHNldmVy YWwgcHVycG9zZXMgaW4gc3Vic2VxdWVudApwYXRjaGVzLgoKRm9yIGNhbGxpbmcgUWVtdUNwdWhw Q29sbGVjdEFwaWNJZHMoKSwgcHJlLWFsbG9jYXRlIGJvdGggb2YgaXRzIG91dHB1dAphcnJheXMg IlBsdWdnZWRBcGljSWRzIiBhbmQgIlRvVW5wbHVnQXBpY0lkcyIgaW4gdGhlIGRyaXZlcidzIGVu dHJ5IHBvaW50CmZ1bmN0aW9uLiBUaGUgYWxsb2NhdGlvbiBzaXplIGlzIGRpY3RhdGVkIGJ5IHRo ZSBwb3NzaWJsZSBDUFUgY291bnQsIHdoaWNoCndlIGZldGNoIGZyb20gIkNQVV9IT1RfUExVR19E QVRBLkFycmF5TGVuZ3RoIi4KClRoZSBDUFVfSE9UX1BMVUdfREFUQSBzdHJ1Y3R1cmUgaW4gU01S QU0gaXMgYW4gb3V0LW9mLWJhbmQgaW5mb3JtYXRpb24KY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uIGV2ZXJ5IE1NSSBzZXBhcmF0ZWx5 Lg0KKy8vDQorU1RBVElDIEFQSUNfSUQgKm1QbHVnZ2VkQXBpY0lkczsNCitTVEFUSUMgQVBJQ19J RCAqbVRvVW5wbHVnQXBpY0lkczsNCisvLw0KIC8vIFJlcHJlc2VudHMgdGhlIHJlZ2lzdHJhdGlv biBvZiB0aGUgQ1BVIEhvdHBsdWcgTU1JIGhhbmRsZXIuDQogLy8NCiBTVEFUSUMgRUZJX0hBTkRM RSBtRGlzcGF0Y2hIYW5kbGU7DQogDQogDQogLyoqDQogICBDUFUgSG90cGx1ZyBNTUkgaGFuZGxl ciBmdW5jdGlvbi4NCiANCiAgIFRoaXMgaXMgYSByb290IE1NSSBoYW5kbGVyLg0KIA0KICAgQHBh cmFtW2luXSBEaXNwYXRjaEhhbmRsZSAgICAgIFRoZSB1bmlxdWUgaGFuZGxlIGFzc2lnbmVkIHRv IHRoaXMgaGFuZGxlciBieQ0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEVGSV9N TV9TWVNURU1fVEFCTEUuTW1pSGFuZGxlclJlZ2lzdGVyKCkuDQogDQogICBAcGFyYW1baW5dIENv bnRleHQgICAgICAgICAgICAgQ29udGV4dCBwYXNzZWQgaW4gYnkNCiAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICBFRklfTU1fU1lTVEVNX1RBQkxFLk1taU1hbmFnZSgpLiBEdWUgdG8N CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBDcHVIb3RwbHVnTW1pKCkgYmVpbmcg YSByb290IE1NSSBoYW5kbGVyLA0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIENv bnRleHQgaXMgQVNTRVJUKCllZCB0byBiZSBOVUxMLg0KIA0KICAgQHBhcmFtW2luLG91dF0gQ29t bUJ1ZmZlciAgICAgIElnbm9yZWQsIGR1ZSB0byBDcHVIb3RwbHVnTW1pKCkgYmVpbmcgYSByb290 DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTU1JIGhhbmRsZXIuDQogDQogICBA cGFyYW1baW4sb3V0XSBDb21tQnVmZmVyU2l6ZSAgSWdub3JlZCwgZHVlIHRvIENwdUhvdHBsdWdN bWkoKSBiZWluZyBhIHJvb3QNCkBAIC02NSwxNjIgKzk1LDIzOSBAQCBTVEFUSUMgRUZJX0hBTkRM RSBtRGlzcGF0Y2hIYW5kbGU7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgYnV0IG90aGVyIGhhbmRsZXJzIHNob3VsZCBzdGlsbA0KICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBiZSBjYWxsZWQuDQogDQogICBAcmV0dmFs IEVGSV9XQVJOX0lOVEVSUlVQVF9TT1VSQ0VfUEVORElORyAgIFRoZSBNTUkgc291cmNlIGlzIHN0 aWxsIHBlbmRpbmcsDQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgIGFuZCBvdGhlciBoYW5kbGVycyBzaG91bGQgc3RpbGwNCiAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgYmUgY2FsbGVkLg0KIA0KICAgQHJldHZhbCBFRklf SU5URVJSVVBUX1BFTkRJTkcgICAgICAgICAgICAgICBUaGUgTU1JIHNvdXJjZSBjb3VsZCBub3Qg YmUNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcXVpZXNj ZWQuDQogKiovDQogU1RBVElDDQogRUZJX1NUQVRVUw0KIEVGSUFQSQ0KIENwdUhvdHBsdWdNbWkg KA0KICAgSU4gRUZJX0hBTkRMRSBEaXNwYXRjaEhhbmRsZSwNCiAgIElOIENPTlNUIFZPSUQgKkNv bnRleHQgICAgICAgIE9QVElPTkFMLA0KICAgSU4gT1VUIFZPSUQgICAqQ29tbUJ1ZmZlciAgICAg T1BUSU9OQUwsDQogICBJTiBPV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JvbCk7DQogICBpZiAoRUZJX0VSUk9SIChT dGF0dXMpKSB7DQogICAgIERFQlVHICgoREVCVUdfRVJST1IsICIlYTogZmFpbGVkIHRvIHJlYWQg SUNIOV9BUE1fQ05UOiAlclxuIiwgX19GVU5DVElPTl9fLA0KICAgICAgIFN0YXR1cykpOw0KICAg ICAvLw0KICAgICAvLyBXZSBjb3VsZG4ndCBldmVuIGRldGVybWluZSBpZiB0aGUgTU1JIHdhcyBm b3IgdXMgb3Igbm90Lg0KICAgICAvLw0KICAgICBnb3RvIEZhdGFsOw0KICAgfQ0KIA0KICAgaWYg KEFwbUNvbnRyb2wgIT0gSUNIOV9BUE1fQ05UX0NQVV9IT1RQTFVHKSB7DQogICAgIC8vDQogICAg IC8vIFRoZSBNTUkgaXMgbm90IGZvciB1cy4NCiAgICAgLy8NCiAgICAgcmV0dXJuIEVGSV9XQVJO X0lOVEVSUlVQVF9TT1VSQ0VfUVVJRVNDRUQ7DQogICB9DQogDQorICAvLw0KKyAgLy8gQ29sbGVj dCB0aGUgQ1BVcyB3aXRoIHBlbmRpbmcgZXZlbnRzLg0KKyAgLy8NCisgIFN0YXR1cyA9IFFlbXVD cHVocENvbGxlY3RBcGljSWRzICgNCisgICAgICAgICAgICAgbU1tQ3B1SW8sDQorICAgICAgICAg ICAgIG1DcHVIb3RQbHVnRGF0YS0+QXJyYXlMZW5ndGgsICAgICAvLyBQb3NzaWJsZUNwdUNvdW50 DQorICAgICAgICAgICAgIG1DcHVIb3RQbHVnRGF0YS0+QXJyYXlMZW5ndGggLSAxLCAvLyBBcGlj SWRDb3VudA0KKyAgICAgICAgICAgICBtUGx1Z2dlZEFwaWNJZHMsDQorICAgICAgICAgICAgICZQ bHVnZ2VkQ291bnQsDQorICAgICAgICAgICAgIG1Ub1VucGx1Z0FwaWNJZHMsDQorICAgICAgICAg ICAgICZUb1VucGx1Z0NvdW50DQorICAgICAgICAgICAgICk7DQorICBpZiAoRUZJX0VSUk9SIChT dGF0dXMpKSB7DQ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u dC4NCisgIC8vDQorICBpZiAoUkVUVVJOX0VSUk9SIChTYWZlVWludG5TdWIgKG1DcHVIb3RQbHVn RGF0YS0+QXJyYXlMZW5ndGgsIDEsICZTaXplKSkgfHwNCisgICAgICBSRVRVUk5fRVJST1IgKFNh ZmVVaW50bk11bHQgKHNpemVvZiAoQVBJQ19JRCksIFNpemUsICZTaXplKSkpIHsNCisgICAgU3Rh dHVzID0gRUZJX0FCT1JURUQ7DQorICAgIERFQlVHICgoREVCVUdfRVJST1IsICIlYTogaW52YWxp ZCBDUFVfSE9UX1BMVUdfREFUQVxuIiwgX19GVU5DVElPTl9fKSk7DQorICAgIGdvdG8gRmF0YWw7 DQorICB9DQorICBTdGF0dXMgPSBnTW1zdC0+TW1BbGxvY2F0ZVBvb2wgKEVmaVJ1bnRpbWVTZXJ2 aWNlc0RhdGEsIFNpemUsDQorICAgICAgICAgICAgICAgICAgICAoVk9JRCAqKikmbVBsdWdnZWRB cGljSWRzKTsNCisgIGlmIChFRklfRVJST1IgKFN0YXR1cykpIHsNCisgICAgREVCVUcgKChERUJV R19FUlJPUiwgIiVhOiBNbUFsbG9jYXRlUG9vbCgpOiAlclxuIiwgX19GVU5DVElPTl9fLCBTdGF0 dXMpKTsNCisgICAgZ290byBGYXRhbDsNCisgIH0NCisgIFN0YXR1cyA9IGdNbXN0LT5NbUFsbG9j YXRlUG9vbCAoRWZpUnVudGltZVNlcnZpY2VzRGF0YSwgU2l6ZSwNCisgICAgICAgICAgICAgICAg ICAgIChWT0lEICoqKSZtVG9VbnBsdWdBcGljSWRzKTsNCisgIGlmIChFRklfRVJST1IgKFN0YXR1 cykpIHsNCisgICAgREVCVUcgKChERUJVR19FUlJPUiwgIiVhOiBNbUFsbG9jYXRlUG9vbCgpOiAl clxuIiwgX19GVU5DVElPTl9fLCBTdGF0dXMpKTsNCisgICAgZ290byBSZWxlYXNlUGx1Z2dlZEFw aWNJZHM7DQorICB9DQogDQogICAvLw0KICAgLy8gU2FuaXR5LWNoZ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