Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion executor/common_kvm_amd64_syzos.h
Original file line number Diff line number Diff line change
Expand Up @@ -1151,7 +1151,10 @@ guest_handle_nested_load_code(struct api_call_nested_load_code* cmd, uint64 cpu_
}
}

GUEST_CODE static noinline void
// Clang's LTO may ignore noinline and attempt to inline this function into both callers,
// which results in duplicate declaration of after_vmentry_label.
// Applying __optnone should prevent this behavior.
GUEST_CODE static noinline __optnone void
guest_handle_nested_vmentry_intel(uint64 vm_id, uint64 cpu_id, bool is_launch)
{
uint64 vmx_error_code = 0;
Expand Down
11 changes: 10 additions & 1 deletion executor/common_kvm_syzos.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,19 @@
#define __addrspace_guest
#endif

// Disable optimizations for a particular function.
#if defined(__clang__)
#define __optnone __attribute__((optnone))
#elif defined(__GNUC__)
#define __optnone __attribute__((optimize("O0")))
#else
#define __optnone
#endif

// Host will map the code in this section into the guest address space.
#define GUEST_CODE __attribute__((section("guest"))) __no_stack_protector __addrspace_guest

// Start/end of the guest section.
extern char *__start_guest, *__stop_guest;

#endif // EXECUTOR_COMMON_KVM_SYZOS_H
#endif // EXECUTOR_COMMON_KVM_SYZOS_H