Page MenuHomeFreeBSD

Correct undesirable interaction between caching of %cr4 in bhyve and invltlb_glob().
ClosedPublic

Authored by kib on Apr 19 2018, 11:28 PM.
Tags
None
Referenced Files
Unknown Object (File)
Jan 16 2024, 12:54 AM
Unknown Object (File)
Jan 7 2024, 3:31 PM
Unknown Object (File)
Dec 20 2023, 7:16 AM
Unknown Object (File)
Dec 19 2023, 12:10 PM
Unknown Object (File)
Dec 12 2023, 5:47 AM
Unknown Object (File)
Nov 25 2023, 6:20 PM
Unknown Object (File)
Nov 16 2023, 9:51 PM
Unknown Object (File)
Nov 9 2023, 7:56 AM
Subscribers

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

Update comment (actually commit the last edits).

This looks sensible to me.

This revision is now accepted and ready to land.Apr 20 2018, 5:00 PM
grehan added a subscriber: grehan.

This looks fine, though I'm interested in the circumstances that this can happen - can module-load pre-empt an existing kernel thread that is in the midst of invltlb_glob() ?

This looks fine, though I'm interested in the circumstances that this can happen - can module-load pre-empt an existing kernel thread that is in the midst of invltlb_glob() ?

Yes, exactly. I did not see anything in the vmm.ko load code which disabled preemption, and preemption can happen while pmap does an invalidation in the kernel pmap. We only pin the thread, we do not enter critical section there.

Of course, it is very bad luck to actually get it in real life. I did not, I just read the code.

BTW, there is another similar 'unlikely thing I saw in vmx_support.S. vmx_enter_guest uses stack space below the bottom to form the INVEPT descriptor. Until very recent time, we could get e.g. MCE executed on the thread stack with interrupts disabled. MCE was changed to use IST, but IMO we should be more careful. And, amd64 kernel does not use red zone.

This revision was automatically updated to reflect the committed changes.