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>


 155 }
 156 
 157 extern __GNU_INLINE void
 158 __set_fs(selector_t value)
 159 {
 160         __asm__ __volatile__(
 161             "movw       %0, %%fs"
 162             : /* no output */
 163             : "r" (value));
 164 }
 165 
 166 extern __GNU_INLINE void
 167 __set_gs(selector_t value)
 168 {
 169         __asm__ __volatile__(
 170             "movw       %0, %%gs"
 171             : /* no output */
 172             : "r" (value));
 173 }
 174 
 175 #if !defined(__xpv)
 176 
 177 extern __GNU_INLINE void
 178 __swapgs(void)
 179 {
 180         __asm__ __volatile__(
 181             "mfence; swapgs");
 182 }
 183 
 184 #endif /* !__xpv */
 185 
 186 #endif  /* __amd64 */
 187 
 188 #endif  /* !__lint && __GNUC__ */
 189 
 190 #ifdef  __cplusplus
 191 }
 192 #endif
 193 
 194 #endif  /* _ASM_CPU_H */


 155 }
 156 
 157 extern __GNU_INLINE void
 158 __set_fs(selector_t value)
 159 {
 160         __asm__ __volatile__(
 161             "movw       %0, %%fs"
 162             : /* no output */
 163             : "r" (value));
 164 }
 165 
 166 extern __GNU_INLINE void
 167 __set_gs(selector_t value)
 168 {
 169         __asm__ __volatile__(
 170             "movw       %0, %%gs"
 171             : /* no output */
 172             : "r" (value));
 173 }
 174 











 175 #endif  /* __amd64 */
 176 
 177 #endif  /* !__lint && __GNUC__ */
 178 
 179 #ifdef  __cplusplus
 180 }
 181 #endif
 182 
 183 #endif  /* _ASM_CPU_H */