Re: [PATCH RFC 01/14] x86/asm: add iosubmit_cmds512() based on movdir64b CPU instruction

From: Borislav Petkov
Date: Thu Nov 21 2019 - 05:59:27 EST


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?

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?

--
Regards/Gruss,
Boris.

https://people.kernel.org/tglx/notes-about-netiquette