Lines Matching +full:build +full:- +full:legacy
4 * Copyright (C) 2009 Hewlett-Packard Development Company, L.P.
12 * the COPYING file in the top-level directory.
14 * Contributions after 2012-01-13 are licensed under the terms of the
21 #include "qemu/config-file.h"
34 * SMBIOS tables provided by user with '-smbios file=<foo>' option
302 .name = "max-speed",
306 .name = "current-speed",
322 .name = "processor-family",
326 .name = "processor-id",
506 * entry point uses a 16-bit integer, so we're limited
568 t->bios_starting_address_segment = cpu_to_le16(0xE800); /* from SeaBIOS */
572 t->bios_rom_size = 0; /* hardcoded in SeaBIOS with FIXME comment */
574 t->bios_characteristics = cpu_to_le64(0x08); /* Not supported */
575 t->bios_characteristics_extension_bytes[0] = 0;
576 t->bios_characteristics_extension_bytes[1] = 0x14; /* TCD/SVVP | VM */
578 t->bios_characteristics_extension_bytes[1] |= 0x08; /* |= UEFI */
582 t->system_bios_major_release = smbios_type0.major;
583 t->system_bios_minor_release = smbios_type0.minor;
585 t->system_bios_major_release = 0;
586 t->system_bios_minor_release = 0;
590 t->embedded_controller_major_release = 0xFF;
591 t->embedded_controller_minor_release = 0xFF;
602 uuid->time_low = bswap32(uuid->time_low);
603 uuid->time_mid = bswap16(uuid->time_mid);
604 uuid->time_hi_and_version = bswap16(uuid->time_hi_and_version);
616 smbios_encode_uuid(&t->uuid, &qemu_uuid);
618 memset(&t->uuid, 0, 16);
620 t->wake_up_type = 0x06; /* power switch */
636 t->feature_flags = 0x01; /* Motherboard */
638 t->chassis_handle = cpu_to_le16(0x300); /* Type 3 (System enclosure) */
639 t->board_type = 0x0A; /* Motherboard */
640 t->contained_element_count = 0;
650 t->type = 0x01; /* Other */
654 t->boot_up_state = 0x03; /* Safe */
655 t->power_supply_state = 0x03; /* Safe */
656 t->thermal_state = 0x03; /* Safe */
657 t->security_status = 0x02; /* Unknown */
658 t->oem_defined = cpu_to_le32(0);
659 t->height = 0;
660 t->number_of_power_cords = 0;
661 t->contained_element_count = 0;
662 t->contained_element_record_length = 0;
686 t->processor_type = 0x03; /* CPU */
687 t->processor_family = 0xfe; /* use Processor Family 2 field */
690 t->processor_id[0] = cpu_to_le32(smbios_cpuid_version);
691 t->processor_id[1] = cpu_to_le32(smbios_cpuid_features);
693 t->processor_id[0] = cpu_to_le32((uint32_t)type4.processor_id);
694 t->processor_id[1] = cpu_to_le32(type4.processor_id >> 32);
697 t->voltage = 0;
698 t->external_clock = cpu_to_le16(0); /* Unknown */
699 t->max_speed = cpu_to_le16(type4.max_speed);
700 t->current_speed = cpu_to_le16(type4.current_speed);
701 t->status = 0x41; /* Socket populated, CPU enabled */
702 t->processor_upgrade = 0x01; /* Other */
703 t->l1_cache_handle = cpu_to_le16(0xFFFF); /* N/A */
704 t->l2_cache_handle = cpu_to_le16(0xFFFF); /* N/A */
705 t->l3_cache_handle = cpu_to_le16(0xFFFF); /* N/A */
713 t->core_count = (cores_per_socket > 255) ? 0xFF : cores_per_socket;
714 t->core_enabled = t->core_count;
716 t->thread_count = (threads_per_socket > 255) ? 0xFF : threads_per_socket;
718 t->processor_characteristics = cpu_to_le16(0x02); /* Unknown */
719 t->processor_family2 = cpu_to_le16(type4.processor_family);
722 t->core_count2 = t->core_enabled2 = cpu_to_le16(cores_per_socket);
723 t->thread_count2 = cpu_to_le16(threads_per_socket);
724 } else if (t->core_count == 0xFF || t->thread_count == 0xFF) {
727 "-machine smbios-entry-point-type=64 option to enable "
744 SMBIOS_TABLE_SET_STR(8, internal_reference_str, t8->internal_reference);
745 SMBIOS_TABLE_SET_STR(8, external_reference_str, t8->external_reference);
747 t->internal_connector_type = 0x0;
748 t->external_connector_type = t8->connector_type;
749 t->port_type = t8->port_type;
764 SMBIOS_TABLE_SET_STR(9, slot_designation, t9->slot_designation);
765 t->slot_type = t9->slot_type;
766 t->slot_data_bus_width = t9->slot_data_bus_width;
767 t->current_usage = t9->current_usage;
768 t->slot_length = t9->slot_length;
769 t->slot_id = t9->slot_id;
770 t->slot_characteristics1 = t9->slot_characteristics1;
771 t->slot_characteristics2 = t9->slot_characteristics2;
773 if (t9->pcidev) {
775 int rc = pci_qdev_find_device(t9->pcidev, &pdev);
779 t9->pcidev, t9->slot_designation);
792 t9->pcidev);
795 t->segment_group_number = cpu_to_le16(0);
796 t->bus_number = pci_dev_bus_num(pdev);
797 t->device_number = pdev->devfn;
800 * Per SMBIOS spec, For slots that are not of the PCI, AGP, PCI-X,
801 * or PCI-Express type that do not have bus/device/function
805 t->segment_group_number = 0xff;
806 t->bus_number = 0xff;
807 t->device_number = 0xff;
827 t->count = type11.nvalues;
846 t->location = 0x01; /* Other */
847 t->use = 0x03; /* System memory */
848 t->error_correction = 0x06; /* Multi-bit ECC (for Microsoft, per SeaBIOS) */
849 size_kb = QEMU_ALIGN_UP(current_machine->ram_size, KiB) / KiB;
851 t->maximum_capacity = cpu_to_le32(size_kb);
852 t->extended_maximum_capacity = cpu_to_le64(0);
854 t->maximum_capacity = cpu_to_le32(MAX_T16_STD_SZ);
855 t->extended_maximum_capacity = cpu_to_le64(current_machine->ram_size);
857 t->memory_error_information_handle = cpu_to_le16(0xFFFE); /* Not provided */
858 t->number_of_memory_devices = cpu_to_le16(dimm_cnt);
863 #define MAX_T17_STD_SZ 0x7FFF /* (32G - 1M), in Megabytes */
873 t->physical_memory_array_handle = cpu_to_le16(0x1000); /* Type 16 above */
874 t->memory_error_information_handle = cpu_to_le16(0xFFFE); /* Not provided */
875 t->total_width = cpu_to_le16(0xFFFF); /* Unknown */
876 t->data_width = cpu_to_le16(0xFFFF); /* Unknown */
879 t->size = cpu_to_le16(size_mb);
880 t->extended_size = cpu_to_le32(0);
883 t->size = cpu_to_le16(MAX_T17_STD_SZ);
884 t->extended_size = cpu_to_le32(size_mb);
886 t->form_factor = 0x09; /* DIMM */
887 t->device_set = 0; /* Not in a set */
891 t->memory_type = 0x07; /* RAM */
892 t->type_detail = cpu_to_le16(0x02); /* Other */
893 t->speed = cpu_to_le16(type17.speed);
898 t->attributes = 0; /* Unknown */
899 t->configured_clock_speed = t->speed; /* reuse value for max speed */
900 t->minimum_voltage = cpu_to_le16(0); /* Unknown */
901 t->maximum_voltage = cpu_to_le16(0); /* Unknown */
902 t->configured_voltage = cpu_to_le16(0); /* Unknown */
915 end = start + size - 1;
920 t->starting_address = cpu_to_le32(start_kb);
921 t->ending_address = cpu_to_le32(end_kb);
922 t->extended_starting_address =
923 t->extended_ending_address = cpu_to_le64(0);
925 t->starting_address = t->ending_address = cpu_to_le32(UINT32_MAX);
926 t->extended_starting_address = cpu_to_le64(start);
927 t->extended_ending_address = cpu_to_le64(end);
929 t->memory_array_handle = cpu_to_le16(0x1000); /* Type 16 above */
930 t->partition_width = 1; /* One device per row */
939 memset(t->reserved, 0, 6);
940 t->boot_status = 0; /* No errors detected */
953 SMBIOS_TABLE_SET_STR(41, reference_designation_str, t41->designation);
954 t->device_type = t41->kind;
955 t->device_type_instance = t41->instance;
956 t->segment_group_number = cpu_to_le16(0);
957 t->bus_number = 0;
958 t->device_number = 0;
960 if (t41->pcidev) {
962 int rc = pci_qdev_find_device(t41->pcidev, &pdev);
966 t41->pcidev, t41->designation);
979 t41->pcidev);
982 t->segment_group_number = cpu_to_le16(0);
983 t->bus_number = pci_dev_bus_num(pdev);
984 t->device_number = pdev->devfn;
1114 assert(ms->smp.sockets >= 1);
1116 for (i = 0; i < ms->smp.sockets; i++) {
1127 #define GET_DIMM_SZ ((i < dimm_cnt - 1) ? mc->smbios_memory_device_size \
1128 : ((current_machine->ram_size - 1) % mc->smbios_memory_device_size) + 1)
1130 dimm_cnt = QEMU_ALIGN_UP(current_machine->ram_size,
1131 mc->smbios_memory_device_size) /
1132 mc->smbios_memory_device_size;
1139 * the two tables (T19_BASE - T17_BASE = 512) is not enough.
1141 offset = (dimm_cnt > (T19_BASE - T17_BASE)) ? \
1142 dimm_cnt - (T19_BASE - T17_BASE) : 0;
1159 assert((mem_array_size + offset) < (T32_BASE - T19_BASE));
1166 if (!smbios_check_type4_count(ms->smp.sockets, errp)) {
1266 return -1;
1278 return -1;
1283 return -1;
1293 *opt->dest = g_renew(char *, *opt->dest, (*opt->ndest) + 1);
1294 (*opt->dest)[*opt->ndest] = (char *)g_byte_array_free(data, FALSE);
1295 (*opt->ndest)++;
1298 *opt->dest = g_renew(char *, *opt->dest, (*opt->ndest) + 1);
1299 (*opt->dest)[*opt->ndest] = g_strdup(value);
1300 (*opt->ndest)++;
1303 return -1;
1335 if (size == -1 || size < sizeof(struct smbios_structure_header)) {
1342 * (except in legacy mode, where the second '\0' is implicit and
1354 if (header->type <= SMBIOS_MAX_TYPE) {
1355 if (test_bit(header->type, smbios_have_fields_bitmap)) {
1358 header->type);
1361 set_bit(header->type, smbios_have_binfile_bitmap);
1364 if (header->type == 4) {
1369 * preserve blob size for legacy mode so it could build its
1465 "processor-family",
1473 type4.processor_id = qemu_opt_get_number(opts, "processor-id", 0);
1474 type4.max_speed = qemu_opt_get_number(opts, "max-speed",
1476 type4.current_speed = qemu_opt_get_number(opts, "current-speed",
1490 save_opt(&t8_i->internal_reference, opts, "internal_reference");
1491 save_opt(&t8_i->external_reference, opts, "external_reference");
1492 t8_i->connector_type = qemu_opt_get_number(opts,
1494 t8_i->port_type = qemu_opt_get_number(opts, "port_type", 0);
1503 save_opt(&t->slot_designation, opts, "slot_designation");
1504 t->slot_type = qemu_opt_get_number(opts, "slot_type", 0);
1505 t->slot_data_bus_width =
1507 t->current_usage = qemu_opt_get_number(opts, "current_usage", 0);
1508 t->slot_length = qemu_opt_get_number(opts, "slot_length", 0);
1509 t->slot_id = qemu_opt_get_number(opts, "slot_id", 0);
1510 t->slot_characteristics1 =
1512 t->slot_characteristics2 =
1514 save_opt(&t->pcidev, opts, "pcidev");
1546 save_opt(&t41_i->designation, opts, "designation");
1547 t41_i->kind = qapi_enum_parse(&type41_kind_lookup,
1550 t41_i->kind |= 0x80; /* enabled */
1556 t41_i->instance = qemu_opt_get_number(opts, "instance", 1);
1557 save_opt(&t41_i->pcidev, opts, "pcidev");
1564 "Don't know how to build fields for SMBIOS type %ld",