lkml.org 
[lkml]   [2023]   [Feb]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    SubjectRe: [RFC PATCH v1 1/2] selftests/x86: sysret_rip: Handle syscall in a FRED system
    From
    On 15/02/2023 9:17 am, Andrew Cooper wrote:
    > On 26/01/2023 8:08 pm, Ammar Faizi wrote:
    >> On Mon, Jan 23, 2023 at 05:40:23PM -0800, H. Peter Anvin wrote:
    >>> So as per Andrew's comment, add:
    >>>
    >>> register void * rsp asm("%rsp");
    >>>
    >>> ...
    >>>
    >>> "+r" (rsp) /* clobber the redzone */
    >>>
    >>> ... as the right way to avoid redzone problems.
    >> I played with this more. I found something wrong with this. This doesn't
    >> work for me. The compiler still uses red zone despite I use "+r" (rsp).
    >>
    >> What did I do wrong?
    > Well this is a fine mess...
    >
    > https://godbolt.org/z/MaPM7s8qr does the right thing, but is now
    > contrary to the prior discussion regarding calls in asm, which concluded
    > that the "+r"(rsp) was the way to go.
    >
    > Furthermore GCC regressed in 9.0 and emits:
    >
    >   warning: listing the stack pointer register 'rsp' in a clobber list is
    > deprecated [-Wdeprecated]
    >
    > which might be the intention of the developers, but is wrong seeing as
    > this is the only way to say "I modify the redzone" to the compiler...

    I've opened https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108799

    ~Andrew

    \
     
     \ /
      Last update: 2023-03-27 00:24    [W:4.369 / U:0.228 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site