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

TDX: Add support for kernel interrupt offloading #124

Merged
merged 1 commit into from
Jan 6, 2025

Conversation

jaredwhitedev
Copy link
Contributor

@jaredwhitedev jaredwhitedev commented Oct 17, 2024

The user<-> kernel transitions during IPI handling incur a significant amount of overhead on both the send and receive sides. These changes support handling IPIs entirely in-kernel, eliminating these transitions.

openhcl/hcl/src/ioctl.rs Outdated Show resolved Hide resolved
openhcl/virt_underhill/src/processor/tdx/mod.rs Outdated Show resolved Hide resolved
@jaredwhitedev
Copy link
Contributor Author

Marking as non-draft & ready for review since the only additional change will be a kernel package bump. GitHub copy of the kernel PR: microsoft/OHCL-Linux-Kernel#26

@jaredwhitedev jaredwhitedev marked this pull request as ready for review December 11, 2024 00:50
@jaredwhitedev jaredwhitedev requested a review from a team as a code owner December 11, 2024 00:50
@smalis-msft
Copy link
Contributor

While we're making kernel changes in this area, can we also make whatever changes are needed for the same code to support Guest VSM (i.e. separate tracking of interrupts for VTL 0 and VTL 1)? We're going to need it at some point. We need it for SNP too.

@jaredwhitedev
Copy link
Contributor Author

While we're making kernel changes in this area, can we also make whatever changes are needed for the same code to support Guest VSM (i.e. separate tracking of interrupts for VTL 0 and VTL 1)? We're going to need it at some point. We need it for SNP too.

The new version only turns on kernel offloading if the next vtl is vtl0. Is that sufficient for now?

openhcl/hcl/src/ioctl.rs Outdated Show resolved Hide resolved
openhcl/hcl/src/ioctl.rs Outdated Show resolved Hide resolved
openhcl/hcl/src/ioctl.rs Outdated Show resolved Hide resolved
@jstarks
Copy link
Member

jstarks commented Dec 18, 2024

This is going to conflict with #470.

@jstarks
Copy link
Member

jstarks commented Dec 18, 2024

LGTM but we'll need to update the kernel first.

@smalis-msft
Copy link
Contributor

While we're making kernel changes in this area, can we also make whatever changes are needed for the same code to support Guest VSM (i.e. separate tracking of interrupts for VTL 0 and VTL 1)? We're going to need it at some point. We need it for SNP too.

The new version only turns on kernel offloading if the next vtl is vtl0. Is that sufficient for now?

Honestly I don't think I'm familiar enough with offloading to say for sure. But my understanding is it's solely a perf improvement, and not needed functionality, correct? And if we combine that with believing that VTL 1 will be running a very small percentage of the time compared to VTL 0, and will not be receiving many interrupts, then maybe this perf change isn't necessary for it?

@jaredwhitedev
Copy link
Contributor Author

While we're making kernel changes in this area, can we also make whatever changes are needed for the same code to support Guest VSM (i.e. separate tracking of interrupts for VTL 0 and VTL 1)? We're going to need it at some point. We need it for SNP too.

The new version only turns on kernel offloading if the next vtl is vtl0. Is that sufficient for now?

Honestly I don't think I'm familiar enough with offloading to say for sure. But my understanding is it's solely a perf improvement, and not needed functionality, correct? And if we combine that with believing that VTL 1 will be running a very small percentage of the time compared to VTL 0, and will not be receiving many interrupts, then maybe this perf change isn't necessary for it?

Definitely yes on "solely a perf improvement, and not needed functionality", and my understanding is yes for the second

@jaredwhitedev jaredwhitedev changed the title TDX: Add support for kernel IPI offloading (needs kernel version bump) TDX: Add support for kernel interrupt offloading Jan 6, 2025
@jaredwhitedev
Copy link
Contributor Author

jaredwhitedev commented Jan 6, 2025

Rebased, kernel update now included (#568)

@jaredwhitedev jaredwhitedev merged commit d059496 into microsoft:main Jan 6, 2025
25 checks passed
jaredwhitedev added a commit to jaredwhitedev/openvmm that referenced this pull request Jan 6, 2025
The user<-> kernel transitions during IPI handling incur a significant
amount of overhead on both the send and receive sides. These changes
support handling IPIs entirely in-kernel, eliminating these transitions.
jaredwhitedev added a commit to jaredwhitedev/openvmm that referenced this pull request Jan 7, 2025
The user<-> kernel transitions during IPI handling incur a significant
amount of overhead on both the send and receive sides. These changes
support handling IPIs entirely in-kernel, eliminating these transitions.
jaredwhitedev added a commit that referenced this pull request Jan 7, 2025
…t offloading (#616)

flowey: Remove kernel version from step name
CP from (#617)
No changes.

Update OHCL kernel to 6.6.63.1
CP from (#568)
YAML change in original commit ignored. No other changes.

TDX: Add support for kernel interrupt offloading
CP from (#124)
Changed to use `LapicState`'s `halted`, `idle`, `startup_suspend` fields
instead of the `MpState` enum, as (#470) is not present in this branch.

---------

Co-authored-by: Ben Hillis <[email protected]>
Co-authored-by: Ben Hillis <[email protected]>
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.

4 participants