Hi Stefano,

> On 3 Sep 2022, at 12:21 am, Stefano Stabellini <sstabell...@kernel.org> wrote:
> 
> On Fri, 2 Sep 2022, Rahul Singh wrote:
>> From: Zhou Wang <wangzh...@hisilicon.com>
>> 
>> Backport Linux commit a76a37777f2c. This is the clean backport without
>> any changes.
>> 
>> Reading the 'prod' MMIO register in order to determine whether or
>> not there is valid data beyond 'cons' for a given queue does not
>> provide sufficient dependency ordering, as the resulting access is
>> address dependent only on 'cons' and can therefore be speculated
>> ahead of time, potentially allowing stale data to be read by the
>> CPU.
>> 
>> Use readl() instead of readl_relaxed() when updating the shadow copy
>> of the 'prod' pointer, so that all speculated memory reads from the
>> corresponding queue can occur only from valid slots.
>> 
>> Signed-off-by: Zhou Wang <wangzh...@hisilicon.com>
>> Link: 
>> https://lore.kernel.org/r/1601281922-117296-1-git-send-email-wangzh...@hisilicon.com
>> [will: Use readl() instead of explicit barrier. Update 'cons' side to match.]
>> Signed-off-by: Will Deacon <w...@kernel.org>
>> Origin: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 
>> a76a37777f2c
>> Signed-off-by: Rahul Singh <rahul.si...@arm.com>
>> ---
>> Changes in v2:
>> - fix commit msg
>> - add _iomb changes also from the origin patch
>> ---
>> xen/arch/arm/include/asm/system.h     |  1 +
>> xen/drivers/passthrough/arm/smmu-v3.c | 11 +++++++++--
>> 2 files changed, 10 insertions(+), 2 deletions(-)
>> 
>> diff --git a/xen/arch/arm/include/asm/system.h 
>> b/xen/arch/arm/include/asm/system.h
>> index 65d5c8e423..fe27cf8c5e 100644
>> --- a/xen/arch/arm/include/asm/system.h
>> +++ b/xen/arch/arm/include/asm/system.h
>> @@ -29,6 +29,7 @@
>> #endif
>> 
>> #define smp_wmb()       dmb(ishst)
>> +#define __iomb()        dmb(osh)
> 
> We don't have any other #define starting with __ in system.h.
> I wonder if we should call this macro differently or simply iomb().
 
I think either iomb() or dma_mb() will be the right name.
Please let me know your view on this.

Regards,
Rahul

Reply via email to