linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: [PATCH] x86/asm: Add support for MOVDIR64B instruction
@ 2019-08-01 19:43 Alexey Dobriyan
  2019-08-01 19:49 ` Luck, Tony
  0 siblings, 1 reply; 16+ messages in thread
From: Alexey Dobriyan @ 2019-08-01 19:43 UTC (permalink / raw)
  To: kirill.shutemov; +Cc: linux-kernel, jing.lin, bp, tony.luck, x86

> +static inline void movdir64b(void *dst, const void *src)
> +{
> +	/* movdir64b [rdx], rax */
> +	asm volatile(".byte 0x66, 0x0f, 0x38, 0xf8, 0x02"
> +			: "=m" (*(char *)dst)
                               ^^^^^^^^^^

> +			: "d" (src), "a" (dst));
> +}

Probably needs fake 64-byte type, so that compiler knows what is dirty.

^ permalink raw reply	[flat|nested] 16+ messages in thread
* [PATCH] x86/asm: Add support for MOVDIR64B instruction
@ 2019-07-30 23:05 Kirill A. Shutemov
  2019-07-31  0:24 ` jinglin
  2019-08-01 10:03 ` Borislav Petkov
  0 siblings, 2 replies; 16+ messages in thread
From: Kirill A. Shutemov @ 2019-07-30 23:05 UTC (permalink / raw)
  To: Thomas Gleixner, Ingo Molnar, Borislav Petkov, H. Peter Anvin
  Cc: x86, Luck, Tony, Lin, Jing, Kumar, Sanjay K, linux-kernel,
	Kirill A. Shutemov

Add support for a new instruction MOVDIR64B. The instruction moves
64-bytes as direct-store with 64-byte write atomicity from source memory
address to destination memory address.

MOVDIR64B requires the destination address to be 64-byte aligned. No
alignment restriction is enforced for source operand.

See Intel Software Developer’s Manual for more information on the
instruction.

Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
---

Several upcoming patchsets will make use of the helper.

---
 arch/x86/include/asm/special_insns.h | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/arch/x86/include/asm/special_insns.h b/arch/x86/include/asm/special_insns.h
index 219be88a59d2..059e7bd331d2 100644
--- a/arch/x86/include/asm/special_insns.h
+++ b/arch/x86/include/asm/special_insns.h
@@ -248,6 +248,13 @@ static inline void clwb(volatile void *__p)
 
 #define nop() asm volatile ("nop")
 
+static inline void movdir64b(void *dst, const void *src)
+{
+	/* movdir64b [rdx], rax */
+	asm volatile(".byte 0x66, 0x0f, 0x38, 0xf8, 0x02"
+			: "=m" (*(char *)dst)
+			: "d" (src), "a" (dst));
+}
 
 #endif /* __KERNEL__ */
 
-- 
2.21.0


^ permalink raw reply related	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2019-08-05 17:50 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-01 19:43 [PATCH] x86/asm: Add support for MOVDIR64B instruction Alexey Dobriyan
2019-08-01 19:49 ` Luck, Tony
2019-08-01 20:28   ` Kirill A. Shutemov
2019-08-01 20:36     ` Borislav Petkov
2019-08-01 22:06       ` Luck, Tony
2019-08-02 14:40         ` Borislav Petkov
2019-08-05 17:50           ` Lin, Jing
2019-08-01 21:53   ` Alexey Dobriyan
2019-08-02  8:15   ` Peter Zijlstra
2019-08-02 12:58     ` Kirill A. Shutemov
  -- strict thread matches above, loose matches on Subject: below --
2019-07-30 23:05 Kirill A. Shutemov
2019-07-31  0:24 ` jinglin
2019-08-01 10:03 ` Borislav Petkov
2019-08-01 11:03   ` Kirill A. Shutemov
2019-08-01 19:20   ` Luck, Tony
2019-08-01 19:36     ` Borislav Petkov

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).