[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH for-4.14 v2 1/2] x86/passthrough: do not assert edge triggered GSIs for PVH dom0


  • To: Jan Beulich <jbeulich@xxxxxxxx>
  • From: Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Date: Tue, 16 Jun 2020 10:20:02 +0200
  • Authentication-results: esa5.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none
  • Cc: xen-devel@xxxxxxxxxxxxxxxxxxxx, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, paul@xxxxxxx
  • Delivery-date: Tue, 16 Jun 2020 08:20:29 +0000
  • Ironport-sdr: JOYXLTr9zv/b1G07GcaAIU6MeekcuFiFnBqH0Ve2kdkm18NqJ5UI4TPpJZVMeZ+8ocqK5u9iz5 /UQl7RxtSRcXH83BBQ96THbVre7iVc8agwC3sOlw+NFlYzb/PeugK4aaT/c7HiGTxHFmVd/AxP 6D1yX6VZhEbZ+1/ji6L5sxJJjYnDDWP5avbOeWXxIFSzgLJhHJtiz17XUTN/xYRkzcgGOiM2kJ XrPW2rD9NVSwoVlVCVuQm3+Jr2q6XyHANrqLzlkZtbp6izfayKP+yNYY643IlkbjKbSm50WBqN V9A=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On Tue, Jun 16, 2020 at 08:11:12AM +0200, Jan Beulich wrote:
> On 10.06.2020 16:29, Roger Pau Monne wrote:
> > @@ -186,9 +187,10 @@ void hvm_gsi_assert(struct domain *d, unsigned int gsi)
> >       * to know if the GSI is pending or not.
> >       */
> >      spin_lock(&d->arch.hvm.irq_lock);
> > -    if ( !hvm_irq->gsi_assert_count[gsi] )
> > +    if ( trig == VIOAPIC_EDGE_TRIG || !hvm_irq->gsi_assert_count[gsi] )
> >      {
> > -        hvm_irq->gsi_assert_count[gsi] = 1;
> > +        if ( trig == VIOAPIC_LEVEL_TRIG )
> > +            hvm_irq->gsi_assert_count[gsi] = 1;
> 
> Btw, along the lines of how you do things here, I think ...
> 
> > @@ -196,11 +198,12 @@ void hvm_gsi_assert(struct domain *d, unsigned int 
> > gsi)
> >  
> >  void hvm_gsi_deassert(struct domain *d, unsigned int gsi)
> >  {
> > +    int trig = vioapic_get_trigger_mode(d, gsi);
> >      struct hvm_irq *hvm_irq = hvm_domain_irq(d);
> >  
> > -    if ( gsi >= hvm_irq->nr_gsis )
> > +    if ( trig <= VIOAPIC_EDGE_TRIG || gsi >= hvm_irq->nr_gsis )
> 
> ... this would better have been "trig != VIOAPIC_LEVEL_TRIG", to
> avoid the code being dependent upon the actual values of both
> VIOAPIC_*_TRIG constants.

Sure, let me send a follow up patch, it's trivial to fix.

Thanks, Roger.



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.