Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

crypto: hisilicon/qm - move the barrier before writing to the mailbox register

Before sending the data via the mailbox to the hardware, to ensure
that the data accessed by the hardware is the most up-to-date,
a write barrier should be added before writing to the mailbox register.
The current memory barrier is placed after writing to the register,
the barrier order should be modified to be before writing to the register.

Signed-off-by: Chenghai Huang <huangchenghai2@huawei.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>

authored by

Chenghai Huang and committed by
Herbert Xu
ebf35d8f 3d313505

+5 -1
+5 -1
drivers/crypto/hisilicon/qm.c
··· 609 609 } 610 610 611 611 #if IS_ENABLED(CONFIG_ARM64) 612 + /* 613 + * The dmb oshst instruction ensures that the data in the 614 + * mailbox is written before it is sent to the hardware. 615 + */ 612 616 asm volatile("ldp %0, %1, %3\n" 613 - "stp %0, %1, %2\n" 614 617 "dmb oshst\n" 618 + "stp %0, %1, %2\n" 615 619 : "=&r" (tmp0), 616 620 "=&r" (tmp1), 617 621 "+Q" (*((char __iomem *)fun_base))