[Bug target/113312] Update __attribute__((interrupt)) for Intel FRED

2024-01-13 Thread hpa at zytor dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113312 --- Comment #21 from H. Peter Anvin --- I think this could be a really useful performance improvement in general. The Linux exception and syscall paths have a fair number of tail calls on the primary path, and this would make it possible to

[Bug target/113312] Update __attribute__((interrupt)) for Intel FRED

2024-01-13 Thread hjl.tools at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113312 --- Comment #20 from H.J. Lu --- In Linux kernel 6.7.0 on x86-64, do_exit is changed from do_exit: endbr64 call push %r15 push %r14 push %r13 push %r12 mov%rdi,%r12

[Bug target/113312] Update __attribute__((interrupt)) for Intel FRED

2024-01-13 Thread hpa at zytor dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113312 --- Comment #19 from H. Peter Anvin --- I'm away for the long weekend, but I'll try it out on Tuesday.

[Bug target/113312] Update __attribute__((interrupt)) for Intel FRED

2024-01-13 Thread hjl.tools at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113312 --- Comment #18 from H.J. Lu --- (In reply to H.J. Lu from comment #17) > Please try users/hjl/pr113312/gcc-13 branch: > > https://gitlab.com/x86-gcc/gcc/-/tree/users/hjl/pr113312/gcc- > 13?ref_type=heads > > It supports

[Bug target/113312] Update __attribute__((interrupt)) for Intel FRED

2024-01-12 Thread hjl.tools at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113312 --- Comment #17 from H.J. Lu --- Please try users/hjl/pr113312/gcc-13 branch: https://gitlab.com/x86-gcc/gcc/-/tree/users/hjl/pr113312/gcc-13?ref_type=heads It supports no_callee_saved_registers attribute. It should also avoid saving

[Bug target/113312] Update __attribute__((interrupt)) for Intel FRED

2024-01-11 Thread hjl.tools at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113312 --- Comment #16 from H.J. Lu --- I updated users/hjl/pr113312/master branch to handle function pointers.

[Bug target/113312] Update __attribute__((interrupt)) for Intel FRED

2024-01-11 Thread hpa at zytor dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113312 --- Comment #15 from H. Peter Anvin --- That should be fine for this use case, obviously. I should add the following: the reason the assembly stub isn't a problem for FRED whereas it is a bit of a nuisance for IDT-style delivery is that with

[Bug target/113312] Update __attribute__((interrupt)) for Intel FRED

2024-01-11 Thread hjl.tools at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113312 --- Comment #14 from H.J. Lu --- Here is a branch for __attribute__((no_callee_saved_registers)): https://gitlab.com/x86-gcc/gcc/-/commits/users/hjl/pr113312/master Calling a function with __attribute__((no_callee_saved_registers)) doesn't

[Bug target/113312] Update __attribute__((interrupt)) for Intel FRED

2024-01-11 Thread hpa at zytor dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113312 --- Comment #13 from H. Peter Anvin --- No, it will not. Most OSes flows will want to merge the kernel and user flows at some point for some handlers, so it isn't clear that that makes sense.

[Bug target/113312] Update __attribute__((interrupt)) for Intel FRED

2024-01-11 Thread fw at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113312 Florian Weimer changed: What|Removed |Added CC||fw at gcc dot gnu.org --- Comment #12

[Bug target/113312] Update __attribute__((interrupt)) for Intel FRED

2024-01-10 Thread liuhongt at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113312 Hongtao Liu changed: What|Removed |Added CC||liuhongt at gcc dot gnu.org --- Comment

[Bug target/113312] Update __attribute__((interrupt)) for Intel FRED

2024-01-10 Thread hpa at zytor dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113312 --- Comment #10 from H. Peter Anvin --- Right, is there such an attribute (that's what I'm asking for in bug 103503)? All I see in the gcc documentation is no_calle*R*_saved_registers, which, again, is the exact opposite.

[Bug target/113312] Update __attribute__((interrupt)) for Intel FRED

2024-01-10 Thread hjl.tools at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113312 --- Comment #9 from H.J. Lu --- (In reply to H.J. Lu from comment #8) > (In reply to H.J. Lu from comment #7) > > (In reply to H. Peter Anvin from comment #6) > > > Of course. That's not what we want in the Linux kernel specifically, > > >

[Bug target/113312] Update __attribute__((interrupt)) for Intel FRED

2024-01-10 Thread hjl.tools at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113312 --- Comment #8 from H.J. Lu --- (In reply to H.J. Lu from comment #7) > (In reply to H. Peter Anvin from comment #6) > > Of course. That's not what we want in the Linux kernel specifically, though. > > It's really up to the OS. > >

[Bug target/113312] Update __attribute__((interrupt)) for Intel FRED

2024-01-10 Thread hjl.tools at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113312 --- Comment #7 from H.J. Lu --- (In reply to H. Peter Anvin from comment #6) > Of course. That's not what we want in the Linux kernel specifically, though. > It's really up to the OS. no_callee_saved_registers attribute is sufficient. One can

[Bug target/113312] Update __attribute__((interrupt)) for Intel FRED

2024-01-10 Thread hpa at zytor dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113312 --- Comment #6 from H. Peter Anvin --- Of course. That's not what we want in the Linux kernel specifically, though. It's really up to the OS.

[Bug target/113312] Update __attribute__((interrupt)) for Intel FRED

2024-01-10 Thread hjl.tools at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113312 --- Comment #5 from H.J. Lu --- (In reply to H. Peter Anvin from comment #3) > Created attachment 57032 [details] > FRED assembly entry stub (example, slightly modified from the Linux kernel) Can you do asm_fred_entry_\type: endbr64

[Bug target/113312] Update __attribute__((interrupt)) for Intel FRED

2024-01-10 Thread hpa at zytor dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113312 --- Comment #4 from H. Peter Anvin --- (In reply to H.J. Lu from comment #2) > (In reply to H. Peter Anvin from comment #1) > > This is actually a specific use case of the feature requested in bug 103503. > > This covers #1. Should FRED

[Bug target/113312] Update __attribute__((interrupt)) for Intel FRED

2024-01-10 Thread hpa at zytor dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113312 --- Comment #3 from H. Peter Anvin --- Created attachment 57032 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57032=edit FRED assembly entry stub (example, slightly modified from the Linux kernel)

[Bug target/113312] Update __attribute__((interrupt)) for Intel FRED

2024-01-10 Thread hjl.tools at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113312 H.J. Lu changed: What|Removed |Added Last reconfirmed||2024-01-11 Ever confirmed|0

[Bug target/113312] Update __attribute__((interrupt)) for Intel FRED

2024-01-10 Thread hpa at zytor dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113312 --- Comment #1 from H. Peter Anvin --- This is actually a specific use case of the feature requested in bug 103503.