mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Michael Kelley (LINUX)" <mikelley@microsoft.com>
To: "Michael Kelley (LINUX)" <mikelley@microsoft.com>,
	"tglx@linutronix.de" <tglx@linutronix.de>,
	"mingo@redhat.com" <mingo@redhat.com>,
	"dave.hansen@linux.intel.com" <dave.hansen@linux.intel.com>,
	"bp@alien8.de" <bp@alien8.de>
Cc: Dave Hansen <dave.hansen@intel.com>,
	"hpa@zytor.com" <hpa@zytor.com>,
	"x86@kernel.org" <x86@kernel.org>,
	"linux-hyperv@vger.kernel.org" <linux-hyperv@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Sean Christopherson <seanjc@google.com>
Subject: RE: [PATCH 1/1] x86/irq: Add hardcoded hypervisor interrupts to /proc/stat
Date: Thu, 13 Apr 2023 23:19:56 +0000	[thread overview]
Message-ID: <BYAPR21MB1688027848D4BAE9A39FC613D7989@BYAPR21MB1688.namprd21.prod.outlook.com> (raw)
In-Reply-To: <BYAPR21MB1688CF3ABAF181A17443BF3FD7879@BYAPR21MB1688.namprd21.prod.outlook.com>

From: Michael Kelley (LINUX) <mikelley@microsoft.com> Sent: Thursday, March 23, 2023 10:36 AM
> 
> From: Sean Christopherson <seanjc@google.com> Sent: Wednesday, March 22, 2023
> 6:27 PM
> >
> > On Wed, Mar 22, 2023, Michael Kelley (LINUX) wrote:
> > > From: Dave Hansen <dave.hansen@intel.com> Sent: Wednesday, March 22, 2023
> > 11:07 AM
> > > >
> > > > On 2/27/23 10:46, Michael Kelley wrote:
> > > > > diff --git a/arch/x86/kernel/irq.c b/arch/x86/kernel/irq.c
> > > > > index 766ffe3..9f668d2 100644
> > > > > --- a/arch/x86/kernel/irq.c
> > > > > +++ b/arch/x86/kernel/irq.c
> > > > > @@ -211,6 +211,13 @@ u64 arch_irq_stat_cpu(unsigned int cpu)
> > > > >  #ifdef CONFIG_X86_MCE_THRESHOLD
> > > > >  	sum += irq_stats(cpu)->irq_threshold_count;
> > > > >  #endif
> > > > > +#ifdef CONFIG_X86_HV_CALLBACK_VECTOR
> > > > > +	sum += irq_stats(cpu)->irq_hv_callback_count;
> > > > > +#endif
> > > > > +#if IS_ENABLED(CONFIG_HYPERV)
> > > > > +	sum += irq_stats(cpu)->irq_hv_reenlightenment_count;
> > > > > +	sum += irq_stats(cpu)->hyperv_stimer0_count;
> > > > > +#endif
> > > > >  #ifdef CONFIG_X86_MCE
> > > > >  	sum += per_cpu(mce_exception_count, cpu);
> > > > >  	sum += per_cpu(mce_poll_count, cpu);
> > > >
> > > > This seems fine, especially since arch_show_interrupts() has them.  But,
> > > > what's with the "#if IS_ENABLED" versus the plain #ifdef?  Is there some
> > > > difference I'm missing?  Why not just be consistent with the other code
> > > > and use a plain #ifdef for both?
> > >
> > > I'm following the coding pattern in arch_show_interrupts(), in irq_cpustat_t,
> > > and most other places that test CONFIG_HYPERV.   Maybe all those existing
> > > cases are a mis-application of Documentation/process/coding-style.rst
> > > Section 21, which prefers "if (IS_ENABLED(CONFIG_HYPERV))" over
> > > "#ifdef CONFIG_HYPERV".  "#if IS_ENABLED()" is not the same as
> > > "if (IS_ENABLED())".  :-)
> > >
> > >  Net, I don't have a strong preference either way.
> >
> > Using IS_ENABLED() is mandatory because CONFIG_HYPERV is a tri-state, i.e. can
> > be a module and thus #define CONFIG_HYPER_MODULE instead of CONFIG_HYPERV.
> 
> Ah, right.  Thanks.
> 

x86 maintainers:   Any issues with picking up this patch for the 6.4 merge window?

Michael


  reply	other threads:[~2023-04-13 23:20 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-27 18:46 Michael Kelley
2023-03-20 20:37 ` Michael Kelley (LINUX)
2023-03-22 18:07 ` Dave Hansen
2023-03-22 19:52   ` Michael Kelley (LINUX)
2023-03-23  1:26     ` Sean Christopherson
2023-03-23 17:36       ` Michael Kelley (LINUX)
2023-04-13 23:19         ` Michael Kelley (LINUX) [this message]
2023-06-08 15:20   ` Michael Kelley (LINUX)

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=BYAPR21MB1688027848D4BAE9A39FC613D7989@BYAPR21MB1688.namprd21.prod.outlook.com \
    --to=mikelley@microsoft.com \
    --cc=bp@alien8.de \
    --cc=dave.hansen@intel.com \
    --cc=dave.hansen@linux.intel.com \
    --cc=hpa@zytor.com \
    --cc=linux-hyperv@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=seanjc@google.com \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®