Print this page
8956 Implement KPTI
Reviewed by: Jerry Jelinek <jerry.jelinek@joyent.com>
Reviewed by: Robert Mustacchi <rm@joyent.com>

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 ↓ 14 lines elided ↑ open up ↑
  15   15   * If applicable, add the following below this CDDL HEADER, with the
  16   16   * fields enclosed by brackets "[]" replaced with your own identifying
  17   17   * information: Portions Copyright [yyyy] [name of copyright owner]
  18   18   *
  19   19   * CDDL HEADER END
  20   20   */
  21   21  
  22   22  /*
  23   23   * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
  24   24   * Use is subject to license terms.
       25 + *
       26 + * Copyright 2018 Joyent, Inc.
  25   27   */
  26   28  
  27   29  #include <sys/debug.h>
  28   30  #include <sys/types.h>
  29   31  #include <sys/param.h>
  30   32  #include <sys/time.h>
  31   33  #include <sys/buf.h>
  32   34  #include <sys/errno.h>
  33   35  #include <sys/systm.h>
  34   36  #include <sys/conf.h>
↓ open down ↓ 57 lines elided ↑ open up ↑
  92   94          pfn_t pfn;
  93   95  
  94   96          if (size == 0)
  95   97                  return (0);
  96   98  
  97   99  #ifdef __xpv
  98  100          /*
  99  101           * The hypervisor doesn't allow r/w mappings to some pages, such as
 100  102           * page tables, gdt, etc. Detect %cr3 to notify users of this interface.
 101  103           */
 102      -        if (start == mmu_ptob(mmu_btop(getcr3())))
      104 +        if (start == mmu_ptob(mmu_btop(getcr3_pa())))
 103  105                  return (0);
 104  106  #endif
 105  107  
 106  108          if (mode == GFXP_MEMORY_CACHED)
 107  109                  hat_attr = HAT_STORECACHING_OK;
 108  110          else if (mode == GFXP_MEMORY_WRITECOMBINED)
 109  111                  hat_attr = HAT_MERGING_OK | HAT_PLAT_NOCACHE;
 110  112          else    /* GFXP_MEMORY_UNCACHED */
 111  113                  hat_attr = HAT_STRICTORDER | HAT_PLAT_NOCACHE;
 112  114          hat_flags = HAT_LOAD_LOCK;
↓ open down ↓ 198 lines elided ↑ open up ↑
 311  313          pfn_t pfn;
 312  314  
 313  315          if (size == 0)
 314  316                  return;
 315  317  
 316  318  #ifdef __xpv
 317  319          /*
 318  320           * The hypervisor doesn't allow r/w mappings to some pages, such as
 319  321           * page tables, gdt, etc. Detect %cr3 to notify users of this interface.
 320  322           */
 321      -        if (start == mmu_ptob(mmu_btop(getcr3())))
      323 +        if (start == mmu_ptob(mmu_btop(getcr3_pa())))
 322  324                  return;
 323  325  #endif
 324  326  
 325  327          if (mode == GFXP_MEMORY_CACHED)
 326  328                  hat_attr = HAT_STORECACHING_OK;
 327  329          else if (mode == GFXP_MEMORY_WRITECOMBINED)
 328  330                  hat_attr = HAT_MERGING_OK | HAT_PLAT_NOCACHE;
 329  331          else    /* GFXP_MEMORY_UNCACHED */
 330  332                  hat_attr = HAT_STRICTORDER | HAT_PLAT_NOCACHE;
 331  333          hat_flags = HAT_LOAD_LOCK;
↓ open down ↓ 65 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX