x86/ept: fix shattering of special pages
authorRoger Pau Monne <roger.pau@citrix.com>
Thu, 30 Jun 2022 16:34:49 +0000 (18:34 +0200)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Thu, 30 Jun 2022 17:07:13 +0000 (18:07 +0100)
commit60d1adfa18793f4ddb70c8e901562d8d3e9be3dc
treeeba4c7f83f02362e8df5cc531f777e9a4f7914c8
parentfef244b179c06fcdfa581f7d57fa6e578c49ff50
x86/ept: fix shattering of special pages

The current logic in epte_get_entry_emt() will split any page marked
as special with order greater than zero, without checking whether the
super page is all special.

Fix this by only splitting the page only if it's not all marked as
special, in order to prevent unneeded super page shuttering.

The unconditional special super page shattering has caused a
performance regression on some XenServer GPU pass through workloads.

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Kevin Tian <kevin.tian@intel.com>
xen/arch/x86/mm/p2m-ept.c