smbios: Fixes for SVVP tests
cover smbios: Fixes for SVVP tests
Some changed introduced by the new QEMU smbios table generation code broke SVVP. This series fixes those issues.
Eduardo Habkost (2):
smbios: Fix dimm size calculation when RAM is multiple of 16GB
smbios: Don't report unknown CPU speed (fix SVVP regression)
hw/i386/smbios.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)
Signature · 1 line
1.9.3
PATCH 1/2 smbios: Fix dimm size calculation when RAM is multiple of 16GB
The Memory Device size calculation logic is broken when the RAM size is a multiple of 16GB, making the size of the last entry be 0 instead of 16GB. Fix the logic to handle that case correctly.
--- hw/i386/smbios.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
hw/i386/smbios.c +2 -1
@@ -850,7 +850,8 @@ void smbios_get_tables(uint8_t **tables, size_t *tables_len, }#define MAX_DIMM_SZ (16ll * ONE_GB) -#define GET_DIMM_SZ ((i < dimm_cnt - 1) ? MAX_DIMM_SZ : ram_size % MAX_DIMM_SZ) +#define GET_DIMM_SZ ((i < dimm_cnt - 1) ? MAX_DIMM_SZ \ + : ((ram_size - 1) % MAX_DIMM_SZ) + 1) dimm_cnt =QEMU_ALIGN_UP (ram_size,MAX_DIMM_SZ ) /MAX_DIMM_SZ ;
Signature · 1 line
1.9.3
Re: [Qemu-devel] [PATCH 1/2] smbios: Fix dimm size calculation when RAM is multiple of 16GB
Quoted 14 lines · Eduardo Habkost
The Memory Device size calculation logic is broken when the RAM size is a multiple of 16GB, making the size of the last entry be 0 instead of 16GB. Fix the logic to handle that case correctly.
Signed-off-by Eduardo Habkost <[email protected]>--- hw/i386/smbios.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)hw/i386/smbios.c +0
-0
hw/i386/smbios.c void smbios_get_tables(uint8_t **tables, size_t *tables_len, · line 856
Quoted 8 lines
hw/i386/smbios.c +2
-1@@ -850,7 +850,8 @@ void smbios_get_tables(uint8_t **tables, size_t *tables_len, }#define MAX_DIMM_SZ (16ll * ONE_GB) -#define GET_DIMM_SZ ((i < dimm_cnt - 1) ? MAX_DIMM_SZ : ram_size % MAX_DIMM_SZ) +#define GET_DIMM_SZ ((i < dimm_cnt - 1) ? MAX_DIMM_SZ \ + : ((ram_size - 1) % MAX_DIMM_SZ) + 1) dimm_cnt =QEMU_ALIGN_UP (ram_size,MAX_DIMM_SZ ) /MAX_DIMM_SZ ;
Using "dimm_size = MAX(ram_size, MAX_DIMM_SZ); ram_size -= dimm_size" would have been less weird, but the whole code here is interesting so your patch is just keeping with the style. We all do that. :)
PATCH 2/2 smbios: Don't report unknown CPU speed (fix SVVP regression)
In reply to Eduardo HabkostSVVP requires processor speed on Type 4 structures to not be unknown. This was fixed in SeaBIOS 0.5.0 (in 2009), but the bug was reintroduced in QEMU 2.1.
Revert to old behavior and report CPU speed as 2000 MHz instead of unknown.
--- hw/i386/smbios.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
hw/i386/smbios.c +3 -2
@@ -618,8 +618,9 @@ static void smbios_build_type_4_table(unsigned instance)SMBIOS_TABLE_SET_STR (4 , processor_version_str, type4.version); t->voltage =0 ; t->external_clock =cpu_to_le16 (0 );/* Unknown */ - t->max_speed =cpu_to_le16 (0 );/* Unknown */ - t->current_speed =cpu_to_le16 (0 );/* Unknown */ +/* SVVP requires max_speed and current_speed to not be unknown. */ + t->max_speed =cpu_to_le16 (2000 );/* 2000 MHz */ + t->current_speed =cpu_to_le16 (2000 );/* 2000 MHz */ t->status =0x41 ;/* Socket populated, CPU enabled */ t->processor_upgrade =0x01 ;/* Other */ t->l1_cache_handle =cpu_to_le16 (0xFFFF );/* N/A */
Signature · 1 line
1.9.3
Re: [Qemu-devel] [PATCH 2/2] smbios: Don't report unknown CPU speed (fix SVVP regression)
Quoted 19 lines · Eduardo Habkost
SVVP requires processor speed on Type 4 structures to not be unknown. This was fixed in SeaBIOS 0.5.0 (in 2009), but the bug was reintroduced in QEMU 2.1.
Revert to old behavior and report CPU speed as 2000 MHz instead of unknown.
Signed-off-by Eduardo Habkost <[email protected]>--- hw/i386/smbios.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)hw/i386/smbios.c +0
-0@@ -618,8 +618,9 @@ static void smbios_build_type_4_table(unsigned instance)SMBIOS_TABLE_SET_STR (4 , processor_version_str, type4.version);
hw/i386/smbios.c static void smbios_build_type_4_table(unsigned instance) · line 626
Quoted 10 lines
hw/i386/smbios.c +3
-2t->voltage =0 ; t->external_clock =cpu_to_le16 (0 );/* Unknown */ - t->max_speed =cpu_to_le16 (0 );/* Unknown */ - t->current_speed =cpu_to_le16 (0 );/* Unknown */ +/* SVVP requires max_speed and current_speed to not be unknown. */ + t->max_speed =cpu_to_le16 (2000 );/* 2000 MHz */ + t->current_speed =cpu_to_le16 (2000 );/* 2000 MHz */ t->status =0x41 ;/* Socket populated, CPU enabled */ t->processor_upgrade =0x01 ;/* Other */ t->l1_cache_handle =cpu_to_le16 (0xFFFF );/* N/A */
Quoted 2 lines · Eduardo Habkost
Some changed introduced by the new QEMU smbios table generation code broke SVVP. This series fixes those issues.
Ping? Through which tree can this go in?
Quoted 7 lines
Eduardo Habkost (2):
smbios: Fix dimm size calculation when RAM is multiple of 16GB
smbios: Don't report unknown CPU speed (fix SVVP regression)hw/i386/smbios.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)
Signature · 1 line
Eduardo
Quoted 5 lines · Eduardo Habkost
Quoted 2 lines · Eduardo Habkost
Some changed introduced by the new QEMU smbios table generation code broke SVVP. This series fixes those issues.
Ping? Through which tree can this go in?
I can merge them I guess - will review shortly.
Pls Cc me in the future if you want my attention.
Quoted 10 lines
Quoted 7 lines
Eduardo Habkost (2):
smbios: Fix dimm size calculation when RAM is multiple of 16GB
smbios: Don't report unknown CPU speed (fix SVVP regression)hw/i386/smbios.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)Signature · 1 line
Eduardo