Skip to content

Commit 457f9a5

Browse files
committedFeb 27, 2024·
Properly handle pre/post illumos#16183 fixups
1 parent 1b34075 commit 457f9a5

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed
 

‎lib/propolis/src/vcpu.rs

+10-8
Original file line numberDiff line numberDiff line change
@@ -1260,16 +1260,18 @@ pub mod migrate {
12601260
.for_vcpu(vcpu.id)
12611261
.read::<bhyve_api::vdi_lapic_v1>()?;
12621262

1263-
if vcpu.hdl.api_version()? <= ApiVersion::V16 {
1264-
// Fix up invalid LAPIC timer data from illumos#16183
1265-
if vdi.vl_timer_target != 0 && vdi.vl_lapic.vlp_icr_timer == 0 {
1263+
// A timer target without a value in ICR is nonsensical
1264+
if vdi.vl_timer_target != 0 && vdi.vl_lapic.vlp_icr_timer == 0 {
1265+
if vcpu.hdl.api_version()? <= ApiVersion::V16 {
1266+
// Fix up invalid LAPIC timer data on kernels predating the
1267+
// fix from illumos#16183
12661268
vdi.vl_timer_target = 0;
1269+
} else {
1270+
return Err(io::Error::new(
1271+
io::ErrorKind::InvalidData,
1272+
"post-illumos#16183 kernel emitting bad ICR timer data",
1273+
));
12671274
}
1268-
} else {
1269-
return Err(io::Error::new(
1270-
io::ErrorKind::InvalidData,
1271-
"post-illumos#16183 kernel emitting bad ICR timer data",
1272-
));
12731275
}
12741276

12751277
Ok(vdi.into())

0 commit comments

Comments
 (0)
Please sign in to comment.