|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-changelog] [xen master] x86/shadow: use shorter constants for callback masks
commit 7977148feee792f79d3d07b27aedb0ef69cdb4c9
Author: Jan Beulich <jbeulich@xxxxxxxx>
AuthorDate: Thu Jan 29 13:46:09 2015 +0000
Commit: Tim Deegan <tim@xxxxxxx>
CommitDate: Thu Jan 29 13:46:17 2015 +0000
x86/shadow: use shorter constants for callback masks
private.h defining them I can't see why they couldn't be used here to
make the code easier to read.
Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
Reviewed-by: Tim Deegan <tim@xxxxxxx>
---
xen/arch/x86/mm/shadow/common.c | 40 ++++++++++++++++++--------------------
1 files changed, 19 insertions(+), 21 deletions(-)
diff --git a/xen/arch/x86/mm/shadow/common.c b/xen/arch/x86/mm/shadow/common.c
index 64c5a28..e6bcdcd 100644
--- a/xen/arch/x86/mm/shadow/common.c
+++ b/xen/arch/x86/mm/shadow/common.c
@@ -2163,12 +2163,12 @@ int sh_remove_write_access(struct vcpu *v, mfn_t gmfn,
};
static const unsigned int callback_mask =
- 1 << SH_type_l1_32_shadow
- | 1 << SH_type_fl1_32_shadow
- | 1 << SH_type_l1_pae_shadow
- | 1 << SH_type_fl1_pae_shadow
- | 1 << SH_type_l1_64_shadow
- | 1 << SH_type_fl1_64_shadow
+ SHF_L1_32
+ | SHF_FL1_32
+ | SHF_L1_PAE
+ | SHF_FL1_PAE
+ | SHF_L1_64
+ | SHF_FL1_64
;
struct page_info *pg = mfn_to_page(gmfn);
@@ -2413,12 +2413,12 @@ int sh_remove_all_mappings(struct vcpu *v, mfn_t gmfn)
};
static const unsigned int callback_mask =
- 1 << SH_type_l1_32_shadow
- | 1 << SH_type_fl1_32_shadow
- | 1 << SH_type_l1_pae_shadow
- | 1 << SH_type_fl1_pae_shadow
- | 1 << SH_type_l1_64_shadow
- | 1 << SH_type_fl1_64_shadow
+ SHF_L1_32
+ | SHF_FL1_32
+ | SHF_L1_PAE
+ | SHF_FL1_PAE
+ | SHF_L1_64
+ | SHF_FL1_64
;
perfc_incr(shadow_mappings);
@@ -2558,20 +2558,18 @@ void sh_remove_shadows(struct vcpu *v, mfn_t gmfn, int
fast, int all)
/* Another lookup table, for choosing which mask to use */
static const unsigned int masks[SH_type_unused] = {
0, /* none */
- 1 << SH_type_l2_32_shadow, /* l1_32 */
+ SHF_L2_32, /* l1_32 */
0, /* fl1_32 */
0, /* l2_32 */
- ((1 << SH_type_l2h_pae_shadow)
- | (1 << SH_type_l2_pae_shadow)), /* l1_pae */
+ SHF_L2H_PAE | SHF_L2_PAE, /* l1_pae */
0, /* fl1_pae */
0, /* l2_pae */
0, /* l2h_pae */
- ((1 << SH_type_l2h_64_shadow)
- | (1 << SH_type_l2_64_shadow)), /* l1_64 */
+ SHF_L2H_64 | SHF_L2_64, /* l1_64 */
0, /* fl1_64 */
- 1 << SH_type_l3_64_shadow, /* l2_64 */
- 1 << SH_type_l3_64_shadow, /* l2h_64 */
- 1 << SH_type_l4_64_shadow, /* l3_64 */
+ SHF_L3_64, /* l2_64 */
+ SHF_L3_64, /* l2h_64 */
+ SHF_L4_64, /* l3_64 */
0, /* l4_64 */
0, /* p2m */
0 /* unused */
@@ -2701,7 +2699,7 @@ void sh_reset_l3_up_pointers(struct vcpu *v)
NULL, /* p2m */
NULL /* unused */
};
- static const unsigned int callback_mask = 1 << SH_type_l3_64_shadow;
+ static const unsigned int callback_mask = SHF_L3_64;
hash_foreach(v, callback_mask, callbacks, _mfn(INVALID_MFN));
}
--
generated by git-patchbot for /home/xen/git/xen.git#master
_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |