SMBIOS strings
Hi,
We were looking at the dmidecode output from qemu-kvm pre-seabios and current qemu-kvm and noticed some of the strings have changed.
The main problem with this is that certain OSes are quite sensitive to system changes and avoiding to change things unnecessarily would probably be a good thing.
I wanted to check with the lists if there are any strong feelings about this, and whether some of these changes were made for specific reasons?
For example:
Handle 0x0000, DMI type 0, 24 bytes
BIOS Information
- Vendor: QEMU
- Version: QEMU
+ Vendor: Bochs
+ Version: Bochs
Release Date: 01/01/2007
Address: 0xE8000
Runtime Size: 96 kBand this:
Handle 0x0401, DMI type 4, 32 bytes
Processor Information
- Socket Designation: CPU 1
+ Socket Designation: CPU01
Type: Central Processor
Family: Other
- Manufacturer: QEMU - ID: 63 06 00 00 FD FB 8B 07 + Manufacturer: Bochs + ID: 23 06 00 00 FD FB 8B 07
Version: Not Specified
Voltage: Unknown
External Clock: Unknown
I guess the Socket Designation in particular might have been done for a reason?
Otherwise, if there are no objections, I'll look at adding some patches to make it more backwards compatible.
Cheers,
Jes
Quoted 3 lines · Jes Sorensen
I guess the Socket Designation in particular might have been done for a reason?
It was part of commit cf2affa6de. And was a result of moving to snprintf() instead of direct string manipulation. Before that string was created like that:
memcpy((char *)start, "CPU " "\0" "" "\0" "", 7);
((char *)start)[4] = cpu_number + '0';Which start to produce strange cpu numbers for cpus greater then 9. I doubt we want to go back to that ;)
--
Gleb.
Quoted 11 lines · Gleb Natapov
Quoted 3 lines · Jes Sorensen
I guess the Socket Designation in particular might have been done for a reason?
It was part of commit
cf2affa6de. And was a result of moving tosnprintf()instead of direct string manipulation. Before that string was created like that:memcpy((char *)start, "CPU " "\0" "" "\0" "", 7); ((char *)start)[4] = cpu_number + '0';Which start to produce strange cpu numbers for cpus greater then 9. I doubt we want to go back to that ;)
Hi Gleb,
I see. Well I guess we could do something slightly more compatible by printing along the lines:
printf("CPU:");
if (nr < 10)
printf(" ");snprintf()
Not sure if it is worth it, but it should be doable without reverting to memcpy().
Thoughts?
Cheers,
Jes
Quoted 15 lines · Jes Sorensen
Quoted 11 lines · Gleb Natapov
Quoted 3 lines · Jes Sorensen
I guess the Socket Designation in particular might have been done for a reason?
It was part of commit
cf2affa6de. And was a result of moving tosnprintf()instead of direct string manipulation. Before that string was created like that:memcpy((char *)start, "CPU " "\0" "" "\0" "", 7); ((char *)start)[4] = cpu_number + '0';Which start to produce strange cpu numbers for cpus greater then 9. I doubt we want to go back to that ;)
Hi Gleb,
Quoted 8 lines
I see. Well I guess we could do something slightly more compatible by printing along the lines:
printf("CPU:");
if (nr < 10)printf(" ");
snprintf()
You mean snprintf() not printf? AFAIR you can tell snprintf to pad with spaces not zeroes.
Quoted 5 lines
Not sure if it is worth it, but it should be doable without reverting to
memcpy().Thoughts?
I don't care much as long as we will not have "CPU :". It looks like something that can change after BIOS upgrade, so it is hard to believe Windows will stop working because of this change.
--
Gleb.
Quoted 3 lines · Gleb Natapov
I don't care much as long as we will not have "CPU :". It looks like something that can change after BIOS upgrade, so it is hard to believe Windows will stop working because of this change.
Maybe it could trigger the Windows activation process?
Sebastian
Quoted 6 lines · Sebastian Herbszt
Quoted 3 lines · Gleb Natapov
I don't care much as long as we will not have "CPU :". It looks like something that can change after BIOS upgrade, so it is hard to believe Windows will stop working because of this change.
Maybe it could trigger the Windows activation process?
Isn't that testable?
Quoted 10 lines · Markus Armbruster
Quoted 6 lines · Sebastian Herbszt
Quoted 3 lines · Gleb Natapov
I don't care much as long as we will not have "CPU :". It looks like something that can change after BIOS upgrade, so it is hard to believe Windows will stop working because of this change.
Maybe it could trigger the Windows activation process?
Isn't that testable?
The problem there is that the number of possible combinations to test is endless. I think older versions of windows are far more prone to such problems than newer ones.
Cheers,
Jes
Quoted 11 lines · Jes Sorensen
Quoted 7 lines · Markus Armbruster
Quoted 5 lines · Sebastian Herbszt
Quoted 3 lines · Gleb Natapov
I don't care much as long as we will not have "CPU :". It looks like something that can change after BIOS upgrade, so it is hard to believe Windows will stop working because of this change.
Maybe it could trigger the Windows activation process?
Isn't that testable?
The problem there is that the number of possible combinations to test is endless. I think older versions of windows are far more prone to such problems than newer ones.
Lets select a handful of OS versions that we think are important and then test. If the smbios changes cause a problem, then we can document that fact and be careful going forward.
I'm leery about reverting improvements on the premise that some guest could possibly observe the change and be finicky about it. That way leads to stagnation. (For example, for all I know, the recent smbios memory layout bug fix could cause a Windows activation.)
BTW, is there a known issue with activation on the latest qemu?
-Kevin
Quoted 10 lines · Markus Armbruster
Quoted 6 lines · Sebastian Herbszt
Quoted 3 lines · Gleb Natapov
I don't care much as long as we will not have "CPU :". It looks like something that can change after BIOS upgrade, so it is hard to believe Windows will stop working because of this change.
Maybe it could trigger the Windows activation process?
Isn't that testable?
Not easily, that process trips when the total number of changes goes over a fixed value.
OG.
Quoted 7 lines · Sebastian Herbszt
Quoted 3 lines · Gleb Natapov
I don't care much as long as we will not have "CPU :". It looks like something that can change after BIOS upgrade, so it is hard to believe Windows will stop working because of this change.
Maybe it could trigger the Windows activation process?
Who knows? But as I said it looks like something that can change after BIOS upgrade. If I were Microsoft I would rely on serial numbers for that (after moving kernel to Unix like one of course).
--
Gleb.
Quoted 8 lines · Jes Sorensen
Hi,
We were looking at the dmidecode output from qemu-kvm pre-seabios and current qemu-kvm and noticed some of the strings have changed.
The main problem with this is that certain OSes are quite sensitive to system changes and avoiding to change things unnecessarily would probably be a good thing.
Which OSes do care? Windows only?
Quoted 7 lines
I wanted to check with the lists if there are any strong feelings about this, and whether some of these changes were made for specific reasons?
For example:
Handle
0x0000, DMI type 0, 24 bytes
BIOS Information
Review
Quoted 7 lines
(quoted diff) +2
-2- Vendor: QEMU - Version: QEMU + Vendor: Bochs + Version: Bochs Release Date: 01/01/2007 Address: 0xE8000 Runtime Size: 96 kB
You can configure this with CONFIG_APPNAME.
Quoted 16 lines
and this:
Handle
0x0401, DMI type 4, 32 bytes
Processor Information(quoted diff) +3
-3- Socket Designation: CPU 1 + Socket Designation: CPU01 Type: Central Processor Family: Other - Manufacturer: QEMU - ID: 63 06 00 00 FD FB 8B 07 + Manufacturer: Bochs + ID: 23 06 00 00 FD FB 8B 07 Version: Not Specified Voltage: Unknown External Clock: Unknown
Quoted 8 lines
I guess the Socket Designation in particular might have been done for a reason?
Otherwise, if there are no objections, I'll look at adding some patches to make it more backwards compatible.
Cheers,
Jes
Is the different ID displayed on the same VM configuration (esp. -cpu option) ? The value is gained by calling CPUID so it should not be different.
Which pre-seabios qemu-kvm bios are you comparing to?
Sebastian
Quoted 9 lines · Sebastian Herbszt
Quoted 6 lines · Jes Sorensen
We were looking at the dmidecode output from qemu-kvm pre-seabios and current qemu-kvm and noticed some of the strings have changed.
The main problem with this is that certain OSes are quite sensitive to system changes and avoiding to change things unnecessarily would probably be a good thing.
Which OSes do care? Windows only?
The problem with this kind of stuff is that we don't know what is sensitive and what doesn't care. Most of the Open Source OSes should be fine, but still Windows is a pretty big customer in the virtualization guest space.
Quoted 17 lines
Quoted 17 lines
Handle
0x0401, DMI type 4, 32 bytes
Processor Information(quoted diff) +3
-3- Socket Designation: CPU 1 + Socket Designation: CPU01 Type: Central Processor Family: Other - Manufacturer: QEMU - ID: 63 06 00 00 FD FB 8B 07 + Manufacturer: Bochs + ID: 23 06 00 00 FD FB 8B 07 Version: Not Specified Voltage: Unknown External Clock: UnknownI guess the Socket Designation in particular might have been done for a reason?
Quoted 8 lines
Quoted 2 lines
Otherwise, if there are no objections, I'll look at adding some patches to make it more backwards compatible.
Is the different ID displayed on the same VM configuration (esp. -cpu option) ?
The value is gained by calling CPUID so it should not be different.Which pre-seabios qemu-kvm bios are you comparing to?
Hmmm good point, I'll go back and dig some more on this.
Cheers,
Jes
Quoted 2 lines · Jes Sorensen
We were looking at the dmidecode output from qemu-kvm pre-seabios and current qemu-kvm and noticed some of the strings have changed.
[...]
Quoted 4 lines
I wanted to check with the lists if there are any strong feelings about this, and whether some of these changes were made for specific reasons?
For example:
[...]
Quoted 4 lines
(quoted diff) +2
-2- Vendor: QEMU - Version: QEMU + Vendor: Bochs + Version: Bochs
[...]
Review
Quoted 4 lines
(quoted diff) +2
-2- Manufacturer: QEMU - ID: 63 06 00 00 FD FB 8B 07 + Manufacturer: Bochs + ID: 23 06 00 00 FD FB 8B 07
I made these changes in SeaBIOS when I was cleaning up the ifdefs in the code. Instead of "ifdef QEMU" spread around the code, I abstracted out the various names into CONFIG_APPNAME. I defaulted the names to the Bochs based ones because they were the default in the original Bochs bios code. So, the only reason for these string differences is that the default name hasn't been changed.
Quoted 2 lines
Otherwise, if there are no objections, I'll look at adding some patches to make it more backwards compatible.
I wonder if making the default names be "SeaBIOS" based instead of bochs/qemu based would make sense. That way there isn't an impulse to change the settings with every emulator seabios runs on. (Ideally, the same binary would be run on multiple emulators to simplify testing.)
-Kevin
Review
Quoted 4 lines · Jes Sorensen
Handle
0x0401, DMI type 4, 32 bytes
Processor Information(quoted diff) +1
-1- Socket Designation: CPU 1 + Socket Designation: CPU01
smbios.c gotsnprintf((char*)start, 6, "CPU%2x", cpu_number);
It should print "CPU 1" instead of "CPU01" because the padding should be done with spaces not zeros. Maybe bvprintf() doesn't handle it correctly?
Sebastian
Quoted 6 lines · Sebastian Herbszt
Review
Quoted 4 lines · Jes Sorensen
Handle
0x0401, DMI type 4, 32 bytes
Processor Information(quoted diff) +1
-1- Socket Designation: CPU 1 + Socket Designation: CPU01
Quoted 6 lines
smbios.cgotsnprintf((char*)start, 6, "CPU%2x", cpu_number);It should print "CPU 1" instead of "CPU01" because the padding should be done with spaces not zeros. Maybe
bvprintf()doesn't handle it correctly?
Space padding hasn't been implemented - nothing needed it.
The bvprintf code is called from 16bit code which is very stack sensitive - if space padding is implemented it will have to be tested carefully.
-Kevin
Quoted 7 lines · Kevin O'Connor
Quoted 6 lines · Sebastian Herbszt
Quoted 4 lines · Jes Sorensen
Handle
0x0401, DMI type 4, 32 bytes
Processor Information(quoted diff) +1
-1- Socket Designation: CPU 1 + Socket Designation: CPU01
Quoted 8 lines
Quoted 6 lines
smbios.cgotsnprintf((char*)start, 6, "CPU%2x", cpu_number);It should print "CPU 1" instead of "CPU01" because the padding should be done with spaces not zeros. Maybe
bvprintf()doesn't handle it correctly?Space padding hasn't been implemented - nothing needed it.
With correct space padding this would be a non issue, because the socket designation string would not have changed.
Sebastian
Quoted 5 lines
The bvprintf code is called from 16bit code which is very stack sensitive - if space padding is implemented it will have to be tested carefully.
-Kevin
Quoted 6 lines · Sebastian Herbszt
Review
Quoted 4 lines · Jes Sorensen
Handle
0x0401, DMI type 4, 32 bytes
Processor Information(quoted diff) +1
-1- Socket Designation: CPU 1 + Socket Designation: CPU01
Quoted 6 lines
smbios.cgotsnprintf((char*)start, 6, "CPU%2x", cpu_number);It should print "CPU 1" instead of "CPU01" because the padding should be done with spaces not zeros. Maybe
bvprintf()doesn't handle it correctly?
I looked at the man page for snprintf() and it isn't clear to me that it is required to space pad when printing hex numbers.
Having looked at the other pieces, I think this is probably the only one we might want to change. It should be pretty easy to just do something like:
if (cpu_number < 0x10)
snprintf("CPU %x", cpu_number);
else
snprintf("CPU%2x", cpu_number);Esthetically I think this would be prettier, but question is whether it's something to worry about or not.
Cheers,
Jes
Quoted 10 lines · Jes Sorensen
Quoted 9 lines · Sebastian Herbszt
Review
Quoted 4 lines · Jes Sorensen
Handle
0x0401, DMI type 4, 32 bytes
Processor Information(quoted diff) +1
-1- Socket Designation: CPU 1 + Socket Designation: CPU01
smbios.cgotsnprintf((char*)start, 6, "CPU%2x", cpu_number);
Quoted 6 lines
Quoted 3 lines
It should print "CPU 1" instead of "CPU01" because the padding should be done with spaces not zeros. Maybe
bvprintf()doesn't handle it correctly?I looked at the man page for
snprintf()and it isn't clear to me that it is required to space pad when printing hex numbers.
"The flag characters
...
0
The value should be zero padded. For d, i, o, u, x, X, a, A, e, E, f, F, g, and G conversions, the converted value is padded on the left with zeros rather than blanks. If the 0 and - flags both appear, the 0 flag is ignored. If a precision is given with a numeric conversion (d, i, o, u, x, and X), the 0 flag is ignored. For other conversions, the behavior is undefined." [1]
So without "0" flag it should be space padded.
Quoted 10 lines
Having looked at the other pieces, I think this is probably the only one we might want to change. It should be pretty easy to just do something like:
if (
cpu_number<0x10)snprintf("CPU %x", cpu_number);
elsesnprintf("CPU%2x", cpu_number);Esthetically I think this would be prettier, but question is whether it's something to worry about or not.
Either change it here or fix bvprintf().
Also "CPU a" looks a bit weird. Maybe change it to "CPU A" (upper case letter) ?
Quoted 2 lines
Cheers,
Jes
[1] http://linux.die.net/man/3/printf
Sebastian