Skip to content
Snippets Groups Projects
  1. 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
  2. Jan 10, 2023
  3. Oct 13, 2022
  4. Sep 21, 2022
    • Jens Axboe's avatar
      io_uring/fdinfo: fix sqe dumping for IORING_SETUP_SQE128 · 3b8fdd1d
      Jens Axboe authored
      
      If we have doubly sized SQEs, then we need to shift the sq index by 1
      to account for using two entries for a single request. The CQE dumping
      gets this right, but the SQE one does not.
      
      Improve the SQE dumping in general, the information dumped is pretty
      sparse and doesn't even cover the whole basic part of the SQE. Include
      information on the extended part of the SQE, if doubly sized SQEs are
      in use. A typical dump now looks like the following:
      
      [...]
      SQEs:	32
         32: opcode:URING_CMD, fd:0, flags:1, off:3225964160, addr:0x0, rw_flags:0x0, buf_index:0 user_data:2721, e0:0x0, e1:0xffffb8041000, e2:0x100000000000, e3:0x5500, e4:0x7, e5:0x0, e6:0x0, e7:0x0
         33: opcode:URING_CMD, fd:0, flags:1, off:3225964160, addr:0x0, rw_flags:0x0, buf_index:0 user_data:2722, e0:0x0, e1:0xffffb8043000, e2:0x100000000000, e3:0x5508, e4:0x7, e5:0x0, e6:0x0, e7:0x0
         34: opcode:URING_CMD, fd:0, flags:1, off:3225964160, addr:0x0, rw_flags:0x0, buf_index:0 user_data:2723, e0:0x0, e1:0xffffb8045000, e2:0x100000000000, e3:0x5510, e4:0x7, e5:0x0, e6:0x0, e7:0x0
      [...]
      
      Fixes: ebdeb7c0 ("io_uring: add support for 128-byte SQEs")
      Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
      3b8fdd1d
    • Jens Axboe's avatar
      io_uring/fdinfo: get rid of unnecessary is_cqe32 variable · 4f731705
      Jens Axboe authored
      
      We already have the cq_shift, just use that to tell if we have doubly
      sized CQEs or not.
      
      While in there, cleanup the CQE32 vs normal CQE size printing.
      
      Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
      4f731705
  5. Jul 25, 2022
Loading