Page MenuHomeFreeBSD

pmap_is_valid_memattr: drop unused 'pmap' argument
AbandonedPublic

Authored by mhorne on May 23 2024, 7:16 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Aug 30, 5:35 PM
Unknown Object (File)
Mon, Aug 18, 7:15 AM
Unknown Object (File)
Thu, Aug 14, 10:16 PM
Unknown Object (File)
Wed, Aug 13, 9:55 AM
Unknown Object (File)
Jul 25 2025, 1:27 PM
Unknown Object (File)
Jul 24 2025, 9:35 AM
Unknown Object (File)
Jul 15 2025, 7:16 PM
Unknown Object (File)
Jul 12 2025, 2:33 AM

Details

Summary

Logically, it doesn't make sense that this result would differ per-pmap.
In practice, no implementation uses the argument, so remove it.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 57874
Build 54762: arc lint + arc unit

Event Timeline

Logically, it doesn't make sense that this result would differ per-pmap.

Well, on amd64 and arm64 we have multiple pmap types in order to support vmm, which generally involves 2 stages of translation: first from guest VA to guest PA, then guest PA to host PA. The mappings used by each stage are maintained in a pmap, but the pmap layer needs to be aware of which stage of the translation it's handling. On amd64, this is reflected in pm_type; on arm64 this is pm_stage. In general, the encoding of a PTE might depend on the type of the pmap, see pmap_valid_bit() on amd64 for example.

While there's currently no difference between pmap types in the handling of memattrs, it's not obvious to me that that'll always be true. In other words, I don't really agree with the premise of the patch. Maybe I'm missing some reason that my concern is invalid.

Logically, it doesn't make sense that this result would differ per-pmap.

...

While there's currently no difference between pmap types in the handling of memattrs, it's not obvious to me that that'll always be true. In other words, I don't really agree with the premise of the patch. Maybe I'm missing some reason that my concern is invalid.

There is already a PAT mode (UC-) which cannot be represented in EPT. Although the mode is a hack to fix broken sofware (I believe), it is still a demonstration of the issue.

In D45321#1034234, @kib wrote:

Logically, it doesn't make sense that this result would differ per-pmap.

...

While there's currently no difference between pmap types in the handling of memattrs, it's not obvious to me that that'll always be true. In other words, I don't really agree with the premise of the patch. Maybe I'm missing some reason that my concern is invalid.

There is already a PAT mode (UC-) which cannot be represented in EPT. Although the mode is a hack to fix broken sofware (I believe), it is still a demonstration of the issue.

ACK, thanks both. I am glad to drop it.