Page MenuHomeFreeBSD

hyperv: Fix compilation with larger page sizes
Needs ReviewPublic

Authored by gallatin on Mar 18 2023, 4:43 PM.
Tags
None
Referenced Files
Unknown Object (File)
Oct 27 2024, 3:05 PM
Unknown Object (File)
Oct 10 2024, 6:42 PM
Unknown Object (File)
Sep 13 2024, 5:21 AM
Unknown Object (File)
Aug 13 2024, 5:51 PM
Unknown Object (File)
Jul 27 2024, 7:48 PM
Unknown Object (File)
Jul 6 2024, 8:32 PM
Unknown Object (File)
Jul 2 2024, 7:48 AM
Unknown Object (File)
Jun 27 2024, 8:45 PM
Subscribers

Details

Summary

When building an arm64 kernel with a 16K page size, I tripped over a few compile time assertions in the hyperV driver that break the build when a PAGE_SIZE other than 4k is used.

It appears that hyperV is tied to a 4K page size. For simplicity, change the constants to refer to 4096 rather than PAGE_SIZE, and fail the device probe if the PAGE_SIZE != 4k

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

gallatin created this revision.
sys/dev/hyperv/vmbus/vmbus_reg.h
103

Hyper-V always runs with a page size of 4096. From a quick look of the vmbus code, it looks like it is not yet supported for 16K PAGE_SIZE.

gallatin edited the summary of this revision. (Show Details)

I just tripped over this again when trying to use some of the 16K changes I have in my Netflix tree on a personal machine running a GENERIC kernel, so let's try this again in a different way.

Rather than adapting the constants to assume any valid page size, remove the PAGE_SIZE constants from the CT assert and instead fail device probe if we are using another page size.

sys/dev/hyperv/vmbus/vmbus_reg.h
183

Why not use a separate macro to use here and corresponding page shift and then use that throughout the drivers (all hyper-v code) ?
That way we can abstract the kernel PAGE_SIZE with HYPER_PAGE_SIZE?