Print this page
11787 Kernel needs to be built with retpolines
11788 Kernel needs to generally use RSB stuffing
Reviewed by: Jerry Jelinek <jerry.jelinek@joyent.com>
Reviewed by: John Levon <john.levon@joyent.com>
@@ -19,14 +19,13 @@
* CDDL HEADER END
*/
/*
* Copyright 2007 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
+ * Copyright 2019 Joyent, Inc.
*/
-#pragma ident "%Z%%M% %I% %E% SMI"
-
#include <sys/asm_linkage.h>
#include <sys/asm_misc.h>
#include <sys/regset.h>
#include <sys/psw.h>
@@ -99,11 +98,12 @@
#if defined(__amd64)
.globl gethrtimef
ENTRY_NP(get_hrtime)
FAST_INTR_PUSH
- call *gethrtimef(%rip)
+ movq gethrtimef(%rip), %rax
+ INDIRECT_CALL_REG(rax)
movq %rax, %rdx
shrq $32, %rdx /* high 32-bit in %edx */
FAST_INTR_POP
FAST_INTR_RETURN
SET_SIZE(get_hrtime)
@@ -125,11 +125,12 @@
.globl gethrestimef
ENTRY_NP(get_hrestime)
FAST_INTR_PUSH
subq $TIMESPEC_SIZE, %rsp
movq %rsp, %rdi
- call *gethrestimef(%rip)
+ movq gethrestimef(%rip), %rax
+ INDIRECT_CALL_REG(rax)
movl (%rsp), %eax
movl CLONGSIZE(%rsp), %edx
addq $TIMESPEC_SIZE, %rsp
FAST_INTR_POP
FAST_INTR_RETURN