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)
Fri, Apr 26, 5:15 PM
Unknown Object (File)
Feb 22 2024, 1:34 AM
Unknown Object (File)
Dec 20 2023, 5:34 AM
Unknown Object (File)
Dec 10 2023, 8:03 PM
Unknown Object (File)
Nov 8 2023, 6:40 PM
Unknown Object (File)
Sep 6 2023, 5:44 AM
Unknown Object (File)
Aug 14 2023, 9:08 PM
Unknown Object (File)
Jul 2 2023, 8:20 AM
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?