All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bard liao <yung-chuan.liao@linux.intel.com>
To: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>,
	Takashi Iwai <tiwai@suse.de>
Cc: daniel.baluta@gmail.com, andriy.shevchenko@intel.com,
	alsa-devel@alsa-project.org, liam.r.girdwood@linux.intel.com,
	vkoul@kernel.org, broonie@kernel.org, alan@linux.intel.com,
	sound-open-firmware@alsa-project.org
Subject: Re: [PATCH v3 09/14] ASoC: SOF: Add firmware, loader support
Date: Fri, 21 Dec 2018 17:05:04 +0800	[thread overview]
Message-ID: <f715299c-d610-2dc2-d968-82c4cf75a5ea@linux.intel.com> (raw)
In-Reply-To: <05d38b48-559f-75ce-6299-e1dfd3a62c30@linux.intel.com>


On 12/20/2018 11:07 PM, Pierre-Louis Bossart wrote:
>
>>>>> + snd_sof_dsp_block_write(sdev, offset,
>>>>> +                    (void *)block + sizeof(*block),
>>>>> +                    block->size);
>>>>> +
>>>>> +        /* next block */
>>>>> +        block = (void *)block + sizeof(*block) + block->size;
>>>> This may lead to an unaligned access.
>>> Did you mean we should double check the block->size to
>>> prevent access to an invalid address?
>> You need two types of checks for the given data:
>> - The bounce check of block->size;
>>    We need to avoid out-of-bounce access.
> s/bounce/bounds ?
>>
>> - Alignment of block->size;
>>    For some non-x86 platforms, the access to an unaligned address might
>>    be illegal.
>
> Maybe I am missing something but I don't see any sort of explicit 
> restriction on alignment in the SOF tools. it looks implicit based on 
> address offsets and bases.

Maybe get_unaligned() is good enough to avoid unaligned access?

>
> Liam, do you see any negative side effects if we enforce a 32-bit 
> alignment for all blocks (which essentially means all block sizes are 
> multiple of 4)? we can try and experiment but it's better if we have 
> an agreement on the design.
>
>
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

  reply	other threads:[~2018-12-21  9:05 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <mailman.3934.1544619824.753.alsa-devel@alsa-project.org>
2018-12-20  2:11 ` [PATCH v3 09/14] ASoC: SOF: Add firmware, loader support Bard liao
2018-12-20  8:16   ` Takashi Iwai
2018-12-20 15:07     ` Pierre-Louis Bossart
2018-12-21  9:05       ` Bard liao [this message]
2018-12-21  9:57         ` Takashi Iwai
2018-12-21 15:43           ` Liam Girdwood
2018-12-11 21:23 [PATCH v3 00/14] Sound Open Firmware (SOF) core Pierre-Louis Bossart
2018-12-11 21:23 ` [PATCH v3 09/14] ASoC: SOF: Add firmware loader support Pierre-Louis Bossart
2018-12-11 22:38   ` Andy Shevchenko
2018-12-11 23:54     ` Pierre-Louis Bossart
2019-01-09 20:55       ` Mark Brown
2018-12-12 11:23   ` Takashi Iwai
2019-01-09 21:02   ` Mark Brown
2019-01-09 21:24     ` Pierre-Louis Bossart

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f715299c-d610-2dc2-d968-82c4cf75a5ea@linux.intel.com \
    --to=yung-chuan.liao@linux.intel.com \
    --cc=alan@linux.intel.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=andriy.shevchenko@intel.com \
    --cc=broonie@kernel.org \
    --cc=daniel.baluta@gmail.com \
    --cc=liam.r.girdwood@linux.intel.com \
    --cc=pierre-louis.bossart@linux.intel.com \
    --cc=sound-open-firmware@alsa-project.org \
    --cc=tiwai@suse.de \
    --cc=vkoul@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.