Skip to content
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

init: add hooks for hpet emulation #113

Merged
merged 2 commits into from
Jan 27, 2024
Merged

Conversation

chrisguikema
Copy link
Contributor

@chrisguikema chrisguikema commented Oct 25, 2023

This allows VMs to emulate the HPET for higher-precision timing.

Test with: seL4/seL4_projects_libs#117, seL4/camkes-vm-examples#51

@chrisguikema
Copy link
Contributor Author

The build only seems to be failing because the "Test with" isn't working. Did I mess something up?

@lsf37
Copy link
Member

lsf37 commented Oct 25, 2023

The build only seems to be failing because the "Test with" isn't working. Did I mess something up?

The "Test with" has to be in the PR description, not in a comment. I'll update.

@chrisguikema
Copy link
Contributor Author

Thanks, Gerwin! I'll remember that for next time.

Copy link
Contributor

@abrandnewusername abrandnewusername left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great to me. It will be nice to have a VM example that demonstrates/tests HPET emulation.

components/Init/src/main.c Show resolved Hide resolved
@chrisguikema
Copy link
Contributor Author

Looks great to me. It will be nice to have a VM example that demonstrates/tests HPET emulation.

Do we even have a test application for a 64-bit guest? If not, I can make one, and have it use the HPET emulation.

@chrisguikema chrisguikema force-pushed the emulate_hpet branch 2 times, most recently from 8af8017 to 4f2d180 Compare October 27, 2023 14:54
@chrisguikema
Copy link
Contributor Author

For what its worth, I added a flag to the minimal application that enables 64-bit guests and emulates the HPET. I don't know how to add that flag to the gitlab test runner, but it would be a good thing to add to the CI! @lsf37

@chrisguikema chrisguikema added the hw-test camkes-vm-examples hardware builds + runs for this PR label Oct 30, 2023
@chrisguikema chrisguikema force-pushed the emulate_hpet branch 2 times, most recently from b9ffb13 to dd15dc2 Compare October 30, 2023 19:49
@chrisguikema
Copy link
Contributor Author

Alright, so y'all will have to manually test the HPET emulation.

CI testing doesn't work because 64-bit VMs have a different file name than the Runner is expecting: https://github.com/seL4/camkes-vm/actions/runs/6697978462/job/18199249921#step:4:1299

And I can't test 32-bit VMs because they don't have HPET support compiled in.

@chrisguikema chrisguikema removed the hw-test camkes-vm-examples hardware builds + runs for this PR label Oct 30, 2023
@chrisguikema
Copy link
Contributor Author

@abrandnewusername Have you been able to look at this?

@chrisguikema chrisguikema added the hw-test camkes-vm-examples hardware builds + runs for this PR label Nov 13, 2023
@chrisguikema
Copy link
Contributor Author

I updated the 32-bit Linux image to support the HPET, and it looks like the tests are failing. The minimal example does seem to use the HPET at least, so there is a chance that I messed something up.

[email protected]:426 invalid HPET_CFG + 4

@abrandnewusername do you want me to update the UseHPET variable to only be used with 64-bit guests? That way we can get this merged, and 32-bit support can be added later if anyone needs it?

@chrisguikema
Copy link
Contributor Author

@abrandnewusername I was able to work with @lsf37 to create a 64-bit guest test. The minimal_64 test worked on a hardware run, with the clocksource switching to the hpet: https://github.com/seL4/camkes-vm/actions/runs/6869868181/job/18683754338?pr=113#step:4:2791

What needs to happen to get this feature merged? Do I need to update the dependency to be a 64-bit guest?

components/Init/src/hpet.c Outdated Show resolved Hide resolved
@chrisguikema chrisguikema removed the hw-test camkes-vm-examples hardware builds + runs for this PR label Nov 15, 2023
This allows VMs to use the HPET for higher-precision timing.

Signed-off-by: Chris Guikema <[email protected]>
Copy link
Contributor

@abrandnewusername abrandnewusername left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't have much experience with HPET so I can't comment on the actual HPET emulation code. Apart from that, everything else is good to go.

@lsf37 lsf37 added the hw-test camkes-vm-examples hardware builds + runs for this PR label Jan 27, 2024
@lsf37 lsf37 self-assigned this Jan 27, 2024
@lsf37 lsf37 removed the hw-test camkes-vm-examples hardware builds + runs for this PR label Jan 27, 2024
@lsf37 lsf37 merged commit a5565bb into seL4:master Jan 27, 2024
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants