lkml.org 
[lkml]   [2023]   [Feb]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [RFC PATCH v3 15/32] x86/fred: make unions for the cs and ss fields in struct pt_regs
    On 24/02/2023 7:01 am, Xin Li wrote:
    > diff --git a/arch/x86/include/asm/ptrace.h b/arch/x86/include/asm/ptrace.h
    > index f4db78b09c8f..341e44847cc1 100644
    > --- a/arch/x86/include/asm/ptrace.h
    > +++ b/arch/x86/include/asm/ptrace.h
    > @@ -82,13 +82,41 @@ struct pt_regs {
    > * On hw interrupt, it's IRQ number:
    > */
    > unsigned long orig_ax;
    > -/* Return frame for iretq */
    > +
    > + /* Return frame for iretq/eretu/erets */
    > unsigned long ip;
    > - unsigned long cs;
    > + union {
    > + unsigned long csl; /* CS + any fields above it */

    I guess that CSL here is supposed to mean cs long, but CSL (Current
    Stack Level) is a new term in the FRED spec which isn't this.

    This causes changes such as the final hunk in patch 27 to read
    incorrectly, despite being technically correct.

    cs_slot would be much clearer in code, but tbh, even cs_l would be
    better than the version without an underscore.

    And obviously, whatever is done here should be mirrored for ss.

    ~Andrew

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