diff --git a/ntoskrnl/ke/amd64/traphandler.c b/ntoskrnl/ke/amd64/traphandler.c index dc72d08fc63..ef2cb4d7dae 100644 --- a/ntoskrnl/ke/amd64/traphandler.c +++ b/ntoskrnl/ke/amd64/traphandler.c @@ -159,9 +159,8 @@ KiSystemCallHandler( /* We don't have an exception frame yet */ TrapFrame->ExceptionFrame = 0; - /* Before enabling interrupts get the user rsp from the KPCR */ - UserRsp = __readgsqword(FIELD_OFFSET(KIPCR, UserRsp)); - TrapFrame->Rsp = UserRsp; + /* Get the user Stack pointer */ + UserRsp = TrapFrame->Rsp; /* Enable interrupts */ _enable(); diff --git a/ntoskrnl/ke/amd64/usercall.c b/ntoskrnl/ke/amd64/usercall.c index 9bcc81384b4..81f7a81fdfc 100644 --- a/ntoskrnl/ke/amd64/usercall.c +++ b/ntoskrnl/ke/amd64/usercall.c @@ -318,9 +318,6 @@ KeUserModeCallback( /* Restore stack and return */ *UserStackPointer = OldStack; -#ifdef _M_AMD64 // could probably move the update to TrapFrame->Rsp from the C handler to the asm code - __writegsqword(FIELD_OFFSET(KIPCR, UserRsp), OldStack); -#endif return CallbackStatus; }