x86/shadow: don't open-code SHF_* shorthands

Use SHF_L1_ANY, SHF_32, SHF_PAE, as well as SHF_64, and introduce
SHF_FL1_ANY.

Note that in shadow_audit_tables() this has the effect of no longer
(I assume mistakenly, or else I don't see why the respective callback
table entry isn't NULL) excluding SHF_L2H_64.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Tim Deegan <tim@xen.org>
This commit is contained in:
Jan Beulich committed 2021-04-12 12:32:18 +02:00
1 parent b49f8bda23
commit 099fcfb037
2 files changed
+6 -21

No files matched your search

+5 -21
View File
@@ -1834,14 +1834,7 @@ int sh_remove_write_access(struct domain *d, mfn_t gmfn,
NULL /* unused */
};
static const unsigned int callback_mask =
SHF_L1_32
| SHF_FL1_32
| SHF_L1_PAE
| SHF_FL1_PAE
| SHF_L1_64
| SHF_FL1_64
;
static const unsigned int callback_mask = SHF_L1_ANY | SHF_FL1_ANY;
struct page_info *pg = mfn_to_page(gmfn);
#if SHADOW_OPTIMIZATIONS & SHOPT_WRITABLE_HEURISTIC
struct vcpu *curr = current;
@@ -2065,14 +2058,7 @@ int sh_remove_all_mappings(struct domain *d, mfn_t gmfn, gfn_t gfn)
NULL /* unused */
};
static const unsigned int callback_mask =
SHF_L1_32
| SHF_FL1_32
| SHF_L1_PAE
| SHF_FL1_PAE
| SHF_L1_64
| SHF_FL1_64
;
static const unsigned int callback_mask = SHF_L1_ANY | SHF_FL1_ANY;
perfc_incr(shadow_mappings);
if ( sh_check_page_has_no_refs(page) )
@@ -3424,11 +3410,9 @@ void shadow_audit_tables(struct vcpu *v)
/* Audit only the current mode's tables */
switch ( v->arch.paging.mode->guest_levels )
{
case 2: mask = (SHF_L1_32|SHF_FL1_32|SHF_L2_32); break;
case 3: mask = (SHF_L1_PAE|SHF_FL1_PAE|SHF_L2_PAE
|SHF_L2H_PAE); break;
case 4: mask = (SHF_L1_64|SHF_FL1_64|SHF_L2_64
|SHF_L3_64|SHF_L4_64); break;
case 2: mask = SHF_32; break;
case 3: mask = SHF_PAE; break;
case 4: mask = SHF_64; break;
default: BUG();
}
}
+1
View File
@@ -269,6 +269,7 @@ static inline void sh_terminate_list(struct page_list_head *tmp_list)
#define SHF_64 (SHF_L1_64|SHF_FL1_64|SHF_L2_64|SHF_L2H_64|SHF_L3_64|SHF_L4_64)
#define SHF_L1_ANY (SHF_L1_32|SHF_L1_PAE|SHF_L1_64)
#define SHF_FL1_ANY (SHF_FL1_32|SHF_FL1_PAE|SHF_FL1_64)
#if (SHADOW_OPTIMIZATIONS & SHOPT_OUT_OF_SYNC)
/* Marks a guest L1 page table which is shadowed but not write-protected.
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.