[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[xen staging] xen/mem_sharing: wrap hvm_copy_context_and_params() with CONFIG_MEM_SHARING



commit 77733db60d33de27d3ecf7fbb1ef99108991d736
Author:     Penny Zheng <Penny.Zheng@xxxxxxx>
AuthorDate: Wed Nov 19 10:11:54 2025 +0100
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Wed Nov 19 10:11:54 2025 +0100

    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@xxxxxxx>
    Reviewed-by: Grygorii Strashko <grygorii_strashko@xxxxxxxx>
    Acked-by: Jan Beulich <jbeulich@xxxxxxxx>
---
 xen/arch/x86/hvm/hvm.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index f1035fc9f6..0ff242d4a0 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -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:
--
generated by git-patchbot for /home/xen/git/xen.git#staging



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.