mbox series

[0/2] ASoC: SOF: dma-trace: Change trace_init() ops parameter list

Message ID 20220128123623.23569-1-peter.ujfalusi@linux.intel.com
Headers show
Series ASoC: SOF: dma-trace: Change trace_init() ops parameter list | expand

Message

Peter Ujfalusi Jan. 28, 2022, 12:36 p.m. UTC
Hi,

the DMA trace implementation on AMD platform assumes that the stream_tag pointer
is pointing the stream_tag member of struct sof_ipc_dma_trace_params_ext, which
is true at the moment, but it can not be guarantied and a change in the dtrace
core can cause out of bound accesses for AMD.

For this reason, change the API to pass the struct itself which will remove the
assumption and makes it clear from both sides what is expected to be sent via the
parameter list.

This opens up a window to clean up the intel and AMD implementation at the same
time.

Regards,
Peter
---

Peter Ujfalusi (2):
  ASoC: SOF: intel: hda-trace: Pass the dma buffer pointer to
    hda_dsp_trace_prepare
  ASoC: SOF: dma-trace: Pass pointer to params_ext struct in
    trace_init()

 sound/soc/sof/amd/acp-trace.c   | 38 ++++++++-------------------------
 sound/soc/sof/amd/acp.h         |  3 ++-
 sound/soc/sof/intel/hda-trace.c | 17 ++++++++-------
 sound/soc/sof/intel/hda.h       |  3 ++-
 sound/soc/sof/ops.h             |  4 ++--
 sound/soc/sof/sof-priv.h        |  2 +-
 sound/soc/sof/trace.c           |  2 +-
 7 files changed, 26 insertions(+), 43 deletions(-)

Comments

Mark Brown Feb. 8, 2022, 6:59 p.m. UTC | #1
On Fri, 28 Jan 2022 14:36:21 +0200, Peter Ujfalusi wrote:
> the DMA trace implementation on AMD platform assumes that the stream_tag pointer
> is pointing the stream_tag member of struct sof_ipc_dma_trace_params_ext, which
> is true at the moment, but it can not be guarantied and a change in the dtrace
> core can cause out of bound accesses for AMD.
> 
> For this reason, change the API to pass the struct itself which will remove the
> assumption and makes it clear from both sides what is expected to be sent via the
> parameter list.
> 
> [...]

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next

Thanks!

[1/2] ASoC: SOF: intel: hda-trace: Pass the dma buffer pointer to hda_dsp_trace_prepare
      commit: 91e716b2a4f997cafb017c04351c2751fc820637
[2/2] ASoC: SOF: dma-trace: Pass pointer to params_ext struct in trace_init()
      commit: bab05b508ebfde32a14880696a13820d54510fcb

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark