lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Mon, 19 Mar 2012 13:49:54 -0400
From:	Konrad Rzeszutek Wilk <konrad.wilk@...cle.com>
To:	Akshay Karle <akshay.a.karle@...il.com>, avi@...hat.com
Cc:	linux-kernel@...r.kernel.org,
	Dan Magenheimer <dan.magenheimer@...cle.com>,
	kvm@...r.kernel.org, ashu tripathi <er.ashutripathi@...il.com>,
	nishant gulhane <nishant.s.gulhane@...il.com>,
	Shreyas Mahure <shreyas.mahure@...il.com>,
	amarmore2006 <amarmore2006@...il.com>,
	mahesh mohan <mahesh6490@...il.com>
Subject: Re: [RFC 2/2] kvm: guest-side changes for tmem on KVM

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?
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