xen/mem_sharing: wrap hvm_copy_context_and_params() with CONFIG_MEM_SHARING

The only reference of hvm_copy_context_and_params() is in
arch/x86/mm/mem_sharing.c, so it shall be wrapped with CONFIG_MEM_SHARING.
Otherwise it will become unreachable when MEM_SHARING=n, and hence violating
Misra rule 2.1.

Signed-off-by: Penny Zheng <Penny.Zheng@amd.com>
Reviewed-by: Grygorii Strashko <grygorii_strashko@epam.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
This commit is contained in:
Penny Zheng authored and Jan Beulich committed 2025-11-19 10:11:54 +01:00
1 parent 092cec0885
commit 77733db60d
1 file changed
+2
+2
View File
@@ -5458,6 +5458,7 @@ void hvm_set_segment_register(struct vcpu *v, enum x86_segment seg,
alternative_vcall(hvm_funcs.set_segment_register, v, seg, reg);
}
#ifdef CONFIG_MEM_SHARING
int hvm_copy_context_and_params(struct domain *dst, struct domain *src)
{
struct hvm_domain_context c = { .size = hvm_save_size(src) };
@@ -5489,6 +5490,7 @@ int hvm_copy_context_and_params(struct domain *dst, struct domain *src)
return rc;
}
#endif /* CONFIG_MEM_SHARING */
/*
* Local variables:
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.