diff mbox series

[kvm-unit-tests,v2,5/5] x86: vmx: mark some test_* functions as noinline

Message ID 20210908204541.3632269-6-morbo@google.com (mailing list archive)
State New, archived
Headers show
Series Prevent inlining for asm blocks with labels | expand

Commit Message

Bill Wendling Sept. 8, 2021, 8:45 p.m. UTC
Some test_* functions use inline asm that has labels. Clang decides that
it can inline these functions, which causes the assembler to complain
about duplicate symbols. Mark the functions as "noinline" to prevent
this.

Signed-off-by: Bill Wendling <morbo@google.com>
---
v2: Use "noinline" instead of "__attribute__((noinline)).
---
 x86/vmx.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/x86/vmx.c b/x86/vmx.c
index f0b853a..2a32aa2 100644
--- a/x86/vmx.c
+++ b/x86/vmx.c
@@ -426,7 +426,7 @@  static void prep_flags_test_env(void **vpage, struct vmcs **vmcs, handler *old)
 	*old = handle_exception(PF_VECTOR, &pf_handler);
 }
 
-static void test_read_sentinel(void)
+static noinline void test_read_sentinel(void)
 {
 	void *vpage;
 	struct vmcs *vmcs;
@@ -474,7 +474,7 @@  static void test_vmread_flags_touch(void)
 	test_read_sentinel();
 }
 
-static void test_write_sentinel(void)
+static noinline void test_write_sentinel(void)
 {
 	void *vpage;
 	struct vmcs *vmcs;
@@ -1786,7 +1786,7 @@  static int exit_handler(union exit_reason exit_reason)
  * Tries to enter the guest, populates @result with VM-Fail, VM-Exit, entered,
  * etc...
  */
-static void vmx_enter_guest(struct vmentry_result *result)
+static noinline void vmx_enter_guest(struct vmentry_result *result)
 {
 	memset(result, 0, sizeof(*result));