openvmm icon indicating copy to clipboard operation
openvmm copied to clipboard

Use VTL-aware direct hypercall to get/set registers when possible

Open stunes-ms opened this issue 1 year ago • 1 comments

Modify ProcessorRunner::get_reg and ProcessorRunner::set_reg to use a direct hypercall when possible, instead of our dedicated get/set-register ioctl. Certain registers have special handling in the kernel ioctl handler. Those are left as-is. Get/set for other registers is now made with a direct hypercall.

This has the benefit of being VTL-aware, so this change also adds a VTL parameter.

This change also removes some proliferation of (g|s)et_vp_registers?(_inner)?, hopefully making it simpler and cleaner. The singular (g|s)et_vp_register is left as an ergonomic convenience.

One unaddressed capability is making ioctls/hypercalls on a batch of registers. This is not strictly a regression, because MSHV_VP_MAX_REGISTERS was previously 1.

stunes-ms avatar Oct 17 '24 22:10 stunes-ms

Probably don't want to merge this until the VMM tests are back online, given that past iterations have definitely broken them

smalis-msft avatar Oct 21 '24 14:10 smalis-msft

2024-10-25T17:36:30.4833152Z 2024-10-25T17:36:23.768666Z INFO openvmm_log: 18.837411200s INFO underhill_log: inner_level="6" inner_target="kmsg" "[U] task 'set_idle_task', thread 'tp' panicked at openhcl/hcl/src/ioctl.rs:1238:17:" fields={} extra={"timestamp": "16.373058000s"} 2024-10-25T17:36:30.4836425Z 2024-10-25T17:36:23.783801Z INFO openhcl_log: <6>[ 16.392066] [U] assertion failed: matches!(name, HvX64RegisterName::GuestOsId)

smalis-msft avatar Oct 28 '24 14:10 smalis-msft

see comments

Thanks John! Will handle batching and adding TODO comments tomorrow.

stunes-ms avatar Nov 08 '24 01:11 stunes-ms