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

[Xen-devel] [PATCH 16/34] x86/hvm: enclose hvm_enabled and hvm_funcs in CONFIG_HVM



This helps to take advantage of dead code elimination. Turn
hvm_enabled into proper bool while at it.

Providing an empty hvm_funcs resolves a lot of undefined references to
it in the header. It is safe to do so because those functions / macros
are not expected to be used.

Signed-off-by: Wei Liu <wei.liu2@xxxxxxxxxx>
---
 xen/include/asm-x86/hvm/hvm.h | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/xen/include/asm-x86/hvm/hvm.h b/xen/include/asm-x86/hvm/hvm.h
index 146720c..b3bc8d2 100644
--- a/xen/include/asm-x86/hvm/hvm.h
+++ b/xen/include/asm-x86/hvm/hvm.h
@@ -234,8 +234,14 @@ struct hvm_function_table {
     } tsc_scaling;
 };
 
+#if CONFIG_HVM
+extern bool hvm_enabled;
 extern struct hvm_function_table hvm_funcs;
-extern bool_t hvm_enabled;
+#else
+#define hvm_enabled false
+static struct hvm_function_table hvm_funcs = {};
+#endif
+
 extern s8 hvm_port80_allowed;
 
 extern const struct hvm_function_table *start_svm(void);
-- 
git-series 0.9.1

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

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