lkml.org 
[lkml]   [2015]   [Oct]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRE: [PATCH] iommu/vt-d: Use cmpxchg16b to update posted format IRTE atomically
Date


> -----Original Message-----
> From: linux-kernel-owner@vger.kernel.org [mailto:linux-kernel-
> owner@vger.kernel.org] On Behalf Of Joerg Roedel
> Sent: Thursday, October 15, 2015 10:24 PM
> To: Wu, Feng <feng.wu@intel.com>
> Cc: iommu@lists.linux-foundation.org; linux-kernel@vger.kernel.org
> Subject: Re: [PATCH] iommu/vt-d: Use cmpxchg16b to update posted format
> IRTE atomically
>
> On Thu, Oct 15, 2015 at 10:19:11AM +0800, Feng Wu wrote:
> > If IRTE is in posted format, the 'pda' field goes across the 64-bit
> > boundary, we need use cmpxchg16b to atomically update it. We only
> > expose posted-interrupt when X86_FEATURE_CX16 is supported and use
> > to update it atomically.
> > +
> > + ret = cmpxchg_double(&irte->low, &irte->high,
> > + irte->low, irte->high,
> > + irte_modified->low, irte_modified->high);
> > + /*
> > + * We use cmpxchg16 to atomically update the 128-bit IRTE,
> > + * and it cannot be updated by the hardware or other
> processors
> > + * behind us, so the return value of cmpxchg16 should be the
> > + * same as the old value.
> > + */
> > + BUG_ON(!ret);
>
> Changed this to a WARN_ON, otherwise applied.

Thanks a lot, Joerg!

Thanks,
Feng


\
 
 \ /
  Last update: 2015-10-16 03:21    [W:0.054 / U:0.196 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site