diff --git a/arch/x86/core/userspace.c b/arch/x86/core/userspace.c index 09e7945303d..7ad77166b0f 100644 --- a/arch/x86/core/userspace.c +++ b/arch/x86/core/userspace.c @@ -134,7 +134,7 @@ FUNC_NORETURN void arch_user_mode_enter(k_thread_entry_t user_entry, stack_start = POINTER_TO_UINT(_current->stack_obj); stack_size = K_THREAD_STACK_LEN(_current->stack_info.size); -#if defined(CONFIG_HW_STACK_PROTECTION) +#if defined(CONFIG_X86_STACK_PROTECTION) /* With hardware stack protection, the first page of stack * is a guard page. So need to skip it. */ diff --git a/arch/x86/gen_gdt.py b/arch/x86/gen_gdt.py index a65586a56f8..5794a965a02 100755 --- a/arch/x86/gen_gdt.py +++ b/arch/x86/gen_gdt.py @@ -185,7 +185,7 @@ def main(): # fault exception handling if "CONFIG_USERSPACE" in syms: num_entries = 7 - elif "CONFIG_HW_STACK_PROTECTION" in syms: + elif "CONFIG_X86_STACK_PROTECTION" in syms: num_entries = 5 else: num_entries = 3 diff --git a/arch/x86/include/x86_mmu.h b/arch/x86/include/x86_mmu.h index b5b319a64e4..0328e98d735 100644 --- a/arch/x86/include/x86_mmu.h +++ b/arch/x86/include/x86_mmu.h @@ -120,7 +120,7 @@ void z_x86_pentry_get(int *paging_level, pentry_t *val, pentry_t *ptables, void z_x86_dump_page_tables(pentry_t *ptables); #endif /* CONFIG_EXCEPTION_DEBUG */ -#ifdef CONFIG_HW_STACK_PROTECTION +#ifdef CONFIG_X86_STACK_PROTECTION /* Legacy function - set identity-mapped MMU stack guard page to RO in the * kernel's page tables to prevent writes and generate an exception */ diff --git a/include/zephyr/arch/x86/ia32/arch.h b/include/zephyr/arch/x86/ia32/arch.h index bd6ae1ed040..8e85ccaea11 100644 --- a/include/zephyr/arch/x86/ia32/arch.h +++ b/include/zephyr/arch/x86/ia32/arch.h @@ -45,7 +45,7 @@ */ #if defined(CONFIG_USERSPACE) #define GS_TLS_SEG (0x38 | 0x03) -#elif defined(CONFIG_HW_STACK_PROTECTION) +#elif defined(CONFIG_X86_STACK_PROTECTION) #define GS_TLS_SEG (0x28 | 0x03) #else #define GS_TLS_SEG (0x18 | 0x03) diff --git a/include/zephyr/arch/x86/ia32/scripts/shared_kernel_pages.ld b/include/zephyr/arch/x86/ia32/scripts/shared_kernel_pages.ld index 5d104e403ac..50dfb4f7abc 100644 --- a/include/zephyr/arch/x86/ia32/scripts/shared_kernel_pages.ld +++ b/include/zephyr/arch/x86/ia32/scripts/shared_kernel_pages.ld @@ -41,7 +41,7 @@ #ifdef CONFIG_USERSPACE #define GDT_NUM_ENTRIES 7 -#elif defined(CONFIG_HW_STACK_PROTECTION) +#elif defined(CONFIG_X86_STACK_PROTECTION) #define GDT_NUM_ENTRIES 5 #else #define GDT_NUM_ENTRIES 3 diff --git a/include/zephyr/arch/x86/thread_stack.h b/include/zephyr/arch/x86/thread_stack.h index a92b04846d4..6602d85784c 100644 --- a/include/zephyr/arch/x86/thread_stack.h +++ b/include/zephyr/arch/x86/thread_stack.h @@ -14,7 +14,7 @@ #define ARCH_STACK_PTR_ALIGN 4UL #endif -#if defined(CONFIG_HW_STACK_PROTECTION) || defined(CONFIG_USERSPACE) +#if defined(CONFIG_X86_STACK_PROTECTION) || defined(CONFIG_USERSPACE) #define Z_X86_STACK_BASE_ALIGN CONFIG_MMU_PAGE_SIZE #else #define Z_X86_STACK_BASE_ALIGN ARCH_STACK_PTR_ALIGN @@ -62,7 +62,7 @@ * privileged mode stack. */ struct z_x86_thread_stack_header { -#ifdef CONFIG_HW_STACK_PROTECTION +#ifdef CONFIG_X86_STACK_PROTECTION char guard_page[CONFIG_MMU_PAGE_SIZE]; #endif #ifdef CONFIG_USERSPACE @@ -78,7 +78,7 @@ struct z_x86_thread_stack_header { #define ARCH_THREAD_STACK_RESERVED \ sizeof(struct z_x86_thread_stack_header) -#ifdef CONFIG_HW_STACK_PROTECTION +#ifdef CONFIG_X86_STACK_PROTECTION #define ARCH_KERNEL_STACK_RESERVED CONFIG_MMU_PAGE_SIZE #define ARCH_KERNEL_STACK_OBJ_ALIGN CONFIG_MMU_PAGE_SIZE #else