Print this page
NEX-16819 loader UEFI support
Includes work by Toomas Soome <tsoome@me.com>
Upstream commits:
    loader: pxe receive cleanup
    9475 libefi: Do not return only if ReceiveFilter
    installboot: should support efi system partition
    8931 boot1.efi: scan all display modes rather than
    loader: spinconsole updates
    loader: gfx experiment to try GOP Blt() function.
    sha1 build test
    loader: add sha1 hash calculation
    common/sha1: update for loader build
    loader: biosdisk rework
    uts: 32-bit kernel FB needs mapping in low memory
    uts: add diag-device
    uts: boot console mirror with diag-device
    uts: enable very early console on ttya
    kmdb: add diag-device as input/output device
    uts: test VGA memory exclusion from mapping
    uts: clear boot mapping and protect boot pages test
    uts: add dboot map debug printf
    uts: need to release FB pages in release_bootstrap()
    uts: add screenmap ioctl
    uts: update sys/queue.h
    loader: add illumos uts/common to include path
    loader: tem/gfx font cleanup
    loader: vbe checks
    uts: gfx_private set KD_TEXT when KD_RESETTEXT is
    uts: gfx 8-bit update
    loader: gfx 8-bit fix
    loader: always set media size from partition.
    uts: MB2 support for 32-bit kernel
    loader: x86 should have tem 80x25
    uts: x86 should have tem 80x25
    uts: font update
    loader: font update
    uts: tem attributes
    loader: tem.c comment added
    uts: use font module
    loader: add font module
    loader: build rules for new font setup
    uts: gfx_private update for new font structure
    uts: early boot update for new font structure
    uts: font update
    uts: font build rules update for new fonts
    uts: tem update to new font structure
    loader: module.c needs to include tem_impl.h
    uts: gfx_private 8x16 font rework
    uts: make font_lookup public
    loader: font rework
    uts: font rework
    9259 libefi: efi_alloc_and_read should check for PMBR
    uts: tem utf-8 support
    loader: implement tem utf-8 support
    loader: tem should be able to display UTF-8
    7784 uts: console input should support utf-8
    7796 uts: ldterm default to utf-8
    uts: do not reset serial console
    uts: set up colors even if tem is not console
    uts: add type for early boot properties
    uts: gfx_private experiment with drm and vga
    uts: gfx_private should use setmode drm callback.
    uts: identify FB types and set up gfx_private based
    loader: replace gop and vesa with framebuffer
    uts: boot needs simple tem to support mdb
    uts: boot_keyboard should emit esc sequences for
    uts: gfx_private FB showuld be written by line
    kmdb: set terminal window size
    uts: gfx_private needs to keep track of early boot FB
    pnglite: move pnglite to usr/src/common
    loader: gfx_fb
    ficl-sys: add gfx primitives
    loader: add illumos.png logo
    ficl: add fb-putimage
    loader: add png support
    loader: add alpha blending for gfx_fb
    loader: use term-drawrect for menu frame
    ficl: add simple gfx words
    uts: provide fb_info via fbgattr dev_specific array.
    uts: gfx_private add alpha blending
    uts: update sys/ascii.h
    uts: tem OSC support (incomplete)
    uts: implement env module support and use data from
    uts: tem get colors from early boot data
    loader: use crc32 from libstand (libz)
    loader: optimize for size
    loader: pass tem info to the environment
    loader: import tem for loader console
    loader: UEFI loader needs to set ISADIR based on
    loader: need UEFI32 support
    8918 loader.efi: add vesa edid support
    uts: tem_safe_pix_clear_prom_output() should only
    uts: tem_safe_pix_clear_entire_screen() should use
    uts: tem_safe_check_first_time() should query cursor
    uts: tem implement cls callback & visual_io v4
    uts: gfx_vgatext use block cursor for vgatext
    uts: gfx_private implement cls callback & visual_io
    uts: gfx_private bitmap framebuffer implementation
    uts: early start frame buffer console support
    uts: font functions should check the input char
    uts: font rendering should support 16/24/32bit depths
    uts: use smallest font as fallback default.
    uts: update terminal dimensions based on selected
    7834 uts: vgatext should use gfx_private
    uts: add spacing property to 8859-1.bdf
    terminfo: add underline for sun-color
    terminfo: sun-color has 16 colors
    uts: add font load callback type
    loader: do not repeat int13 calls with error 0x20 and
    8905 loader: add skein/edonr support
    8904 common/crypto: make skein and edonr loader
