Skip to content

Commit a3a89ed

Browse files
Andrew Boienashif
authored andcommitted
x86: only use lfence if x86 bcb config enabled
Work around a testcase problem, where we want to check some logic for the bounds check bypass mitigation in the common kernel code. By changing the ifdef to the x86-specific option for these lfence instructions, we avoid IAMCU build errors but still test the common code. Signed-off-by: Andrew Boie <[email protected]>
1 parent e809289 commit a3a89ed

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

arch/x86/core/ia32/userspace.S

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ SECTION_FUNC(TEXT, z_x86_syscall_entry_stub)
199199
jae _bad_syscall
200200

201201
_id_ok:
202-
#ifdef CONFIG_BOUNDS_CHECK_BYPASS_MITIGATION
202+
#ifdef CONFIG_X86_BOUNDS_CHECK_BYPASS_MITIGATION
203203
/* Prevent speculation with bogus system call IDs */
204204
lfence
205205
#endif

arch/x86/core/ia32/x86_mmu.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ int z_arch_buffer_validate(void *addr, size_t size, int write)
162162
}
163163
ret = 0;
164164
out:
165-
#ifdef CONFIG_BOUNDS_CHECK_BYPASS_MITIGATION
165+
#ifdef CONFIG_X86_BOUNDS_CHECK_BYPASS_MITIGATION
166166
__asm__ volatile ("lfence" : : : "memory");
167167
#endif
168168

0 commit comments

Comments
 (0)