x86/shadow: Move GUEST_PTE_SIZE defines into types.h
PATCH 1/1 x86/shadow: Move GUEST_PTE_SIZE defines into types.h
GUEST_PTE_SIZE are only used by multi.c, but private.h gets used by code that doesn't have GUEST_PAGING_LEVELS defined. Eclair notes that this is a violation of MISRA Rule 20.9.
Move it into types.h with the rest of the level-dependent logic lives.
No functional change.
---
CC: Jan Beulich <[email protected]>
CC: Roger Pau Monné <[email protected]>
CC: Stefano Stabellini <[email protected]>
CC: [email protected] <[email protected]>
CC: Nicola Vetrini <[email protected]>
--- xen/arch/x86/mm/shadow/private.h | 7 ------- xen/arch/x86/mm/shadow/types.h | 7 +++++++ 2 files changed, 7 insertions(+), 7 deletions(-)
xen/arch/x86/mm/shadow/private.h +0 -7
@@ -121,13 +121,6 @@ enum { }; -/* Size (in bytes) of a guest PTE */ -#if GUEST_PAGING_LEVELS >=3 -# define GUEST_PTE_SIZE 8 -#else -# define GUEST_PTE_SIZE 4 -#endif -/****************************************************************************** * Auditing routines */
xen/arch/x86/mm/shadow/types.h +7 -0
@@ -18,6 +18,13 @@#define SHADOW_PAGING_LEVELS 3#endif +/* Size (in bytes) of a guest PTE */ +#if GUEST_PAGING_LEVELS >=3 +# define GUEST_PTE_SIZE 8 +#else +# define GUEST_PTE_SIZE 4 +#endif +/* * Define various types for handling pagetabels, based on these options: * SHADOW_PAGING_LEVELS : Number of levels of shadow pagetables
Signature · 1 line
2.39.5
Quoted 9 lines · Andrew Cooper
GUEST_PTE_SIZEare only used bymulti.c, butprivate.hgets used by code that doesn't haveGUEST_PAGING_LEVELSdefined. Eclair notes that this is a violation of MISRA Rule 20.9.Move it into
types.hwith the rest of the level-dependent logic lives.No functional change.
Signed-off-by Andrew Cooper <[email protected]>
Quoted 9 lines · Andrew Cooper
GUEST_PTE_SIZEare only used bymulti.c, butprivate.hgets used by code that doesn't haveGUEST_PAGING_LEVELSdefined. Eclair notes that this is a violation of MISRA Rule 20.9.Move it into
types.hwith the rest of the level-dependent logic lives.No functional change.
Signed-off-by Andrew Cooper <[email protected]>
Okay with me, yet I wonder if we shouldn't go a step further and simply drop the constant, replacing uses of it by sizeof(guest_intpte_t).
Jan