Reviewed by: Yuri Pankov <yuri.pankov@nexenta.com>
Reviewed by: Sanjay Nadkarni <sanjay.nadkarni@nexenta.com>
Reviewed by: Evan Layton <evan.layton@nexenta.com>
Revert "NEX-16819 loader UEFI support"
This reverts commit ec06b9fc617b99234e538bf2e7e4d02a24993e0c.
Reverting due to failures in the zfs-tests and the sharefs-tests
NEX-16819 loader UEFI support
Includes work by Toomas Soome <tsoome@me.com>
Upstream commits:
    loader: pxe receive cleanup
    9475 libefi: Do not return only if ReceiveFilter
    installboot: should support efi system partition
    8931 boot1.efi: scan all display modes rather than
    loader: spinconsole updates
    loader: gfx experiment to try GOP Blt() function.
    sha1 build test
    loader: add sha1 hash calculation
    common/sha1: update for loader build
    loader: biosdisk rework
    uts: 32-bit kernel FB needs mapping in low memory
    uts: add diag-device
    uts: boot console mirror with diag-device
    uts: enable very early console on ttya
    kmdb: add diag-device as input/output device
    uts: test VGA memory exclusion from mapping
    uts: clear boot mapping and protect boot pages test
    uts: add dboot map debug printf
    uts: need to release FB pages in release_bootstrap()
    uts: add screenmap ioctl
    uts: update sys/queue.h
    loader: add illumos uts/common to include path
    loader: tem/gfx font cleanup
    loader: vbe checks
    uts: gfx_private set KD_TEXT when KD_RESETTEXT is
    uts: gfx 8-bit update
    loader: gfx 8-bit fix
    loader: always set media size from partition.
    uts: MB2 support for 32-bit kernel
    loader: x86 should have tem 80x25
    uts: x86 should have tem 80x25
    uts: font update
    loader: font update
    uts: tem attributes
    loader: tem.c comment added
    uts: use font module
    loader: add font module
    loader: build rules for new font setup
    uts: gfx_private update for new font structure
    uts: early boot update for new font structure
    uts: font update
    uts: font build rules update for new fonts
    uts: tem update to new font structure
    loader: module.c needs to include tem_impl.h
    uts: gfx_private 8x16 font rework
    uts: make font_lookup public
    loader: font rework
    uts: font rework
    libefi: efi_alloc_and_read should check for PMBR
    uts: tem utf-8 support
    loader: implement tem utf-8 support
    loader: tem should be able to display UTF-8
    7784 uts: console input should support utf-8
    7796 uts: ldterm default to utf-8
    uts: do not reset serial console
    uts: set up colors even if tem is not console
    uts: add type for early boot properties
    uts: gfx_private experiment with drm and vga
    uts: gfx_private should use setmode drm callback.
    uts: identify FB types and set up gfx_private based
    loader: replace gop and vesa with framebuffer
    uts: boot needs simple tem to support mdb
    uts: boot_keyboard should emit esc sequences for
    uts: gfx_private FB showuld be written by line
    kmdb: set terminal window size
    uts: gfx_private needs to keep track of early boot FB
    pnglite: move pnglite to usr/src/common
    loader: gfx_fb
    ficl-sys: add gfx primitives
    loader: add illumos.png logo
    ficl: add fb-putimage
    loader: add png support
    loader: add alpha blending for gfx_fb
    loader: use term-drawrect for menu frame
    ficl: add simple gfx words
    uts: provide fb_info via fbgattr dev_specific array.
    uts: gfx_private add alpha blending
    uts: update sys/ascii.h
    uts: tem OSC support (incomplete)
    uts: implement env module support and use data from
    uts: tem get colors from early boot data
    loader: use crc32 from libstand (libz)
    loader: optimize for size
    loader: pass tem info to the environment
    loader: import tem for loader console
    loader: UEFI loader needs to set ISADIR based on
    loader: need UEFI32 support
    8918 loader.efi: add vesa edid support
    uts: tem_safe_pix_clear_prom_output() should only
    uts: tem_safe_pix_clear_entire_screen() should use
    uts: tem_safe_check_first_time() should query cursor
    uts: tem implement cls callback & visual_io v4
    uts: gfx_vgatext use block cursor for vgatext
    uts: gfx_private implement cls callback & visual_io
    uts: gfx_private bitmap framebuffer implementation
    uts: early start frame buffer console support
    uts: font functions should check the input char
    uts: font rendering should support 16/24/32bit depths
    uts: use smallest font as fallback default.
    uts: update terminal dimensions based on selected
    7834 uts: vgatext should use gfx_private
    uts: add spacing property to 8859-1.bdf
    terminfo: add underline for sun-color
    terminfo: sun-color has 16 colors
    uts: add font load callback type
    loader: do not repeat int13 calls with error 0x20 and
    8905 loader: add skein/edonr support
    8904 common/crypto: make skein and edonr loader
