Skip to content
Snippets Groups Projects
  1. Apr 19, 2023
  2. Mar 01, 2023
    • Linus Torvalds's avatar
      capability: just use a 'u64' instead of a 'u32[2]' array · f122a08b
      Linus Torvalds authored
      
      Back in 2008 we extended the capability bits from 32 to 64, and we did
      it by extending the single 32-bit capability word from one word to an
      array of two words.  It was then obfuscated by hiding the "2" behind two
      macro expansions, with the reasoning being that maybe it gets extended
      further some day.
      
      That reasoning may have been valid at the time, but the last thing we
      want to do is to extend the capability set any more.  And the array of
      values not only causes source code oddities (with loops to deal with
      it), but also results in worse code generation.  It's a lose-lose
      situation.
      
      So just change the 'u32[2]' into a 'u64' and be done with it.
      
      We still have to deal with the fact that the user space interface is
      designed around an array of these 32-bit values, but that was the case
      before too, since the array layouts were different (ie user space
      doesn't use an array of 32-bit values for individual capability masks,
      but an array of 32-bit slices of multiple masks).
      
      So that marshalling of data is actually simplified too, even if it does
      remain somewhat obscure and odd.
      
      This was all triggered by my reaction to the new "cap_isidentical()"
      introduced recently.  By just using a saner data structure, it went from
      
      	unsigned __capi;
      	CAP_FOR_EACH_U32(__capi) {
      		if (a.cap[__capi] != b.cap[__capi])
      			return false;
      	}
      	return true;
      
      to just being
      
      	return a.val == b.val;
      
      instead.  Which is rather more obvious both to humans and to compilers.
      
      Cc: Mateusz Guzik <mjguzik@gmail.com>
      Cc: Casey Schaufler <casey@schaufler-ca.com>
      Cc: Serge Hallyn <serge@hallyn.com>
      Cc: Al Viro <viro@zeniv.linux.org.uk>
      Cc: Paul Moore <paul@paul-moore.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      f122a08b
  3. Feb 25, 2023
  4. Feb 24, 2023
  5. Feb 23, 2023
    • Lu Wei's avatar
      selftests: fib_tests: Add test cases for IPv4/IPv6 in route notify · 44bd0394
      Lu Wei authored
      
      Add tests to check whether the total fib info length is calculated
      corretly in route notify process.
      
      Signed-off-by: default avatarLu Wei <luwei32@huawei.com>
      Reviewed-by: default avatarDavid Ahern <dsahern@kernel.org>
      Link: https://lore.kernel.org/r/20230222083629.335683-3-luwei32@huawei.com
      
      
      Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      44bd0394
    • Josh Poimboeuf's avatar
      objtool: Fix ORC 'signal' propagation · 00c8f01c
      Josh Poimboeuf authored
      
      There have been some recently reported ORC unwinder warnings like:
      
        WARNING: can't access registers at entry_SYSCALL_64_after_hwframe+0x63/0xcd
        WARNING: stack going in the wrong direction? at __sys_setsockopt+0x2c6/0x5b0 net/socket.c:2271
      
      And a KASAN warning:
      
        BUG: KASAN: stack-out-of-bounds in unwind_next_frame (arch/x86/include/asm/ptrace.h:136 arch/x86/kernel/unwind_orc.c:455)
      
      It turns out the 'signal' bit isn't getting propagated from the unwind
      hints to the ORC entries, making the unwinder confused at times.
      
      Fixes: ffb1b4a4 ("x86/unwind/orc: Add 'signal' field to ORC metadata")
      Reported-by: default avatarkernel test robot <oliver.sang@intel.com>
      Reported-by: default avatarDmitry Vyukov <dvyukov@google.com>
      Signed-off-by: default avatarJosh Poimboeuf <jpoimboe@kernel.org>
      Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
      Link: https://lore.kernel.org/r/97eef9db60cd86d376a9a40d49d77bb67a8f6526.1676579666.git.jpoimboe@kernel.org
      00c8f01c
    • Peter Zijlstra's avatar
      objtool: Remove instruction::list · 1c34496e
      Peter Zijlstra authored
      
      Replace the instruction::list by allocating instructions in arrays of
      256 entries and stringing them together by (amortized) find_insn().
      This shrinks instruction by 16 bytes and brings it down to 128.
      
       struct instruction {
      -	struct list_head           list;                 /*     0    16 */
      -	struct hlist_node          hash;                 /*    16    16 */
      -	struct list_head           call_node;            /*    32    16 */
      -	struct section *           sec;                  /*    48     8 */
      -	long unsigned int          offset;               /*    56     8 */
      -	/* --- cacheline 1 boundary (64 bytes) --- */
      -	long unsigned int          immediate;            /*    64     8 */
      -	unsigned int               len;                  /*    72     4 */
      -	u8                         type;                 /*    76     1 */
      -
      -	/* Bitfield combined with previous fields */
      +	struct hlist_node          hash;                 /*     0    16 */
      +	struct list_head           call_node;            /*    16    16 */
      +	struct section *           sec;                  /*    32     8 */
      +	long unsigned int          offset;               /*    40     8 */
      +	long unsigned int          immediate;            /*    48     8 */
      +	u8                         len;                  /*    56     1 */
      +	u8                         prev_len;             /*    57     1 */
      +	u8                         type;                 /*    58     1 */
      +	s8                         instr;                /*    59     1 */
      +	u32                        idx:8;                /*    60: 0  4 */
      +	u32                        dead_end:1;           /*    60: 8  4 */
      +	u32                        ignore:1;             /*    60: 9  4 */
      +	u32                        ignore_alts:1;        /*    60:10  4 */
      +	u32                        hint:1;               /*    60:11  4 */
      +	u32                        save:1;               /*    60:12  4 */
      +	u32                        restore:1;            /*    60:13  4 */
      +	u32                        retpoline_safe:1;     /*    60:14  4 */
      +	u32                        noendbr:1;            /*    60:15  4 */
      +	u32                        entry:1;              /*    60:16  4 */
      +	u32                        visited:4;            /*    60:17  4 */
      +	u32                        no_reloc:1;           /*    60:21  4 */
      
      -	u16                        dead_end:1;           /*    76: 8  2 */
      -	u16                        ignore:1;             /*    76: 9  2 */
      -	u16                        ignore_alts:1;        /*    76:10  2 */
      -	u16                        hint:1;               /*    76:11  2 */
      -	u16                        save:1;               /*    76:12  2 */
      -	u16                        restore:1;            /*    76:13  2 */
      -	u16                        retpoline_safe:1;     /*    76:14  2 */
      -	u16                        noendbr:1;            /*    76:15  2 */
      -	u16                        entry:1;              /*    78: 0  2 */
      -	u16                        visited:4;            /*    78: 1  2 */
      -	u16                        no_reloc:1;           /*    78: 5  2 */
      +	/* XXX 10 bits hole, try to pack */
      
      -	/* XXX 2 bits hole, try to pack */
      -	/* Bitfield combined with next fields */
      -
      -	s8                         instr;                /*    79     1 */
      -	struct alt_group *         alt_group;            /*    80     8 */
      -	struct instruction *       jump_dest;            /*    88     8 */
      -	struct instruction *       first_jump_src;       /*    96     8 */
      +	/* --- cacheline 1 boundary (64 bytes) --- */
      +	struct alt_group *         alt_group;            /*    64     8 */
      +	struct instruction *       jump_dest;            /*    72     8 */
      +	struct instruction *       first_jump_src;       /*    80     8 */
       	union {
      -		struct symbol *    _call_dest;           /*   104     8 */
      -		struct reloc *     _jump_table;          /*   104     8 */
      -	};                                               /*   104     8 */
      -	struct alternative *       alts;                 /*   112     8 */
      -	struct symbol *            sym;                  /*   120     8 */
      -	/* --- cacheline 2 boundary (128 bytes) --- */
      -	struct stack_op *          stack_ops;            /*   128     8 */
      -	struct cfi_state *         cfi;                  /*   136     8 */
      +		struct symbol *    _call_dest;           /*    88     8 */
      +		struct reloc *     _jump_table;          /*    88     8 */
      +	};                                               /*    88     8 */
      +	struct alternative *       alts;                 /*    96     8 */
      +	struct symbol *            sym;                  /*   104     8 */
      +	struct stack_op *          stack_ops;            /*   112     8 */
      +	struct cfi_state *         cfi;                  /*   120     8 */
      
      -	/* size: 144, cachelines: 3, members: 28 */
      -	/* sum members: 142 */
      -	/* sum bitfield members: 14 bits, bit holes: 1, sum bit holes: 2 bits */
      -	/* last cacheline: 16 bytes */
      +	/* size: 128, cachelines: 2, members: 29 */
      +	/* sum members: 124 */
      +	/* sum bitfield members: 22 bits, bit holes: 1, sum bit holes: 10 bits */
       };
      
      pre:	5:38.18 real,   213.25 user,    124.90 sys,     23449040 mem
      post:	5:03.34 real,   210.75 user,    88.80 sys,      20241232 mem
      
      Signed-off-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
      Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
      Acked-by: default avatarJosh Poimboeuf <jpoimboe@kernel.org>
      Tested-by: Nathan Chancellor <nathan@kernel.org> # build only
      Tested-by: Thomas Weißschuh <linux@weissschuh.net> # compile and run
      Link: https://lore.kernel.org/r/20230208172245.851307606@infradead.org
      1c34496e
    • Peter Zijlstra's avatar
      objtool: Fix overlapping alternatives · a706bb08
      Peter Zijlstra authored
      
      Things like ALTERNATIVE_{2,3}() generate multiple alternatives on the
      same place, objtool would override the first orig_alt_group with the
      second (or third), failing to check the CFI among all the different
      variants.
      
      Signed-off-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
      Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
      Acked-by: default avatarJosh Poimboeuf <jpoimboe@kernel.org>
      Tested-by: Nathan Chancellor <nathan@kernel.org> # build only
      Tested-by: Thomas Weißschuh <linux@weissschuh.net> # compile and run
      Link: https://lore.kernel.org/r/20230208172245.711471461@infradead.org
      a706bb08
    • Peter Zijlstra's avatar
      objtool: Union instruction::{call_dest,jump_table} · c6f5dc28
      Peter Zijlstra authored
      
      The instruction call_dest and jump_table members can never be used at
      the same time, their usage depends on type.
      
       struct instruction {
       	struct list_head           list;                 /*     0    16 */
       	struct hlist_node          hash;                 /*    16    16 */
       	struct list_head           call_node;            /*    32    16 */
       	struct section *           sec;                  /*    48     8 */
       	long unsigned int          offset;               /*    56     8 */
       	/* --- cacheline 1 boundary (64 bytes) --- */
       	long unsigned int          immediate;            /*    64     8 */
       	unsigned int               len;                  /*    72     4 */
       	u8                         type;                 /*    76     1 */
      
       	/* Bitfield combined with previous fields */
      
       	u16                        dead_end:1;           /*    76: 8  2 */
       	u16                        ignore:1;             /*    76: 9  2 */
       	u16                        ignore_alts:1;        /*    76:10  2 */
       	u16                        hint:1;               /*    76:11  2 */
       	u16                        save:1;               /*    76:12  2 */
       	u16                        restore:1;            /*    76:13  2 */
       	u16                        retpoline_safe:1;     /*    76:14  2 */
       	u16                        noendbr:1;            /*    76:15  2 */
       	u16                        entry:1;              /*    78: 0  2 */
       	u16                        visited:4;            /*    78: 1  2 */
       	u16                        no_reloc:1;           /*    78: 5  2 */
      
       	/* XXX 2 bits hole, try to pack */
       	/* Bitfield combined with next fields */
      
       	s8                         instr;                /*    79     1 */
       	struct alt_group *         alt_group;            /*    80     8 */
      -	struct symbol *            call_dest;            /*    88     8 */
      -	struct instruction *       jump_dest;            /*    96     8 */
      -	struct instruction *       first_jump_src;       /*   104     8 */
      -	struct reloc *             jump_table;           /*   112     8 */
      -	struct alternative *       alts;                 /*   120     8 */
      +	struct instruction *       jump_dest;            /*    88     8 */
      +	struct instruction *       first_jump_src;       /*    96     8 */
      +	union {
      +		struct symbol *    _call_dest;           /*   104     8 */
      +		struct reloc *     _jump_table;          /*   104     8 */
      +	};                                               /*   104     8 */
      +	struct alternative *       alts;                 /*   112     8 */
      +	struct symbol *            sym;                  /*   120     8 */
       	/* --- cacheline 2 boundary (128 bytes) --- */
      -	struct symbol *            sym;                  /*   128     8 */
      -	struct stack_op *          stack_ops;            /*   136     8 */
      -	struct cfi_state *         cfi;                  /*   144     8 */
      +	struct stack_op *          stack_ops;            /*   128     8 */
      +	struct cfi_state *         cfi;                  /*   136     8 */
      
      -	/* size: 152, cachelines: 3, members: 29 */
      -	/* sum members: 150 */
      +	/* size: 144, cachelines: 3, members: 28 */
      +	/* sum members: 142 */
       	/* sum bitfield members: 14 bits, bit holes: 1, sum bit holes: 2 bits */
      -	/* last cacheline: 24 bytes */
      +	/* last cacheline: 16 bytes */
       };
      
      pre:	5:39.35 real,   215.58 user,    123.69 sys,     23448736 mem
      post:	5:38.18 real,   213.25 user,    124.90 sys,     23449040 mem
      
      Signed-off-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
      Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
      Acked-by: default avatarJosh Poimboeuf <jpoimboe@kernel.org>
      Tested-by: Nathan Chancellor <nathan@kernel.org> # build only
      Tested-by: Thomas Weißschuh <linux@weissschuh.net> # compile and run
      Link: https://lore.kernel.org/r/20230208172245.640914454@infradead.org
      c6f5dc28
    • Peter Zijlstra's avatar
      objtool: Remove instruction::reloc · 0932dbe1
      Peter Zijlstra authored
      
      Instead of caching the reloc for each instruction, only keep a
      negative cache of not having a reloc (by far the most common case).
      
       struct instruction {
       	struct list_head           list;                 /*     0    16 */
       	struct hlist_node          hash;                 /*    16    16 */
       	struct list_head           call_node;            /*    32    16 */
       	struct section *           sec;                  /*    48     8 */
       	long unsigned int          offset;               /*    56     8 */
       	/* --- cacheline 1 boundary (64 bytes) --- */
       	long unsigned int          immediate;            /*    64     8 */
       	unsigned int               len;                  /*    72     4 */
       	u8                         type;                 /*    76     1 */
      
       	/* Bitfield combined with previous fields */
      
       	u16                        dead_end:1;           /*    76: 8  2 */
       	u16                        ignore:1;             /*    76: 9  2 */
       	u16                        ignore_alts:1;        /*    76:10  2 */
       	u16                        hint:1;               /*    76:11  2 */
       	u16                        save:1;               /*    76:12  2 */
       	u16                        restore:1;            /*    76:13  2 */
       	u16                        retpoline_safe:1;     /*    76:14  2 */
       	u16                        noendbr:1;            /*    76:15  2 */
       	u16                        entry:1;              /*    78: 0  2 */
       	u16                        visited:4;            /*    78: 1  2 */
      +	u16                        no_reloc:1;           /*    78: 5  2 */
      
      -	/* XXX 3 bits hole, try to pack */
      +	/* XXX 2 bits hole, try to pack */
       	/* Bitfield combined with next fields */
      
       	s8                         instr;                /*    79     1 */
       	struct alt_group *         alt_group;            /*    80     8 */
       	struct symbol *            call_dest;            /*    88     8 */
       	struct instruction *       jump_dest;            /*    96     8 */
       	struct instruction *       first_jump_src;       /*   104     8 */
       	struct reloc *             jump_table;           /*   112     8 */
      -	struct reloc *             reloc;                /*   120     8 */
      +	struct alternative *       alts;                 /*   120     8 */
       	/* --- cacheline 2 boundary (128 bytes) --- */
      -	struct alternative *       alts;                 /*   128     8 */
      -	struct symbol *            sym;                  /*   136     8 */
      -	struct stack_op *          stack_ops;            /*   144     8 */
      -	struct cfi_state *         cfi;                  /*   152     8 */
      +	struct symbol *            sym;                  /*   128     8 */
      +	struct stack_op *          stack_ops;            /*   136     8 */
      +	struct cfi_state *         cfi;                  /*   144     8 */
      
      -	/* size: 160, cachelines: 3, members: 29 */
      -	/* sum members: 158 */
      -	/* sum bitfield members: 13 bits, bit holes: 1, sum bit holes: 3 bits */
      -	/* last cacheline: 32 bytes */
      +	/* size: 152, cachelines: 3, members: 29 */
      +	/* sum members: 150 */
      +	/* sum bitfield members: 14 bits, bit holes: 1, sum bit holes: 2 bits */
      +	/* last cacheline: 24 bytes */
       };
      
      pre:	5:48.89 real,   220.96 user,    127.55 sys,     24834672 mem
      post:	5:39.35 real,   215.58 user,    123.69 sys,     23448736 mem
      
      Signed-off-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
      Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
      Acked-by: default avatarJosh Poimboeuf <jpoimboe@kernel.org>
      Tested-by: Nathan Chancellor <nathan@kernel.org> # build only
      Tested-by: Thomas Weißschuh <linux@weissschuh.net> # compile and run
      Link: https://lore.kernel.org/r/20230208172245.572145269@infradead.org
      0932dbe1
    • Peter Zijlstra's avatar
      objtool: Shrink instruction::{type,visited} · 8b2de412
      Peter Zijlstra authored
      
      Since we don't have that many types in enum insn_type, force it into a
      u8 and re-arrange member to get rid of the holes, saves another 8
      bytes.
      
       struct instruction {
       	struct list_head           list;                 /*     0    16 */
       	struct hlist_node          hash;                 /*    16    16 */
       	struct list_head           call_node;            /*    32    16 */
       	struct section *           sec;                  /*    48     8 */
       	long unsigned int          offset;               /*    56     8 */
       	/* --- cacheline 1 boundary (64 bytes) --- */
      -	unsigned int               len;                  /*    64     4 */
      -	enum insn_type             type;                 /*    68     4 */
      -	long unsigned int          immediate;            /*    72     8 */
      -	u16                        dead_end:1;           /*    80: 0  2 */
      -	u16                        ignore:1;             /*    80: 1  2 */
      -	u16                        ignore_alts:1;        /*    80: 2  2 */
      -	u16                        hint:1;               /*    80: 3  2 */
      -	u16                        save:1;               /*    80: 4  2 */
      -	u16                        restore:1;            /*    80: 5  2 */
      -	u16                        retpoline_safe:1;     /*    80: 6  2 */
      -	u16                        noendbr:1;            /*    80: 7  2 */
      -	u16                        entry:1;              /*    80: 8  2 */
      +	long unsigned int          immediate;            /*    64     8 */
      +	unsigned int               len;                  /*    72     4 */
      +	u8                         type;                 /*    76     1 */
      
      -	/* XXX 7 bits hole, try to pack */
      +	/* Bitfield combined with previous fields */
      
      -	s8                         instr;                /*    82     1 */
      -	u8                         visited;              /*    83     1 */
      +	u16                        dead_end:1;           /*    76: 8  2 */
      +	u16                        ignore:1;             /*    76: 9  2 */
      +	u16                        ignore_alts:1;        /*    76:10  2 */
      +	u16                        hint:1;               /*    76:11  2 */
      +	u16                        save:1;               /*    76:12  2 */
      +	u16                        restore:1;            /*    76:13  2 */
      +	u16                        retpoline_safe:1;     /*    76:14  2 */
      +	u16                        noendbr:1;            /*    76:15  2 */
      +	u16                        entry:1;              /*    78: 0  2 */
      +	u16                        visited:4;            /*    78: 1  2 */
      
      -	/* XXX 4 bytes hole, try to pack */
      +	/* XXX 3 bits hole, try to pack */
      +	/* Bitfield combined with next fields */
      
      -	struct alt_group *         alt_group;            /*    88     8 */
      -	struct symbol *            call_dest;            /*    96     8 */
      -	struct instruction *       jump_dest;            /*   104     8 */
      -	struct instruction *       first_jump_src;       /*   112     8 */
      -	struct reloc *             jump_table;           /*   120     8 */
      +	s8                         instr;                /*    79     1 */
      +	struct alt_group *         alt_group;            /*    80     8 */
      +	struct symbol *            call_dest;            /*    88     8 */
      +	struct instruction *       jump_dest;            /*    96     8 */
      +	struct instruction *       first_jump_src;       /*   104     8 */
      +	struct reloc *             jump_table;           /*   112     8 */
      +	struct reloc *             reloc;                /*   120     8 */
       	/* --- cacheline 2 boundary (128 bytes) --- */
      -	struct reloc *             reloc;                /*   128     8 */
      -	struct alternative *       alts;                 /*   136     8 */
      -	struct symbol *            sym;                  /*   144     8 */
      -	struct stack_op *          stack_ops;            /*   152     8 */
      -	struct cfi_state *         cfi;                  /*   160     8 */
      +	struct alternative *       alts;                 /*   128     8 */
      +	struct symbol *            sym;                  /*   136     8 */
      +	struct stack_op *          stack_ops;            /*   144     8 */
      +	struct cfi_state *         cfi;                  /*   152     8 */
      
      -	/* size: 168, cachelines: 3, members: 29 */
      -	/* sum members: 162, holes: 1, sum holes: 4 */
      -	/* sum bitfield members: 9 bits, bit holes: 1, sum bit holes: 7 bits */
      -	/* last cacheline: 40 bytes */
      +	/* size: 160, cachelines: 3, members: 29 */
      +	/* sum members: 158 */
      +	/* sum bitfield members: 13 bits, bit holes: 1, sum bit holes: 3 bits */
      +	/* last cacheline: 32 bytes */
       };
      
      pre:	5:48.86 real,   220.30 user,    128.34 sys,     24834672 mem
      post:	5:48.89 real,   220.96 user,    127.55 sys,     24834672 mem
      
      Signed-off-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
      Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
      Acked-by: default avatarJosh Poimboeuf <jpoimboe@kernel.org>
      Tested-by: Nathan Chancellor <nathan@kernel.org> # build only
      Tested-by: Thomas Weißschuh <linux@weissschuh.net> # compile and run
      Link: https://lore.kernel.org/r/20230208172245.501847188@infradead.org
      8b2de412
    • Peter Zijlstra's avatar
      objtool: Make instruction::alts a single-linked list · d5406654
      Peter Zijlstra authored
      
       struct instruction {
       	struct list_head           list;                 /*     0    16 */
       	struct hlist_node          hash;                 /*    16    16 */
       	struct list_head           call_node;            /*    32    16 */
       	struct section *           sec;                  /*    48     8 */
       	long unsigned int          offset;               /*    56     8 */
       	/* --- cacheline 1 boundary (64 bytes) --- */
       	unsigned int               len;                  /*    64     4 */
       	enum insn_type             type;                 /*    68     4 */
       	long unsigned int          immediate;            /*    72     8 */
       	u16                        dead_end:1;           /*    80: 0  2 */
       	u16                        ignore:1;             /*    80: 1  2 */
       	u16                        ignore_alts:1;        /*    80: 2  2 */
       	u16                        hint:1;               /*    80: 3  2 */
       	u16                        save:1;               /*    80: 4  2 */
       	u16                        restore:1;            /*    80: 5  2 */
       	u16                        retpoline_safe:1;     /*    80: 6  2 */
       	u16                        noendbr:1;            /*    80: 7  2 */
       	u16                        entry:1;              /*    80: 8  2 */
      
       	/* XXX 7 bits hole, try to pack */
      
       	s8                         instr;                /*    82     1 */
       	u8                         visited;              /*    83     1 */
      
       	/* XXX 4 bytes hole, try to pack */
      
       	struct alt_group *         alt_group;            /*    88     8 */
       	struct symbol *            call_dest;            /*    96     8 */
       	struct instruction *       jump_dest;            /*   104     8 */
       	struct instruction *       first_jump_src;       /*   112     8 */
       	struct reloc *             jump_table;           /*   120     8 */
       	/* --- cacheline 2 boundary (128 bytes) --- */
       	struct reloc *             reloc;                /*   128     8 */
      -	struct list_head           alts;                 /*   136    16 */
      -	struct symbol *            sym;                  /*   152     8 */
      -	struct stack_op *          stack_ops;            /*   160     8 */
      -	struct cfi_state *         cfi;                  /*   168     8 */
      +	struct alternative *       alts;                 /*   136     8 */
      +	struct symbol *            sym;                  /*   144     8 */
      +	struct stack_op *          stack_ops;            /*   152     8 */
      +	struct cfi_state *         cfi;                  /*   160     8 */
      
      -	/* size: 176, cachelines: 3, members: 29 */
      -	/* sum members: 170, holes: 1, sum holes: 4 */
      +	/* size: 168, cachelines: 3, members: 29 */
      +	/* sum members: 162, holes: 1, sum holes: 4 */
       	/* sum bitfield members: 9 bits, bit holes: 1, sum bit holes: 7 bits */
      -	/* last cacheline: 48 bytes */
      +	/* last cacheline: 40 bytes */
       };
      
      pre:	5:58.50 real,   229.64 user,    128.65 sys,     26221520 mem
      post:	5:48.86 real,   220.30 user,    128.34 sys,     24834672 mem
      
      Signed-off-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
      Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
      Acked-by: default avatarJosh Poimboeuf <jpoimboe@kernel.org>
      Tested-by: Nathan Chancellor <nathan@kernel.org> # build only
      Tested-by: Thomas Weißschuh <linux@weissschuh.net> # compile and run
      Link: https://lore.kernel.org/r/20230208172245.430556498@infradead.org
      d5406654
    • Peter Zijlstra's avatar
      objtool: Make instruction::stack_ops a single-linked list · 3ee88df1
      Peter Zijlstra authored
      
       struct instruction {
       	struct list_head           list;                 /*     0    16 */
       	struct hlist_node          hash;                 /*    16    16 */
       	struct list_head           call_node;            /*    32    16 */
       	struct section *           sec;                  /*    48     8 */
       	long unsigned int          offset;               /*    56     8 */
       	/* --- cacheline 1 boundary (64 bytes) --- */
       	unsigned int               len;                  /*    64     4 */
       	enum insn_type             type;                 /*    68     4 */
       	long unsigned int          immediate;            /*    72     8 */
       	u16                        dead_end:1;           /*    80: 0  2 */
       	u16                        ignore:1;             /*    80: 1  2 */
       	u16                        ignore_alts:1;        /*    80: 2  2 */
       	u16                        hint:1;               /*    80: 3  2 */
       	u16                        save:1;               /*    80: 4  2 */
       	u16                        restore:1;            /*    80: 5  2 */
       	u16                        retpoline_safe:1;     /*    80: 6  2 */
       	u16                        noendbr:1;            /*    80: 7  2 */
       	u16                        entry:1;              /*    80: 8  2 */
      
       	/* XXX 7 bits hole, try to pack */
      
       	s8                         instr;                /*    82     1 */
       	u8                         visited;              /*    83     1 */
      
       	/* XXX 4 bytes hole, try to pack */
      
       	struct alt_group *         alt_group;            /*    88     8 */
       	struct symbol *            call_dest;            /*    96     8 */
       	struct instruction *       jump_dest;            /*   104     8 */
       	struct instruction *       first_jump_src;       /*   112     8 */
       	struct reloc *             jump_table;           /*   120     8 */
       	/* --- cacheline 2 boundary (128 bytes) --- */
       	struct reloc *             reloc;                /*   128     8 */
       	struct list_head           alts;                 /*   136    16 */
       	struct symbol *            sym;                  /*   152     8 */
      -	struct list_head           stack_ops;            /*   160    16 */
      -	struct cfi_state *         cfi;                  /*   176     8 */
      +	struct stack_op *          stack_ops;            /*   160     8 */
      +	struct cfi_state *         cfi;                  /*   168     8 */
      
      -	/* size: 184, cachelines: 3, members: 29 */
      -	/* sum members: 178, holes: 1, sum holes: 4 */
      +	/* size: 176, cachelines: 3, members: 29 */
      +	/* sum members: 170, holes: 1, sum holes: 4 */
       	/* sum bitfield members: 9 bits, bit holes: 1, sum bit holes: 7 bits */
      -	/* last cacheline: 56 bytes */
      +	/* last cacheline: 48 bytes */
       };
      
      pre:	5:58.22 real,   226.69 user,    131.22 sys,     26221520 mem
      post:	5:58.50 real,   229.64 user,    128.65 sys,     26221520 mem
      
      Signed-off-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
      Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
      Acked-by: default avatarJosh Poimboeuf <jpoimboe@kernel.org>
      Tested-by: Nathan Chancellor <nathan@kernel.org> # build only
      Tested-by: Thomas Weißschuh <linux@weissschuh.net> # compile and run
      Link: https://lore.kernel.org/r/20230208172245.362196959@infradead.org
      3ee88df1
    • Peter Zijlstra's avatar
      objtool: Change arch_decode_instruction() signature · 20a55463
      Peter Zijlstra authored
      
      In preparation to changing struct instruction around a bit, avoid
      passing it's members by pointer and instead pass the whole thing.
      
      A cleanup in it's own right too.
      
      Signed-off-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
      Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
      Acked-by: default avatarJosh Poimboeuf <jpoimboe@kernel.org>
      Tested-by: Nathan Chancellor <nathan@kernel.org> # build only
      Tested-by: Thomas Weißschuh <linux@weissschuh.net> # compile and run
      Link: https://lore.kernel.org/r/20230208172245.291087549@infradead.org
      20a55463
  6. Feb 22, 2023
  7. Feb 21, 2023
  8. Feb 20, 2023
  9. Feb 18, 2023
  10. Feb 17, 2023
Loading