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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4FD9E70A.9090507@redhat.com>
Date:	Thu, 14 Jun 2012 16:28:42 +0300
From:	Avi Kivity <avi@...hat.com>
To:	zhangyanfei <zhangyanfei@...fujitsu.com>
CC:	mtosatti@...hat.com, ebiederm@...ssion.com, luto@....edu,
	Joerg Roedel <joerg.roedel@....com>, dzickus@...hat.com,
	paul.gortmaker@...driver.com, ludwig.nussel@...e.de,
	linux-kernel@...r.kernel.org, kvm@...r.kernel.org,
	kexec@...ts.infradead.org, Greg KH <gregkh@...uxfoundation.org>
Subject: Re: [PATCH v2 1/5] x86: Add helper variables and functions to hold
 VMCSINFO

On 05/16/2012 10:52 AM, zhangyanfei wrote:
> This patch provides a set of variables to hold the VMCSINFO and also
> some helper functions to help fill the VMCSINFO.

Need to document the format.


> +void vmcsinfo_append_id(u32 id)
> +{
> +	size_t r;
> +
> +	r = sizeof(id);
> +	if (r + vmcsinfo_size > vmcsinfo_max_size)
> +		return;
> +
> +	memcpy(&vmcsinfo_data[vmcsinfo_size], &id, r);
> +	vmcsinfo_size += r;
> +}
> +EXPORT_SYMBOL_GPL(vmcsinfo_append_id);
> +
> +void vmcsinfo_append_field(u32 field, u64 offset)

Why u64?  It's guaranteed to fit within a page.

> +{
> +	size_t r;
> +
> +	r = sizeof(field) + sizeof(offset);
> +	if (r + vmcsinfo_size > vmcsinfo_max_size)
> +		return;
> +
> +	memcpy(&vmcsinfo_data[vmcsinfo_size], &field, sizeof(field));
> +	vmcsinfo_size += sizeof(field);
> +	memcpy(&vmcsinfo_data[vmcsinfo_size], &offset, sizeof(offset));
> +	vmcsinfo_size += sizeof(offset);

Instead of this vmcsinfo_data, how about a struct with fields for the
revision ID and field count, and an array for the fields?  Should be a
lot simpler.

> +}
> +EXPORT_SYMBOL_GPL(vmcsinfo_append_field);
> +
> +unsigned long paddr_vmcsinfo_note(void)
> +{
> +	return __pa((unsigned long)(char *)&vmcsinfo_note);
> +}
> 


-- 
error compiling committee.c: too many arguments to function


--
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