Reviewed by: Yuri Pankov <yuri.pankov@nexenta.com>
Reviewed by: Sanjay Nadkarni <sanjay.nadkarni@nexenta.com>
Reviewed by: Evan Layton <evan.layton@nexenta.com>
NEX-14317 HVM with more than 2 VCPUs hangs on Xen 4.7
Reviewed by: Alex Deiter <alex.deiter@nexenta.com>
Reviewed by: Evan Layton <evan.layton@nexenta.com>
re #13613 rb4516 Tunables needs volatile keyword
re #13140 rb4270 hvm_sd module missing dependencies on scsi and cmlb
re #13166 rb4270 Check for Xen HVM even if CPUID signature returns Microsoft Hv
re #13187 rb4270 Fix Xen HVM related warnings
re #11780 rb3700 Improve hypervisor environment detection

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/i86pc/os/startup.c
          +++ new/usr/src/uts/i86pc/os/startup.c
↓ open down ↓ 18 lines elided ↑ open up ↑
  19   19   * CDDL HEADER END
  20   20   */
  21   21  
  22   22  /*
  23   23   * Copyright (c) 1993, 2010, Oracle and/or its affiliates. All rights reserved.
  24   24   * Copyright 2012 DEY Storage Systems, Inc.  All rights reserved.
  25   25   * Copyright 2017 Nexenta Systems, Inc.
  26   26   * Copyright 2015 Joyent, Inc.
  27   27   * Copyright (c) 2015 by Delphix. All rights reserved.
  28   28   */
       29 +
  29   30  /*
  30   31   * Copyright (c) 2010, Intel Corporation.
  31   32   * All rights reserved.
  32   33   */
  33   34  
  34   35  #include <sys/types.h>
  35   36  #include <sys/t_lock.h>
  36   37  #include <sys/param.h>
  37   38  #include <sys/sysmacros.h>
  38   39  #include <sys/signal.h>
↓ open down ↓ 79 lines elided ↑ open up ↑
 118  119  #include <sys/kobj_lex.h>
 119  120  #include <sys/cpc_impl.h>
 120  121  #include <sys/cpu_module.h>
 121  122  #include <sys/smbios.h>
 122  123  #include <sys/debug_info.h>
 123  124  #include <sys/bootinfo.h>
 124  125  #include <sys/ddi_periodic.h>
 125  126  #include <sys/systeminfo.h>
 126  127  #include <sys/multiboot.h>
 127  128  #include <sys/ramdisk.h>
      129 +#include <sys/framebuffer.h>
 128  130  
 129  131  #ifdef  __xpv
 130  132  
 131  133  #include <sys/hypervisor.h>
 132  134  #include <sys/xen_mmu.h>
 133  135  #include <sys/evtchn_impl.h>
 134  136  #include <sys/gnttab.h>
 135  137  #include <sys/xpv_panic.h>
 136  138  #include <xen/sys/xenbus_comms.h>
 137  139  #include <xen/public/physdev.h>
↓ open down ↓ 85 lines elided ↑ open up ↑
 223  225   * code will need revisiting. There is an implicit assumption that there
 224  226   * are no *huge* holes in the physical address space too.
 225  227   */
 226  228  #define TERABYTE                (1ul << 40)
 227  229  #define PHYSMEM_MAX64           mmu_btop(64 * TERABYTE)
 228  230  #define PHYSMEM                 PHYSMEM_MAX64
 229  231  #define AMD64_VA_HOLE_END       0xFFFF800000000000ul
 230  232  
 231  233  #endif /* __amd64 */
 232  234  
 233      -pgcnt_t physmem = PHYSMEM;
      235 +volatile pgcnt_t physmem = PHYSMEM;
 234  236  pgcnt_t obp_pages;      /* Memory used by PROM for its text and data */
 235  237  
 236  238  char *kobj_file_buf;
 237  239  int kobj_file_bufsize;  /* set in /etc/system */
 238  240  
 239  241  /* Global variables for MP support. Used in mp_startup */
 240  242  caddr_t rm_platter_va = 0;
 241  243  uint32_t rm_platter_pa;
 242  244  
 243  245  int     auto_lpg_disable = 1;
