Print this page
104 Bring back lx brand

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/i86pc/ml/syscall_asm_amd64.s
          +++ new/usr/src/uts/i86pc/ml/syscall_asm_amd64.s
↓ open down ↓ 1124 lines elided ↑ open up ↑
1125 1125          swapgs
1126 1126          sti
1127 1127          sysexit
1128 1128          SET_SIZE(sys_sysenter_swapgs_sysexit)
1129 1129          SET_SIZE(sys_sysenter)
1130 1130          SET_SIZE(_sys_sysenter_post_swapgs)
1131 1131          SET_SIZE(brand_sys_sysenter)
1132 1132  
1133 1133  #endif  /* __lint */
1134 1134  
     1135 +#if defined(__lint)
1135 1136  /*
     1137 + * System call via an int80.  This entry point is only used by the Linux
     1138 + * application environment.  Unlike the other entry points, there is no
     1139 + * default action to take if no callback is registered for this process.
     1140 + */
     1141 +void
     1142 +sys_int80()
     1143 +{}
     1144 +
     1145 +#else   /* __lint */
     1146 +
     1147 +        ENTRY_NP(brand_sys_int80)
     1148 +        SWAPGS                          /* kernel gsbase */
     1149 +        XPV_TRAP_POP
     1150 +        BRAND_CALLBACK(BRAND_CB_INT80, BRAND_URET_FROM_INTR_STACK())
     1151 +        SWAPGS                          /* user gsbase */
     1152 +        jmp     nopop_int80
     1153 +
     1154 +        ENTRY_NP(sys_int80)
     1155 +        /*
     1156 +         * We hit an int80, but this process isn't of a brand with an int80
     1157 +         * handler.  Bad process!  Make it look as if the INT failed.
     1158 +         * Modify %rip to point before the INT, push the expected error
     1159 +         * code and fake a GP fault. Note on 64-bit hypervisor we need
     1160 +         * to undo the XPV_TRAP_POP and push rcx and r11 back on the stack
     1161 +         * because gptrap will pop them again with its own XPV_TRAP_POP.
     1162 +         */
     1163 +        XPV_TRAP_POP
     1164 +nopop_int80:
     1165 +        subq    $2, (%rsp)      /* int insn 2-bytes */
     1166 +        pushq   $_CONST(_MUL(T_INT80, GATE_DESC_SIZE) + 2)
     1167 +#if defined(__xpv)
     1168 +        push    %r11
     1169 +        push    %rcx
     1170 +#endif
     1171 +        jmp     gptrap                  / GP fault
     1172 +        SET_SIZE(sys_int80)
     1173 +        SET_SIZE(brand_sys_int80)
     1174 +#endif  /* __lint */
     1175 +
     1176 +
     1177 +/*
1136 1178   * This is the destination of the "int $T_SYSCALLINT" interrupt gate, used by
1137 1179   * the generic i386 libc to do system calls. We do a small amount of setup
1138 1180   * before jumping into the existing sys_syscall32 path.
1139 1181   */
1140 1182  #if defined(__lint)
1141 1183  
1142 1184  /*ARGSUSED*/
1143 1185  void
1144 1186  sys_syscall_int()
1145 1187  {}
↓ open down ↓ 135 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX