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/os/fakebop.c
          +++ new/usr/src/uts/i86pc/os/fakebop.c
↓ open down ↓ 18 lines elided ↑ open up ↑
  19   19   * CDDL HEADER END
  20   20   */
  21   21  
  22   22  /*
  23   23   * Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
  24   24   * Use is subject to license terms.
  25   25   *
  26   26   * Copyright (c) 2010, Intel Corporation.
  27   27   * All rights reserved.
  28   28   *
  29      - * Copyright 2013 Joyent, Inc.  All rights reserved.
       29 + * Copyright 2018 Joyent, Inc.  All rights reserved.
  30   30   */
  31   31  
  32   32  /*
  33   33   * This file contains the functionality that mimics the boot operations
  34   34   * on SPARC systems or the old boot.bin/multiboot programs on x86 systems.
  35   35   * The x86 kernel now does everything on its own.
  36   36   */
  37   37  
  38   38  #include <sys/types.h>
  39   39  #include <sys/bootconf.h>
↓ open down ↓ 800 lines elided ↑ open up ↑
 840  840  do_bsys_doint(bootops_t *bop, int intnum, struct bop_regs *rp)
 841  841  {
 842  842  #if defined(__xpv)
 843  843          prom_panic("unsupported call to BOP_DOINT()\n");
 844  844  #else   /* __xpv */
 845  845          static int firsttime = 1;
 846  846          bios_func_t bios_func = (bios_func_t)(void *)(uintptr_t)0x5000;
 847  847          bios_regs_t br;
 848  848  
 849  849          /*
      850 +         * We're about to disable paging; we shouldn't be PCID enabled.
      851 +         */
      852 +        if (getcr4() & CR4_PCIDE)
      853 +                prom_panic("do_bsys_doint() with PCID enabled\n");
      854 +
      855 +        /*
 850  856           * The first time we do this, we have to copy the pre-packaged
 851  857           * low memory bios call code image into place.
 852  858           */
 853  859          if (firsttime) {
 854  860                  extern char bios_image[];
 855  861                  extern uint32_t bios_size;
 856  862  
 857  863                  bcopy(bios_image, (void *)bios_func, bios_size);
 858  864                  firsttime = 0;
 859  865          }
↓ open down ↓ 1940 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX