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.web09.294.1582755149914024946 for ; Wed, 26 Feb 2020 14:12:30 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Lq7ILLhD; 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=1582755149; 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=VHD4trStedmpskio1yA19P1MLbWFojhSpNUErgLsFOE=; b=Lq7ILLhDr7+AZgHXxT/wdKNnYtKPeP6c9W/J1qUIPqxvYvyXGXDBqJsBXNsFbv+x36leyV M/RlCZMlWDAWjhVoKp+XLf27xXiaAbrM3RjqfM9v8FmDt1EaNdWVOxw27tsPYAmxXvE67W fwLenY3GUBWDOuqUxxFEZcPClRHZulw= 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-266-8fUNTNgEPlOTfxLw_V1nwA-1; Wed, 26 Feb 2020 17:12:26 -0500 X-MC-Unique: 8fUNTNgEPlOTfxLw_V1nwA-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 7B9FB1007268; Wed, 26 Feb 2020 22:12:25 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-116-185.ams2.redhat.com [10.36.116.185]) by smtp.corp.redhat.com (Postfix) with ESMTP id C757660BEF; Wed, 26 Feb 2020 22:12:23 +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 v2 10/16] OvmfPkg/CpuHotplugSmm: collect CPUs with events Date: Wed, 26 Feb 2020 23:11:50 +0100 Message-Id: <20200226221156.29589-11-lersek@redhat.com> In-Reply-To: <20200226221156.29589-1-lersek@redhat.com> References: <20200226221156.29589-1-lersek@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 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 QU0gaXMgYW4gb3V0LW9mLWJhbmQgaW5mb3JtYXRpb24KY2hhbm5l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RUZJX01NX1NZU1RFTV9UQUJMRS5NbWlN YW5hZ2UoKS4gRHVlIHRvDQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQ3B1SG90 cGx1Z01taSgpIGJlaW5nIGEgcm9vdCBNTUkgaGFuZGxlciwNCiAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICBDb250ZXh0IGlzIEFTU0VSVCgpZWQgdG8gYmUgTlVMTC4NCiANCiAgIEBw YXJhbVtpbixvdXRdIENvbW1CdWZmZXIgICAgICBJZ25vcmVkLCBkdWUgdG8gQ3B1SG90cGx1Z01t aSgpIGJlaW5nIGEgcm9vdA0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE1NSSBo YW5kbGVyLg0KIA0KICAgQHBhcmFtW2luLG91dF0gQ29tbUJ1ZmZlclNpemUgIElnbm9yZWQsIGR1 ZSB0byBDcHVIb3RwbHVnTW1pKCkgYmVpbmcgYSByb290DQpAQCAtNjUsMTYyICs5NSwyMzkgQEAg U1RBVElDIEVGSV9IQU5ETEUgbURpc3BhdGNoSGFuZGxlOwogICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgIGJ1dCBvdGhlciBoYW5kbGVycyBzaG91bGQgc3RpbGwN CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYmUgY2FsbGVk Lg0KIA0KICAgQHJldHZhbCBFRklfV0FSTl9JTlRFUlJVUFRfU09VUkNFX1BFTkRJTkcgICBUaGUg TU1JIHNvdXJjZSBpcyBzdGlsbCBwZW5kaW5nLA0KICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICBhbmQgb3RoZXIgaGFuZGxlcnMgc2hvdWxkIHN0aWxsDQogICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJlIGNhbGxlZC4NCiAN CiAgIEByZXR2YWwgRUZJX0lOVEVSUlVQVF9QRU5ESU5H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