kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Avi Kivity <avi-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
To: zhangyanfei <zhangyanfei-BthXqXjhjHXQFUHtdCDX3A@public.gmane.org>
Cc: dzickus-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org,
	luto-3s7WtUTddSA@public.gmane.org,
	kvm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	Joerg Roedel <joerg.roedel-5C7GfCeVMHo@public.gmane.org>,
	mtosatti-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org,
	kexec-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	paul.gortmaker-CWA4WttNNZF54TAoqtyWWQ@public.gmane.org,
	ludwig.nussel-l3A5Bk7waGM@public.gmane.org,
	ebiederm-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org,
	Greg KH
	<gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org>
Subject: Re: [PATCH v2 1/5] x86: Add helper variables and functions to hold VMCSINFO
Date: Thu, 14 Jun 2012 16:28:42 +0300	[thread overview]
Message-ID: <4FD9E70A.9090507@redhat.com> (raw)
In-Reply-To: <4FB35CD4.3080801-BthXqXjhjHXQFUHtdCDX3A@public.gmane.org>

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

  parent reply	other threads:[~2012-06-14 13:28 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-16  7:50 [PATCH v2 0/5] Export offsets of VMCS fields as note information for kdump zhangyanfei
2012-05-16  7:52 ` [PATCH v2 1/5] x86: Add helper variables and functions to hold VMCSINFO zhangyanfei
     [not found]   ` <4FB35CD4.3080801-BthXqXjhjHXQFUHtdCDX3A@public.gmane.org>
2012-06-14 13:28     ` Avi Kivity [this message]
     [not found] ` <4FB35C48.30708-BthXqXjhjHXQFUHtdCDX3A@public.gmane.org>
2012-05-16  7:54   ` [PATCH v2 2/5] KVM: Export symbols for module vmcsinfo-intel zhangyanfei
2012-05-16  7:55   ` [PATCH v2 3/5] KVM-INTEL: Add new module vmcsinfo-intel to fill VMCSINFO zhangyanfei
     [not found]     ` <4FB35D60.6050009-BthXqXjhjHXQFUHtdCDX3A@public.gmane.org>
2012-06-14 13:37       ` Avi Kivity
2012-06-15  3:03         ` HATAYAMA Daisuke
2012-05-16  7:56   ` [PATCH v2 4/5] ksysfs: Export VMCSINFO via sysfs zhangyanfei
2012-05-16  7:57   ` [PATCH v2 5/5] Documentation: Add ABI entry for sysfs file vmcsinfo and vmcsinfo_maxsize zhangyanfei
     [not found]     ` <4FB35DEF.2040008-BthXqXjhjHXQFUHtdCDX3A@public.gmane.org>
2012-06-14 13:21       ` Avi Kivity
2012-05-20 17:43   ` [PATCH v2 0/5] Export offsets of VMCS fields as note information for kdump Avi Kivity
2012-05-21  2:32     ` Yanfei Zhang
     [not found]       ` <4FB9A92D.7050108-BthXqXjhjHXQFUHtdCDX3A@public.gmane.org>
2012-05-21  8:34         ` Avi Kivity
     [not found]           ` <4FB9FE08.4050905-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2012-05-21  9:08             ` Yanfei Zhang
     [not found]               ` <4FBA05F6.8070804-BthXqXjhjHXQFUHtdCDX3A@public.gmane.org>
2012-05-21  9:36                 ` Avi Kivity
     [not found]                   ` <4FBA0C8A.2050003-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2012-05-22  3:40                     ` Yanfei Zhang
2012-05-28  5:25                       ` Yanfei Zhang
     [not found]                         ` <4FC30C40.80500-BthXqXjhjHXQFUHtdCDX3A@public.gmane.org>
2012-05-28 13:28                           ` Avi Kivity
2012-05-29  7:06                             ` Yanfei Zhang
     [not found]                               ` <4FC47579.2040504-BthXqXjhjHXQFUHtdCDX3A@public.gmane.org>
2012-06-11  5:35                                 ` Yanfei Zhang
     [not found]                                   ` <4FD58399.4050700-BthXqXjhjHXQFUHtdCDX3A@public.gmane.org>
2012-06-14 13:15                                     ` Avi Kivity
     [not found]                                       ` <4FD9E3FF.4050906-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2012-06-18  7:25                                         ` YOSHIDA Masanori
2012-05-21 18:58   ` Eric Northup
     [not found]     ` <CAG7+5M2nc3qPAS-GvX=YoVKqwdwSGdesoBQ6nsksHp2LFfzYcQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-05-22  3:53       ` Yanfei Zhang
     [not found]         ` <4FBB0DB7.3040909-BthXqXjhjHXQFUHtdCDX3A@public.gmane.org>
2012-05-22 20:53           ` Eric Northup

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=4FD9E70A.9090507@redhat.com \
    --to=avi-h+wxahxf7alqt0dzr+alfa@public.gmane.org \
    --cc=dzickus-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
    --cc=ebiederm-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org \
    --cc=gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org \
    --cc=joerg.roedel-5C7GfCeVMHo@public.gmane.org \
    --cc=kexec-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
    --cc=kvm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=ludwig.nussel-l3A5Bk7waGM@public.gmane.org \
    --cc=luto-3s7WtUTddSA@public.gmane.org \
    --cc=mtosatti-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
    --cc=paul.gortmaker-CWA4WttNNZF54TAoqtyWWQ@public.gmane.org \
    --cc=zhangyanfei-BthXqXjhjHXQFUHtdCDX3A@public.gmane.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
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;
as well as URLs for NNTP newsgroup(s).