MCPcopy Create free account
hub / github.com/cloud-hypervisor/cloud-hypervisor / create_slit_table

Function create_slit_table

vmm/src/acpi.rs:449–474  ·  view source on GitHub ↗
(numa_nodes: &NumaNodes)

Source from the content-addressed store, hash-verified

447}
448
449fn create_slit_table(numa_nodes: &NumaNodes) -> Sdt {
450 let mut slit = Sdt::new(*b"SLIT", 36, 1, *b"CLOUDH", *b"CHSLIT ", 1);
451 // Number of System Localities on 8 bytes.
452 slit.append(numa_nodes.len() as u64);
453
454 let existing_nodes: Vec<u32> = numa_nodes.keys().cloned().collect();
455 for (node_id, node) in numa_nodes.iter() {
456 let distances = &node.distances;
457 for i in existing_nodes.iter() {
458 let dist: u8 = if *node_id == *i {
459 10
460 } else if let Some(distance) = distances.get(i) {
461 *distance
462 // When forward distance config is missing
463 // we can derive it using distance symmetry
464 } else if let Some(destination) = numa_nodes.get(i) {
465 destination.distances.get(node_id).copied().unwrap_or(20)
466 } else {
467 20
468 };
469
470 slit.append(dist);
471 }
472 }
473 slit
474}
475
476#[cfg(target_arch = "aarch64")]
477fn create_gtdt_table() -> Sdt {

Callers 2

create_acpi_tables_tdxFunction · 0.85

Calls 4

newFunction · 0.85
iterMethod · 0.80
lenMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected