Print this page
OS-6546 Use PCID if KPTI is enabled


1242         CPU->cpu_idt = idt0;
1243 
1244         /*
1245          * set default kernel stack
1246          */
1247         xen_stack_switch(KDS_SEL,
1248             (ulong_t)&dblfault_stack0[sizeof (dblfault_stack0)]);
1249 
1250         xen_init_callbacks();
1251 
1252         init_ldt();
1253 }
1254 
1255 #else   /* __xpv */
1256 
1257 void
1258 init_desctbls(void)
1259 {
1260         user_desc_t *gdt;
1261         desctbr_t idtr;
1262 #if defined(__amd64)
1263         extern uint64_t kpti_safe_cr3;
1264 #endif
1265 
1266         /*
1267          * Allocate IDT and TSS structures on unique pages for better
1268          * performance in virtual machines.
1269          */
1270 #if !defined(__lint)
1271         ASSERT(NIDT * sizeof (*idt0) <= PAGESIZE);
1272 #endif
1273         idt0 = (gate_desc_t *)BOP_ALLOC(bootops, (caddr_t)IDT_VA,
1274             PAGESIZE, PAGESIZE);
1275         bzero(idt0, PAGESIZE);
1276 #if !defined(__lint)
1277         ASSERT(sizeof (*ktss0) <= PAGESIZE);
1278 #endif
1279         ktss0 = (tss_t *)BOP_ALLOC(bootops, (caddr_t)KTSS_VA,
1280             PAGESIZE, PAGESIZE);
1281         bzero(ktss0, PAGESIZE);
1282 
1283 #if defined(__i386)
1284 #if !defined(__lint)




1242         CPU->cpu_idt = idt0;
1243 
1244         /*
1245          * set default kernel stack
1246          */
1247         xen_stack_switch(KDS_SEL,
1248             (ulong_t)&dblfault_stack0[sizeof (dblfault_stack0)]);
1249 
1250         xen_init_callbacks();
1251 
1252         init_ldt();
1253 }
1254 
1255 #else   /* __xpv */
1256 
1257 void
1258 init_desctbls(void)
1259 {
1260         user_desc_t *gdt;
1261         desctbr_t idtr;



1262 
1263         /*
1264          * Allocate IDT and TSS structures on unique pages for better
1265          * performance in virtual machines.
1266          */
1267 #if !defined(__lint)
1268         ASSERT(NIDT * sizeof (*idt0) <= PAGESIZE);
1269 #endif
1270         idt0 = (gate_desc_t *)BOP_ALLOC(bootops, (caddr_t)IDT_VA,
1271             PAGESIZE, PAGESIZE);
1272         bzero(idt0, PAGESIZE);
1273 #if !defined(__lint)
1274         ASSERT(sizeof (*ktss0) <= PAGESIZE);
1275 #endif
1276         ktss0 = (tss_t *)BOP_ALLOC(bootops, (caddr_t)KTSS_VA,
1277             PAGESIZE, PAGESIZE);
1278         bzero(ktss0, PAGESIZE);
1279 
1280 #if defined(__i386)
1281 #if !defined(__lint)