[DTrace-devel] [oracle/dtrace-utils] d09005: cg: lift restriction of 1st arg to bcopy() not bei...

euloh noreply at github.com
Wed Jan 18 20:24:46 UTC 2023


  Branch: refs/heads/dev
  Home:   https://github.com/oracle/dtrace-utils
  Commit: d090056fc1427e733b6c4934da993645348f9b91
      https://github.com/oracle/dtrace-utils/commit/d090056fc1427e733b6c4934da993645348f9b91
  Author: Kris Van Hees <kris.van.hees at oracle.com>
  Date:   2023-01-18 (Wed, 18 Jan 2023)

  Changed paths:
    M libdtrace/dt_cg.c
    A test/unittest/funcs/bcopy/err.badbcopy.d
    A test/unittest/funcs/bcopy/err.badbcopy.r
    A test/unittest/funcs/bcopy/err.badbcopy1.d
    A test/unittest/funcs/bcopy/err.badbcopy1.r
    A test/unittest/funcs/bcopy/err.badbcopy2.d
    A test/unittest/funcs/bcopy/err.badbcopy2.r
    A test/unittest/funcs/bcopy/err.badbcopy3.d
    A test/unittest/funcs/bcopy/err.badbcopy3.r
    A test/unittest/funcs/bcopy/err.badbcopy4.d
    A test/unittest/funcs/bcopy/err.badbcopy4.r
    A test/unittest/funcs/bcopy/err.badbcopy5.d
    A test/unittest/funcs/bcopy/err.badbcopy5.r
    A test/unittest/funcs/bcopy/err.badbcopy6.d
    A test/unittest/funcs/bcopy/err.badbcopy6.r
    A test/unittest/funcs/bcopy/err.badbcopy7.d
    A test/unittest/funcs/bcopy/err.badbcopy7.r
    A test/unittest/funcs/bcopy/err.badbcopy8.d
    A test/unittest/funcs/bcopy/err.badbcopy8.r
    A test/unittest/funcs/bcopy/tst.bcopy.d
    A test/unittest/funcs/bcopy/tst.bcopy2.d
    R test/unittest/funcs/err.badbcopy.d
    R test/unittest/funcs/err.badbcopy.r
    R test/unittest/funcs/err.badbcopy1.d
    R test/unittest/funcs/err.badbcopy1.r
    R test/unittest/funcs/err.badbcopy2.d
    R test/unittest/funcs/err.badbcopy2.r
    R test/unittest/funcs/err.badbcopy3.d
    R test/unittest/funcs/err.badbcopy3.r
    R test/unittest/funcs/err.badbcopy4.d
    R test/unittest/funcs/err.badbcopy4.r
    R test/unittest/funcs/err.badbcopy5.d
    R test/unittest/funcs/err.badbcopy5.r
    R test/unittest/funcs/err.badbcopy6.d
    R test/unittest/funcs/err.badbcopy6.r
    R test/unittest/funcs/err.badbcopy7.d
    R test/unittest/funcs/err.badbcopy7.r
    R test/unittest/funcs/err.badbcopy8.d
    R test/unittest/funcs/err.badbcopy8.r
    R test/unittest/funcs/tst.bcopy.d

  Log Message:
  -----------
  cg: lift restriction of 1st arg to bcopy() not being alloca

The documentation states that the source address is not allowed to be
within the scratch memory region, but the legacy implementation does
not actually enforce that restriction, nor does it seem necessary.

This patch also moves bcopy tests into their own directory.

Signed-off-by: Kris Van Hees <kris.van.hees at oracle.com>
Reviewed-by: Eugene Loh <eugene.loh at oracle.com>


  Commit: ca761db74a141cf2b8758575e651320f99dc62bc
      https://github.com/oracle/dtrace-utils/commit/ca761db74a141cf2b8758575e651320f99dc62bc
  Author: Eugene Loh <eugene.loh at oracle.com>
  Date:   2023-01-18 (Wed, 18 Jan 2023)

  Changed paths:
    M libdtrace/dt_cg.c
    M libdtrace/dt_cg.h
    M libdtrace/dt_prov_dtrace.c
    M libdtrace/dt_prov_fbt.c
    M libdtrace/dt_prov_profile.c
    M libdtrace/dt_prov_uprobe.c

  Log Message:
  -----------
  Standardize use of %r7, %r8, and %r9 in trampoline generation

In libdtrace/dt_cg.c, a number of functions generate the trampoline.

After a call to dt_cg_tramp_prologue[_act](), we can expect:
    %r7 contains a pointer to dctx->mst
    %r8 contains a pointer to dctx->ctx
    %r9 contains a pointer to dctx

Most other calls to dt_cg_tramp_*() functions rely on these values.
However,
    dt_cg_tramp_copy_args_from_regs()
    dt_cg_tramp_copy_regs()
    dt_cg_tramp_copy_rval_from_regs()
all pass BPF_REG_8 in via an argument rp.  This is unnecessary.  In fact,
the last two functions don't even use the passed-in argument, already using
the known, hard-wired value BPF_REG_8 instead.

Do not pass BPF_REG_8 in to these functions.  Clean up the comments and
interfaces and switch dt_cg_tramp_copy_args_from_regs() to use BPF_REG_8
explicitly, as the other functions already do.

Signed-off-by: Eugene Loh <eugene.loh at oracle.com>
Reviewed-by: Kris Van Hees <kris.van.hees at oracle.com>


Compare: https://github.com/oracle/dtrace-utils/compare/7c655ca914e7...ca761db74a14



More information about the DTrace-devel mailing list