From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-1.mimecast.com (us-smtp-1.mimecast.com [205.139.110.120]) by mx.groups.io with SMTP id smtpd.web09.9138.1582478768135842250 for ; Sun, 23 Feb 2020 09:26:08 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=doJZXR0M; spf=pass (domain: redhat.com, ip: 205.139.110.120, mailfrom: lersek@redhat.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1582478767; 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=lr9VSESjgFMqNd4J8Q6HHVYfDXxiiD1vrY500iyOrN0=; b=doJZXR0MCV1Y4EmuB/06LdhuZNBUxMZGpWRuBBMw0aALJyeRAujRPoCL7SZyadCO3BLRmA +pM3hP4guJ6Rnvg+E2Ww8q+kAtsXRpVrj3VvPeOZSeSH7vyUVe61X4jiSoByeb3Z1Lsgx/ yB63kecOCsRinXSPchnNT9oghH/lWwE= 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-292-mo8ahZUIPkyqf8g3_IILZQ-1; Sun, 23 Feb 2020 12:26:05 -0500 X-MC-Unique: mo8ahZUIPkyqf8g3_IILZQ-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 9286F107ACC5; Sun, 23 Feb 2020 17:26:04 +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 D66019182B; Sun, 23 Feb 2020 17:26:02 +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 09/16] OvmfPkg/CpuHotplugSmm: add function for collecting CPUs with events Date: Sun, 23 Feb 2020 18:25:30 +0100 Message-Id: <20200223172537.28464-10-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 QWRkIGEgZnVuY3Rpb24gdGhhdCBjb2xsZWN0cyB0aGUgQVBJQyBJRHMgb2YgQ1BVcyB0aGF0IGhh dmUganVzdCBiZWVuCmhvdC1wbHVnZ2VkLCBvciBhcmUgYWJvdXQgdG8gYmUgaG90LXVucGx1Z2dl ZC4KClBlbmRpbmcgZXZlbnRzIGFyZSBvbmx5IGxvY2F0ZWQgYW5kIG5ldmVyIGNsZWFyZWQ7IFFF TVUncyBBTUwgbmVlZHMgdGhlCmZpcm13YXJlIHRvIGxlYXZlIHRoZSBzdGF0dXMgYml0cyBpbnRh Y3QgaW4gdGhlIGhvdHBsdWcgcmVnaXN0ZXIgYmxvY2suCgpDYzogQXJkIEJpZXNoZXV2ZWwgPGFy ZC5iaWVzaGV1dmVsQGxpbmFyby5vcmc+CkNjOiBJZ29yIE1hbW1lZG92IDxpbWFtbWVkb0ByZWRo YXQuY29tPgpDYzogSmlld2VuIFlhbyA8amlld2VuLnlhb0BpbnRlbC5jb20+CkNjOiBKb3JkYW4g SnVzdGVuIDxqb3JkYW4ubC5qdXN0ZW5AaW50ZWwuY29tPgpDYzogTWljaGFlbCBLaW5uZXkgPG1p Y2hhZWwuZC5raW5uZXlAaW50ZWwuY29tPgpDYzogUGhpbGl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U5UMzIgICAgIENvbW1h bmREYXRhMjsNCkBAIC0xMTUsMjIgKzExNSwxODcgQEAgUWVtdUNwdWhwV3JpdGVDcHVTZWxlY3Rv ciAoCiANCiBWT0lEDQogUWVtdUNwdWhwV3JpdGVDb21tYW5kICgNCiAgIElOIENPTlNUIEVGSV9N TV9DUFVfSU9fUFJPVE9DT0wgKk1tQ3B1SW8sDQogICBJTiBVSU5UOCAgICAgICAgICAgICAgICAg ICAgICAgIENvbW1hbmQNCiAgICkNCiB7DQogICBFRklfU1RBVFVTIFN0YXR1czsNCiANCiAgIFN0 YXR1cyA9IE1tQ3B1SW8tPklvLldyaXRlICgNCiAgICAgICAgICAgICAgICAgICAgICAgICAgTW1D cHVJbywNCiAgICAgICAgICAgICAgICAgICAgICAgICAgTU1fSU9fVUlOVDgsDQogICAgICAgICAg ICAgICAgICAgICAgICAgIElDSDlfQ1BVX0hPVFBMVUdfQkFTRSArIFFFTVVfQ1BVSFBfV19DTUQs DQogICAgICAgICAgICAgICAgICAgICAgICAgIDEsDQogICAgICAgICAgICAgICAgICAgICAgICAg ICZDb21tYW5kDQogICAgICAgICAgICAgICAgICAgICAgICAgICk7DQogICBpZiAoRUZJX0VSUk9S IChTdGF0dXMpKSB7DQogICAgIERFQlVHICgoREVCVUdfRVJST1IsICIlYTogJXJcbiIsIF9fRlVO Q1RJT05fXywgU3RhdHVzKSk7DQogICAgIEFTU0VSVCAoRkFMU0UpOw0KICAgICBDcHVEZWFkTG9v cCAoKTsNCiAgIH0NCiB9DQorDQorLyoqDQorICBDb2xsZWN0IHRoZSBBUElDIElEcyBvZg0KKyAg LSB0aGUgQ1BVcyB0aGF0IGhhdmUgYmVlbiBob3QtcGx1Z2dlZCwNCisgIC0gdGhlIENQVXMgdGhh dCBhcmUgYWJvdXQgdG8gYmUgaG90LXVucGx1Z2dlZC4NCisNCisgIFRoaXMgZnVuY3Rpb24gb25s eSBzY2FucyBmb3IgZXZlbnRzIC0tIGl0IGRvZXMgbm90IG1vZGlmeSB0aGVtIC0tIGluIHRoZQ0K KyAgaG90cGx1ZyByZWdpc3RlcnMuDQorDQorICBPbiBlcnJvciwgdGhlIGNvbnRlbnRzIG9mIHRo ZSBvdXRwdXQgcGFyYW1ldGVycyBhcmUgdW5kZWZpbmVkLg0KKw0KKyAgQHBhcmFtW2luXSBNbUNw dUlvICAgICAgICAgICBUaGUgRUZJX01NX0NQVV9JT19QUk9UT0NPTCBpbnN0YW5jZSBmb3INCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYWNjZXNzaW5nIElPIFBvcnRzLg0KKw0KKyAg QHBhcmFtW2luXSBQb3NzaWJsZUNwdUNvdW50ICBUaGUgbnVtYmVyIG9mIHBvc3NpYmxlIENQVXMg aW4gdGhlIHN5c3RlbS4gTXVzdA0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBiZSBw b3NpdGl2ZS4NCisNCisgIEBwYXJhbVtpbl0gQXBpY0lkQ291bnQgICAgICAgVGhlIG51bWJlciBv ZiBlbGVtZW50cyBlYWNoIG9uZSBvZiB0aGUNCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgUGx1Z2dlZEFwaWNJZHMgYW5kIFRvVW5wbHVnQXBpY0lkcyBhcnJheXMgY2FuDQorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgIGFjY29tbW9kYXRlLiBNdXN0IGJlIHBvc2l0aXZlLg0K Kw0KKyAgQHBhcmFtW291dF0gUGx1Z2dlZEFwaWNJZHMgICBUaGUgQVBJQyBJRHMgb2YgdGhlIENQ VXMgdGhhdCBoYXZlIGJlZW4NCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaG90LXBs dWdnZWQuDQorDQorICBAcGFyYW1bb3V0XSBQbHVnZ2VkQ291bnQgICAgIFRoZSBudW1iZXIgb2Yg ZmlsbGVkLWluIEFQSUMgSURzIGluDQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFBs dWdnZWRBcGljSWRzLg0KKw0KKyAgQHBhcmFtW291dF0gVG9VbnBsdWdBcGljSWRzICBUaGUgQVBJ QyBJRHMgb2YgdGhlIENQVXMgdGhhdCBhcmUgYWJvdXQgdG8gYmUNCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgaG90LXVucGx1Z2dlZC4NCisNCisgIEBwYXJhbVtvdXRdIFRvVW5wbHVn Q291bnQgICAgVGhlIG51bWJlciBvZiBmaWxsZWQtaW4gQVBJQyBJRHMgaW4NCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgVG9VbnBsdWdBcGljSWRzLg0KKw0KKyAgQHJldHZhbCBFRklf SU5WQUxJRF9QQVJBTUVURVIgIFBvc3NpYmxlQ3B1Q291bnQgaXMgemVybywgb3IgQXBpY0lkQ291 bnQgaXMNCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB6ZXJvLg0KKw0KKyAgQHJl dHZhbCBFRklfUFJPVE9DT0xfRVJST1IgICAgIEludmFsaWQgYml0bWFwIGRldGVjdGVkIGluIHRo ZQ0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFFFTVVfQ1BVSFBfUl9DUFVfU1RB VCByZWdpc3Rlci4NCisNCisgIEByZXR2YWwgRUZJX0JVRkZFUl9UT09fU01BTEwgICBUaGVyZSB3 YXMgYW4gYXR0ZW1wdCB0byBwbGFjZSBtb3JlIHRoYW4NCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICBBcGljSWRDb3VudCBBUElDIElEcyBpbnRvIG9uZSBvZiB0aGUNCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICBQbHVnZ2VkQXBpY0lkcyBhbmQgVG9VbnBsdWdBcGlj SWRzIGFycmF5cy4NCisNCisgIEByZXR2YWwgRUZJX1NVQ0NFU1MgICAgICAgICAgICBPdXRwdXQg cGFyYW1ldGVycyBoYXZlIGJlZW4gc2V0IHN1Y2Nlc3NmdWxseS4NCisqKi8NCitFRklfU1RBVFVT DQorUWVtdUNwdWhwQ29sbGVjdEFwaWNJZHMgKA0KKyAgSU4gIENPTlNUIEVGSV9NTV9DUFVfSU9f UFJPVE9DT0wgKk1tQ3B1SW8sDQorICBJTiAgVUlOVDMyICAgICAgICAgICAgICAgICAgICAgICBQ b3NzaWJsZUNwdUNvdW50LA0KKyAgSU4gIFVJTlQzMiAgICAgICAgICAgICAgICAgICAgICAgQXBp Y0lkQ291bnQsDQorICBPVVQgQVBJQ19JRCAgICAgICAgICAgICAgICAgICAgICAqUGx1Z2dlZEFw aWNJZHMsDQorICBPVVQgVUlOVDMyICAgICAgICAgICAgICAgICAgICAgICAqUGx1Z2dlZENvdW50 LA0KKyAgT1VUIEFQSUNfSUQgICAgICAgICAgICAgICAgICAgICAgKlRvVW5wbHVnQXBpY0lkcywN CisgIE9VVCBVSU5UMzIgICAgICAgICAgICAgICAgICAgICAgICpUb1VucGx1Z0NvdW50DQorICAp DQorew0KKyAgVUlOVDMyIEN1cnJlbnRTZWxlY3RvcjsNCisNCisgIGlmIChQb3NzaWJsZUNwdUNv dW50ID09IDAgfHwgQXBpY0lkQ291bnQgPT0gMCkgew0KKyAgICByZXR1cm4gRUZJX0lOVkFMSURf UEFSQU1FVEVSOw0KKyAgfQ0KKw0KKyAgKlBsdWdnZWRDb3VudCA9IDA7DQorICAqVG9VbnBsdWdD b3VudCA9IDA7DQorDQorICBDdXJyZW50U2VsZWN0b3IgPSAwOw0KKyAgZG8gew0KKyAgICBVSU5U MzIgIFBlbmRpbmdTZWxlY3RvcjsNCisgICAgVUlOVDggICBDcHVTdGF0dXM7DQorICAgIEFQSUNf SUQgKkV4dGVuZElkczsNCisgICAgVUlOVDMyICAqRXh0ZW5kQ291bnQ7DQorICAgIEFQSUNfSUQg TmV3QXBpY0lkOw0KKw0KKyAgICAvLw0KKyAgICAvLyBXcml0ZSBDdXJyZW50U2VsZWN0b3IgKHdo aWNoIGlzIHZhbGlkKSB0byB0aGUgQ1BVIHNlbGVjdG9yIHJlZ2lzdGVyLg0KKyAgICAvLy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