Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reduce the number of search_exception_tables in valid kernel fault path #317

Closed
npiggin opened this issue Jul 22, 2020 · 8 comments
Closed
Assignees
Labels
easy Should be easy

Comments

@npiggin
Copy link

npiggin commented Jul 22, 2020

copy_to/from_user taking valid page faults should have good performance.

This currently searches exception tables at least once for no pte faults, at least twice for prot faults, and sometimes 3 times. This is easy to consolidate the prot fault case to one.

The search is used as a poor man's KUAP and provides almost no benefit if real KUAP is enabled, it could be avoided completely in that case.

The search after mmap_read_trylock is still necessary as the comment explains.

@chleroy
Copy link

chleroy commented Aug 6, 2020

See series at https://patchwork.ozlabs.org/project/linuxppc-dev/list/?series=194507&state=*

Is that what you had in mind ?

@npiggin
Copy link
Author

npiggin commented Aug 6, 2020

Oh nice, yeah that looks pretty good. I will try to review it in time for the next merge window.

@chleroy
Copy link

chleroy commented Dec 8, 2020

New version at https://patchwork.ozlabs.org/project/linuxppc-dev/patch/0d37490a067840f53fc5b118869917c0aec9ab87.1607416578.git.christophe.leroy@csgroup.eu/

This is mainly rebasing on top of Aneesh's changes

I droped the last patch (removal of bad_kuap_fault() warnings) as it doesn't make consensus. We'll see in a second step, maybe we could keep those warnings only when CONFIG_PPC_KUAP_DEBUG is set.

@chleroy chleroy added easy Should be easy in-progress Some work has been done on this issue labels Dec 8, 2020
@chleroy chleroy self-assigned this Dec 8, 2020
@npiggin
Copy link
Author

npiggin commented Mar 8, 2021

Can this be closed?

@mpe
Copy link
Member

mpe commented Mar 9, 2021

Yeah I think so, merged as of: torvalds/linux@5f1888a

I didn't take the removal of the bad_kuap_fault() warnings, that can be a new issue if it needs to be.

@mpe mpe closed this as completed Mar 9, 2021
@mpe mpe removed the in-progress Some work has been done on this issue label Mar 9, 2021
@chleroy
Copy link

chleroy commented Mar 9, 2021

I didn't take the removal of the bad_kuap_fault() warnings, that can be a new issue if it needs to be.

They have been removed, see torvalds/linux@3dc12df

@mpe
Copy link
Member

mpe commented Mar 9, 2021

OK, what do I know 😛

We still have a WARN in bad_kernel_fault(), which I'm happy with.

@chleroy
Copy link

chleroy commented Mar 9, 2021

We still have a WARN in bad_kernel_fault(), which I'm happy with.

Yes that has allowed us to get the search_exception_table() out of the fast path, so everyone is happy :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
easy Should be easy
Projects
Status: Done
Development

No branches or pull requests

3 participants