↓ open down ↓ 79 lines elided ↑ open up ↑
 323  325  struct seg kvseg_core;          /* Segment used for the core heap */
 324  326  struct seg kpmseg;              /* Segment used for physical mapping */
 325  327  struct seg *segkpm = &kpmseg;   /* 64bit kernel physical mapping segment */
 326  328  #else
 327  329  struct seg *segkpm = NULL;      /* Unused on IA32 */
 328  330  #endif
 329  331  
 330  332  caddr_t segkp_base;             /* Base address of segkp */
 331  333  caddr_t segzio_base;            /* Base address of segzio */
 332  334  #if defined(__amd64)
 333      -pgcnt_t segkpsize = btop(SEGKPDEFSIZE); /* size of segkp segment in pages */
      335 +volatile pgcnt_t segkpsize = btop(SEGKPDEFSIZE); /* size of segkp segment in */
      336 +                                                /* pages */
 334  337  #else
 335      -pgcnt_t segkpsize = 0;
      338 +volatile pgcnt_t segkpsize = 0;
 336  339  #endif
 337  340  pgcnt_t segziosize = 0;         /* size of zio segment in pages */
 338  341  
 339  342  /*
 340  343   * A static DR page_t VA map is reserved that can map the page structures
 341  344   * for a domain's entire RA space. The pages that back this space are
 342  345   * dynamically allocated and need not be physically contiguous.  The DR
 343  346   * map size is derived from KPM size.
 344  347   * This mechanism isn't used by x86 yet, so just stubs here.
 345  348   */
↓ open down ↓ 1691 lines elided ↑ open up ↑
2037 2040           */
2038 2041          protect_boot_range(KERNEL_TEXT, (uintptr_t)-1, 0);
2039 2042  
2040 2043          /*
2041 2044           * Before we can take over memory allocation/mapping from the boot
2042 2045           * loader we must remove from our free page lists any boot allocated
2043 2046           * pages that stay mapped until release_bootstrap().
2044 2047           */
2045 2048          protect_boot_range(0, kernelbase, 1);
2046 2049  
2047      -
2048 2050          /*
2049 2051           * Switch to running on regular HAT (not boot_mmu)
2050 2052           */
2051 2053          PRM_POINT("Calling hat_kern_setup()...");
2052 2054          hat_kern_setup();
2053 2055  
2054 2056          /*
2055 2057           * It is no longer safe to call BOP_ALLOC(), so make sure we don't.
2056 2058           */
2057 2059          bop_no_more_mem();
↓ open down ↓ 456 lines elided ↑ open up ↑
2514 2516          /* unmount boot ramdisk and release kmem usage */
2515 2517          kobj_boot_unmountroot();
2516 2518  
2517 2519          /*
2518 2520           * We're finished using the boot loader so free its pages.
2519 2521           */
2520 2522          PRM_POINT("Unmapping lower boot pages");
2521 2523  
2522 2524          clear_boot_mappings(0, _userlimit);
2523 2525  
     2526 +#if 0
     2527 +        if (fb_info.paddr != 0 && fb_info.fb_type != FB_TYPE_EGA_TEXT) {
     2528 +                clear_boot_mappings(fb_info.paddr,
     2529 +                    P2ROUNDUP(fb_info.paddr + fb_info.fb_size, MMU_PAGESIZE));
     2530 +                clear_boot_mappings((uintptr_t)fb_info.fb,
     2531 +                    P2ROUNDUP((uintptr_t)fb_info.fb + fb_info.fb_size,
     2532 +                    MMU_PAGESIZE));
     2533 +        }
     2534 +#endif
     2535 +
2524 2536          postbootkernelbase = kernelbase;
2525 2537  
2526 2538          /*
2527 2539           * If root isn't on ramdisk, destroy the hardcoded
2528 2540           * ramdisk node now and release the memory. Else,
2529 2541           * ramdisk memory is kept in rd_pages.
2530 2542           */
2531 2543          root_is_ramdisk = (getmajor(rootdev) == ddi_name_to_major("ramdisk"));
2532 2544          if (!root_is_ramdisk) {
2533 2545                  dev_info_t *dip = ddi_find_devinfo("ramdisk", -1, 0);
↓ open down ↓ 858 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX