From 155e622e5738fff73114b9ab5f787493d1773219 Mon Sep 17 00:00:00 2001 From: Gleb Natapov <gleb@redhat.com> Date: Sun, 22 Nov 2009 14:16:21 -0200 Subject: [PATCH 1/4] Make SMBIOS pass MS SVVP test. RH-Author: Gleb Natapov <gleb@redhat.com> Message-id: <20091122141621.GJ3193@redhat.com> Patchwork-id: 3752 O-Subject: [PATCH KVM] Make SMBIOS pass MS SVVP test. Bugzilla: 537178 RH-Acked-by: Rik van Riel <riel@redhat.com> RH-Acked-by: Juan Quintela <quintela@redhat.com> RH-Acked-by: Markus Armbruster <armbru@redhat.com> MS SVVP test check that certain fields in SMBIOS table have arbitrary values. Put them there to make MS happy. BZ: 537178 Upstream status: Similar patch was send to seabios Signed-off-by: Gleb Natapov <gleb@redhat.com> -- Gleb. Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> --- bios/rombios32.c | 23 ++++++++++++----------- 1 files changed, 12 insertions(+), 11 deletions(-) diff --git a/bios/rombios32.c b/bios/rombios32.c index 710e320..32c2839 100755 --- a/bios/rombios32.c +++ b/bios/rombios32.c @@ -1952,7 +1952,7 @@ smbios_init_type_0(void *start) memset(p->bios_characteristics, 0, 8); p->bios_characteristics[0] = 0x08; /* BIOS characteristics not supported */ p->bios_characteristics_extension_bytes[0] = 0; - p->bios_characteristics_extension_bytes[1] = 0; + p->bios_characteristics_extension_bytes[1] = 4; /* enable targeted content distribution */ if (!smbios_load_field(0, offsetof(struct smbios_type_0, system_bios_major_release), @@ -1987,7 +1987,7 @@ smbios_init_type_1(void *start) p->header.handle = 0x100; load_str_field_with_default(1, manufacturer_str, "Red Hat"); - load_str_field_or_skip(1, product_name_str); + load_str_field_with_default(1, product_name_str, "KVM"); load_str_field_or_skip(1, version_str); load_str_field_or_skip(1, serial_number_str); @@ -2021,7 +2021,7 @@ smbios_init_type_3(void *start) p->header.length = sizeof(struct smbios_type_3); p->header.handle = 0x300; - p->manufacturer_str = 0; + p->manufacturer_str = 1; p->type = 0x01; /* other */ p->version_str = 0; p->serial_number_str = 0; @@ -2036,9 +2036,10 @@ smbios_init_type_3(void *start) p->contained_element_count = 0; start += sizeof(struct smbios_type_3); - *((uint16_t *)start) = 0; - return start+2; + memcpy((char *)start, "RED HAT\0\0", 9); + + return start+9; } /* Type 4 -- Processor Information */ @@ -2054,7 +2055,7 @@ smbios_init_type_4(void *start, unsigned int cpu_number) p->socket_designation_str = 1; p->processor_type = 0x03; /* CPU */ p->processor_family = 0x01; /* other */ - p->processor_manufacturer_str = 0; + p->processor_manufacturer_str = 2; p->processor_id[0] = cpuid_signature; p->processor_id[1] = cpuid_features; @@ -2063,8 +2064,8 @@ smbios_init_type_4(void *start, unsigned int cpu_number) p->voltage = 0; p->external_clock = 0; - p->max_speed = 0; /* unknown */ - p->current_speed = 0; /* unknown */ + p->max_speed = 2000; + p->current_speed = 2000; p->status = 0x41; /* socket populated, CPU enabled */ p->processor_upgrade = 0x01; /* other */ @@ -2075,10 +2076,10 @@ smbios_init_type_4(void *start, unsigned int cpu_number) start += sizeof(struct smbios_type_4); - memcpy((char *)start, "CPU " "\0" "" "\0" "", 7); + memcpy((char *)start, "CPU \0QEMU\0\0", 12); ((char *)start)[4] = cpu_number + '0'; - return start+7; + return start+12; } /* Type 16 -- Physical Memory Array */ @@ -2093,7 +2094,7 @@ smbios_init_type_16(void *start, uint32_t memsize, int nr_mem_devs) p->location = 0x01; /* other */ p->use = 0x03; /* system memory */ - p->error_correction = 0x01; /* other */ + p->error_correction = 0x06; /* Multi-bit ECC to make Microsoft happy */ p->maximum_capacity = memsize * 1024; p->memory_error_information_handle = 0xfffe; /* none provided */ p->number_of_memory_devices = nr_mem_devs; -- 1.6.3.rc4.29.g8146