Print this page
XXX nobios

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/i86pc/os/fakebop.c
          +++ new/usr/src/uts/i86pc/os/fakebop.c
↓ open down ↓ 133 lines elided ↑ open up ↑
 134  134  
 135  135  static void build_firmware_properties(void);
 136  136  
 137  137  static int early_allocation = 1;
 138  138  
 139  139  int force_fastreboot = 0;
 140  140  volatile int fastreboot_onpanic = 0;
 141  141  int post_fastreboot = 0;
 142  142  #ifdef  __xpv
 143  143  volatile int fastreboot_capable = 0;
      144 +boolean_t bios_calls_available = B_FALSE;
 144  145  #else
 145  146  volatile int fastreboot_capable = 1;
      147 +boolean_t bios_calls_available = B_TRUE;
 146  148  #endif
 147  149  
 148  150  /*
 149  151   * Information saved from current boot for fast reboot.
 150  152   * If the information size exceeds what we have allocated, fast reboot
 151  153   * will not be supported.
 152  154   */
 153  155  multiboot_info_t saved_mbi;
 154  156  mb_memory_map_t saved_mmap[FASTBOOT_SAVED_MMAP_COUNT];
 155  157  uint8_t saved_drives[FASTBOOT_SAVED_DRIVES_SIZE];
↓ open down ↓ 2346 lines elided ↑ open up ↑
2502 2504          /*
2503 2505           * Existence of MSCT implies CPU/memory hotplug-capability for the
2504 2506           * platform.
2505 2507           */
2506 2508          plat_dr_options |= PLAT_DR_FEATURE_CPU;
2507 2509          plat_dr_options |= PLAT_DR_FEATURE_MEMORY;
2508 2510  
2509 2511          return (tp);
2510 2512  }
2511 2513  
     2514 +/*
     2515 + * If this system has a PC-compatible BIOS, it will have handlers for
     2516 + * various well-known BIOS calls.  These calls take the form of INT
     2517 + * instructions, revectoring to the nominated entry in the real mode
     2518 + * Interrupt Vector Table (IVT).  If all of the commonly used entries (from
     2519 + * INT 10h up to INT 1Ah) are zero, we almost certainly don't want to make
     2520 + * use of BOP_DOINT() later.
     2521 + *
     2522 + * The IVT begins at linear address 0 on the 8086.  Though later CPUs
     2523 + * allowed it to be moved, it seems that most BIOS implementations choose
     2524 + * not to do so for compatibility reasons.  Our BIOS call trampoline (see
     2525 + * "idt_info" in "uts/i86pc/ml/bios_call_src.s") also assumes this address.
     2526 + */
     2527 +static int
     2528 +system_has_bios(void)
     2529 +{
     2530 +        uint32_t all_ivts = 0;
     2531 +
     2532 +        DBG_MSG("\nBIOS IVT Entries:\n");
     2533 +        for (uint32_t intnum = 0x10; intnum <= 0x1a; intnum++) {
     2534 +                /*
     2535 +                 * The first software interrupt number (i.e. INT 0h) maps to
     2536 +                 * vector number 32 in the IVT.  Each entry in the IVT is
     2537 +                 * four bytes, describing a 16 bit far call address.
     2538 +                 */
     2539 +                uintptr_t slot = 4 * (32 + intnum);
     2540 +                uint32_t ivte = *((uint32_t *)slot);
     2541 +
     2542 +                if (ivte != 0) {
     2543 +                        DBG(intnum);
     2544 +                        DBG(ivte);
     2545 +                }
     2546 +                all_ivts |= ivte;
     2547 +        }
     2548 +        if (all_ivts == 0) {
     2549 +                DBG_MSG("System has no BIOS IVT entries\n");
     2550 +        }
     2551 +        DBG_MSG("\n");
     2552 +
     2553 +        return (all_ivts != 0);
     2554 +}
     2555 +
2512 2556  #else /* __xpv */
2513 2557  static void
2514 2558  enumerate_xen_cpus()
2515 2559  {
2516 2560          processorid_t   id, max_id;
2517 2561  
2518 2562          /*
2519 2563           * User-set boot-ncpus overrides enumeration
2520 2564           */
2521 2565          if (do_bsys_getproplen(NULL, BOOT_NCPUS_NAME) >= 0)
↓ open down ↓ 13 lines elided ↑ open up ↑
2535 2579  
2536 2580  }
2537 2581  #endif /* __xpv */
2538 2582  
2539 2583  static void
2540 2584  build_firmware_properties(void)
2541 2585  {
2542 2586          ACPI_TABLE_HEADER *tp = NULL;
2543 2587  
2544 2588  #ifndef __xpv
     2589 +        if (do_bsys_getproplen(NULL, "no-bios") > 0 || !system_has_bios())
     2590 +                bios_calls_available = B_FALSE;
     2591 +
2545 2592          if ((tp = find_fw_table(ACPI_SIG_MSCT)) != NULL)
2546 2593                  msct_ptr = process_msct((ACPI_TABLE_MSCT *)tp);
2547 2594          else
2548 2595                  msct_ptr = NULL;
2549 2596  
2550 2597          if ((tp = find_fw_table(ACPI_SIG_MADT)) != NULL)
2551 2598                  process_madt((ACPI_TABLE_MADT *)tp);
2552 2599  
2553 2600          if ((srat_ptr = (ACPI_TABLE_SRAT *)
2554 2601              find_fw_table(ACPI_SIG_SRAT)) != NULL)
↓ open down ↓ 64 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX