]> xenbits.xensource.com Git - xen.git/commit
x86/EPT: avoid marking non-present entries for re-configuring
authorJan Beulich <jbeulich@suse.com>
Thu, 13 Jun 2024 14:54:17 +0000 (16:54 +0200)
committerJan Beulich <jbeulich@suse.com>
Thu, 13 Jun 2024 14:54:17 +0000 (16:54 +0200)
commit777c71d31325bc55ba1cc3f317d4155fe519ab0b
treefedefcd03bccc34a43a4813fc54e95ae4d29810d
parent5540b94e8191059eb9cbbe98ac316232a42208f6
x86/EPT: avoid marking non-present entries for re-configuring

For non-present entries EMT, like most other fields, is meaningless to
hardware. Make the logic in ept_set_entry() setting the field (and iPAT)
conditional upon dealing with a present entry, leaving the value at 0
otherwise. This has two effects for epte_get_entry_emt() which we'll
want to leverage subsequently:
1) The call moved here now won't be issued with INVALID_MFN anymore (a
   respective BUG_ON() is being added).
2) Neither of the other two calls could now be issued with a truncated
   form of INVALID_MFN anymore (as long as there's no bug anywhere
   marking an entry present when that was populated using INVALID_MFN).

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
Release-Acked-By: Oleksii Kurochko <oleksii.kurochko@gmail.com>
xen/arch/x86/mm/p2m-ept.c