LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: KY Srinivasan <kys@microsoft.com>
To: Thomas Gleixner <tglx@linutronix.de>
Cc: "olaf@aepfle.de" <olaf@aepfle.de>,
	Stephen Hemminger <sthemmin@microsoft.com>,
	"gregkh@linuxfoundation.org" <gregkh@linuxfoundation.org>,
	"jasowang@redhat.com" <jasowang@redhat.com>,
	"x86@kernel.org" <x86@kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"Michael Kelley \(EOSG\)" <Michael.H.Kelley@microsoft.com>,
	"hpa@zytor.com" <hpa@zytor.com>,
	"apw@canonical.com" <apw@canonical.com>,
	"devel@linuxdriverproject.org" <devel@linuxdriverproject.org>,
	"vkuznets@redhat.com" <vkuznets@redhat.com>
Subject: RE: [PATCH 3/5] X86: Hyper-V: Enhanced IPI enlightenment
Date: Fri, 27 Apr 2018 06:24:21 +0000	[thread overview]
Message-ID: <MW2PR2101MB111348D79C56945B695A04C8A08D0@MW2PR2101MB1113.namprd21.prod.outlook.com> (raw)
In-Reply-To: <alpine.DEB.2.21.1804270009080.1596@nanos.tec.linutronix.de>



> -----Original Message-----
> From: Thomas Gleixner <tglx@linutronix.de>
> Sent: Thursday, April 26, 2018 3:17 PM
> To: KY Srinivasan <kys@microsoft.com>
> Cc: x86@kernel.org; gregkh@linuxfoundation.org; linux-
> kernel@vger.kernel.org; devel@linuxdriverproject.org; olaf@aepfle.de;
> apw@canonical.com; jasowang@redhat.com; hpa@zytor.com; Stephen
> Hemminger <sthemmin@microsoft.com>; Michael Kelley (EOSG)
> <Michael.H.Kelley@microsoft.com>; vkuznets@redhat.com
> Subject: Re: [PATCH 3/5] X86: Hyper-V: Enhanced IPI enlightenment
> 
> On Wed, 25 Apr 2018, kys@linuxonhyperv.com wrote:
> >
> > +struct ipi_arg_ex {
> > +	u32 vector;
> > +	u32  reserved;
> > +	struct hv_vpset vp_set;
> 
> Please align that in tabular fashion for easy of reading
> 
> 	u32		vector;
> 	u32  		reserved;
> 	struct hv_vpset	vp_set;
> 
> > +};
> > +
> >  static struct apic orig_apic;
> >
> >  static u64 hv_apic_icr_read(void)
> > @@ -97,6 +103,40 @@ static void hv_apic_eoi_write(u32 reg, u32 val)
> >   * IPI implementation on Hyper-V.
> >   */
> >
> > +static int __send_ipi_mask_ex(const struct cpumask *mask, int vector)
> > +{
> > +	int nr_bank = 0;
> > +	struct ipi_arg_ex **arg;
> > +	struct ipi_arg_ex *ipi_arg;
> > +	int ret = 1;
> > +	unsigned long flags;
> 
> This is really horrible to read.
> 
> 	struct ipi_arg_ex *ipi_arg;
> 	struct ipi_arg_ex **arg;
> 	unsigned long flags;
> 	bool ret = false;
> 	int nr_bank = 0;
> 
> is really more conveniant for quick reading.
> 
> So the other more limited function has a lot more sanity checks vs. vector
> number and other things. Why are they not required here? Comment
> please.

Yes, I will add the comments. This function is called from the other function
after all the sanity checks have been done and hence are not replicated here.
> 
> > +	local_irq_save(flags);
> > +	arg = (struct ipi_arg_ex **)this_cpu_ptr(hyperv_pcpu_input_arg);
> > +
> > +	ipi_arg = *arg;
> > +	if (unlikely(!ipi_arg))
> > +		goto ipi_mask_ex_done;
> > +
> > +	ipi_arg->vector = vector;
> > +	ipi_arg->reserved = 0;
> > +	ipi_arg->vp_set.valid_bank_mask = 0;
> > +
> > +	if (!cpumask_equal(mask, cpu_present_mask)) {
> > +		ipi_arg->vp_set.format = HV_GENERIC_SET_SPARCE_4K;
> > +		nr_bank = cpumask_to_vpset(&(ipi_arg->vp_set), mask);
> 
> nr_bank really confused me. bank_nr is what you mean, not number of
> banks,
> right?
It is the number of banks. The hypercall used here is a variable length
hypercall.

Regards,

K. Y  
_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

  reply	other threads:[~2018-04-27  6:24 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-25 18:11 [PATCH 0/5] X86: Hyper-V: APIC enlightenments kys
2018-04-25 18:12 ` [PATCH 1/5] X86: Hyper-V: Enlighten APIC access kys
2018-04-25 18:12   ` [PATCH 2/5] X86: Hyper-V: Enable IPI enlightenments kys
2018-04-26 21:31     ` Dan Carpenter
2018-04-27  6:34       ` KY Srinivasan
2018-04-26 22:08     ` Thomas Gleixner
2018-04-27  6:11       ` KY Srinivasan
2018-04-26 22:54     ` Michael Kelley (EOSG)
2018-04-27  6:31       ` KY Srinivasan
2018-04-27  6:24     ` kbuild test robot
2018-04-27 11:21     ` kbuild test robot
2018-04-27 11:55     ` kbuild test robot
2018-04-25 18:12   ` [PATCH 3/5] X86: Hyper-V: Enhanced IPI enlightenment kys
2018-04-26 22:16     ` Thomas Gleixner
2018-04-27  6:24       ` KY Srinivasan [this message]
2018-04-26 23:25     ` Michael Kelley (EOSG)
2018-04-25 18:12   ` [PATCH 4/5] X86: Hyper-V: Consolidate code for converting cpumask to vpset kys
2018-04-26 22:21     ` Thomas Gleixner
2018-04-25 18:12   ` [PATCH 5/5] X86: Hyper-V: Consolidate the allocation of the hypercall input page kys
2018-04-26 22:23     ` Thomas Gleixner
2018-04-27  6:29       ` KY Srinivasan
2018-04-27 10:58         ` Thomas Gleixner
2018-04-27 11:50     ` kbuild test robot
2018-04-26 21:49   ` [PATCH 1/5] X86: Hyper-V: Enlighten APIC access Thomas Gleixner
2018-04-27  5:52     ` KY Srinivasan
2018-04-26 22:15   ` Michael Kelley (EOSG)
2018-04-26 22:55     ` Thomas Gleixner
2018-04-27  5:44   ` kbuild test robot

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=MW2PR2101MB111348D79C56945B695A04C8A08D0@MW2PR2101MB1113.namprd21.prod.outlook.com \
    --to=kys@microsoft.com \
    --cc=Michael.H.Kelley@microsoft.com \
    --cc=apw@canonical.com \
    --cc=devel@linuxdriverproject.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=hpa@zytor.com \
    --cc=jasowang@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=olaf@aepfle.de \
    --cc=sthemmin@microsoft.com \
    --cc=tglx@linutronix.de \
    --cc=vkuznets@redhat.com \
    --cc=x86@kernel.org \
    --subject='RE: [PATCH 3/5] X86: Hyper-V: Enhanced IPI enlightenment' \
    /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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).