lkml.org 
[lkml]   [2021]   [Oct]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH V3 22/49] x86/entry: Don't call error_entry for XENPV
    Date
    From: Lai Jiangshan <laijs@linux.alibaba.com>

    When in XENPV, it is already in the task stack, and it can't fault
    at native_irq_return_iret nor asm_load_gs_index_gs_change since
    XENPV uses its own pvops for iret and load_gs_index(). And it
    doesn't need to switch CR3. So it can skip invoking error_entry().

    Signed-off-by: Lai Jiangshan <laijs@linux.alibaba.com>
    ---
    arch/x86/entry/entry_64.S | 13 +++++++++++--
    1 file changed, 11 insertions(+), 2 deletions(-)

    diff --git a/arch/x86/entry/entry_64.S b/arch/x86/entry/entry_64.S
    index 52a08c4a0171..9bad620553c8 100644
    --- a/arch/x86/entry/entry_64.S
    +++ b/arch/x86/entry/entry_64.S
    @@ -326,8 +326,17 @@ SYM_CODE_END(ret_from_fork)
    PUSH_AND_CLEAR_REGS
    ENCODE_FRAME_POINTER

    - call error_entry
    - movq %rax, %rsp /* switch stack settled by sync_regs() */
    + /*
    + * Call error_entry and switch stack settled by sync_regs().
    + *
    + * When in XENPV, it is already in the task stack, and it can't fault
    + * at native_irq_return_iret nor asm_load_gs_index_gs_change since
    + * XENPV uses its own pvops for iret and load_gs_index(). And it
    + * doesn't need to switch CR3. So it can skip invoking error_entry().
    + */
    + ALTERNATIVE "call error_entry; movq %rax, %rsp", \
    + "", X86_FEATURE_XENPV
    +
    ENCODE_FRAME_POINTER
    UNWIND_HINT_REGS

    --
    2.19.1.6.gb485710b
    \
     
     \ /
      Last update: 2021-10-14 05:36    [W:2.508 / U:0.228 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site