Print this page
11859 need swapgs mitigation
Reviewed by: Robert Mustacchi <rm@fingolfin.org>
Reviewed by: Dan McDonald <danmcd@joyent.com>
Reviewed by: Jerry Jelinek <jerry.jelinek@joyent.com>
Reviewed by: Robert Mustacchi <rm@fingolfin.org>


   4  * The contents of this file are subject to the terms of the
   5  * Common Development and Distribution License (the "License").
   6  * You may not use this file except in compliance with the License.
   7  *
   8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
   9  * or http://www.opensolaris.org/os/licensing.
  10  * See the License for the specific language governing permissions
  11  * and limitations under the License.
  12  *
  13  * When distributing Covered Code, include this CDDL HEADER in each
  14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15  * If applicable, add the following below this CDDL HEADER, with the
  16  * fields enclosed by brackets "[]" replaced with your own identifying
  17  * information: Portions Copyright [yyyy] [name of copyright owner]
  18  *
  19  * CDDL HEADER END
  20  */
  21 
  22 /*
  23  * Copyright (c) 1993, 2010, Oracle and/or its affiliates. All rights reserved.
  24  * Copyright 2018 Joyent, Inc.
  25  */
  26 
  27 #ifndef _SYS_ARCHSYSTM_H
  28 #define _SYS_ARCHSYSTM_H
  29 
  30 /*
  31  * A selection of ISA-dependent interfaces
  32  */
  33 
  34 #include <vm/seg_enum.h>
  35 #include <vm/page.h>
  36 
  37 #ifdef __cplusplus
  38 extern "C" {
  39 #endif
  40 
  41 #ifdef _KERNEL
  42 
  43 extern greg_t getfp(void);
  44 extern int getpil(void);


  77 extern void int_cmci(void);
  78 
  79 #if defined(__amd64)
  80 extern void sys_syscall(), tr_sys_syscall();
  81 extern void sys_syscall32(), tr_sys_syscall32();
  82 extern void sys_lcall32();
  83 extern void sys_syscall_int();
  84 extern void tr_sys_syscall_int();
  85 extern void brand_sys_syscall(), tr_brand_sys_syscall();
  86 extern void brand_sys_syscall32(), tr_brand_sys_syscall32();
  87 extern void brand_sys_syscall_int(), tr_brand_sys_syscall_int();
  88 extern int update_sregs();
  89 extern void reset_sregs();
  90 #elif defined(__i386)
  91 extern void sys_call();
  92 extern void tr_sys_call();
  93 extern void brand_sys_call();
  94 #endif
  95 extern void sys_sysenter();
  96 extern void tr_sys_sysenter();
  97 extern void _sys_sysenter_post_swapgs();
  98 extern void brand_sys_sysenter();
  99 extern void tr_brand_sys_sysenter();
 100 extern void _brand_sys_sysenter_post_swapgs();
 101 
 102 extern void dosyscall(void);
 103 
 104 extern void bind_hwcap(void);
 105 
 106 extern uint16_t inw(int port);
 107 extern uint32_t inl(int port);
 108 extern void outw(int port, uint16_t value);
 109 extern void outl(int port, uint32_t value);
 110 
 111 extern void pc_reset(void) __NORETURN;
 112 extern void efi_reset(void) __NORETURN;
 113 extern void reset(void) __NORETURN;
 114 extern int goany(void);
 115 
 116 extern void setgregs(klwp_t *, gregset_t);
 117 extern void getgregs(klwp_t *, gregset_t);
 118 extern void setfpregs(klwp_t *, fpregset_t *);
 119 extern void getfpregs(klwp_t *, fpregset_t *);
 120 




   4  * The contents of this file are subject to the terms of the
   5  * Common Development and Distribution License (the "License").
   6  * You may not use this file except in compliance with the License.
   7  *
   8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
   9  * or http://www.opensolaris.org/os/licensing.
  10  * See the License for the specific language governing permissions
  11  * and limitations under the License.
  12  *
  13  * When distributing Covered Code, include this CDDL HEADER in each
  14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15  * If applicable, add the following below this CDDL HEADER, with the
  16  * fields enclosed by brackets "[]" replaced with your own identifying
  17  * information: Portions Copyright [yyyy] [name of copyright owner]
  18  *
  19  * CDDL HEADER END
  20  */
  21 
  22 /*
  23  * Copyright (c) 1993, 2010, Oracle and/or its affiliates. All rights reserved.
  24  * Copyright 2019 Joyent, Inc.
  25  */
  26 
  27 #ifndef _SYS_ARCHSYSTM_H
  28 #define _SYS_ARCHSYSTM_H
  29 
  30 /*
  31  * A selection of ISA-dependent interfaces
  32  */
  33 
  34 #include <vm/seg_enum.h>
  35 #include <vm/page.h>
  36 
  37 #ifdef __cplusplus
  38 extern "C" {
  39 #endif
  40 
  41 #ifdef _KERNEL
  42 
  43 extern greg_t getfp(void);
  44 extern int getpil(void);


  77 extern void int_cmci(void);
  78 
  79 #if defined(__amd64)
  80 extern void sys_syscall(), tr_sys_syscall();
  81 extern void sys_syscall32(), tr_sys_syscall32();
  82 extern void sys_lcall32();
  83 extern void sys_syscall_int();
  84 extern void tr_sys_syscall_int();
  85 extern void brand_sys_syscall(), tr_brand_sys_syscall();
  86 extern void brand_sys_syscall32(), tr_brand_sys_syscall32();
  87 extern void brand_sys_syscall_int(), tr_brand_sys_syscall_int();
  88 extern int update_sregs();
  89 extern void reset_sregs();
  90 #elif defined(__i386)
  91 extern void sys_call();
  92 extern void tr_sys_call();
  93 extern void brand_sys_call();
  94 #endif
  95 extern void sys_sysenter();
  96 extern void tr_sys_sysenter();

  97 extern void brand_sys_sysenter();
  98 extern void tr_brand_sys_sysenter();

  99 
 100 extern void dosyscall(void);
 101 
 102 extern void bind_hwcap(void);
 103 
 104 extern uint16_t inw(int port);
 105 extern uint32_t inl(int port);
 106 extern void outw(int port, uint16_t value);
 107 extern void outl(int port, uint32_t value);
 108 
 109 extern void pc_reset(void) __NORETURN;
 110 extern void efi_reset(void) __NORETURN;
 111 extern void reset(void) __NORETURN;
 112 extern int goany(void);
 113 
 114 extern void setgregs(klwp_t *, gregset_t);
 115 extern void getgregs(klwp_t *, gregset_t);
 116 extern void setfpregs(klwp_t *, fpregset_t *);
 117 extern void getfpregs(klwp_t *, fpregset_t *);
 118