Page MenuHomeFreeBSD

Add OBJ_PG_DTOR flag to VM object
ClosedPublic

Authored by br on Jul 21 2017, 2:36 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Dec 20, 10:39 PM
Unknown Object (File)
Fri, Dec 20, 7:59 PM
Unknown Object (File)
Wed, Dec 18, 11:03 AM
Unknown Object (File)
Sun, Dec 15, 1:20 AM
Unknown Object (File)
Nov 28 2024, 11:24 PM
Unknown Object (File)
Nov 24 2024, 1:58 PM
Unknown Object (File)
Nov 17 2024, 6:25 PM
Unknown Object (File)
Nov 13 2024, 10:42 AM
Subscribers
None

Details

Summary

Add OBJ_PG_DTOR flag to object allowing us to skip pages removal from object in vm_object_terminate() and to leave that for cdev_pg_dtor function.

This is required for Intel SGX support as we want to lookup pages in queue before removal.

Diff Detail

Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

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

move out pages removal code to separate function to avoid code duplication

This revision is now accepted and ready to land.Aug 15 2017, 12:09 PM

I have no objections to this change. I'm just interested in hearing a little more about why it is needed. In your SGX driver are you essentially maintaining a private free page list for managing the pool of physical memory that backs enclaves?

In D11688#249549, @alc wrote:

I have no objections to this change. I'm just interested in hearing a little more about why it is needed. In your SGX driver are you essentially maintaining a private free page list for managing the pool of physical memory that backs enclaves?

Exactly. We have enclave's page cache (EPC) memory pool reserved by processor and we register it as fictitious range of physical memory. That EPC pool is encrypted and backs enclave's control information, enclave's code, stack, data, etc.
https://reviews.freebsd.org/D11113

In D11688#249553, @br wrote:
In D11688#249549, @alc wrote:

I have no objections to this change. I'm just interested in hearing a little more about why it is needed. In your SGX driver are you essentially maintaining a private free page list for managing the pool of physical memory that backs enclaves?

Exactly. We have enclave's page cache (EPC) memory pool reserved by processor and we register it as fictitious range of physical memory. That EPC pool is encrypted and backs enclave's control information, enclave's code, stack, data, etc.
https://reviews.freebsd.org/D11113

Ok, that helps. Because you are using OBJT_MGTDEVICE in the SGX driver, there is no list of fake pages, i.e., we don't maintain un_pager.devp.devp_pglist for that type of object.

This revision was automatically updated to reflect the committed changes.