x86/shadow: eliminate unused forms of sh_map_and_validate_gl<N>e()

The L2H, L3, and L4 forms only have GUEST_PAGING_LEVELS=4 call sites, i.e.
their 2- and 3-level forms are unreachable, violating Misra rule 2.1. The
L2H form additionally is unused (call site DCE-d) with PV32=n.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Roger Pau Monné <roger@xenproject.org>
This commit is contained in:
Jan Beulich committed 2026-09-11 08:53:19 +02:00
1 parent 4fcd42a958
commit 7fc89f9649
1 file changed
+5 -12
+5 -12
View File
@@ -1789,35 +1789,30 @@ sh_map_and_validate(struct vcpu *v, mfn_t gmfn,
return result;
}
#if GUEST_PAGING_LEVELS >= 4
int
sh_map_and_validate_gl4e(struct vcpu *v, mfn_t gl4mfn,
void *new_gl4p, u32 size)
{
#if GUEST_PAGING_LEVELS >= 4
return sh_map_and_validate(v, gl4mfn, new_gl4p, size,
SH_type_l4_shadow,
shadow_l4_index,
validate_gl4e);
#else // ! GUEST_PAGING_LEVELS >= 4
BUG(); /* Called in wrong paging mode! */
#endif
}
int
sh_map_and_validate_gl3e(struct vcpu *v, mfn_t gl3mfn,
void *new_gl3p, u32 size)
{
#if GUEST_PAGING_LEVELS >= 4
return sh_map_and_validate(v, gl3mfn, new_gl3p, size,
SH_type_l3_shadow,
shadow_l3_index,
validate_gl3e);
#else // ! GUEST_PAGING_LEVELS >= 4
BUG(); /* Called in wrong paging mode! */
#endif
}
#endif /* GUEST_PAGING_LEVELS >= 4 */
int
sh_map_and_validate_gl2e(struct vcpu *v, mfn_t gl2mfn,
void *new_gl2p, u32 size)
@@ -1828,19 +1823,17 @@ sh_map_and_validate_gl2e(struct vcpu *v, mfn_t gl2mfn,
validate_gl2e);
}
#if defined(CONFIG_PV32) && GUEST_PAGING_LEVELS >= 4
int
sh_map_and_validate_gl2he(struct vcpu *v, mfn_t gl2mfn,
void *new_gl2p, u32 size)
{
#if GUEST_PAGING_LEVELS >= 4 && defined(CONFIG_PV32)
return sh_map_and_validate(v, gl2mfn, new_gl2p, size,
SH_type_l2h_shadow,
shadow_l2_index,
validate_gl2e);
#else /* Non-PAE guests don't have different kinds of l2 table */
BUG(); /* Called in wrong paging mode! */
#endif
}
#endif /* CONFIG_PV32 && GUEST_PAGING_LEVELS >= 4 */
int
sh_map_and_validate_gl1e(struct vcpu *v, mfn_t gl1mfn,
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.