Page MenuHomeFreeBSD

linuxkpi: Define `PMD_SHIFT`
ClosedPublic

Authored by dumbbell on Sun, Mar 8, 1:21 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Apr 5, 10:39 AM
Unknown Object (File)
Thu, Mar 19, 10:35 PM
Unknown Object (File)
Tue, Mar 17, 1:36 PM
Unknown Object (File)
Mon, Mar 16, 2:09 PM
Unknown Object (File)
Mon, Mar 16, 1:11 PM
Unknown Object (File)
Sun, Mar 15, 9:29 PM
Unknown Object (File)
Fri, Mar 13, 7:47 AM
Unknown Object (File)
Wed, Mar 11, 6:52 AM

Details

Summary

For now, only define it for x86 architectures.

The DRM generic code started to use it in Linux 6.11.

This is part of the update of DRM drivers to Linux 6.11.

Sponsored by: The FreeBSD Foundation

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

I don't really like this being done for x86 only, but I'd rather have it at least here for now and we can follow up with other architectures

This revision is now accepted and ready to land.Sun, Mar 8, 3:38 PM

Define for several architectures to address @emaste concerns.

This revision now requires review to proceed.Sun, Mar 8, 8:55 PM
bz requested changes to this revision.Sun, Mar 29, 11:16 PM
bz added a subscriber: bz.

Where do these values come from? Do they match anything native? Do we want at least a comment which ones are considered "to be fixed"?

This revision now requires changes to proceed.Sun, Mar 29, 11:16 PM

for i386 PDRSHIFT_PAE, for amd64 PDRSHIFT, but outside it doesn't seems that FreeBSD has direct match. Maybe arm64 / riscv64 L2_SHIFT?

Explain how the constants are computed on Linux and use the corresponding FreeBSD constants. This should address @bz concerns.

Thank you @david_ixit.cz for the initial lookup!

You made me run a grep on Linux; I assume your comments are for 6.11 as I just checked 7 and cannot find any hard coded 21ones anymore.

This revision is now accepted and ready to land.Thu, Apr 2, 12:29 AM
In D55734#1286250, @bz wrote:

You made me run a grep on Linux; I assume your comments are for 6.11 as I just checked 7 and cannot find any hard coded 21ones anymore.

Right, there could be a difference between Linux versions. In Linux 6.11 for instance, the x86 version is defined in arch/x86/include/asm/pgtable_64_types.h and arch/x86/include/asm/pgtable-3level_types.h as:

#define PMD_SHIFT	21
This revision was automatically updated to reflect the committed changes.