Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F153480235
D24107.id69945.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D24107.id69945.diff
View Options
Index: usr.sbin/bhyve/smbiostbl.c
===================================================================
--- usr.sbin/bhyve/smbiostbl.c
+++ usr.sbin/bhyve/smbiostbl.c
@@ -255,7 +255,7 @@
uint16_t errhand; /* handle of mem error data */
uint16_t twidth; /* total width in bits */
uint16_t dwidth; /* data width in bits */
- uint16_t size; /* size in bytes */
+ uint16_t size; /* size in kb or mb */
uint8_t form; /* form factor */
uint8_t set; /* set */
uint8_t dloc; /* device locator string */
@@ -268,7 +268,7 @@
uint8_t asset; /* asset tag string */
uint8_t part; /* part number string */
uint8_t attributes; /* attributes */
- uint32_t xsize; /* extended size in mbs */
+ uint32_t xsize; /* extended size in mb */
uint16_t curspeed; /* current speed in mhz */
uint16_t minvoltage; /* minimum voltage */
uint16_t maxvoltage; /* maximum voltage */
@@ -444,7 +444,7 @@
-1, /* handle of memory error data */
64, /* total width in bits including ecc */
64, /* data width in bits */
- 0x7fff, /* size in bytes (0x7fff=use extended)*/
+ 0, /* size in kb or mb (0x7fff=use extended)*/
SMBIOS_MDFF_UNKNOWN,
0, /* set (0x00=none, 0xff=unknown) */
1, /* device locator string */
@@ -695,20 +695,25 @@
uint16_t *n, uint16_t *size)
{
struct smbios_table_type17 *type17;
+ uint64_t memsize, size_MB;
smbios_generic_initializer(template_entry, template_strings,
curaddr, endaddr, n, size);
type17 = (struct smbios_table_type17 *)curaddr;
type17->arrayhand = type16_handle;
- type17->xsize = guest_lomem;
- if (guest_himem > 0) {
- curaddr = *endaddr;
- smbios_generic_initializer(template_entry, template_strings,
- curaddr, endaddr, n, size);
- type17 = (struct smbios_table_type17 *)curaddr;
- type17->arrayhand = type16_handle;
- type17->xsize = guest_himem;
+ memsize = guest_lomem + guest_himem;
+ size_MB = memsize / MB;
+
+ // Can represent up to ~32GB.
+ // The top bit is 0 for MB, 1 for KB.
+ type17->size = size_MB & 0x7FFF;
+
+ if (size_MB >= 0x7FFF) {
+ type17->size = 0x7FFF;
+ // Can represent up to ~2PB.
+ // The top bit is reserved.
+ type17->xsize = size_MB & 0x7FFFFFFF;
}
return (0);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Apr 22, 9:53 AM (5 h, 5 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
31969539
Default Alt Text
D24107.id69945.diff (2 KB)
Attached To
Mode
D24107: Bhyve: fix SMBIOS Type 17 table generation
Attached
Detach File
Event Timeline
Log In to Comment