From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: Akshay Karle <akshay.a.karle@gmail.com>, avi@redhat.com
Cc: linux-kernel@vger.kernel.org,
Dan Magenheimer <dan.magenheimer@oracle.com>,
kvm@vger.kernel.org, ashu tripathi <er.ashutripathi@gmail.com>,
nishant gulhane <nishant.s.gulhane@gmail.com>,
Shreyas Mahure <shreyas.mahure@gmail.com>,
amarmore2006 <amarmore2006@gmail.com>,
mahesh mohan <mahesh6490@gmail.com>
Subject: Re: [RFC 2/2] kvm: guest-side changes for tmem on KVM
Date: Mon, 19 Mar 2012 13:49:54 -0400 [thread overview]
Message-ID: <20120319174954.GD5063@phenom.dumpdata.com> (raw)
In-Reply-To: <1331874035.2790.5.camel@aks>
On Fri, Mar 16, 2012 at 10:30:35AM +0530, Akshay Karle wrote:
> >> +/* kvm tmem foundation ops/hypercalls */
> >> +
> >> +static inline int kvm_tmem_op(u32 tmem_cmd, u32 tmem_pool, struct tmem_oid oid,
> >> + u32 index, u32 tmem_offset, u32 pfn_offset, unsigned long pfn, u32 len, uint16_t cli_id)
> >
> > That is rather long list of arguments. Could you pass in a structure instead?
> >
> > Are you actually using all of the arguments in every call?
>
> For different functions different parameters are used. If we want to reduce the number of arguments,
> the tmem_ops structure can be created in the functions calling kvm_tmem_op instead of creating it here
> and that can be passed, will make these changes in the next patch.
>
> >> +{
> >> + struct tmem_ops op;
> >> + int rc = 0;
> >> + op.cmd = tmem_cmd;
> >> + op.pool_id = tmem_pool;
> >> + op.u.gen.oid[0] = oid.oid[0];
> >> + op.u.gen.oid[1] = oid.oid[1];
> >> + op.u.gen.oid[2] = oid.oid[2];
> >> + op.u.gen.index = index;
> >> + op.u.gen.tmem_offset = tmem_offset;
> >> + op.u.gen.pfn_offset = pfn_offset;
> >> + op.u.gen.pfn = pfn;
> >> + op.u.gen.len = len;
> >> + op.u.gen.cli_id = cli_id;
> >> + rc = kvm_hypercall1(KVM_HC_TMEM, virt_to_phys(&op));
> >> + rc = rc + 1000;
> >
> > Why the addition?
>
> If you notice the host patch I had subtracted 1000 while passing the return value
> in the kvm_emulate_hypercall function. This was to avoid the guest kernel panic due to
> the return of a non-negative value by the kvm_hypercall. In order to get the original value
> back I added 1000.
Avi, is there a right way of doing this?
next prev parent reply other threads:[~2012-03-19 17:49 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-08 17:02 [RFC 2/2] kvm: guest-side changes for tmem on KVM Akshay Karle
2012-03-08 17:39 ` Bobby Powers
2012-03-15 17:03 ` Konrad Rzeszutek Wilk
2012-03-16 5:00 ` Akshay Karle
2012-03-19 17:49 ` Konrad Rzeszutek Wilk [this message]
2012-03-19 17:56 ` Avi Kivity
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=20120319174954.GD5063@phenom.dumpdata.com \
--to=konrad.wilk@oracle.com \
--cc=akshay.a.karle@gmail.com \
--cc=amarmore2006@gmail.com \
--cc=avi@redhat.com \
--cc=dan.magenheimer@oracle.com \
--cc=er.ashutripathi@gmail.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mahesh6490@gmail.com \
--cc=nishant.s.gulhane@gmail.com \
--cc=shreyas.mahure@gmail.com \
/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