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.web12.2678.1578612320667750791 for ; Thu, 09 Jan 2020 15:25:20 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=IMDRCpiS; 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=1578612319; 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=dh9A7t1HRzh1nLntFm7dA+PjevisiRrZh6FZsAqePW8=; b=IMDRCpiSZQK4EX6kovNH8fLhA78g2Ovx8KL6aqD+N3Y4EW88nOlJ14X9uVg1FbdONq8PiD 4VanHhdyGlsAggUyXsRK3Uy0gBkW4Q+I5Mwz/aUzrtPCS36TQR3KShEza8NMYd8tQupr33 bzwyMLrm6UK9dp+OsBTF3phGCtFLD00= 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-426-GhXoxcAaNSir4VdGzJYHog-1; Thu, 09 Jan 2020 18:25:16 -0500 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 83885100550E; Thu, 9 Jan 2020 23:25:15 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (unknown [10.36.118.145]) by smtp.corp.redhat.com (Postfix) with ESMTP id 72FDC7C3D1; Thu, 9 Jan 2020 23:25:14 +0000 (UTC) From: "Laszlo Ersek" To: edk2-devel-groups-io Cc: Eric Dong , Ray Ni Subject: [PATCH] UefiCpuPkg/PiSmmCpuDxeSmm: fix 2M->4K page splitting regression for PDEs Date: Fri, 10 Jan 2020 00:25:12 +0100 Message-Id: <20200109232512.11022-1-lersek@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-MC-Unique: GhXoxcAaNSir4VdGzJYHog-1 X-Mimecast-Spam-Score: 0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: base64 SW4gY29tbWl0IDRlZWUwY2M3Y2MwZCAoIlVlZmlDcHVQa2cvUGlTbW1DcHU6IEVuYWJsZSA1IGxl dmVsIHBhZ2luZyB3aGVuCkNQVSBzdXBwb3J0cyIsIDIwMTktMDctMTIpLCB0aGUgUGFnZSBEaXJl Y3RvcnkgRW50cnkgc2V0dGluZyB3YXMgcmVncmVzc2VkCihjb3JydXB0ZWQpIHdoZW4gc3BsaXR0 aW5nIGEgMk1CIHBhZ2UgdG8gNTEyIDRLQiBwYWdlcywgaW4gdGhlCkluaXRQYWdpbmcoKSBmdW5j dGlvbi4KCkNvbnNpZGVyIHRoZSBmb2xsb3dpbmcgaHVuaywgZGlzcGxheWVkIHdpdGgKCiQgZ2l0 IHNob3cgLS1mdW5jdGlvbi1jb250ZXh0IC0taWdub3JlLXNwYWNlLWNoYW5nZSA0ZWVlMGNjN2Nj MGRiCgo+ICAgICAgICAgICAgLy8KPiAgICAgICAgICAgIC8vIElmIGl0IGlzIDJNIHBhZ2UsIGNo ZWNrIElzQWRkcmVzc1NwbGl0KCkKPiAgICAgICAgICAgIC8vCj4gICAgICAgICAgICBpZiAoKCgq UGQgJiBJQTMyX1BHX1BTKSAhPSAwKSAmJiBJc0FkZHJlc3NTcGxpdCAoQWRkcmVzcykpIHsKPiAg ICAgICAgICAgICAgLy8KPiAgICAgICAgICAgICAgLy8gQmFzZWQgb24gY3VycmVudCBwYWdlIHRh YmxlLCBjcmVhdGUgNEtCIHBhZ2UgdGFibGUgZm9yIHNwbGl0IGFyZWEuCj4gICAgICAgICA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