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

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/i86pc/io/gfx_private/gfxp_vm.c
          +++ new/usr/src/uts/i86pc/io/gfx_private/gfxp_vm.c
↓ open down ↓ 91 lines elided ↑ open up ↑
  92   92          pfn_t pfn;
  93   93  
  94   94          if (size == 0)
  95   95                  return (0);
  96   96  
  97   97  #ifdef __xpv
  98   98          /*
  99   99           * The hypervisor doesn't allow r/w mappings to some pages, such as
 100  100           * page tables, gdt, etc. Detect %cr3 to notify users of this interface.
 101  101           */
 102      -        if (start == mmu_ptob(mmu_btop(getcr3())))
      102 +        if (start == mmu_ptob(mmu_btop(getcr3_pa())))
 103  103                  return (0);
 104  104  #endif
 105  105  
 106  106          if (mode == GFXP_MEMORY_CACHED)
 107  107                  hat_attr = HAT_STORECACHING_OK;
 108  108          else if (mode == GFXP_MEMORY_WRITECOMBINED)
 109  109                  hat_attr = HAT_MERGING_OK | HAT_PLAT_NOCACHE;
 110  110          else    /* GFXP_MEMORY_UNCACHED */
 111  111                  hat_attr = HAT_STRICTORDER | HAT_PLAT_NOCACHE;
 112  112          hat_flags = HAT_LOAD_LOCK;
↓ open down ↓ 198 lines elided ↑ open up ↑
 311  311          pfn_t pfn;
 312  312  
 313  313          if (size == 0)
 314  314                  return;
 315  315  
 316  316  #ifdef __xpv
 317  317          /*
 318  318           * The hypervisor doesn't allow r/w mappings to some pages, such as
 319  319           * page tables, gdt, etc. Detect %cr3 to notify users of this interface.
 320  320           */
 321      -        if (start == mmu_ptob(mmu_btop(getcr3())))
      321 +        if (start == mmu_ptob(mmu_btop(getcr3_pa())))
 322  322                  return;
 323  323  #endif
 324  324  
 325  325          if (mode == GFXP_MEMORY_CACHED)
 326  326                  hat_attr = HAT_STORECACHING_OK;
 327  327          else if (mode == GFXP_MEMORY_WRITECOMBINED)
 328  328                  hat_attr = HAT_MERGING_OK | HAT_PLAT_NOCACHE;
 329  329          else    /* GFXP_MEMORY_UNCACHED */
 330  330                  hat_attr = HAT_STRICTORDER | HAT_PLAT_NOCACHE;
 331  331          hat_flags = HAT_LOAD_LOCK;
↓ open down ↓ 65 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX