From: Avi Kivity <avi-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
To: Jun Koi <junkoi2004-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
Subject: Re: [PATCH 1/2] Separate vmx/svm fields from kvm_vcpu
Date: Tue, 26 Jun 2007 08:59:17 -0400 [thread overview]
Message-ID: <46810DA5.9070301@qumranet.com> (raw)
In-Reply-To: <fdaac4d50706252000g1b1509e4q77cd92c51f97bec9-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
>>
>> If you make this
>>
>> + union {
>> + struct kvm_vmx_data vmx[1];
>> + struct kvm_svm_data svm[1];
>> + };
>>
>> then we can later change it to a zero-sized array with variable-size
>> allocation, with no additional code changes.
>>
>
> Why do we want to make it array? I suppose that we only have 1 struct
> (either vmx or svm) for each vcpu, no?
>
If it's an array of size one, you can refer to the only element with
vcpu->vmx->member. If it's later changed to an array of size zero, you
can keep the references the same, and change the allocations to
kmalloc(sizeof(struct kvm_vcpu) +sizeof(struct kvm_vmx_data)) so that
you don't allocate any unnecessary memory.
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
prev parent reply other threads:[~2007-06-26 12:59 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-06-25 12:44 [PATCH 1/2] Separate vmx/svm fields from kvm_vcpu Paul Turner
[not found] ` <Pine.LNX.4.64.0706250526560.6952-hxTPNdr267xSzHKm+aFRNNkmqwFzkYv6@public.gmane.org>
2007-06-25 21:00 ` Avi Kivity
[not found] ` <46802CF0.6090100-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2007-06-26 3:00 ` Jun Koi
[not found] ` <fdaac4d50706252000g1b1509e4q77cd92c51f97bec9-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2007-06-26 5:22 ` Paul Turner
2007-06-26 12:59 ` Avi Kivity [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=46810DA5.9070301@qumranet.com \
--to=avi-atkuwr5tajbwk0htik3j/w@public.gmane.org \
--cc=junkoi2004-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.