Print this page
10570 Need workaround to EFI boot on AMI BIOS

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/sun4v/io/vds.c
          +++ new/usr/src/uts/sun4v/io/vds.c
↓ open down ↓ 13 lines elided ↑ open up ↑
  14   14   * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  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 (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
       24 + * Copyright (c) 2019, Joyent, Inc.
  24   25   */
  25   26  
  26   27  /*
  27   28   * Virtual disk server
  28   29   */
  29   30  
  30   31  
  31   32  #include <sys/types.h>
  32   33  #include <sys/conf.h>
  33   34  #include <sys/crc32.h>
↓ open down ↓ 5791 lines elided ↑ open up ↑
5825 5826          /*
5826 5827           * Adjust the vdisk_size, we emulate the first few blocks
5827 5828           * for the disk label.
5828 5829           */
5829 5830          vd->vdisk_size += first_u_lba;
5830 5831          s0_start = first_u_lba;
5831 5832          s0_end = vd->vdisk_size - 1;
5832 5833  
5833 5834          gpt->efi_gpt_Signature = LE_64(EFI_SIGNATURE);
5834 5835          gpt->efi_gpt_Revision = LE_32(EFI_VERSION_CURRENT);
5835      -        gpt->efi_gpt_HeaderSize = LE_32(sizeof (efi_gpt_t));
     5836 +        gpt->efi_gpt_HeaderSize = LE_32(EFI_HEADER_SIZE);
5836 5837          gpt->efi_gpt_FirstUsableLBA = LE_64(first_u_lba);
5837 5838          gpt->efi_gpt_PartitionEntryLBA = LE_64(2ULL);
5838 5839          gpt->efi_gpt_SizeOfPartitionEntry = LE_32(sizeof (efi_gpe_t));
5839 5840  
5840 5841          UUID_LE_CONVERT(gpe[0].efi_gpe_PartitionTypeGUID, uuid);
5841 5842          gpe[0].efi_gpe_StartingLBA = LE_64(s0_start);
5842 5843          gpe[0].efi_gpe_EndingLBA = LE_64(s0_end);
5843 5844  
5844 5845          if (vd_slice_single_slice) {
5845 5846                  gpt->efi_gpt_NumberOfPartitionEntries = LE_32(1);
↓ open down ↓ 16 lines elided ↑ open up ↑
5862 5863  
5863 5864          gpt->efi_gpt_LastUsableLBA = LE_64(vd->vdisk_size - 1);
5864 5865  
5865 5866          /* adjust the vdisk size for the backup GPT and GPE */
5866 5867          vd->vdisk_size += (EFI_MIN_ARRAY_SIZE / bsize) + 1;
5867 5868          gpt->efi_gpt_AlternateLBA = LE_64(vd->vdisk_size - 1);
5868 5869  
5869 5870          CRC32(crc, gpe, sizeof (efi_gpe_t) * VD_MAXPART, -1U, crc32_table);
5870 5871          gpt->efi_gpt_PartitionEntryArrayCRC32 = LE_32(~crc);
5871 5872  
5872      -        CRC32(crc, gpt, sizeof (efi_gpt_t), -1U, crc32_table);
     5873 +        CRC32(crc, gpt, EFI_HEADER_SIZE, -1U, crc32_table);
5873 5874          gpt->efi_gpt_HeaderCRC32 = LE_32(~crc);
5874 5875  
5875 5876          return (0);
5876 5877  }
5877 5878  
5878 5879  /*
5879 5880   * Setup for a virtual disk whose backend is a file (exported as a single slice
5880 5881   * or as a full disk). In that case, the backend is accessed using the vnode
5881 5882   * interface.
5882 5883   */
↓ open down ↓ 1658 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX