-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
move smbios table creation to propolis (out of server+standalone) #759
base: master
Are you sure you want to change the base?
Conversation
cpuid_ident is non-optional, any defaulting happens in applications
if cpuid::host_query(cpuid::Ident(0x8000_0000, None)).eax | ||
>= 0x8000_0004 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
boring but funny note: the oldest CPUs that don't support cpuid leaves 0x8000_000[1..4] are, i think, Pentium II and K5. so as long as Propolis is running on a CPU newer than those, this arm is always taken?
not really sure how i feel about this, but it seems interesting this is the only state in MachineInitializerState right now..
// With "only" types 0, 1, 4, 16, 17, and 32, we are technically missing | ||
// some (types 3, 7, 9, 19) of the data required by the 2.7 spec. The | ||
// data provided here were what we determined was a reasonable | ||
// collection to start with. Should further requirements arise, we may | ||
// expand on it. | ||
let mut smb_tables = smbios::Tables::new(0x7f00.into()); | ||
smb_tables.add(0x0000.into(), &smb_type0).unwrap(); | ||
smb_tables.add(0x0100.into(), &smb_type1).unwrap(); | ||
smb_tables.add(0x0300.into(), &smb_type4).unwrap(); | ||
smb_tables.add(phys_mem_array_handle, &smb_type16).unwrap(); | ||
smb_tables.add(0x1700.into(), &smb_type17).unwrap(); | ||
smb_tables.add(0x3200.into(), &smb_type32).unwrap(); | ||
smb_tables.add(0x0000.into(), &smbios_params.table_type0()).unwrap(); | ||
smb_tables.add(0x0100.into(), &smbios_params.table_type1()).unwrap(); | ||
smb_tables.add(0x0300.into(), &smbios_params.table_type4()).unwrap(); | ||
let phys_mem_array_handle = 0x1600.into(); | ||
smb_tables | ||
.add(phys_mem_array_handle, &smbios_params.table_type16()) | ||
.unwrap(); | ||
smb_tables | ||
.add( | ||
0x1700.into(), | ||
&smbios_params.table_type17(phys_mem_array_handle), | ||
) | ||
.unwrap(); | ||
smb_tables.add(0x3200.into(), &smbios_params.table_type32()).unwrap(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pfmooney how's this seem? my thinking is that the SmbiosParams::table_*
are "this is probably a reasonable way to put the tables together", and if we find value in changing any of the defaults we'd hoist them into fields of SmbiosParameters
.
tiny cleanup i noticed alongside #756: the two
generate_smbios()
were similar but not quite the same, and it wasn't entirely clear what external inputs were to the tables either would generate. so, take theSmbiosParameters
idea frompropolis-standalone
and makepropolis-server
put its parameters in a similar struct.nice benefit: anything we make configurable for
propolis-standalone
is at least progress towards configurability forpropolis- server
.in the process i've added a few more fields to
SmbiosParameters
for values that either varied or had different defaulting behavior depending on the application:rom_release_date
,cpuid_vendor
, and the value as we use table 1's serial number and uuid, which i'm callingsystem_id
- it's the instance's ID and just left as defaults inpropolis-standalone
.edit: i did go a bit beyond just code motion in acb6da1. as i was moving this around i realized that's the only place we need a scratchpad in
MachineInitializer
, so i wanted to see how things look withrom_size
passed around on its own. seems fine? do we expectMachineInitializerState
would eventually have more state in it?