> From: Jan Beulich [mailto:jbeul...@suse.com]
> Sent: Thursday, March 16, 2017 6:29 PM
>
> >>> On 15.03.17 at 23:39, wrote:
> > On Wed, Mar 15, 2017 at 10:48:25AM -0600, Jan Beulich wrote:
> > On 15.03.17 at 06:11, wrote:
> >>> +/*
> >>> + * The following method to update IR
> From: Jan Beulich [mailto:jbeul...@suse.com]
> Sent: Thursday, March 16, 2017 6:29 PM
>
> >>> On 15.03.17 at 23:39, wrote:
> > On Wed, Mar 15, 2017 at 10:48:25AM -0600, Jan Beulich wrote:
> > On 15.03.17 at 06:11, wrote:
> >>> +/*
> >>> + * The following method to update IR
>>> On 17.03.17 at 02:52, wrote:
> On Thu, Mar 16, 2017 at 04:29:29AM -0600, Jan Beulich wrote:
> On 15.03.17 at 23:39, wrote:
>>> On Wed, Mar 15, 2017 at 10:48:25AM -0600, Jan Beulich wrote:
>>> On 15.03.17 at 06:11, wrote:
> +/*
> + * The following method to upd
On Thu, Mar 16, 2017 at 04:29:29AM -0600, Jan Beulich wrote:
On 15.03.17 at 23:39, wrote:
>> On Wed, Mar 15, 2017 at 10:48:25AM -0600, Jan Beulich wrote:
>> On 15.03.17 at 06:11, wrote:
+/*
+ * The following method to update IRTE is safe on condition that
+
>>> On 15.03.17 at 23:39, wrote:
> On Wed, Mar 15, 2017 at 10:48:25AM -0600, Jan Beulich wrote:
> On 15.03.17 at 06:11, wrote:
>>> +/*
>>> + * The following method to update IRTE is safe on condition that
>>> + * only the high qword or the low qword is to be updated.
>
On Wed, Mar 15, 2017 at 10:48:25AM -0600, Jan Beulich wrote:
On 15.03.17 at 06:11, wrote:
>> +/*
>> + * The following method to update IRTE is safe on condition that
>> + * only the high qword or the low qword is to be updated.
>> + * If entire IRTE is to be up
>>> On 15.03.17 at 06:11, wrote:
> +static void update_irte(struct iremap_entry *entry,
> +const struct iremap_entry *new_ire)
> +{
> +if ( cpu_has_cx16 )
> +{
> +__uint128_t ret;
> +struct iremap_entry old_ire;
> +
> +old_ire = *entry;
> +
We used structure assignment to update irte which was not safe when an
interrupt happened during update. It is better to update IRTE atomically
through cmpxchg16b(). When cmpxchg16b is not supported, two 64-bit write
operations can update IRTE safely when only the high qword or the low qword is
int