From: Dave Jiang <dave.jiang@intel.com>
To: Borislav Petkov <bp@alien8.de>
Cc: vkoul@kernel.org, tglx@linutronix.de, mingo@redhat.com,
dan.j.williams@intel.com, tony.luck@intel.com,
jing.lin@intel.com, ashok.raj@intel.com,
sanjay.k.kumar@intel.com, fenghua.yu@intel.com,
kevin.tian@intel.com, dmaengine@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v4 1/5] x86/asm: move the raw asm in iosubmit_cmds512() to special_insns.h
Date: Wed, 23 Sep 2020 08:43:11 -0700 [thread overview]
Message-ID: <c38406b7-f1d1-35d8-8015-bacce7a52226@intel.com> (raw)
In-Reply-To: <20200923104158.GG28545@zn.tnic>
On 9/23/2020 3:41 AM, Borislav Petkov wrote:
>> Subject: Re: [PATCH v4 1/5] x86/asm: move the raw asm in iosubmit_cmds512() to special_insns.h
>
> Start patch name with a capital letter: "Move the asm definition.."
>
> Also, calling stuff "raw" and "core" is misleading in the kernel context
> - you wanna say simply: "Carve out a generic movdir64b() helper... "
Ok I will update
>
> On Thu, Sep 17, 2020 at 02:15:16PM -0700, Dave Jiang wrote:
>> diff --git a/arch/x86/include/asm/special_insns.h b/arch/x86/include/asm/special_insns.h
>> index 59a3e13204c3..7bc8e714f37e 100644
>> --- a/arch/x86/include/asm/special_insns.h
>> +++ b/arch/x86/include/asm/special_insns.h
>> @@ -234,6 +234,23 @@ static inline void clwb(volatile void *__p)
>>
>> #define nop() asm volatile ("nop")
>>
>> +static inline void movdir64b(void *__dst, const void *src)
>
> Make __dst be the function local variable name and keep "dst", i.e.,
> without the underscores, the function parameter name.
Ok will fix
>
>> + /*
>> + * Note that this isn't an "on-stack copy", just definition of "dst"
>> + * as a pointer to 64-bytes of stuff that is going to be overwritten.
>> + * In the MOVDIR64B case that may be needed as you can use the
>> + * MOVDIR64B instruction to copy arbitrary memory around. This trick
>> + * lets the compiler know how much gets clobbered.
>> + */
>> + volatile struct { char _[64]; } *dst = __dst;
>> +
>> + /* MOVDIR64B [rdx], rax */
>> + asm volatile(".byte 0x66, 0x0f, 0x38, 0xf8, 0x02"
>> + : "=m" (dst)
>> + : "d" (src), "a" (dst));
>> +}
>> +
>> #endif /* __KERNEL__ */
>>
>> #endif /* _ASM_X86_SPECIAL_INSNS_H */
>>
>
next prev parent reply other threads:[~2020-09-23 15:43 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-17 21:15 [PATCH v4 0/5] Add shared workqueue support for idxd driver Dave Jiang
2020-09-17 21:15 ` [PATCH v4 1/5] x86/asm: move the raw asm in iosubmit_cmds512() to special_insns.h Dave Jiang
2020-09-23 10:41 ` Borislav Petkov
2020-09-23 15:43 ` Dave Jiang [this message]
2020-09-23 16:00 ` David Laight
2020-09-17 21:15 ` [PATCH v4 2/5] x86/asm: add enqcmds() to support ENQCMDS instruction Dave Jiang
2020-09-23 11:08 ` Borislav Petkov
2020-09-23 15:47 ` Dave Jiang
2020-09-17 21:15 ` [PATCH v4 4/5] dmaengine: idxd: clean up descriptors with fault error Dave Jiang
2020-09-17 21:15 ` [PATCH v4 5/5] dmaengine: idxd: add ABI documentation for shared wq Dave Jiang
2020-09-17 23:43 ` [PATCH v4 0/5] Add shared workqueue support for idxd driver Randy Dunlap
2020-09-17 23:51 ` Dave Jiang
2020-09-17 23:56 ` Randy Dunlap
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=c38406b7-f1d1-35d8-8015-bacce7a52226@intel.com \
--to=dave.jiang@intel.com \
--cc=ashok.raj@intel.com \
--cc=bp@alien8.de \
--cc=dan.j.williams@intel.com \
--cc=dmaengine@vger.kernel.org \
--cc=fenghua.yu@intel.com \
--cc=jing.lin@intel.com \
--cc=kevin.tian@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=sanjay.k.kumar@intel.com \
--cc=tglx@linutronix.de \
--cc=tony.luck@intel.com \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).