Skip to content

Commit efe6d3d

Browse files
committed
Add support for FPU flag for PDs
Signed-off-by: Jakub Duchniewicz <j.duchniewicz@unsw.edu.au>
1 parent 23f1f6d commit efe6d3d

2 files changed

Lines changed: 13 additions & 1 deletion

File tree

tool/microkit/src/capdl/builder.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -322,6 +322,7 @@ impl CapDLSpecContainer {
322322
prio: 0,
323323
max_prio: 0,
324324
resume: false,
325+
fpu: true,
325326
ip: entry_point.into(),
326327
sp: 0.into(),
327328
gprs: Vec::new(),
@@ -468,7 +469,7 @@ pub fn build_capdl_spec(
468469
)
469470
.unwrap();
470471

471-
// At this point, all of the required objects for the monitor have been created and it caps inserted into
472+
// At this point, all of the required objects for the monitor have been created and its caps inserted into
472473
// the correct slot in the CSpace. We need to bind those objects into the TCB for the monitor to use them.
473474
// In addition, `add_elf_to_spec()` doesn't fill most the details in the TCB.
474475
// Now fill them in: stack ptr, priority, ipc buf vaddr, etc.
@@ -911,6 +912,7 @@ pub fn build_capdl_spec(
911912
affinity: Word(vcpu.cpu.0.into()),
912913
prio: virtual_machine.priority,
913914
max_prio: virtual_machine.priority,
915+
fpu: true,
914916
resume: false,
915917
// VMs do not have program images associated with them so these are always zero.
916918
ip: Word(0),

tool/microkit/src/sdf.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,8 @@ pub struct ProtectionDomain {
257257
pub smc: bool,
258258
pub cpu: CpuCore,
259259
pub program_image: PathBuf,
260+
/// Enable FPU for this PD.
261+
pub fpu: bool,
260262
pub maps: Vec<SysMap>,
261263
pub irqs: Vec<SysIrq>,
262264
pub ioports: Vec<IOPort>,
@@ -456,6 +458,7 @@ impl ProtectionDomain {
456458
// but we do the error-checking further down.
457459
"smc",
458460
"cpu",
461+
"fpu",
459462
];
460463
if is_child {
461464
attrs.push("id");
@@ -607,6 +610,12 @@ impl ProtectionDomain {
607610
));
608611
}
609612

613+
let fpu = if let Some(xml_fpu) = node.attribute("fpu") {
614+
xml_fpu == "true"
615+
} else {
616+
false
617+
};
618+
610619
for child in node.children() {
611620
if !child.is_element() {
612621
continue;
@@ -1074,6 +1083,7 @@ impl ProtectionDomain {
10741083
smc,
10751084
cpu,
10761085
program_image: program_image.unwrap(),
1086+
fpu,
10771087
maps,
10781088
irqs,
10791089
ioports,

0 commit comments

Comments
 (0)