Re: [Xen-devel] [PATCH v2 2.5/4] xen/x86: Replace mandatory barriers with compiler barriers
>>> On 16.08.17 at 19:18,wrote: > In this case, rmb() is being used for its compiler barrier property. Replace > it with an explicit barrer() and comment, to avoid it becoming an > unnecessary > lfence instruction (when rmb() gets fixed) or looking like an SMP issue. > > Signed-off-by: Andrew Cooper Reviewed-by: Jan Beulich But you forgot to Cc Suravee (now done), for him to have a chance to ack the change. Jan > --- a/xen/drivers/passthrough/amd/iommu_init.c > +++ b/xen/drivers/passthrough/amd/iommu_init.c > @@ -558,7 +558,7 @@ static void parse_event_log_entry(struct amd_iommu > *iommu, u32 entry[]) > return; > } > udelay(1); > -rmb(); > +barrier(); /* Prevent hoisting of the entry[] read. */ > code = get_field_from_reg_u32(entry[1], IOMMU_EVENT_CODE_MASK, >IOMMU_EVENT_CODE_SHIFT); > } > @@ -663,7 +663,7 @@ void parse_ppr_log_entry(struct amd_iommu *iommu, u32 > entry[]) > return; > } > udelay(1); > -rmb(); > +barrier(); /* Prevent hoisting of the entry[] read. */ > code = get_field_from_reg_u32(entry[1], IOMMU_PPR_LOG_CODE_MASK, >IOMMU_PPR_LOG_CODE_SHIFT); > } > -- > 2.1.4 ___ Xen-devel mailing list Xen-devel@lists.xen.org https://lists.xen.org/xen-devel
[Xen-devel] [PATCH v2 2.5/4] xen/x86: Replace mandatory barriers with compiler barriers
In this case, rmb() is being used for its compiler barrier property. Replace it with an explicit barrer() and comment, to avoid it becoming an unnecessary lfence instruction (when rmb() gets fixed) or looking like an SMP issue. Signed-off-by: Andrew Cooper--- CC: Jan Beulich --- xen/drivers/passthrough/amd/iommu_init.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xen/drivers/passthrough/amd/iommu_init.c b/xen/drivers/passthrough/amd/iommu_init.c index a459e99..474992a 100644 --- a/xen/drivers/passthrough/amd/iommu_init.c +++ b/xen/drivers/passthrough/amd/iommu_init.c @@ -558,7 +558,7 @@ static void parse_event_log_entry(struct amd_iommu *iommu, u32 entry[]) return; } udelay(1); -rmb(); +barrier(); /* Prevent hoisting of the entry[] read. */ code = get_field_from_reg_u32(entry[1], IOMMU_EVENT_CODE_MASK, IOMMU_EVENT_CODE_SHIFT); } @@ -663,7 +663,7 @@ void parse_ppr_log_entry(struct amd_iommu *iommu, u32 entry[]) return; } udelay(1); -rmb(); +barrier(); /* Prevent hoisting of the entry[] read. */ code = get_field_from_reg_u32(entry[1], IOMMU_PPR_LOG_CODE_MASK, IOMMU_PPR_LOG_CODE_SHIFT); } -- 2.1.4 ___ Xen-devel mailing list Xen-devel@lists.xen.org https://lists.xen.org/xen-devel