Skip to content

PINE: Disallow access to pages with custom VTLB handlers#14588

Merged
F0bes merged 2 commits into
PCSX2:masterfrom
chaoticgd:pine_mmio
Jun 28, 2026
Merged

PINE: Disallow access to pages with custom VTLB handlers#14588
F0bes merged 2 commits into
PCSX2:masterfrom
chaoticgd:pine_mmio

Conversation

@chaoticgd

@chaoticgd chaoticgd commented Jun 15, 2026

Copy link
Copy Markdown
Member

Description of Changes

  • Prevent PINE from accessing pages with custom VTLB handlers, such as MMIO registers.
  • Rewrite the vtlb_ramRead function template.

Rationale behind Changes

Calling arbitrary hardware peripherals from the PINE thread is definitely not safe.

The vtlb_ramRead declaration previously didn't match its definition. I ended up changing the definition since it's slightly cleaner, and on my machine it ended up being slightly faster in a little microbenchmark I wrote.

(edit: To clarify, this is an initial fix I wanted to get in until we figure out what to do about #14589)

Suggested Testing Steps

Test some PINE clients.

Did you use AI to help find, test, or implement this issue or feature?

No.

Previously the declaration didn't match the definition, so you couldn't
actually call it.
@Ziemas

Ziemas commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

Sadly it's not actually thread safe for it to write to normal guest RAM either because of the JIT block invalidation.

I wonder if it would be better to queue up PINE commands and run them on the main thread.

@chaoticgd

chaoticgd commented Jun 15, 2026

Copy link
Copy Markdown
Member Author

Sadly it's not actually thread safe for it to write to normal guest RAM either because of the JIT block invalidation.

I wonder if it would be better to queue up PINE commands and run them on the main thread.

Hah, I was literally just about to open an issue about that when you commented. Thanks for bringing it up originally.

@lightningterror lightningterror requested a review from GovanifY June 16, 2026 01:17
@chaoticgd chaoticgd force-pushed the pine_mmio branch 2 times, most recently from 56ca52f to 3c9ecfc Compare June 16, 2026 16:03

@F0bes F0bes left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How am I going to try and drain the hardware FIFOs asynchronously now :( </3

@F0bes F0bes merged commit b67e793 into PCSX2:master Jun 28, 2026
36 checks passed
@Mrlinkwii Mrlinkwii added this to the Release 2.8 milestone Jun 28, 2026
@chaoticgd chaoticgd deleted the pine_mmio branch June 28, 2026 22:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants