mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 18:50:05 +01:00
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:
1 parent
092cec0885
commit
77733db60d
1 file changed
+2
@@ -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:
|
||||
|
||||