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

Re: [PATCH] x86/vmx: reorder code in vmx_deliver_posted_intr


  • To: Jan Beulich <jbeulich@xxxxxxxx>
  • From: Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Date: Fri, 31 Jul 2020 15:56:56 +0200
  • Authentication-results: esa5.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none
  • Cc: xen-devel@xxxxxxxxxxxxxxxxxxxx, Kevin Tian <kevin.tian@xxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Jun Nakajima <jun.nakajima@xxxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • Delivery-date: Fri, 31 Jul 2020 13:57:24 +0000
  • Ironport-sdr: lYBgwtNojffg8me2tMYK+TdIMt1R4Rw6s59L1lDEjqqTWz/4HQKl0oH+SQeud8JvLkUYS2Syu7 04r9Fk/Kf8alVC83vQ9SWQ0rDeRB/TtuER1MzlBLXna48iStRkgUuZDGTfNxzW5krS+FXarJQG G68OvhHq627BjqLYHfx6Sjvr6z68jW2RuEuCeD1kzYvyxZDGFN9YNsOytEny31c7ktaq6XBoae XZIdiG96syJuhd8ZD6JM3OBohhKWQ9YCtlEmb4Q91zCk0dtE/Z4CISJ7mfuZqAa/O2OaA+N9Cj JU0=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On Fri, Jul 31, 2020 at 03:05:52PM +0200, Jan Beulich wrote:
> On 30.07.2020 16:03, Roger Pau Monne wrote:
> > Remove the unneeded else branch, which allows to reduce the
> > indentation of a larger block of code, while making the flow of the
> > function more obvious.
> > 
> > No functional change intended.
> > 
> > Signed-off-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>
> 
> Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx>
> 
> One minor request (could likely be taken care of while
> committing):
> 
> > @@ -2014,41 +2016,36 @@ static void vmx_deliver_posted_intr(struct vcpu *v, 
> > u8 vector)
> >           * VMEntry as it used to be.
> >           */
> >          pi_set_on(&v->arch.hvm.vmx.pi_desc);
> > +        vcpu_kick(v);
> > +        return;
> >      }
> > -    else
> > -    {
> > -        struct pi_desc old, new, prev;
> >  
> > -        prev.control = v->arch.hvm.vmx.pi_desc.control;
> > +    prev.control = v->arch.hvm.vmx.pi_desc.control;
> >  
> > -        do {
> > -            /*
> > -             * Currently, we don't support urgent interrupt, all
> > -             * interrupts are recognized as non-urgent interrupt,
> > -             * Besides that, if 'ON' is already set, no need to
> > -             * sent posted-interrupts notification event as well,
> > -             * according to hardware behavior.
> > -             */
> > -            if ( pi_test_sn(&prev) || pi_test_on(&prev) )
> > -            {
> > -                vcpu_kick(v);
> > -                return;
> > -            }
> > -
> > -            old.control = v->arch.hvm.vmx.pi_desc.control &
> > -                          ~((1 << POSTED_INTR_ON) | (1 << POSTED_INTR_SN));
> > -            new.control = v->arch.hvm.vmx.pi_desc.control |
> > -                          (1 << POSTED_INTR_ON);
> > +    do {
> > +        /*
> > +         * Currently, we don't support urgent interrupt, all
> > +         * interrupts are recognized as non-urgent interrupt,
> > +         * Besides that, if 'ON' is already set, no need to
> > +         * sent posted-interrupts notification event as well,
> > +         * according to hardware behavior.
> > +         */
> 
> Would be nice to s/sent/send/ here as you move it (maybe also
> remove the plural from "posted-interrupts") and - if possible -
> re-flow for the now increased space on the right side.

Oh, sure, I should have realized myself. Feel free to adjust at commit
if you don't mind. I would also adjust 'non-urgent interrupts'.

Thanks, Roger.



 


Rackspace

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