lkml.org 
[lkml]   [2019]   [Nov]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH RFC 01/14] x86/asm: add iosubmit_cmds512() based on movdir64b CPU instruction
From
Date


On 11/21/19 3:59 AM, Borislav Petkov wrote:
> On Wed, Nov 20, 2019 at 05:10:41PM -0700, Dave Jiang wrote:
>> I'll add the check on the destination address. The call is modeled after
>> __iowrite64_copy() / __iowrite32_copy() in lib/iomap_copy.c. Looks like
>> those functions do not check for the alignment requirements either.
>
> So just because they don't check, you don't need to check either?

No what I mean was those primitives are missing the checks and we should
probably address that at some point.

>
> Can you guarantee that all callers will always do the right thing?
>
> I mean, if you don't care too much, why even write "(must be 512-bit
> aligned)"? Who cares then if the data is aligned or not...
>


>>>> + * @dst: destination, in MMIO space (must be 512-bit aligned)
>>>> + * @src: source
>>>> + * @count: number of 512 bits quantities to submit
>>>
>>> Where's that check on the data?
>>
>> I don't follow?
>
> What do you do if the caller doesn't submit data in 512 bits quantities?
>

How would I detect that? Add a size (in bytes) parameter for the total
source data?

\
 
 \ /
  Last update: 2019-11-21 17:52    [from the cache]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and my Meterkast|Read the blog