[for-4.14,1/8] x86/hvm: fix vIO-APIC build without IRQ0_SPECIAL_ROUTING
diff mbox series

Message ID 20200612155640.4101-2-roger.pau@citrix.com
State New
Headers show
Series
  • x86/vpt: fixes for vpt and enable vPIT for PVH dom0
Related show

Commit Message

Roger Pau Monné June 12, 2020, 3:56 p.m. UTC
pit_channel0_enabled needs to be guarded with IRQ0_SPECIAL_ROUTING
since it's only used when the special handling of ISA IRQ 0 is enabled.

No functional change.

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
---
 xen/arch/x86/hvm/vioapic.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Paul Durrant June 15, 2020, 10 a.m. UTC | #1
> -----Original Message-----
> From: Roger Pau Monne <roger.pau@citrix.com>
> Sent: 12 June 2020 16:57
> To: xen-devel@lists.xenproject.org
> Cc: paul@xen.org; Roger Pau Monne <roger.pau@citrix.com>; Jan Beulich <jbeulich@suse.com>; Andrew
> Cooper <andrew.cooper3@citrix.com>; Wei Liu <wl@xen.org>
> Subject: [PATCH for-4.14 1/8] x86/hvm: fix vIO-APIC build without IRQ0_SPECIAL_ROUTING
> 
> pit_channel0_enabled needs to be guarded with IRQ0_SPECIAL_ROUTING
> since it's only used when the special handling of ISA IRQ 0 is enabled.
> 
> No functional change.
> 
> Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
> ---
>  xen/arch/x86/hvm/vioapic.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/xen/arch/x86/hvm/vioapic.c b/xen/arch/x86/hvm/vioapic.c
> index b87facb0e0..bd41036137 100644
> --- a/xen/arch/x86/hvm/vioapic.c
> +++ b/xen/arch/x86/hvm/vioapic.c
> @@ -391,10 +391,12 @@ static void ioapic_inj_irq(
>      vlapic_set_irq(target, vector, trig_mode);
>  }
> 
> +#ifdef IRQ0_SPECIAL_ROUTING
>  static inline int pit_channel0_enabled(void)
>  {
>      return pt_active(&current->domain->arch.vpit.pt0);
>  }
> +#endif

It's only called in two places. How about just manually inlining?

  Paul

> 
>  static void vioapic_deliver(struct hvm_vioapic *vioapic, unsigned int pin)
>  {
> --
> 2.26.2
Roger Pau Monné June 15, 2020, 11:44 a.m. UTC | #2
On Mon, Jun 15, 2020 at 11:00:38AM +0100, Paul Durrant wrote:
> > -----Original Message-----
> > From: Roger Pau Monne <roger.pau@citrix.com>
> > Sent: 12 June 2020 16:57
> > To: xen-devel@lists.xenproject.org
> > Cc: paul@xen.org; Roger Pau Monne <roger.pau@citrix.com>; Jan Beulich <jbeulich@suse.com>; Andrew
> > Cooper <andrew.cooper3@citrix.com>; Wei Liu <wl@xen.org>
> > Subject: [PATCH for-4.14 1/8] x86/hvm: fix vIO-APIC build without IRQ0_SPECIAL_ROUTING
> > 
> > pit_channel0_enabled needs to be guarded with IRQ0_SPECIAL_ROUTING
> > since it's only used when the special handling of ISA IRQ 0 is enabled.
> > 
> > No functional change.
> > 
> > Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
> > ---
> >  xen/arch/x86/hvm/vioapic.c | 2 ++
> >  1 file changed, 2 insertions(+)
> > 
> > diff --git a/xen/arch/x86/hvm/vioapic.c b/xen/arch/x86/hvm/vioapic.c
> > index b87facb0e0..bd41036137 100644
> > --- a/xen/arch/x86/hvm/vioapic.c
> > +++ b/xen/arch/x86/hvm/vioapic.c
> > @@ -391,10 +391,12 @@ static void ioapic_inj_irq(
> >      vlapic_set_irq(target, vector, trig_mode);
> >  }
> > 
> > +#ifdef IRQ0_SPECIAL_ROUTING
> >  static inline int pit_channel0_enabled(void)
> >  {
> >      return pt_active(&current->domain->arch.vpit.pt0);
> >  }
> > +#endif
> 
> It's only called in two places. How about just manually inlining?

That would be fine, as I'm also removing one of the callers in a
following patch.

Thanks, Roger.

Patch
diff mbox series

diff --git a/xen/arch/x86/hvm/vioapic.c b/xen/arch/x86/hvm/vioapic.c
index b87facb0e0..bd41036137 100644
--- a/xen/arch/x86/hvm/vioapic.c
+++ b/xen/arch/x86/hvm/vioapic.c
@@ -391,10 +391,12 @@  static void ioapic_inj_irq(
     vlapic_set_irq(target, vector, trig_mode);
 }
 
+#ifdef IRQ0_SPECIAL_ROUTING
 static inline int pit_channel0_enabled(void)
 {
     return pt_active(&current->domain->arch.vpit.pt0);
 }
+#endif
 
 static void vioapic_deliver(struct hvm_vioapic *vioapic, unsigned int pin)
 {