lkml.org 
[lkml]   [2015]   [May]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRE: [v6 3/8] iommu, x86: Implement irq_set_vcpu_affinity for intel_ir_chip
Date


> -----Original Message-----
> From: Thomas Gleixner [mailto:tglx@linutronix.de]
> Sent: Thursday, May 21, 2015 6:48 PM
> To: Wu, Feng
> Cc: joro@8bytes.org; dwmw2@infradead.org; jiang.liu@linux.intel.com;
> iommu@lists.linux-foundation.org; linux-kernel@vger.kernel.org
> Subject: Re: [v6 3/8] iommu, x86: Implement irq_set_vcpu_affinity for
> intel_ir_chip
>
> On Thu, 21 May 2015, Feng Wu wrote:
> > +static int intel_ir_set_vcpu_affinity(struct irq_data *data, void *vcpu_info)
> > +{
> > + struct intel_ir_data *ir_data = data->chip_data;
> > + struct irte *irte_pi = &ir_data->irte_pi_entry;
> > + struct vcpu_data *vcpu_pi_info;
> > +
> > + /* stop posting interrupts, back to remapping mode */
> > + if (!vcpu_info)
> > + modify_irte(&ir_data->irq_2_iommu, &ir_data->irte_entry);
> > + else {
>
> We add braces to both branches if one requires it.
>
> > + vcpu_pi_info = (struct vcpu_data *)vcpu_info;
> > + memcpy(irte_pi, &ir_data->irte_entry, sizeof(struct irte));
>
> This lacks a comment WHY you copy irte_entry to irte_pi_entry and WHY
> we have two seperate entries stored in ir_data.

"ir_data->irte_entry" saves the remapped format of IRTE, as you can see
from patch [4/8], it being a cached irte is still updated when setting the
affinity even when we are in posted mode. So this make it possible to switch
back to remapped mode from posted mode, we can just set "ir_data->irte_entry"
to hardware for that purpose. I will add the comments, thanks for the suggestion!

BTW, do you have any other comments/suggestions about this series?
Any comments are appreciated!

Thanks,
Feng

>
> Thanks,
>
> tglx


\
 
 \ /
  Last update: 2015-05-22 03:41    [W:0.043 / U:2.404 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site