[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <7d3ba8bb-fbb6-097c-fa5a-6b3ec21f72e3@intel.com>
Date: Wed, 20 Nov 2019 16:46:53 -0700
From: Dave Jiang <dave.jiang@...el.com>
To: "Hansen, Dave" <dave.hansen@...el.com>,
"dmaengine@...r.kernel.org" <dmaengine@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"vkoul@...nel.org" <vkoul@...nel.org>
Cc: "Williams, Dan J" <dan.j.williams@...el.com>,
"Luck, Tony" <tony.luck@...el.com>,
"Lin, Jing" <jing.lin@...el.com>,
"Raj, Ashok" <ashok.raj@...el.com>,
"Kumar, Sanjay K" <sanjay.k.kumar@...el.com>,
"Dey, Megha" <megha.dey@...el.com>,
"Pan, Jacob jun" <jacob.jun.pan@...el.com>,
"Liu, Yi L" <yi.l.liu@...el.com>,
"axboe@...nel.dk" <axboe@...nel.dk>,
"akpm@...ux-foundation.org" <akpm@...ux-foundation.org>,
"tglx@...utronix.de" <tglx@...utronix.de>,
"mingo@...hat.com" <mingo@...hat.com>,
"bp@...en8.de" <bp@...en8.de>,
"Yu, Fenghua" <fenghua.yu@...el.com>,
"hpa@...or.com" <hpa@...or.com>
Subject: Re: [PATCH RFC 01/14] x86/asm: add iosubmit_cmds512() based on
movdir64b CPU instruction
On 11/20/19 2:50 PM, Hansen, Dave wrote:
> On 11/20/19 1:23 PM, Dave Jiang wrote:
>> +static inline void __iowrite512(void __iomem *__dst, const void *src)
>> +{
>> + volatile struct { char _[64]; } *dst = __dst;
>
> This _looks_ like gibberish. I know it's not, but it is subtle enough
> that it really needs specific comments.
I'll add comments explaining.
>
>> +static inline void iosubmit_cmds512(void __iomem *dst, const void *src,
>> + size_t count)
>> +{
>> + const u8 *from = src;
>> + const u8 *end = from + count * 64;
>> +
>> + if (!cpu_has_write512())
>> + return;
>> +
>> + while (from < end) {
>> + __iowrite512(dst, from);
>> + from += 64;
>> + }
>> +}
>
> Won't this silently just drop things if the CPU doesn't have movdir64b
> support?
>
> It seems like this shouldn't be called at all if
> !cpu_has_write512(), but wouldn't something like this be mroe appropriate?
>
> if (!cpu_has_write512()) {
> WARN_ON_ONCE(1);
> return;
> }
>
> Is the caller just supposed to infer that "dst" was never overwritten?
>
Thanks. I'll add the WARN().
Powered by blists - more mailing lists