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.web10.3165.1596048750558391097 for ; Wed, 29 Jul 2020 11:52:30 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=CqW8M4Vb; 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=1596048749; 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; bh=cbWE+V2z2AML1we3bnDSweajY6u058MREct1ZEOuWNE=; b=CqW8M4Vb5NrCab+EOgCSaguhCREsUfCEwbHK6KdFPOiiwLAFYfqNrSQr0V1BRseXonslV7 dypl2WvSD88S9ne0CrMcHPjzGFrMf6otg3JEt9Zq0AXcax5xb85fgWeEndfIVUqExm/IwG Umc9UERNLVH6p8scBXHV2DlGEdQ9oGs= 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-240-PR4-7nMQMS-ST3cvtk2Ojw-1; Wed, 29 Jul 2020 14:52:21 -0400 X-MC-Unique: PR4-7nMQMS-ST3cvtk2Ojw-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 547AD800685; Wed, 29 Jul 2020 18:52:20 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-114-234.ams2.redhat.com [10.36.114.234]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1A23C1C6; Wed, 29 Jul 2020 18:52:18 +0000 (UTC) From: "Laszlo Ersek" To: edk2-devel-groups-io Cc: Eric Dong , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Rahul Kumar , Ray Ni Subject: [PATCH] UefiCpuPkg/PiSmmCpuDxeSmm: pause in WaitForSemaphore() before re-fetch Date: Wed, 29 Jul 2020 20:52:17 +0200 Message-Id: <20200729185217.10084-1-lersek@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: base64 TW9zdCBidXN5IHdhaXRzIChzcGlubG9ja3MpIGluICJVZWZpQ3B1UGtnL1BpU21tQ3B1RHhlU21t L01wU2VydmljZS5jIgphbHJlYWR5IGNhbGwgQ3B1UGF1c2UoKSBpbiB0aGVpciBsb29wIGJvZGll czsgc2VlIFNtbVdhaXRGb3JBcEFycml2YWwoKSwKQVBIYW5kbGVyKCksIGFuZCBTbWlSZW5kZXp2 b3VzKCkuIEhvd2V2ZXIsIHRoZSAibWFpbiB3YWl0IiB3aXRoaW4KQVBIYW5kbGVyKCk6Cgo+ICAg ICAvLwo+ICAgICAvLyBXYWl0IGZvciBzb21ldGhpbmcgdG8gaGFwcGVuCj4gICAgIC8vCj4gICAg IFdhaXRGb3JTZW1hcGhvcmUgKG1TbW1NcFN5bmNEYXRhLT5DcHVEYXRhW0NwdUluZGV4XS5SdW4p OwoKZG9lc24ndCBkbyBzbywgYXMgV2FpdEZvclNlbWFwaG9yZSgpIGtlZXBzIHRyeWluZyB0byBh Y3F1aXJlIHRoZSBzZW1hcGhvcmUKd2l0aG91dCBwYXVzaW5nLgoKVGhlIHBlcmZvcm1hbmNlIGlt cGFjdCBpcyBlc3BlY2lhbGx5IG5vdGFibGUgaW4gUUVNVS9LVk0gKyBPVk1GCnZpcnR1YWxpemF0 aW9uIHdpdGggQ1BVIG92ZXJjb21taXQgKHRoYXQgaXMsIHdoZW4gdGhlIGd1ZXN0IGhhcwpzaWd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wgNyBkZWxldGlvbnMo LSkKCmRpZmYgLS1naXQgYS9VZWZpQ3B1UGtnL1BpU21tQ3B1RHhlU21tL01wU2VydmljZS5jIGIv VWVmaUNwdVBrZy9QaVNtbUNwdUR4ZVNtbS9NcFNlcnZpY2UuYwppbmRleCA1N2U3ODhjMDFiMWYu LjRiY2QyMTc5MTdkNyAxMDA2NDQKLS0tIGEvVWVmaUNwdVBrZy9QaVNtbUNwdUR4ZVNtbS9NcFNl cnZpY2UuYworKysgYi9VZWZpQ3B1UGtnL1BpU21tQ3B1RHhlU21tL01wU2VydmljZS5jCkBAIC00 MCwxNCArNDAsMTggQEAgV2FpdEZvclNlbWFwaG9yZSAoCiB7DQogICBVSU5UMzIgICAgICAgICAg ICAgICAgICAgICAgICAgICAgVmFsdWU7DQogDQotICBkbyB7DQorICBmb3IgKDs7KSB7DQogICAg IFZhbHVlID0gKlNlbTsNCi0gIH0gd2hpbGUgKFZhbHVlID09IDAgfHwNCi0gICAgICAgICAgIElu dGVybG9ja2VkQ29tcGFyZUV4Y2hhbmdlMzIgKA0KLSAgICAgICAgICAgICAoVUlOVDMyKilTZW0s DQotICAgICAgICAgICAgIFZhbHVlLA0KLSAgICAgICAgICAgICBWYWx1ZSAtIDENCi0gICAgICAg ICAgICAgKSAhPSBWYWx1ZSk7DQorICAgIGlmIChWYWx1ZSAhPSAwICYmDQorICAgICAgICBJbnRl cmxvY2tlZENvbXBhcmVFeGNoYW5nZTMyICgNCisgICAgICAgICAgKFVJTlQzMiopU2VtLA0KKyAg ICAgICAgICBWYWx1ZSwNCisgICAgICAgICAgVmFsdWUgLSAxDQorICAgICAgICAgICkgPT0gVmFs dWUpIHsNCisgICAgICBicmVhazsNCisgICAgfQ0KKyAgICBDcHVQYXVzZSAoKTsNCisgIH0NCiAg IHJldHVybiBWYWx1ZSAtIDE7DQogfQ0KIA0KLS0gCjIuMTkuMS4zLmczMDI0N2FhNWQyMDEKCg==