Linux-HyperV Archive on lore.kernel.org
 help / color / Atom feed
From: Michael Kelley <mikelley@microsoft.com>
To: Sunil Muthuswamy <sunilmut@microsoft.com>,
	Wei Liu <wei.liu@kernel.org>,
	Alexander Duyck <alexander.h.duyck@linux.intel.com>
Cc: KY Srinivasan <kys@microsoft.com>,
	Haiyang Zhang <haiyangz@microsoft.com>,
	Stephen Hemminger <sthemmin@microsoft.com>,
	Wei Liu <liuwe@microsoft.com>,
	Tianyu Lan <Tianyu.Lan@microsoft.com>,
	"linux-hyperv@vger.kernel.org" <linux-hyperv@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: RE: [EXTERNAL] Re: [PATCH] x86/Hyper-V: Support for free page reporting
Date: Sat, 23 May 2020 00:40:24 +0000
Message-ID: <MW2PR2101MB10520A323E708F71A9944758D7B50@MW2PR2101MB1052.namprd21.prod.outlook.com> (raw)
In-Reply-To: <SN4PR2101MB08804F99992085C64982C821C0B40@SN4PR2101MB0880.namprd21.prod.outlook.com>

From: Sunil Muthuswamy <sunilmut@microsoft.com> Sent: Friday, May 22, 2020 9:40 AM
> 
> > > +	if (hv_do_hypercall(HV_EXT_CALL_QUERY_CAPABILITIES, NULL, cap) ==
> > > +	    HV_STATUS_SUCCESS)
> >
> > You're using the input page as the output parameter. Ideally we should
> > introduce hyperv_pcpu_output_arg page, but that would waste one page per
> > cpu just for this one call.
> >
> > So for now I think this setup is fine, but I would like to add the
> > following comment.
> >
> >     /*
> >      * Repurpose the input_arg page to accept output from Hyper-V for
> >      * now because this is the only call that needs output from the
> >      * hypervisor. It should be fixed properly by introducing an
> >      * output_arg page once we have more places that require output.
> >      */
> 
> Sounds good. Will add it in v2.
> 

Note that the only real requirement for the output parameter to hypercalls
is that it not cross a page boundary.  Since '*cap' is only 64-bits, you can
declare it as a static variable or even as a local on the stack.  It will
naturally be aligned  (or can add __aligned(8) to be explicit??), so it won't
cross a page boundary.  Then you can skip using the per-cpu input arg
altogether, along with the associated local_irq_save()/restore().

Michael

      parent reply index

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-19 18:37 Sunil Muthuswamy
2020-05-20  8:59 ` Vitaly Kuznetsov
2020-05-20  9:05   ` Wei Liu
2020-05-22 17:02   ` [EXTERNAL] " Sunil Muthuswamy
2020-05-20  9:01 ` Wei Liu
2020-05-22 16:40   ` [EXTERNAL] " Sunil Muthuswamy
2020-05-22 20:11     ` Alexander Duyck
2020-05-23  0:40     ` Michael Kelley [this message]

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=MW2PR2101MB10520A323E708F71A9944758D7B50@MW2PR2101MB1052.namprd21.prod.outlook.com \
    --to=mikelley@microsoft.com \
    --cc=Tianyu.Lan@microsoft.com \
    --cc=alexander.h.duyck@linux.intel.com \
    --cc=haiyangz@microsoft.com \
    --cc=kys@microsoft.com \
    --cc=linux-hyperv@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=liuwe@microsoft.com \
    --cc=sthemmin@microsoft.com \
    --cc=sunilmut@microsoft.com \
    --cc=wei.liu@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

Linux-HyperV Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-hyperv/0 linux-hyperv/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-hyperv linux-hyperv/ https://lore.kernel.org/linux-hyperv \
		linux-hyperv@vger.kernel.org
	public-inbox-index linux-hyperv

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-hyperv


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git